summaryrefslogtreecommitdiff
path: root/modules.d/90dmraid/module-setup.sh
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-08-15 10:44:20 +0200
committerHarald Hoyer <harald@redhat.com>2013-08-15 10:44:20 +0200
commit69f7ed96109095c8d3c39c1f741598119b602936 (patch)
tree4352bca2e91f6c6c9887de0e0eb241f631934b45 /modules.d/90dmraid/module-setup.sh
parent67b4a9ea173b78fa5ce6be471891a433e629e097 (diff)
downloaddracut-69f7ed96109095c8d3c39c1f741598119b602936.tar.gz
dracut-69f7ed96109095c8d3c39c1f741598119b602936.tar.bz2
dracut-69f7ed96109095c8d3c39c1f741598119b602936.zip
Create initramfs without using udevadm
This enables building a hostonly image, without the udev database populated.
Diffstat (limited to 'modules.d/90dmraid/module-setup.sh')
-rwxr-xr-xmodules.d/90dmraid/module-setup.sh33
1 files changed, 17 insertions, 16 deletions
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index cea7bd87..87465d93 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -27,25 +27,26 @@ install() {
local _i
check_dmraid() {
- local dev=$1 fs=$2 holder DEVPATH DM_NAME
+ local dev=$1 fs=$2 holder DEVPATH DM_NAME majmin
[[ "$fs" != *_raid_member ]] && return 1
- DEVPATH=$(udevadm info --query=property --name=$dev \
- | while read line; do
- [[ ${line#DEVPATH} = $line ]] && continue
- eval "$line"
- echo $DEVPATH
- break
- done)
- for holder in /sys/$DEVPATH/holders/*; do
- [[ -e $holder ]] || continue
- DM_NAME=$(udevadm info --query=property --path=$holder \
- | while read line; do
- [[ ${line#DM_NAME} = $line ]] && continue
- eval "$line"
- echo $DM_NAME
+
+ majmin=$(get_maj_min $dev)
+ DEVPATH=$(
+ for i in /sys/block/*; do
+ [[ -e "$i/dev" ]] || continue
+ if [[ $a == $(<"$i/dev") ]]; then
+ printf "%s" "$i"
break
- done)
+ fi
+ done
+ )
+
+ for holder in "$DEVPATH"/holders/*; do
+ [[ -e "$holder" ]] || continue
+ dev="/dev/${holder##*/}"
+ DM_NAME="$(/usr/sbin/dmsetup info -c --noheadings -o name "$dev" 2>/dev/null)"
+ [[ ${DM_NAME} ]] && break
done
[[ ${DM_NAME} ]] || return 1