|
Harald Hoyer |
f8c4a0 |
From a4f7b504712bd7499d60d16f358ec89ab31bbb47 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
f8c4a0 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
f8c4a0 |
Date: Mon, 5 Aug 2013 11:25:45 +0200
|
|
Harald Hoyer |
f8c4a0 |
Subject: [PATCH] dracut.sh/dracut-functions.sh: handle root on non-block
|
|
Harald Hoyer |
f8c4a0 |
device
|
|
Harald Hoyer |
f8c4a0 |
|
|
Harald Hoyer |
f8c4a0 |
---
|
|
Harald Hoyer |
f8c4a0 |
dracut-functions.sh | 4 +++-
|
|
Harald Hoyer |
f8c4a0 |
dracut.sh | 5 ++++-
|
|
Harald Hoyer |
f8c4a0 |
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
Harald Hoyer |
f8c4a0 |
|
|
Harald Hoyer |
f8c4a0 |
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
|
Harald Hoyer |
f8c4a0 |
index eb1278e..dee53bb 100755
|
|
Harald Hoyer |
f8c4a0 |
--- a/dracut-functions.sh
|
|
Harald Hoyer |
f8c4a0 |
+++ b/dracut-functions.sh
|
|
Harald Hoyer |
f8c4a0 |
@@ -421,7 +421,9 @@ find_mp_fstype() {
|
|
Harald Hoyer |
f8c4a0 |
find_dev_fstype() {
|
|
Harald Hoyer |
f8c4a0 |
local _find_dev _fs
|
|
Harald Hoyer |
f8c4a0 |
_find_dev="$1"
|
|
Harald Hoyer |
f8c4a0 |
- [[ "$_find_dev" = /dev* ]] || _find_dev="/dev/block/$_find_dev"
|
|
Harald Hoyer |
f8c4a0 |
+ if ! [[ "$_find_dev" = /dev* ]]; then
|
|
Harald Hoyer |
f8c4a0 |
+ [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
|
|
Harald Hoyer |
f8c4a0 |
+ fi
|
|
Harald Hoyer |
f8c4a0 |
|
|
Harald Hoyer |
f8c4a0 |
if [[ $use_fstab != yes ]]; then
|
|
Harald Hoyer |
f8c4a0 |
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
|
Harald Hoyer |
f8c4a0 |
diff --git a/dracut.sh b/dracut.sh
|
|
Harald Hoyer |
f8c4a0 |
index 3140b7e..c35d771 100755
|
|
Harald Hoyer |
f8c4a0 |
--- a/dracut.sh
|
|
Harald Hoyer |
f8c4a0 |
+++ b/dracut.sh
|
|
Harald Hoyer |
f8c4a0 |
@@ -871,7 +871,10 @@ if [[ $hostonly ]]; then
|
|
Harald Hoyer |
f8c4a0 |
do
|
|
Harald Hoyer |
f8c4a0 |
mp=$(readlink -f "$mp")
|
|
Harald Hoyer |
f8c4a0 |
mountpoint "$mp" >/dev/null 2>&1 || continue
|
|
Harald Hoyer |
f8c4a0 |
- _dev="$(readlink -f "/dev/block/$(find_block_device "$mp")")"
|
|
Harald Hoyer |
f8c4a0 |
+ _dev=$(find_block_device "$mp")
|
|
Harald Hoyer |
f8c4a0 |
+ _bdev=$(readlink -f "/dev/block/$dev")
|
|
Harald Hoyer |
f8c4a0 |
+ [[ -b $_bdev ]] && _dev=$_bdev
|
|
Harald Hoyer |
f8c4a0 |
+ push host_devs $_dev
|
|
Harald Hoyer |
f8c4a0 |
[[ "$_mp" == "/" ]] && root_dev="$_dev"
|
|
Harald Hoyer |
f8c4a0 |
push host_devs "$_dev"
|
|
Harald Hoyer |
f8c4a0 |
done
|