From: Andrew Gaffney Date: Sat, 13 Dec 2008 20:15:24 +0000 (-0600) Subject: Add --real-root= parameter to specify a default for real_root= in the initramfs... X-Git-Tag: v3.4.10.903~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=462e35fe870fdd37951c78df2b22385107585302;p=genkernel.git Add --real-root= parameter to specify a default for real_root= in the initramfs for gentoo bug #249783 --- diff --git a/ChangeLog b/ChangeLog index 0db5fd0..c7208f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney # Distributed under the GPL v2 + 13 Dec 2008; Andrew Gaffney defaults/linuxrc, + gen_cmdline.sh, gen_determineargs.sh, gen_initramfs.sh: + Add --real-root= parameter to specify a default for real_root= in the + initramfs for gentoo bug #249783 + 12 Dec 2008; Andrew Gaffney -arch/alpha/busy-config, -arch/arm/busy-config, -arch/ia64/busy-config, -arch/mips/busy-config, -arch/parisc/busy-config, -arch/parisc64/busy-config, diff --git a/defaults/linuxrc b/defaults/linuxrc index 4dd1b7c..4d21314 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -41,7 +41,6 @@ quiet_kmsg CMDLINE=`cat /proc/cmdline` # Scan CMDLINE for any specified real_root= or cdroot arguments -REAL_ROOT='' FAKE_ROOT='' REAL_ROOTFLAGS='' CRYPT_SILENT=0 diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 60a1ab9..84e135e 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -92,6 +92,7 @@ longusage() { echo " --no-busybox Do not include busybox in the initramfs." echo " --unionfs Include support for unionfs" echo " --netboot Create a self-contained env in the initramfs" + echo " --real-root= Specify a default for real_root= echo " Internals" echo " --arch-override= Force to arch instead of autodetect" echo " --cachedir= Override the default cache location" @@ -254,6 +255,10 @@ parse_cmdline() { CMD_NETBOOT=1 print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}" ;; + --real-root=*) + CMD_REAL_ROOT=`parse_opt "$*"` + print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}" + ;; --slowusb) CMD_SLOWUSB=1 print_info 2 "CMD_SLOWUSB: ${CMD_SLOWUSB}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 6e9c259..02995bc 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -105,6 +105,7 @@ determine_real_args() { set_config_with_override 1 BUSYBOX CMD_BUSYBOX "yes" set_config_with_override 1 UNIONFS CMD_UNIONFS set_config_with_override 1 NETBOOT CMD_NETBOOT + set_config_with_override 2 REAL_ROOT CMD_REAL_ROOT set_config_with_override 1 DISKLABEL CMD_DISKLABEL set_config_with_override 1 LUKS CMD_LUKS set_config_with_override 1 MDADM CMD_MDADM diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 045574a..e14604c 100644 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -451,6 +451,11 @@ append_auxilary() { else cp "${GK_SHARE}/defaults/initrd.defaults" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" fi + + if [ -n "${REAL_ROOT}" ] + then + sed -i "s/^REAL_ROOT=.*$/REAL_ROOT='${REAL_ROOT}'/" "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" + fi echo -n 'HWOPTS="$HWOPTS ' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" for group_modules in ${!MODULES_*}; do