Support virtio devices, and provide fallback of all remaining devices.
authorRobin H. Johnson <robbat2@gentoo.org>
Mon, 6 Feb 2012 07:50:17 +0000 (07:50 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Mon, 6 Feb 2012 08:19:05 +0000 (08:19 +0000)
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
ChangeLog
defaults/initrd.scripts

index 1c39b7b0f698253c2c1137197445b17ab3f20612..bc8be736e6d799a4ba5be04ad199713d61cc3bc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
 # Distributed under the GPL v2
 # $Id$
 
+  06 Feb 2012; Robin H. Johnson <robbat2@gentoo.org> defaults/initrd.scripts:
+  Support virtio devices, and provide fallback of all remaining devices.
+
   03 Feb 2012; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts:
   Support SD card readers. Patch by Rick Farina
 
index 4f71a88b0416886a1238669b307ceb404f12f6d7..609c52f7734bb3bc41942108761ef386ee1d2f13 100755 (executable)
@@ -139,12 +139,17 @@ devicelist(){
        DEVICES="$DEVICES /dev/sd*"
        # IDE devices
        DEVICES="$DEVICES /dev/hd*"
+       # virtio devices
+       DEVICES="$DEVICES /dev/vd*"
        # USB using the USB Block Driver
        DEVICES="$DEVICES /dev/ubd* /dev/ubd/*"
        # iSeries devices
        DEVICES="$DEVICES /dev/iseries/vcd*"
        # builtin mmc/sd card reader devices
        DEVICES="$DEVICES /dev/mmcblk* /dev/mmcblk*/*"
+       # fallback scanning, this might scan something twice, but it's better than
+       # failing to boot.
+       [ -e /proc/partitions ] && DEVICES="${DEVICES} $(awk -r '/([0-9]+[[:space:]]+)/{print "/dev/" $4}' /proc/partitions)"
        echo ${DEVICES}
 }