slitaz-modular diff initramfs/init @ rev 13

Add rootuuid support into init. Also started copying initramfs to /mnt/memory/initramfs to save space. Updated linuxrc to support /memory/initramfs in union.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Dec 16 08:53:50 2010 +0000 (2010-12-16)
parents 6d654d523ac8
children 5dd7947d1eeb
line diff
     1.1 --- a/initramfs/init	Thu Nov 25 03:30:16 2010 +0000
     1.2 +++ b/initramfs/init	Thu Dec 16 08:53:50 2010 +0000
     1.3 @@ -9,6 +9,15 @@
     1.4  launch_init_modular()
     1.5  {
     1.6  	echo -e "\\033[70G[ \\033[1;33mOK\\033[0;39m ]"
     1.7 +	[ -d /mnt/memory/initramfs ] || mkdir -p /mnt/memory/initramfs
     1.8 +	SYS_DIR="dev bin etc boot lib sbin home root usr var"
     1.9 +	for dir in $SYS_DIR; do
    1.10 +		cp -a /$dir /mnt/memory/initramfs
    1.11 +	done
    1.12 +	MK_DIR="sys proc tmp media mnt"
    1.13 +	for dir1 in $MK_DIR; do
    1.14 +		mkdir -p /mnt/memory/initramfs/$dir
    1.15 +	done
    1.16  	exec /sbin/switch_root mnt /linuxrc
    1.17  }
    1.18  
    1.19 @@ -126,6 +135,10 @@
    1.20  	try_init
    1.21  fi
    1.22  grep -q cryptoroot= /proc/cmdline && try_init
    1.23 +if grep -q rootuuid= /proc/cmdline; then
    1.24 +	root="$(sed 's/.*rootuuid=\([^ ]*\).*/\1/' < /proc/cmdline)"
    1.25 +	mount $(blkid | grep $root | sed 's/:.*//') /mnt && try_init
    1.26 +fi
    1.27  umount /sys
    1.28  echo -n "Switching / to tmpfs..."
    1.29  size="$(grep rootfssize= < /proc/cmdline | \