From: Peter Hjalmarsson Date: Mon, 9 Apr 2012 18:03:01 +0000 (+0200) Subject: Support using init= on the command line X-Git-Tag: v3.4.45~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e224199ffbf67af99e57d4aa2cf3a7a625b87ac;p=genkernel.git Support using init= on the command line We do not support ramdisk, only initramfs nowdays. So init= is a dead command, and we may as well have it do the same as it does for dracut and in the Linux kernel documentation. (Use rdinit to choose the initramfs init file) Signed-off-by: Robin H. Johnson --- diff --git a/ChangeLog b/ChangeLog index dfe39e2..023016b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ # Distributed under the GPL v2 # $Id$ + 15 Oct 2012; Peter Hjalmarsson defaults/linuxrc: + Support using init= on the command line. + 15 Oct 2012; Peter Hjalmarsson README, doc/genkernel.8.txt, gen_bootloader.sh, genkernel: Update the documentation to reflect current status re real_root/init. diff --git a/defaults/linuxrc b/defaults/linuxrc index 48446ba..1bc09a7 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -36,6 +36,7 @@ quiet_kmsg CMDLINE=$(cat /proc/cmdline) # Scan CMDLINE for any specified real_root= or cdroot arguments FAKE_ROOT='' +FAKE_INIT='' REAL_ROOTFLAGS='' ROOTFSTYPE='auto' CRYPT_SILENT=0 @@ -56,6 +57,9 @@ do real_init=*) REAL_INIT=${x#*=} ;; + init=*) + FAKE_INIT=${x#*=} + ;; init_opts=*) INIT_OPTS=${x#*=} ;; @@ -263,6 +267,10 @@ if [ -z "${REAL_ROOT}" -a \( "${CDROOT}" = '0' \) -a \( "${FAKE_ROOT}" != "/dev then REAL_ROOT="${FAKE_ROOT}" fi +if [ -z "${REAL_INIT}" -a \( "${CDROOT}" = '0' \) -a \( "${FAKE_INIT}" != "/linuxrc" \) ] +then + REAL_INIT="${FAKE_INIT}" +fi # Set variables based on the value of REAL_ROOT case "${REAL_ROOT}" in