This change makes it so we only try to mount 'auto' when cdroot is specified. This...
authorChris Gianelloni <wolf31o2@gentoo.org>
Thu, 14 Sep 2006 18:41:07 +0000 (18:41 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Thu, 14 Sep 2006 18:41:07 +0000 (18:41 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@442 67a159dc-881f-0410-a524-ba9dfbe2cb84

generic/initrd.scripts

index bd22ad43e3550d5426233a23847d671e9f17d188..7715708f6e1607b8920e1a521c661065d5bb63c0 100644 (file)
@@ -72,21 +72,14 @@ findcdmount() {
                        if [ -b "${x}" ]
                        then
                                good_msg "Attempting to mount media:- ${x}"
-                               mount -r -t iso9660 ${x} ${NEW_ROOT}/mnt/cdrom \
-                                       > /dev/null 2>&1
-                               if [ "$?" = '0' ]
+                               if [ -n "${CDROOT_DEV}" ]
                                then
-                                       # Check for a LiveCD
-                                       if [ -e ${NEW_ROOT}/mnt/cdrom/${SUBDIR}/livecd ]
-                                       then
-                                               REAL_ROOT="${x}"
-                                               break
-                                       else
-                                               umount ${NEW_ROOT}/mnt/cdrom
-                                       fi
+                                       mount -r -t auto ${x} ${NEW_ROOT}/mnt/cdrom \
+                                               > /dev/null 2>&1
+                               else
+                                       mount -r -t iso9660 ${x} ${NEW_ROOT}/mnt/cdrom \
+                                               > /dev/null 2>&1
                                fi
-                               mount -r -t auto ${x} ${NEW_ROOT}/mnt/cdrom \
-                                       > /dev/null 2>&1
                                if [ "$?" = '0' ]
                                then
                                        # Check for a LiveCD
@@ -97,6 +90,7 @@ findcdmount() {
                                        else
                                                umount ${NEW_ROOT}/mnt/cdrom
                                        fi
+                               fi
                        fi
                done
                if [ "${REAL_ROOT}" != '' ]
@@ -341,14 +335,19 @@ start_dev_mgr() {
 
 bootstrapCD() {
        # Locate the cdrom device with our media on it.
-       [ -n "${CDROOT_DEV}" ] && DEVICES="$DEVICES ${CDROOT_DEV}" # Device specified on the command line
-       DEVICES="$DEVICES /dev/cdroms/*" # CDROM DEVICES
-       DEVICES="$DEVICES /dev/ide/cd/*" # CDROM DEVICES
-       DEVICES="$DEVICES /dev/sr*" # UML DEVICES
-       DEVICES="$DEVICES /dev/sd*" # USB Keychain
-       DEVICES="$DEVICES /dev/hd*" # IDE devices
-       DEVICES="$DEVICES /dev/ubd* /dev/ubd/*" # UML DEVICES
-       DEVICES="$DEVICES /dev/iseries/vcd*" # iSeries Devices
+       # CDROM DEVICES
+       DEVICES="/dev/cdroms/* /dev/ide/cd/* /dev/sr*"
+       # USB Keychain/Storage
+       DEVICES="$DEVICES /dev/sd*"
+       # IDE devices
+       DEVICES="$DEVICES /dev/hd*"
+       # USB using the USB Block Driver
+       DEVICES="$DEVICES /dev/ubd* /dev/ubd/*"
+       # iSeries devices
+       DEVICES="$DEVICES /dev/iseries/vcd*"
+       # The device was specified on the command line.  Shold we even be doing a
+       # scan at this point?  I think not.
+       [ -n "${CDROOT_DEV}" ] && DEVICES="$DEVICES ${CDROOT_DEV}"
 
        findcdmount $DEVICES
 }