Added a patch to skip device nodes for devices if at least one partition exists on...
authorChris Gianelloni <wolf31o2@gentoo.org>
Fri, 4 Apr 2008 15:17:30 +0000 (15:17 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Fri, 4 Apr 2008 15:17:30 +0000 (15:17 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@663 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
generic/initrd.scripts
genkernel

index 26bdc53523844c1f0149bd028b8cb7c2dfb2bfb9..0e798c1a8811c3fe40deb0f33bc7d595dec11d52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  04 Apr 2008; Chris Gianelloni <wolf31o2@gentoo.org>
+  generic/initrd.scripts, genkernel:
+  Added a patch to skip device nodes for devices if at least one partition
+  exists on the device. This aids in LiveUSB usage and is for bug #212794.
+  This is genkernel 3.4.10_pre8.
+
   03 Apr 2008; Andrew Gaffney <agaffney@gentoo.org> generic/linuxrc:
   Split up /dev node checks into console/null and tty1
 
index 095f3aaaf84ab9e05f2807fa004c4a37a9903db2..fed77493c36ec1b05e8da2835e20ef26d702b794 100644 (file)
@@ -92,6 +92,23 @@ findmediamount() {
                        # Check for a block device to mount
                        if [ -b "${x}" ]
                        then
+                               skip=0
+                               bsn=`basename "${x}"`
+                               #
+                               # If disk and it has at least one partition, skip.
+                               # We use /sys/block/${bsn}/${bsn}[0-9]* to make sure that we
+                               # don't skip device mapper devices. Even the craziest scenario
+                               # deserves a fair chance.
+                               #
+                               for part in `ls /sys/block/${bsn}/${bsn}[0-9]* 2>/dev/null`
+                               do
+                                       skip=1
+                                       break;
+                               done
+                               if [ ${skip} -eq 1 ]
+                               then
+                                       continue
+                               fi
                                good_msg "Attempting to mount media:- ${x}" ${CRYPT_SILENT}
 
 #                              if [ "${media}" = "cdrom" ]; then
@@ -281,8 +298,9 @@ runmdev() {
 }
 
 test_success() {
+       retcode=$?
        # If last command failed send error message and fall back to a shell    
-       if [ "$?" != '0' ]
+       if [ "$retcode" != '0' ]
        then
                error_string=$1
                error_string="${error_string:-run command}"
@@ -385,13 +403,13 @@ start_dev_mgr() {
        if [ "${KV_2_6_OR_GREATER}" ]
        then
                cd /sys
-               [ "${DO_slowusb}" ] && sleep 10
+               [ "${DO_slowusb}" ] && sdelay
                check_slowusb
-               [ "${FORCE_slowusb}" ] && sleep 10
+               [ "${FORCE_slowusb}" ] && sdelay
                good_msg 'Activating mdev'
                runmdev
                [ "${DO_slowusb}" ] || \
-               [ "${FORCE_slowusb}" ] && sleep 20
+               [ "${FORCE_slowusb}" ] && sdelay
                cd /
        fi
 }
index 38b12a5345a10ee4f3a574fe495e90dc78963012..2ae16949899be1cd62e0874deb0919b9a8334af7 100755 (executable)
--- a/genkernel
+++ b/genkernel
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 PATH="${PATH}:/sbin:/usr/sbin"
-GK_V='3.4.10_pre7'
+GK_V='3.4.10_pre8'
 
 # Set the default for TMPDIR.  May be modified by genkernel.conf or the
 # --tempdir command line option.