From 5132f39138648df9fce0e9ccbc9866aaeeba1d78 Mon Sep 17 00:00:00 2001 From: Windsome Zeng Date: Thu, 11 Aug 2022 14:04:43 +0800 Subject: [PATCH] Use run-init instead of chroot, it will free initramfs to save memory. --- system/skeleton/init | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/skeleton/init b/system/skeleton/init index 70e9e49a..6cd410a8 100755 --- a/system/skeleton/init +++ b/system/skeleton/init @@ -57,4 +57,5 @@ mount -n -o move /dev /rootfs/dev mount -n -o move /dev/shm /rootfs/dev/shm mount -n -o move /dev/pts /rootfs/dev/pts -exec chroot /rootfs $init 3 +exec run-init /rootfs "${init}" "$@" <"/rootfs/dev/console" >"/rootfs/dev/console" 2>&1 +echo "Something went badly wrong in the initramfs."