Add --real-root=<foo> parameter to specify a default for real_root= in the initramfs...
authorAndrew Gaffney <agaffney@gentoo.org>
Sat, 13 Dec 2008 20:15:24 +0000 (14:15 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sat, 13 Dec 2008 20:15:24 +0000 (14:15 -0600)
ChangeLog
defaults/linuxrc
gen_cmdline.sh
gen_determineargs.sh
gen_initramfs.sh

index 0db5fd053b8cc9924e94bc3765783d67bf16d5a5..c7208f07a10bb8d658d9e32eb5f386f59fb30791 100644 (file)
--- 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 <agaffney@gentoo.org> defaults/linuxrc,
+  gen_cmdline.sh, gen_determineargs.sh, gen_initramfs.sh:
+  Add --real-root=<foo> parameter to specify a default for real_root= in the
+  initramfs for gentoo bug #249783
+
   12 Dec 2008; Andrew Gaffney <agaffney@gentoo.org> -arch/alpha/busy-config,
   -arch/arm/busy-config, -arch/ia64/busy-config, -arch/mips/busy-config,
   -arch/parisc/busy-config, -arch/parisc64/busy-config,
index 4dd1b7c51ec0d51984c3efc771cb9017d65b960d..4d213147b4aa6327f4ef1792746d9993c8d22873 100644 (file)
@@ -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
index 60a1ab9401e0fb1e42240243570fdacbd74169b6..84e135ee1bb73ab4ba68092c68a0b93072b469a4 100755 (executable)
@@ -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=<foo>  Specify a default for real_root=
   echo "  Internals"
   echo "       --arch-override=<arch>  Force to arch instead of autodetect"
   echo "       --cachedir=<dir>        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}"
index 6e9c259c65984ab4e5fff2e4e2454cdf1b882f3d..02995bc1786097da30dc5ab6fd8f415c5fdaeefb 100644 (file)
@@ -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
index 045574a3206577f08dbec4d3a8e5c8994f4721fe..e14604c9e949fdb107ee1a9a8cd5d851054e0dbc 100644 (file)
@@ -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