]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh/dracut-functions.sh: handle root on non-block device
authorHarald Hoyer <harald@redhat.com>
Mon, 5 Aug 2013 09:25:45 +0000 (11:25 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 7 Aug 2013 08:33:14 +0000 (10:33 +0200)
dracut-functions.sh
dracut.sh

index eb1278e0104c2db23830fcb3132b468c18b497af..dee53bbd502548b0a9baebee1a4f09c820c8e78c 100755 (executable)
@@ -421,7 +421,9 @@ find_mp_fstype() {
 find_dev_fstype() {
     local _find_dev _fs
     _find_dev="$1"
-    [[ "$_find_dev" = /dev* ]] || _find_dev="/dev/block/$_find_dev"
+    if ! [[ "$_find_dev" = /dev* ]]; then
+        [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
+    fi
 
     if [[ $use_fstab != yes ]]; then
         findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
index 3140b7eac70a2cbd7c84ecb06c316bfaf0ff2cc7..c35d771f0bdf2aedb6b6f24600effff564c803f4 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -871,7 +871,10 @@ if [[ $hostonly ]]; then
     do
         mp=$(readlink -f "$mp")
         mountpoint "$mp" >/dev/null 2>&1 || continue
-        _dev="$(readlink -f "/dev/block/$(find_block_device "$mp")")"
+        _dev=$(find_block_device "$mp")
+        _bdev=$(readlink -f "/dev/block/$dev")
+        [[ -b $_bdev ]] && _dev=$_bdev
+        push host_devs $_dev
         [[ "$_mp" == "/" ]] && root_dev="$_dev"
         push host_devs "$_dev"
     done