dracut-018-37.git20120425

- fixed udevd location
This commit is contained in:
Harald Hoyer 2012-04-25 15:15:17 +02:00
parent 2f4f1d71a4
commit a633d05a18
5 changed files with 201 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 7e6121699b0cfb0049ab4bddb9e299e2ec978115 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 25 Apr 2012 11:23:10 +0200
Subject: [PATCH] iscsi/module-setup.sh: fix host-only/mount checks
---
modules.d/95iscsi/module-setup.sh | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 2f343ee..34e101c 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -15,8 +15,11 @@ check() {
[[ $debug ]] && set -x
is_iscsi() (
- [[ -L /sys/dev/block/$1 ]] || return
- cd "$(readlink -f /sys/dev/block/$1)"
+ local _dev
+ _dev=${1##/dev/}
+
+ [[ -L /sys/dev/block/$_dev ]] || return
+ cd "$(readlink -f /sys/dev/block/$_dev)"
until [[ -d sys || -d iscsi_session ]]; do
cd ..
done
@@ -24,14 +27,7 @@ check() {
)
[[ $hostonly ]] || [[ $mount_needs ]] && {
- _rootdev=$(find_root_block_device)
- if [[ $_rootdev ]]; then
- # root lives on a block device, so we can be more precise about
- # hostonly checking
- check_block_and_slaves is_iscsi "$_rootdev" || return 1
- else
- return 1
- fi
+ for_each_host_dev_fs is_iscsi || return 1
}
return 0
}

View File

@ -0,0 +1,39 @@
From 63616dffe30add9fd4c0a22349fd33fe0fb3db1d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 25 Apr 2012 11:23:49 +0200
Subject: [PATCH] multipath/module-setup.sh: fix host-only/mount checks
---
modules.d/90multipath/module-setup.sh | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 2bc1b41..ae9ec59 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -11,18 +11,16 @@ check() {
[[ $debug ]] && set -x
is_mpath() {
- [ -e /sys/dev/block/$1/dm/uuid ] || return 1
- [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+ local _dev
+ _dev=${1##/dev/}
+ [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+ [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
return 1
}
- if [[ $hostonly ]]; then
- _rootdev=$(find_root_block_device)
- if [[ $_rootdev ]]; then
- check_block_and_slaves is_mpath "$_rootdev" && return 0
- fi
- return 1
- fi
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ for_each_host_dev_fs is_mpath || return 1
+ }
return 0
}

View File

@ -0,0 +1,56 @@
From e78a0b55b28196c2075b388ca4da8de3face3baf Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 25 Apr 2012 12:22:15 +0200
Subject: [PATCH] udev-rules/module-setup.sh: fixed udevd location
---
modules.d/95udev-rules/module-setup.sh | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
index cc42eb7..b4acce3 100755
--- a/modules.d/95udev-rules/module-setup.sh
+++ b/modules.d/95udev-rules/module-setup.sh
@@ -8,13 +8,14 @@ install() {
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best
dracut_install udevadm
- if [ -x /sbin/udevd ]; then
- dracut_install udevd
- mkdir -p ${initdir}/lib/systemd
- ln -s /sbin/udevd ${initdir}/lib/systemd/systemd-udevd
- elif [ -x /lib/systemd/systemd-udevd ]; then
- inst /lib/systemd/systemd-udevd
- fi
+ [ -d ${initdir}/lib/systemd ] || mkdir -p ${initdir}/lib/systemd
+ for _i in /lib/systemd/systemd-udevd /lib/udev/udevd /sbin/udevd; do
+ [ -x "$_i" ] || continue
+ inst "$_i"
+ [[ $_i != "/lib/systemd/systemd-udevd" ]] \
+ && ln -s "$_i" ${initdir}/lib/systemd/systemd-udevd
+ break
+ done
for i in /etc/udev/udev.conf /etc/group; do
inst_simple $i
@@ -62,20 +63,11 @@ install() {
vol_id \
pcmcia-socket-startup \
pcmcia-check-broken-cis \
- udevd \
; do
[ -e /lib/udev/$_i ] && dracut_install /lib/udev/$_i
[ -e /usr/lib/udev/$_i ] && dracut_install /usr/lib/udev/$_i
done
- if ! [ -e "$initdir/sbin/udevd" ]; then
- if [ -x /usr/lib/udev/udevd ]; then
- ln -s /usr/lib/udev/udevd "$initdir/sbin/udevd"
- elif [ -x /lib/udev/udevd ]; then
- ln -s /lib/udev/udevd "$initdir/sbin/udevd"
- fi
- fi
-
[ -f /etc/arch-release ] && \
inst "$moddir/load-modules.sh" /lib/udev/load-modules.sh

View File

@ -0,0 +1,55 @@
From bea590954e873e915791d1c8610820159ab164c3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 25 Apr 2012 14:23:12 +0200
Subject: [PATCH] TEST-15-BTRFSRAID: add one more partition to the btrfs
raid10
---
test/TEST-15-BTRFSRAID/create-root.sh | 12 +++++++++---
test/TEST-15-BTRFSRAID/test.sh | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/test/TEST-15-BTRFSRAID/create-root.sh b/test/TEST-15-BTRFSRAID/create-root.sh
index 60dd319..3debf33 100755
--- a/test/TEST-15-BTRFSRAID/create-root.sh
+++ b/test/TEST-15-BTRFSRAID/create-root.sh
@@ -5,17 +5,23 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
done
udevadm control --reload-rules
# save a partition at the beginning for future flagging purposes
-sfdisk -C 524288 -H 2 -S 32 -L /dev/sda <<EOF
+sfdisk -C 655600 -H 2 -S 32 -L /dev/sda <<EOF
,16
+,,E
+;
+;
+,10240
,10240
,10240
,10240
EOF
-mkfs.btrfs -mraid10 -L root /dev/sda2 /dev/sda3 /dev/sda4
+mkfs.btrfs -draid10 -mraid10 -L root /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8
+udevadm settle
btrfs device scan
+udevadm settle
set -e
mkdir -p /sysroot
-mount /dev/sda4 /sysroot
+mount -t btrfs /dev/sda8 /sysroot
cp -a -t /sysroot /source/*
umount /sysroot
echo "dracut-root-block-created" >/dev/sda1
diff --git a/test/TEST-15-BTRFSRAID/test.sh b/test/TEST-15-BTRFSRAID/test.sh
index f64b2b2..b65e77a 100755
--- a/test/TEST-15-BTRFSRAID/test.sh
+++ b/test/TEST-15-BTRFSRAID/test.sh
@@ -20,7 +20,7 @@ test_setup() {
# Create the blank file to use as a root filesystem
DISKIMAGE=$TESTDIR/TEST-15-BTRFSRAID-root.img
rm -f $DISKIMAGE
- dd if=/dev/null of=$DISKIMAGE bs=1M seek=1024
+ dd if=/dev/null of=$DISKIMAGE bs=2M seek=1024
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay

View File

@ -10,7 +10,7 @@
Name: dracut
Version: 018
Release: 33.git20120424%{?dist}
Release: 37.git20120425%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
@ -56,6 +56,10 @@ Patch29: 0029-base-dracut-lib.sh-add-arguments-for-source_hook-and.patch
Patch30: 0030-merge-cleanup-and-pre-pivot-cleanup-hooks.patch
Patch31: 0031-network-fix-ifup-and-netroot-calling.patch
Patch32: 0032-ifcfg-write-DNS1-.-for-nameserver-args-RHBZ-815369.patch
Patch33: 0033-iscsi-module-setup.sh-fix-host-only-mount-checks.patch
Patch34: 0034-multipath-module-setup.sh-fix-host-only-mount-checks.patch
Patch35: 0035-udev-rules-module-setup.sh-fixed-udevd-location.patch
Patch36: 0036-TEST-15-BTRFSRAID-add-one-more-partition-to-the-btrf.patch
BuildArch: noarch
@ -372,6 +376,9 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay
%changelog
* Wed Apr 25 2012 Harald Hoyer <harald@redhat.com> 018-37.git20120425
- fixed udevd location
* Tue Apr 24 2012 Harald Hoyer <harald@redhat.com> 018-33.git20120424
- new upstream version