buildroot: init: fix dev/shm and devpts fs lost in ramdisk rootfs issue.

In ramdisk case, dev/shm and devpts not mounted in ramdisk rootfs,
for the mount commands are not executed in ramdisk rootfs,
this will cause adb shell can't work.
move these commands before execute sbin/init.

Signed-off-by: minda.chen <minda.chen@starfivetech.com>
This commit is contained in:
minda.chen
2022-08-31 17:23:02 +08:00
parent e1adcb3c9a
commit e8b2ed98eb
+4 -4
View File
@@ -18,10 +18,6 @@ for x in $(cat /proc/cmdline); do
esac esac
done done
if [ "x${ROOT}" = "x" ]; then
exec /sbin/init
fi
mount -t sysfs sysfs /sys mount -t sysfs sysfs /sys
mount -t devtmpfs -o nosuid,mode=0755 devtmpfs /dev mount -t devtmpfs -o nosuid,mode=0755 devtmpfs /dev
@@ -33,6 +29,10 @@ mount -t tmpfs tmpfs /dev/shm
mount -t tmpfs tmpfs /tmp mount -t tmpfs tmpfs /tmp
mount -t tmpfs tmpfs /run mount -t tmpfs tmpfs /run
if [ "x${ROOT}" = "x" ]; then
exec /sbin/init
fi
export ROOT export ROOT
mkdir /rootfs mkdir /rootfs