From e8b2ed98eb4427b6861005a6a9bf47927d36e5c5 Mon Sep 17 00:00:00 2001 From: "minda.chen" Date: Wed, 31 Aug 2022 17:23:02 +0800 Subject: [PATCH] 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 --- system/skeleton/init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/skeleton/init b/system/skeleton/init index 6cd410a8..7586499a 100755 --- a/system/skeleton/init +++ b/system/skeleton/init @@ -18,10 +18,6 @@ for x in $(cat /proc/cmdline); do esac done -if [ "x${ROOT}" = "x" ]; then - exec /sbin/init -fi - mount -t sysfs sysfs /sys 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 /run +if [ "x${ROOT}" = "x" ]; then + exec /sbin/init +fi + export ROOT mkdir /rootfs