From c7f6660aa9c150c3a720b2344a7a9cb1bdbf04ef Mon Sep 17 00:00:00 2001 From: samin Date: Wed, 6 Jul 2022 11:34:35 +0800 Subject: [PATCH] init: Added /dev/null to fix rootfs issues. When booting from rootfs, /dev/null generates attributes as 0 0, causing service startup failure (ssh/nfs,...etc) remove debug code: "echo abcd" Signed-off-by: samin --- system/skeleton/init | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/skeleton/init b/system/skeleton/init index 723bd348..d86152c7 100755 --- a/system/skeleton/init +++ b/system/skeleton/init @@ -19,7 +19,6 @@ for x in $(cat /proc/cmdline); do done if [ "x${ROOT}" = "x" ]; then - echo abcd exec /sbin/init fi @@ -27,8 +26,8 @@ mount -t sysfs sysfs /sys mdev -s -mkdir /dev/pts -mkdir /dev/shm +mkdir -p /dev/pts +mkdir -p /dev/shm mount -t devpts devpts /dev/pts mount -t tmpfs tmpfs /dev/shm mount -t tmpfs tmpfs /tmp @@ -45,6 +44,9 @@ else if [ ! -e /rootfs/dev/console ]; then /bin/mknod /rootfs/dev/console c 5 1 fi + if [ ! -e /rootfs/dev/null ]; then + /bin/mknod /rootfs/dev/null c 1 3 + fi fi mount -n -o move /proc /rootfs/proc