SVN: livecd/mklive: templates-liveth/initrd/init templates/initrd/init

qwiat qwiat at pld-linux.org
Sun Sep 25 14:30:36 CEST 2011


Author: qwiat
Date: Sun Sep 25 14:30:36 2011
New Revision: 12355

Modified:
   livecd/mklive/templates-liveth/initrd/init
   livecd/mklive/templates/initrd/init
Log:
 - fixed runlevel support

Modified: livecd/mklive/templates-liveth/initrd/init
==============================================================================
--- livecd/mklive/templates-liveth/initrd/init	(original)
+++ livecd/mklive/templates-liveth/initrd/init	Sun Sep 25 14:30:36 2011
@@ -41,8 +41,11 @@
 echo "Starting Live initrd. Use 'debuginitrd' argument to enable debug mode."
 for arg in $@
 do
-	[ "$arg" = 'debuginitrd' ] && debugmode=1
-	[ "$arg" = 'allmodules' ] && loadAllModules=1
+	case "$arg" in
+		debuginitrd) debugmode=1 ;;
+		allmodules) loadAllModules=1 ;;
+		1|2|3|4|5) runlevel=$arg;;
+	esac
 done
 
 mount -t proc  none /proc
@@ -132,10 +135,11 @@
 mount --move $live_root $union_dir/.live_liveroot
 
 # Starting Live.th
-echo "Switching to a new rootfs"
 [ ! -z "$debugmode" ] && run_debug_shell
+echo "Switching to a new rootfs"
+echo "Running init with $runlevel runlevel"
 umount /proc
 umount /sys
-exec switch_root $union_dir /sbin/init
+exec switch_root $union_dir /sbin/init $runlevel
 echo "Fatal: switch_root failed! That's all folks."
 run_debug_shell

Modified: livecd/mklive/templates/initrd/init
==============================================================================
--- livecd/mklive/templates/initrd/init	(original)
+++ livecd/mklive/templates/initrd/init	Sun Sep 25 14:30:36 2011
@@ -41,8 +41,11 @@
 echo "Starting Live initrd. Use 'debuginitrd' argument to enable debug mode."
 for arg in $@
 do
-	[ "$arg" = 'debuginitrd' ] && debugmode=1
-	[ "$arg" = 'allmodules' ] && loadAllModules=1
+	case "$arg" in
+		debuginitrd) debugmode=1 ;;
+		allmodules) loadAllModules=1 ;;
+		1|2|3|4|5) runlevel=$arg;;
+	esac
 done
 
 mount -t proc  none /proc
@@ -132,10 +135,11 @@
 mount --move $live_root $union_dir/.live_liveroot
 
 # Starting Live.th
-echo "Switching to a new rootfs"
 [ ! -z "$debugmode" ] && run_debug_shell
+echo "Switching to a new rootfs"
+echo "Running init with $runlevel runlevel"
 umount /proc
 umount /sys
-exec switch_root $union_dir /sbin/init
+exec switch_root $union_dir /sbin/init $runlevel
 echo "Fatal: switch_root failed! That's all folks."
 run_debug_shell


More information about the pld-cvs-commit mailing list