From: Chris Gianelloni Date: Fri, 4 Apr 2008 15:17:30 +0000 (+0000) Subject: Added a patch to skip device nodes for devices if at least one partition exists on... X-Git-Tag: v3.4.10.902~89 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cc57e07bb855e8f41e92b7d67098375587947693;p=genkernel.git 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. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@663 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/ChangeLog b/ChangeLog index 26bdc53..0e798c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 04 Apr 2008; Chris Gianelloni + 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 generic/linuxrc: Split up /dev node checks into console/null and tty1 diff --git a/generic/initrd.scripts b/generic/initrd.scripts index 095f3aa..fed7749 100644 --- a/generic/initrd.scripts +++ b/generic/initrd.scripts @@ -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 } diff --git a/genkernel b/genkernel index 38b12a5..2ae1694 100755 --- 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.