Add rootfstype= boot parameter (bug #221245)
authorSebastian Pipping <sebastian@pipping.org>
Tue, 31 May 2011 13:03:12 +0000 (15:03 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 31 May 2011 13:17:37 +0000 (15:17 +0200)
ChangeLog
defaults/linuxrc
doc/genkernel.8.txt
genkernel

index 03f20db824dadcea702b1dd78ab400fca4a17f14..6ef649fac0dd1712b81be53da224d89aef960620 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,13 @@
 # Distributed under the GPL v2
 # $Id$
 
+  31 May 2011; Sebastian Pipping <sping@gentoo.org> defaults/linuxrc,
+  doc/genkernel.8.txt:
+  Add rootfstype= boot parameter (bug #221245)
+
+  Special thanks:
+  - Marcin Kurek
+
   31 May 2011; Nelson Batalha <nelson.batalha@gmail.com> defaults/initrd.defaults:
   Add Kernel 3.0.0 support (bug #369481)
 
index 1819d9f7923b16ed573208f3f7ce51046f957160..51c45298130b6e3b4c96be1f2c38b2162124f90d 100755 (executable)
@@ -37,6 +37,7 @@ CMDLINE=`cat /proc/cmdline`
 # Scan CMDLINE for any specified real_root= or cdroot arguments
 FAKE_ROOT=''
 REAL_ROOTFLAGS=''
+ROOTFSTYPE='auto'
 CRYPT_SILENT=0
 for x in ${CMDLINE}
 do
@@ -212,6 +213,9 @@ do
                real_rootflags\=*)
                        REAL_ROOTFLAGS=`parse_opt "${x}"`
                ;;
+               rootfstype\=*)
+                       ROOTFSTYPE=`parse_opt "${x}"`
+               ;;
                keymap\=*)
                        keymap=`parse_opt "${x}"`
                ;;
@@ -495,10 +499,11 @@ do
                else
                        # mount ro so fsck doesn't barf later
                        if [ "${REAL_ROOTFLAGS}" = '' ]; then
-                               mount -o ro ${REAL_ROOT} ${NEW_ROOT}
+                               good_msg "Using mount -t ${ROOTFSTYPE} -o ro"
+                               mount -t ${ROOTFSTYPE} -o ro ${REAL_ROOT} ${NEW_ROOT}
                        else
-                               good_msg "Using mount -o ro,${REAL_ROOTFLAGS}"
-                               mount -o ro,${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT}
+                               good_msg "Using mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS}"
+                               mount -t ${ROOTFSTYPE} -o ro,${REAL_ROOTFLAGS} ${REAL_ROOT} ${NEW_ROOT}
                        fi
                fi
                
index c43564637a7c783b4c9b56485af0c05a7c82e53d..c12dca2c515081352b8ea13f1bcd8975eb64a6af 100644 (file)
@@ -440,6 +440,11 @@ which the ramdisk scripts would recognize.
 *dokeymap*::
     Use keymap.  Usage of *keymap*= implies this option, already.
 
+*rootfstype*=<...>::
+    Specify the file system type to mount the real root filesystem as.
+    This can be useful when support for ext2/ext3/ext4 are
+    in competition.  Default is "auto".
+
 
 NETBOOTING
 ----------
index 273d9da4be8476161b6b0d5b73c93118dfc4b759..6e18506c3efe5b5b33de8afbec450023e0176bb1 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -353,6 +353,10 @@ then
        [ "${MDADM}" = '1' ] && print_warning 1 'add "domdadm" for RAID support'
        [ "${DMRAID}" = '1' ] && print_warning 1 '      or "dodmraid=<additional options>"'
        [ "${ISCSI}" = '1' ] && print_warning 1 'add at least "iscsi_initiatorname=<initiator name> iscsi_target=<target name> and iscsi_address=<target ip>" for iscsi support'
+       if [ `grep 'CONFIG_EXT[0-9]_FS=' "${KERNEL_DIR}"/.config | wc -l` -ge 2 ]; then
+               print_warning 1 'With support for several ext* filesystems around it may be needed to'
+               print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4"'
+       fi
 fi
 
 [ "${BOOTRW}" != '' ] && mount -o remount,ro ${BOOTDIR}