dracut-032-1

- fix for kdump in FIPS mode
Resolves: rhbz#920931
- fixed iBFT booting
Resolves: rhbz#989944
- fixed FIPS mode initramfs creation
Resolves: rhbz#990250
- shutdown: fixed killall_proc_mountpoint()
Resolves: rhbz#996549
- disable lvmetad in the initramfs
Resolves: rhbz#996627
- require dhclient
This commit is contained in:
Harald Hoyer 2013-08-20 15:25:09 +02:00
parent ec64c91ce1
commit b6aad2a9c8
31 changed files with 21 additions and 3250 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@
/dracut-029.tar.bz2
/dracut-030.tar.bz2
/dracut-031.tar.bz2
/dracut-032.tar.bz2

View File

@ -1,59 +0,0 @@
From 030b00b8a5499a1d2150730ae412a356f40ca5a4 Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Wed, 31 Jul 2013 15:18:20 +0200
Subject: [PATCH] Generate correct ifcfg file for vlan= option.
---
modules.d/45ifcfg/write-ifcfg.sh | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 2e78c49..dcb2aef 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -9,6 +9,10 @@ if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
fi
+if [ -e /tmp/vlan.info ]; then
+ . /tmp/vlan.info
+fi
+
mkdir -m 0755 -p /tmp/ifcfg/
mkdir -m 0755 -p /tmp/ifcfg-leases/
@@ -103,6 +107,9 @@ for netup in /tmp/net.*.did-setup ; do
# $netif can't be bridge and bond at the same time
bond=yes
fi
+ if [ "$netif" = "$vlanname" ]; then
+ vlan=yes
+ fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
{
echo "# Generated by dracut initrd"
@@ -149,7 +156,7 @@ for netup in /tmp/net.*.did-setup ; do
} > /tmp/ifcfg/ifcfg-$netif
# bridge needs different things written to ifcfg
- if [ -z "$bridge" ] && [ -z "$bond" ]; then
+ if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
# standard interface
{
if [ -n "$macaddr" ]; then
@@ -164,6 +171,15 @@ for netup in /tmp/net.*.did-setup ; do
} >> /tmp/ifcfg/ifcfg-$netif
fi
+ if [ -n "$vlan" ] ; then
+ {
+ echo "TYPE=Vlan"
+ echo "NAME=\"$netif\""
+ echo "VLAN=yes"
+ echo "PHYSDEV=\"$phydevice\""
+ } >> /tmp/ifcfg/ifcfg-$netif
+ fi
+
if [ -n "$bond" ] ; then
# bond interface
{

View File

@ -1,58 +0,0 @@
From d27cd4dfdd51c7f5178c5f4cb8f5bf4668228995 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 31 Jul 2013 15:55:13 +0200
Subject: [PATCH] Revert "base: setup correct system time and time zone in
initrd"
This reverts commit 77364fd6bb01ea184db73b1a5ad05da984752293.
Too many problems with adjtime in the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=981617
---
modules.d/99base/init.sh | 9 ---------
modules.d/99base/module-setup.sh | 11 -----------
2 files changed, 20 deletions(-)
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 0e4cac5..ae73fd2 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -48,15 +48,6 @@ if ! ismounted /dev; then
exit 1
fi
-# setup system time
-if [ -f /etc/adjtime ]; then
- if strstr "$(cat /etc/adjtime)" LOCAL; then
- hwclock --hctosys --localtime
- else
- hwclock --hctosys --utc
- fi
-fi
-
# prepare the /dev directory
[ ! -h /dev/fd ] && ln -s /proc/self/fd /dev/fd >/dev/null 2>&1
[ ! -h /dev/stdin ] && ln -s /proc/self/fd/0 /dev/stdin >/dev/null 2>&1
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index c9ee838..842dde6 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -29,17 +29,6 @@ install() {
egrep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd"
egrep '^nobody:' /etc/passwd >> "$initdir/etc/passwd"
- # install /etc/adjtime and time zone data
- if [[ $hostonly ]]; then
- dracut_install -o /etc/adjtime \
- /etc/localtime
-
- # Our init.sh script needs hwclock to set system time
- if ! dracut_module_included "systemd"; then
- dracut_install -o hwclock
- fi
- fi
-
# install our scripts and hooks
inst_script "$moddir/init.sh" "/init"
inst_script "$moddir/initqueue.sh" "/sbin/initqueue"

View File

@ -1,102 +0,0 @@
From d2765b5175663d094737d6819cc3f3df53e7a4cb Mon Sep 17 00:00:00 2001
From: Baoquan He <bhe@redhat.com>
Date: Tue, 23 Jul 2013 18:16:00 +0800
Subject: [PATCH] Change the implementation of action_on_fail
Currently when action_on_fail is enabled, the emergency_shell won't be called.
In kdump even though user specify the default action as emergency_shell,
dracut skip it. Now change the implementation of action_on_fail to depend
on a file which is created by kdump when making kdump initrd, then remove it
at the beginning of kdump. This can solve the explicit emergency_shell problem.
And action_on_fail won't need paramenters, remove the relevant description in
dracut man page.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
dracut.cmdline.7.asc | 4 ----
modules.d/98systemd/dracut-emergency.service | 2 +-
modules.d/98systemd/emergency.service | 2 +-
modules.d/99base/dracut-lib.sh | 28 ++++++++++------------------
4 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index cf11d50..09c47e8 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -121,10 +121,6 @@ Misc
specify the controlling terminal for the console.
This is useful, if you have multiple "console=" arguments.
-**rd.action_on_fail=**_{shell|continue}_::
- Specify the action after failure. By default it's emergency_shell.
- 'continue' means: ignore the current failure and go ahead.
-
[[dracutkerneldebug]]
Debug
~~~~~
diff --git a/modules.d/98systemd/dracut-emergency.service b/modules.d/98systemd/dracut-emergency.service
index a4b81bc..5a6d525 100644
--- a/modules.d/98systemd/dracut-emergency.service
+++ b/modules.d/98systemd/dracut-emergency.service
@@ -13,7 +13,7 @@ DefaultDependencies=no
After=systemd-vconsole-setup.service
Wants=systemd-vconsole-setup.service
Conflicts=emergency.service emergency.target
-ConditionKernelCommandLine=!action_on_fail=continue
+ConditionPathExists=!/lib/dracut/no-emergency-shell
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index c19fe37..5f1eaa2 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -12,7 +12,7 @@ Description=Emergency Shell
DefaultDependencies=no
After=systemd-vconsole-setup.service
Wants=systemd-vconsole-setup.service
-ConditionKernelCommandLine=!action_on_fail=continue
+ConditionPathExists=!/lib/dracut/no-emergency-shell
[Service]
Environment=HOME=/
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 9e49a9c..248cc8e 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -1030,24 +1030,16 @@ emergency_shell()
action_on_fail()
{
- local _action=$(getarg rd.action_on_fail= -d action_on_fail=)
- case "$_action" in
- continue)
- [ "$1" = "-n" ] && shift 2
- [ "$1" = "--shutdown" ] && shift 2
- warn "$*"
- warn "Not dropping to emergency shell, because 'action_on_fail=continue' was set on the kernel command line."
- return 0
- ;;
- shell)
- emergency_shell $@
- return 1
- ;;
- *)
- emergency_shell $@
- return 1
- ;;
- esac
+ if [ -f "$initdir/lib/dracut/no-emergency-shell" ]; then
+ [ "$1" = "-n" ] && shift 2
+ [ "$1" = "--shutdown" ] && shift 2
+ warn "$*"
+ warn "Not dropping to emergency shell, because $initdir/lib/dracut/no-emergency-shell exists."
+ return 0
+ fi
+
+ emergency_shell $@
+ return 1
}
# Retain the values of these variables but ensure that they are unexported

View File

@ -1,25 +0,0 @@
From 051de5aadcd8cf1638fb86b89916f7184b30991a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 31 Jul 2013 17:17:37 +0200
Subject: [PATCH] lvm: add "--yes" to lvm lvchange
---
modules.d/90lvm/lvm_scan.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index cc006c8..85ecd4d 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -108,9 +108,9 @@ if [ -n "$LVS" ] ; then
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
if [ -z "$sysinit" ]; then
- lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
+ lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
else
- lvm lvchange -ay $sysinit $LVS 2>&1 | vinfo
+ lvm lvchange --yes -ay $sysinit $LVS 2>&1 | vinfo
fi
fi

View File

@ -1,34 +0,0 @@
From 64a7eace88b30f3ea03df86ddceb23d4949b692d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 31 Jul 2013 17:28:04 +0200
Subject: [PATCH] cms/cmssetup.sh: correct port for zfcp.conf
---
modules.d/80cms/cmssetup.sh | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh
index 16704c3..36955bc 100755
--- a/modules.d/80cms/cmssetup.sh
+++ b/modules.d/80cms/cmssetup.sh
@@ -182,7 +182,19 @@ function dasd_settle_all() {
unset _do_zfcp
for i in ${!FCP_*}; do
- echo "${!i}" >> /etc/zfcp.conf
+ echo "${!i}" | while read port rest; do
+ case $port in
+ *.*.*)
+ ;;
+ *.*)
+ port="0.$port"
+ ;;
+ *)
+ port="0.0.$port"
+ ;;
+ esac
+ echo $port $rest >> /etc/zfcp.conf
+ done
_do_zfcp=1
done
[[ $_do_zfcp ]] && zfcp_cio_free

View File

@ -1,31 +0,0 @@
From ff66b6dad345ca12de4aa14db298c8776b16d115 Mon Sep 17 00:00:00 2001
From: WANG Chao <chaowang@redhat.com>
Date: Thu, 1 Aug 2013 18:54:55 +0800
Subject: [PATCH] 95terminfo: install vt102
systemd uses vt102 as default term for tty:
commit acda6a0
Author: Lennart Poettering <lennart@poettering.net>
Date: Sun Apr 22 02:45:39 2012 +0200
default to v102 everywhere, instead of vt100, to synchronize with agetty
Signed-off-by: WANG Chao <chaowang@redhat.com>
---
modules.d/95terminfo/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95terminfo/module-setup.sh b/modules.d/95terminfo/module-setup.sh
index ecd4395..4656cd3 100755
--- a/modules.d/95terminfo/module-setup.sh
+++ b/modules.d/95terminfo/module-setup.sh
@@ -10,7 +10,7 @@ install() {
done
if [ -d ${_terminfodir} ]; then
- for i in "l/linux" "v/vt100" "v/vt220"; do
+ for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do
inst_dir "$_terminfodir/${i%/*}"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i"
done

View File

@ -1,21 +0,0 @@
From 1cb652491858464a1ce04f263bb78f313338aa68 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:14:24 +0200
Subject: [PATCH] lsinitrd.sh: add old cpio signature
---
lsinitrd.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index ae71d2e..ef1c262 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -109,6 +109,7 @@ case $bin in
CAT="zcat";;
BZh*)
CAT="bzcat";;
+ $'\x71\xc7'*)
070701)
CAT="cat";;
*)

View File

@ -1,31 +0,0 @@
From 283c34fc2b0b3ecb06613e57163a88dc4ce53ff7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:22:21 +0200
Subject: [PATCH] dracut.sh: call find with -print0 and cpio with --null
---
dracut.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index cf92397..3140b7e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1259,7 +1259,7 @@ if [[ $early_microcode = yes ]]; then
fi
done
done
- (cd "$microcode_dir/d"; find . | cpio -o -H newc --quiet >../ucode.cpio)
+ (cd "$microcode_dir/d"; find . -print0 | cpio --null -o -H newc --quiet >../ucode.cpio)
fi
rm -f -- "$outfile"
@@ -1268,7 +1268,7 @@ if [[ $early_microcode = yes ]]; then
# The microcode blob is _before_ the initramfs blob, not after
mv $microcode_dir/ucode.cpio $outfile.$$
fi
-if ! ( umask 077; cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \
+if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet| \
$compress >> "$outfile.$$"; ); then
dfatal "dracut: creation of $outfile.$$ failed"
exit 1

View File

@ -1,198 +0,0 @@
From 89f7217954231dc11307cc481f1e3ca8ad3ad001 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:22:55 +0200
Subject: [PATCH] dracut.asc: small corrections
---
dracut.asc | 75 ++++++++++++++------------------------------------------------
1 file changed, 16 insertions(+), 59 deletions(-)
diff --git a/dracut.asc b/dracut.asc
index 4de3dbf..dfad67e 100644
--- a/dracut.asc
+++ b/dracut.asc
@@ -777,25 +777,12 @@ scripts and udev rules.
[[stages]]
== Boot Process Stages
-The init script in _99base_ is the main script, which prepares the root file
-system for usage, runs udev, mounts the real root device, kills the remaining
-processes, and switches to the real root device for further booting. dracut
-modules can insert custom script at various points, to control the boot process.
+dracut modules can insert custom script at various points, to control the boot
+process.
These hooks are plain directories containing shell scripts ending with ".sh",
which are sourced by init.
Common used functions are in _dracut-lib.sh_, which can be sourced by any script.
-
-
-=== Basic Setup
-
-The first thing init does, is to mount _/proc_ and _/sys_ and manually create
-the basic device nodes and symbolic links in _/dev_ needed to execute basic
-commands. Then logging is setup according to kernel command line arguments.
-_/dev/pts_ and _/dev/shm_ are mounted and the first hook is sourced.
-
-
-
=== Hook: cmdline
The _cmdline_ hook is a place to insert scripts to parse the kernel command line
@@ -813,63 +800,49 @@ This hook is executed right after the cmdline hook and a check if root and
rootok were set. Here modules can take action with the final root, and before
udev has been run.
-
-
=== Start Udev
Now udev is started and the logging for udev is setup.
-
-
=== Hook: pre-trigger
In this hook, you can set udev environment variables with **udevadm control
--property=KEY=_value_** or control the further execution of udev with
udevadm.
-
-
=== Trigger Udev
udev is triggered by calling udevadm trigger, which sends add events for all
devices and subsystems.
-
-
=== Main Loop
-Now the main loop of 99base/init begins. Here we loop until udev has settled and
-all scripts in _initqueue/finished_ returned true. In this loop there are three
-hooks, where scripts can be inserted by calling /sbin/initqueue.
-
-
+In the main loop of dracut loops until udev has settled and
+all scripts in _initqueue/finished_ returned true.
+In this loop there are three hooks, where scripts can be inserted
+by calling /sbin/initqueue.
==== Initqueue
This hook gets executed every time a script is inserted here, regardless of the
udev state.
-
-
==== Initqueue settled
-This hooks gets executed every time udev has settled.
-
+This hooks (initqueue/settled) gets executed every time udev has settled.
==== Initqueue timeout
-This hooks gets executed, when the main loop counter becomes half of the
+This hooks (initqueue/timeout) gets executed, when the main loop counter becomes half of the
rd.retry counter.
-
-
==== Initqueue finished
-This hook is called after udev has settled and if all scripts herein return 0
-the main loop will be ended.
-
-
+This hook (initqueue/finished) is called after udev has settled and
+if all scripts herein return 0 the main loop will be ended.
+Abritary scripts can be added here, to loop in the
+initqueue until something happens, which a dracut module wants to wait for.
=== Hook: pre-mount
@@ -877,20 +850,15 @@ Before the root device is mounted all scripts in the hook pre-mount are
executed. In some cases (e.g. NFS) the real root device is already mounted,
though.
-
-
=== Hook: mount
This hook is mainly to mount the real root device.
-
-
=== Hook: pre-pivot
This hook is called before cleanup hook, This is a good place for
actions other than cleanups which need to be called before pivot.
-
=== Hook: cleanup
This hook is the last hook and is called before init finally switches root to
@@ -900,21 +868,18 @@ needed anymore.
=== Cleanup and switch_root
-Init kills all udev processes, cleans up the environment, sets up the arguments
-for the real init process and finally calls switch_root. switch_root removes the
-whole filesystem hierarchy of the initramfs, chroot()s to the real root device
-and calls /sbin/init with the specified arguments.
+Init (or systemd) kills all udev processes, cleans up the environment,
+sets up the arguments for the real init process and finally calls switch_root.
+switch_root removes the whole filesystem hierarchy of the initramfs,
+chroot()s to the real root device and calls /sbin/init with the specified arguments.
To ensure all files in the initramfs hierarchy can be removed, all processes
still running from the initramfs should not have any open file descriptors left.
-
-
== Network Infrastructure
FIXME
-
== Writing a Module
A simple example module is _96insmodpost_, which modprobes a kernel module after
@@ -926,8 +891,6 @@ First we create a check() function, which just exits with 0 indicating that this
module should be included by default.
check():
-
-
----
return 0
----
@@ -937,8 +900,6 @@ priority number 20 called _parse-insmodpost.sh_. It also installs the
_insmodpost.sh_ script in _/sbin_.
install():
-
-
----
inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
@@ -949,8 +910,6 @@ rd.driver.post, blacklists the module from being autoloaded and installs the
hook _insmodpost.sh_ in the _initqueue/settled_.
_parse-insmodpost.sh_:
-
-
----
for p in $(getargs rd.driver.post=); do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
@@ -967,8 +926,6 @@ modprobe the kernel modules specified in all rd.driver.post kernel command line
parameters. It runs after udev has settled and is only called once (--onetime).
_insmodpost.sh_:
-
-
----
. /lib/dracut-lib.sh

View File

@ -1,31 +0,0 @@
From 226e3710b4236c69a8f821b6a5c53a264fe4892a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:23:16 +0200
Subject: [PATCH] systemd/dracut-initqueue.sh: continue to boot if finished
failed
but /sysroot/etc/fstab exists.
---
modules.d/98systemd/dracut-initqueue.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 35cd76f..893ebc4 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -62,7 +62,14 @@ while :; do
fi
main_loop=$(($main_loop+1))
- [ $main_loop -gt $RDRETRY ] && action_on_fail "Could not boot." && break
+ if [ $main_loop -gt $RDRETRY ];
+ if ! [ -d /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then
+ action_on_fail "Could not boot." && break
+ fi
+ warn "Not all disks have been found."
+ warn "You might want to regenerate your initramfs."
+ break
+ fi
done
unset job

View File

@ -1,42 +0,0 @@
From a4f7b504712bd7499d60d16f358ec89ab31bbb47 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:25:45 +0200
Subject: [PATCH] dracut.sh/dracut-functions.sh: handle root on non-block
device
---
dracut-functions.sh | 4 +++-
dracut.sh | 5 ++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index eb1278e..dee53bb 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -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" | { \
diff --git a/dracut.sh b/dracut.sh
index 3140b7e..c35d771 100755
--- 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

View File

@ -1,354 +0,0 @@
From 55a0b3abc7b8da4f3714cfcb5d34f7aa4e78e5bc Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 5 Aug 2013 11:47:54 +0200
Subject: [PATCH] dracut-functions.sh: removed non dracut-install shell
functions
---
dracut-functions.sh | 315 ++++++++++------------------------------------------
1 file changed, 56 insertions(+), 259 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index dee53bb..c0a12cd 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -55,14 +55,6 @@ if ! [[ $dracutbasedir ]]; then
dracutbasedir="$(readlink -f $dracutbasedir)"
fi
-if ! [[ $DRACUT_INSTALL ]]; then
- DRACUT_INSTALL=$(find_binary dracut-install)
-fi
-
-if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
- DRACUT_INSTALL=$dracutbasedir/dracut-install
-fi
-
# Detect lib paths
if ! [[ $libdirs ]] ; then
if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
@@ -588,268 +580,73 @@ fs_get_option() {
done
}
-if [[ $DRACUT_INSTALL ]]; then
- [[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
- inst_dir() {
- [[ -e ${initdir}/"$1" ]] && return 0 # already there
- $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@" || :
- }
-
- inst() {
- [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
- #dinfo "$DRACUT_INSTALL -l $@"
- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- }
-
- inst_simple() {
- [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
- [[ -e $1 ]] || return 1 # no source
- $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@" || :
- }
-
- inst_symlink() {
- [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
- [[ -L $1 ]] || return 1
- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- }
-
- dracut_install() {
- local ret
- #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
- $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- ret=$?
- (($ret != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- return $ret
- }
-
- inst_library() {
- [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
- [[ -e $1 ]] || return 1 # no source
- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- }
-
- inst_binary() {
- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- }
-
- inst_script() {
- $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
- (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
- }
-
-else
-
- # Install a directory, keeping symlinks as on the original system.
- # Example: if /lib points to /lib64 on the host, "inst_dir /lib/file"
- # will create ${initdir}/lib64, ${initdir}/lib64/file,
- # and a symlink ${initdir}/lib -> lib64.
- inst_dir() {
- [[ -e ${initdir}/"$1" ]] && return 0 # already there
-
- local _dir="$1" _part="${1%/*}" _file
- while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
- _dir="$_part $_dir"
- _part=${_part%/*}
- done
-
- # iterate over parent directories
- for _file in $_dir; do
- [[ -e "${initdir}/$_file" ]] && continue
- if [[ -L $_file ]]; then
- inst_symlink "$_file"
- else
- # create directory
- mkdir -m 0755 -p "${initdir}/$_file" || return 1
- [[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
- chmod u+w "${initdir}/$_file"
- fi
- done
- }
- # $1 = file to copy to ramdisk
- # $2 (optional) Name for the file on the ramdisk
- # Location of the image dir is assumed to be $initdir
- # We never overwrite the target if it exists.
- inst_simple() {
- [[ -f "$1" ]] || return 1
- [[ "$1" == */* ]] || return 1
- local _src=$1 _target="${2:-$1}"
-
- [[ -L $_src ]] && { inst_symlink $_src $_target; return $?; }
-
- if ! [[ -d ${initdir}/$_target ]]; then
- [[ -e ${initdir}/$_target ]] && return 0
- [[ -L ${initdir}/$_target ]] && return 0
- [[ -d "${initdir}/${_target%/*}" ]] || inst_dir "${_target%/*}"
- fi
- if [[ $DRACUT_FIPS_MODE ]]; then
- # install checksum files also
- if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
- inst "${_src%/*}/.${_src##*/}.hmac" "${_target%/*}/.${_target##*/}.hmac"
- fi
- if [[ -e "/lib/fipscheck/${_src##*/}.hmac" ]]; then
- inst "/lib/fipscheck/${_src##*/}.hmac" "/lib/fipscheck/${_target##*/}.hmac"
- fi
- if [[ -e "/lib64/fipscheck/${_src##*/}.hmac" ]]; then
- inst "/lib64/fipscheck/${_src##*/}.hmac" "/lib64/fipscheck/${_target##*/}.hmac"
- fi
- fi
- ddebug "Installing $_src"
- cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$_target"
- }
+if ! [[ $DRACUT_INSTALL ]]; then
+ DRACUT_INSTALL=$(find_binary dracut-install)
+fi
- # same as above, but specialized for symlinks
- inst_symlink() {
- local _src=$1 _target=${2:-$1} _realsrc
- [[ "$1" == */* ]] || return 1
- [[ -L $1 ]] || return 1
- [[ -L $initdir/$_target ]] && return 0
- _realsrc=$(readlink -f "$_src")
- if ! [[ -e $initdir/$_realsrc ]]; then
- if [[ -d $_realsrc ]]; then
- inst_dir "$_realsrc"
- else
- inst "$_realsrc"
- fi
- fi
- [[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
+if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
+ DRACUT_INSTALL=$dracutbasedir/dracut-install
+fi
- ln_r "${_realsrc}" "${_target}"
- }
+if ! [[ -x $DRACUT_INSTALL ]]; then
+ dfatal "dracut-install not found!"
+ exit 10
+fi
- # Same as above, but specialized to handle dynamic libraries.
- # It handles making symlinks according to how the original library
- # is referenced.
- inst_library() {
- local _src="$1" _dest=${2:-$1} _lib _reallib _symlink
- [[ "$1" == */* ]] || return 1
- [[ -e $initdir/$_dest ]] && return 0
- if [[ -L $_src ]]; then
- if [[ $DRACUT_FIPS_MODE ]]; then
- # install checksum files also
- if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
- inst "${_src%/*}/.${_src##*/}.hmac" "${_dest%/*}/.${_dest##*/}.hmac"
- fi
- if [[ -e "/lib/fipscheck/${_src##*/}.hmac" ]]; then
- inst "/lib/fipscheck/${_src##*/}.hmac" "/lib/fipscheck/${_dest##*/}.hmac"
- fi
- if [[ -e "/lib64/fipscheck/${_src##*/}.hmac" ]]; then
- inst "/lib64/fipscheck/${_src##*/}.hmac" "/lib64/fipscheck/${_dest##*/}.hmac"
- fi
- fi
- _reallib=$(readlink -f "$_src")
- inst_simple "$_reallib" "$_reallib"
- inst_dir "${_dest%/*}"
- ln_r "${_reallib}" "${_dest}"
- else
- inst_simple "$_src" "$_dest"
- fi
+[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
+inst_dir() {
+ [[ -e ${initdir}/"$1" ]] && return 0 # already there
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@" || :
+}
- # Create additional symlinks. See rev_symlinks description.
- for _symlink in $(rev_lib_symlinks $_src) $(rev_lib_symlinks $_reallib); do
- [[ ! -e $initdir/$_symlink ]] && {
- ddebug "Creating extra symlink: $_symlink"
- inst_symlink $_symlink
- }
- done
- }
+inst() {
+ [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
+ #dinfo "$DRACUT_INSTALL -l $@"
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+}
- # Same as above, but specialized to install binary executables.
- # Install binary executable, and all shared library dependencies, if any.
- inst_binary() {
- local _bin _target
- _bin=$(find_binary "$1") || return 1
- _target=${2:-$_bin}
- [[ -e $initdir/$_target ]] && return 0
- local _file _line
- local _so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
- # I love bash!
- LC_ALL=C ldd "$_bin" 2>/dev/null | while read _line; do
- [[ $_line = 'not a dynamic executable' ]] && break
-
- if [[ $_line =~ $_so_regex ]]; then
- _file=${BASH_REMATCH[1]}
- [[ -e ${initdir}/$_file ]] && continue
- inst_library "$_file"
- continue
- fi
+inst_simple() {
+ [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
+ [[ -e $1 ]] || return 1 # no source
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@" || :
+}
- if [[ $_line == *not\ found* ]]; then
- dfatal "Missing a shared library required by $_bin."
- dfatal "Run \"ldd $_bin\" to find out what it is."
- dfatal "$_line"
- dfatal "dracut cannot create an initrd."
- exit 1
- fi
- done
- inst_simple "$_bin" "$_target"
- }
+inst_symlink() {
+ [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
+ [[ -L $1 ]] || return 1
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+}
- # same as above, except for shell scripts.
- # If your shell script does not start with shebang, it is not a shell script.
- inst_script() {
- local _bin
- _bin=$(find_binary "$1") || return 1
- shift
- local _line _shebang_regex
- read -r -n 80 _line <"$_bin"
- # If debug is set, clean unprintable chars to prevent messing up the term
- [[ $debug ]] && _line=$(echo -n "$_line" | tr -c -d '[:print:][:space:]')
- _shebang_regex='(#! *)(/[^ ]+).*'
- [[ $_line =~ $_shebang_regex ]] || return 1
- inst "${BASH_REMATCH[2]}" && inst_simple "$_bin" "$@"
- }
+dracut_install() {
+ local ret
+ #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ ret=$?
+ (($ret != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+ return $ret
+}
- # general purpose installation function
- # Same args as above.
- inst() {
- local _x
-
- case $# in
- 1) ;;
- 2) [[ ! $initdir && -d $2 ]] && export initdir=$2
- [[ $initdir = $2 ]] && set $1;;
- 3) [[ -z $initdir ]] && export initdir=$2
- set $1 $3;;
- *) dfatal "inst only takes 1 or 2 or 3 arguments"
- exit 1;;
- esac
- for _x in inst_symlink inst_script inst_binary inst_simple; do
- $_x "$@" && return 0
- done
- return 1
- }
+inst_library() {
+ [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
+ [[ -e $1 ]] || return 1 # no source
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+}
- # dracut_install [-o ] <file> [<file> ... ]
- # Install <file> to the initramfs image
- # -o optionally install the <file> and don't fail, if it is not there
- dracut_install() {
- local _optional=no
- if [[ $1 = '-o' ]]; then
- _optional=yes
- shift
- fi
- while (($# > 0)); do
- if ! inst "$1" ; then
- if [[ $_optional = yes ]]; then
- dinfo "Skipping program $1 as it cannot be found and is" \
- "flagged to be optional"
- else
- dfatal "Failed to install $1"
- exit 1
- fi
- fi
- shift
- done
- }
+inst_binary() {
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+}
-fi
+inst_script() {
+ $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
+ (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
+}
# find symlinks linked to given library file
# $1 = library file

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +0,0 @@
From 8652d5493d139105620ab82f34334f8acae13f13 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 6 Aug 2013 11:01:45 +0200
Subject: [PATCH] 51-dracut-rescue.install: fixed rescue image creation
---
51-dracut-rescue.install | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/51-dracut-rescue.install b/51-dracut-rescue.install
index 39d01a7..b655bc2 100755
--- a/51-dracut-rescue.install
+++ b/51-dracut-rescue.install
@@ -6,6 +6,9 @@ export LANG=C
COMMAND="$1"
KERNEL_VERSION="$2"
+BOOT_DIR_ABS="${3%/*}/0-rescue"
+KERNEL_IMAGE="$4"
+
dropindirs_sort()
{
@@ -50,7 +53,6 @@ fi
LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"
BOOT_DIR="/${MACHINE_ID}/0-rescue"
-BOOT_DIR_ABS="/boot${BOOT_DIR}"
ret=0

View File

@ -1,43 +0,0 @@
From 5ae33613ab3145db12f21bca491d97832160cc1a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 6 Aug 2013 11:43:58 +0200
Subject: [PATCH] dracut.sh: do not strip in FIPS mode
---
dracut.sh | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index e119bd2..4ef71f3 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1209,25 +1209,11 @@ if [[ $do_strip = yes ]] ; then
done
fi
-if [[ $do_strip = yes ]] ; then
+if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
dinfo "*** Stripping files ***"
- if [[ $DRACUT_FIPS_MODE ]]; then
- find "$initdir" -type f \
- -executable -not -path '*/lib/modules/*.ko' -print0 \
- | while read -r -d $'\0' f; do
- if ! [[ -e "${f%/*}/.${f##*/}.hmac" ]] \
- && ! [[ -e "/lib/hmaccalc/${f##*/}.hmac" ]] \
- && ! [[ -e "/lib64/hmaccalc/${f##*/}.hmac" ]] \
- && ! [[ -e "/lib/fipscheck/${f##*/}.hmac" ]] \
- && ! [[ -e "/lib64/fipscheck/${f##*/}.hmac" ]]; then
- printf "%s\000" "$f";
- fi
- done | xargs -r -0 strip -g 2>/dev/null
- else
- find "$initdir" -type f \
- -executable -not -path '*/lib/modules/*.ko' -print0 \
- | xargs -r -0 strip -g 2>/dev/null
- fi
+ find "$initdir" -type f \
+ -executable -not -path '*/lib/modules/*.ko' -print0 \
+ | xargs -r -0 strip -g 2>/dev/null
# strip kernel modules, but do not touch signed modules
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \

View File

@ -1,26 +0,0 @@
From aacdba2bdb3efddd7b3b9cdb149204d86f5020b0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 6 Aug 2013 16:56:42 +0200
Subject: [PATCH] dracut.sh: check the value of --kver
https://bugzilla.redhat.com/show_bug.cgi?id=993327
---
dracut.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 4ef71f3..0b674ae 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -478,6 +478,11 @@ if [[ $regenerate_all == "yes" ]]; then
((ret+=$?))
done
exit $ret
+elif [[ $kernel ]]; then
+ if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then
+ printf -- "Kernel version $kernel has no modules in /lib/modules/$kernel\n" >&2
+ exit 1
+ fi
fi
if ! [[ $kernel ]]; then

View File

@ -1,24 +0,0 @@
From 7deba0428a23b3f410a7cf8cac7cf8355e4dc150 Mon Sep 17 00:00:00 2001
From: James Lee <jlee@thestaticvoid.com>
Date: Tue, 6 Aug 2013 11:25:58 -0400
Subject: [PATCH] crypt: Fix typo--/etc/crypttab not /etc/cryptab
1ae8b8a breaks the crypt module for those who use keyfiles due to a
typo leading to the exclusion of /etc/crypttab from the initrd.
---
modules.d/90crypt/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 975f115..68b5fbe 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -57,7 +57,7 @@ install() {
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
fi
- if [[ $hostonly ]] && [[ -f /etc/cryptab ]]; then
+ if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
# filter /etc/crypttab for the devices we need
while read _mapper _dev _rest; do
[[ $_mapper = \#* ]] && continue

View File

@ -1,58 +0,0 @@
From 0b11ea71996a7b804afbc38d1d5461fb0f4ef882 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 7 Aug 2013 16:05:03 +0200
Subject: [PATCH] network/net-lib.sh: fix ibft interface configuration
also skip ibft$num names, which have been already given
https://bugzilla.redhat.com/show_bug.cgi?id=989944
---
modules.d/40network/net-lib.sh | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 494960c..ca4b393 100644
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -172,13 +172,20 @@ save_netinfo() {
}
set_ifname() {
- local name="$1" mac="$2" num=0 n=""
+ local name="$1" mac="$2" num=-1 n=""
# if it's already set, return the existing name
for n in $(getargs ifname=); do
strstr "$n" "$mac" && echo ${n%%:*} && return
done
# otherwise, pick a new name and use that
- while [ -e /sys/class/net/$name$num ]; do num=$(($num+1)); done
+ while :; do
+ num=$(($num+1));
+ [ -e /sys/class/net/$name$num ] && continue
+ for n in $(getargs ifname=); do
+ [ "$name$num" = "${n%%:*}" ] && continue 2
+ done
+ break
+ done
echo "ifname=$name$num:$mac" >> /etc/cmdline.d/45-ifname.conf
echo "$name$num"
}
@@ -205,6 +212,9 @@ ibft_to_cmdline() {
mac=$(read a < ${iface}/mac; echo $a)
[ -z "$mac" ] && continue
dev=$(set_ifname ibft $mac)
+
+ [ -e /tmp/net.${dev}.has_ibft_config ] && continue
+
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
if [ -e ${iface}/vlan ]; then
vlan=$(read a < ${iface}/vlan; echo $a)
@@ -215,6 +225,8 @@ ibft_to_cmdline() {
echo "ip=$dev:dhcp"
elif [ -e ${iface}/ip-addr ]; then
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
+ # skip not assigned ip adresses
+ [ "$ip" = "0.0.0.0" ] && continue
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)

View File

@ -1,24 +0,0 @@
From 7929ec198fa693f07160518b6858e967fdd53f48 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 9 Aug 2013 10:33:27 +0200
Subject: [PATCH] iscsi/module-setup.sh: install some modules regardless of
hostonly
---
modules.d/95iscsi/module-setup.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 3f817ec..502e834 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -36,7 +36,8 @@ depends() {
installkernel() {
local _arch=$(uname -m)
- instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
+ instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
+ hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
iscsi_module_filter() {
local _funcs='iscsi_register_transport'
# subfunctions inherit following FDs

View File

@ -1,41 +0,0 @@
From e84d115b93428bf93e82a2c808721aadc048b163 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 9 Aug 2013 10:44:34 +0200
Subject: [PATCH] multipath: need_shutdown if multipath devices exist
https://bugzilla.redhat.com/show_bug.cgi?id=994913
---
modules.d/90multipath/module-setup.sh | 3 +++
modules.d/90multipath/multipathd-needshutdown.sh | 9 +++++++++
2 files changed, 12 insertions(+)
create mode 100755 modules.d/90multipath/multipathd-needshutdown.sh
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 6cdc511..feb58dc 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -95,6 +95,9 @@ install() {
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
fi
+
+ inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
+
inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
}
diff --git a/modules.d/90multipath/multipathd-needshutdown.sh b/modules.d/90multipath/multipathd-needshutdown.sh
new file mode 100755
index 0000000..1565d4d
--- /dev/null
+++ b/modules.d/90multipath/multipathd-needshutdown.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+for i in /dev/mapper/mpath*; do
+ [ -b "$i" ] || continue
+ need_shutdown
+ break
+done

View File

@ -1,30 +0,0 @@
From beb26a084794a4bc8baffc8384cb8e41844f89f9 Mon Sep 17 00:00:00 2001
From: "dyoung@redhat.com" <dyoung@redhat.com>
Date: Thu, 8 Aug 2013 14:05:02 +0800
Subject: [PATCH] omit drivers fix
Because omit_drivers list use underline always, so when maching with it
the _mod need to be converted as well or sometimes omit-drivers will fail
silently.
Fix this by replace '-' with '_' in instmods function.
Signed-off-by: Dave Young <dyoung@redhat.com>
---
dracut-functions.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index fbe0633..6033a1a 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1420,7 +1420,8 @@ instmods() {
return $_ret
fi
- if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
+ _mod=${_mod/-/_}
+ if [[ $omit_drivers ]] && [[ "$_mod" =~ $omit_drivers ]]; then
dinfo "Omitting driver ${_mod##$srcmods}"
return 0
fi

View File

@ -1,23 +0,0 @@
From d93fe0fa35d29762a21a44a9644ba37e352e8b7a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 9 Aug 2013 15:35:20 +0200
Subject: [PATCH] lsinitrd.sh: fixed case
---
lsinitrd.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index ef1c262..faad99a 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -109,8 +109,7 @@ case $bin in
CAT="zcat";;
BZh*)
CAT="bzcat";;
- $'\x71\xc7'*)
- 070701)
+ $'\x71\xc7'*|070701)
CAT="cat";;
*)
CAT="xzcat";

View File

@ -1,55 +0,0 @@
From 3e6c9011d0f42e19c1c5e2b04b41073100edcf14 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 9 Aug 2013 15:47:30 +0200
Subject: [PATCH] dracut-logger.sh: do not unset logging messages if sysloglvl
is set
---
dracut-logger.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dracut-logger.sh b/dracut-logger.sh
index f4dcdb8..ff23301 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -173,34 +173,34 @@ dlog_init() {
export maxloglvl
- if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)); then
+ if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then
unset dtrace
dtrace() { :; };
fi
- if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)); then
+ if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then
unset ddebug
ddebug() { :; };
fi
- if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)); then
+ if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then
unset dinfo
dinfo() { :; };
fi
- if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)); then
+ if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then
unset dwarn
dwarn() { :; };
unset dwarning
dwarning() { :; };
fi
- if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)); then
+ if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then
unset derror
derror() { :; };
fi
- if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)); then
+ if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then
unset dfatal
dfatal() { :; };
fi

View File

@ -1,22 +0,0 @@
From 3e70a25bcf2fb49fbc81d110d3186bddf4f81ad0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 12 Aug 2013 12:44:10 +0200
Subject: [PATCH] dracut-logger.sh: saveguard logger with --
---
dracut-logger.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-logger.sh b/dracut-logger.sh
index ff23301..0c505e2 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -323,7 +323,7 @@ _do_dlog() {
if [[ "$_dlogfd" ]]; then
echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
else
- logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
+ logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
fi
fi

View File

@ -1,26 +0,0 @@
From dadd2b698ef7d0c069dce58ccad5543337b007c9 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 12 Aug 2013 12:46:03 +0200
Subject: [PATCH] dracut.sh: use local lsinitrd.sh for "-l"
---
dracut.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 0b674ae..6208c82 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1271,7 +1271,11 @@ mv -- "$outfile.$$" "$outfile"
dinfo "*** Creating image file done ***"
if (( maxloglvl >= 5 )); then
- lsinitrd "$outfile"| ddebug
+ if [[ $allowlocal ]]; then
+ "$dracutbasedir/lsinitrd.sh" "$outfile"| ddebug
+ else
+ lsinitrd "$outfile"| ddebug
+ fi
fi
exit 0

View File

@ -1,22 +0,0 @@
From e95b672376314602777989bcb416bf7037ca77bc Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 12 Aug 2013 12:46:35 +0200
Subject: [PATCH] dracut.sh: fixed typo
---
dracut.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index 6208c82..2ac3d8b 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -877,7 +877,7 @@ if [[ $hostonly ]]; then
mp=$(readlink -f "$mp")
mountpoint "$mp" >/dev/null 2>&1 || continue
_dev=$(find_block_device "$mp")
- _bdev=$(readlink -f "/dev/block/$dev")
+ _bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
push host_devs $_dev
[[ "$_mp" == "/" ]] && root_dev="$_dev"

View File

@ -1,26 +0,0 @@
From 109283a8830f7b9c1d4bb6b4852f1bff0d36bf30 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 12 Aug 2013 12:57:13 +0200
Subject: [PATCH] base: don't install switch_root, if systemd is used
---
modules.d/99base/module-setup.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index f217ccb..52ce400 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -41,11 +41,10 @@ install() {
mkdir -p ${initdir}/tmp
- inst_multiple switch_root || dfatal "Failed to install switch_root"
-
inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
if ! dracut_module_included "systemd"; then
+ inst_multiple switch_root || dfatal "Failed to install switch_root"
inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
fi

View File

@ -1,22 +0,0 @@
From e8b9702c0a7837c901addbdc964eccfc71e7a3df Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 12 Aug 2013 13:08:17 +0200
Subject: [PATCH] systemd/dracut-initqueue.sh: added missing "then"
---
modules.d/98systemd/dracut-initqueue.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 893ebc4..d7ebf2b 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -62,7 +62,7 @@ while :; do
fi
main_loop=$(($main_loop+1))
- if [ $main_loop -gt $RDRETRY ];
+ if [ $main_loop -gt $RDRETRY ]; then
if ! [ -d /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then
action_on_fail "Could not boot." && break
fi

View File

@ -9,8 +9,8 @@
%endif
Name: dracut
Version: 031
Release: 29.git20130812%{?dist}
Version: 032
Release: 1%{?dist}
Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel}
@ -21,42 +21,14 @@ Group: System/Base
%endif
# The entire source code is GPLv2+
# except install/* which is LGPLv2.1+
License: GPLv2+ and LGPLv2.1+
# except install/* which is LGPLv2+
License: GPLv2+ and LGPLv2+
URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
Patch1: 0001-Generate-correct-ifcfg-file-for-vlan-option.patch
Patch2: 0002-Revert-base-setup-correct-system-time-and-time-zone-.patch
Patch3: 0003-Change-the-implementation-of-action_on_fail.patch
Patch4: 0004-lvm-add-yes-to-lvm-lvchange.patch
Patch5: 0005-cms-cmssetup.sh-correct-port-for-zfcp.conf.patch
Patch6: 0006-95terminfo-install-vt102.patch
Patch7: 0007-lsinitrd.sh-add-old-cpio-signature.patch
Patch8: 0008-dracut.sh-call-find-with-print0-and-cpio-with-null.patch
Patch9: 0009-dracut.asc-small-corrections.patch
Patch10: 0010-systemd-dracut-initqueue.sh-continue-to-boot-if-fini.patch
Patch11: 0011-dracut.sh-dracut-functions.sh-handle-root-on-non-blo.patch
Patch12: 0012-dracut-functions.sh-removed-non-dracut-install-shell.patch
Patch13: 0013-dracut-functions.sh-inst_multiple-dracut_install.patch
Patch14: 0014-51-dracut-rescue.install-fixed-rescue-image-creation.patch
Patch15: 0015-dracut.sh-do-not-strip-in-FIPS-mode.patch
Patch16: 0016-dracut.sh-check-the-value-of-kver.patch
Patch17: 0017-crypt-Fix-typo-etc-crypttab-not-etc-cryptab.patch
Patch18: 0018-network-net-lib.sh-fix-ibft-interface-configuration.patch
Patch19: 0019-iscsi-module-setup.sh-install-some-modules-regardles.patch
Patch20: 0020-multipath-need_shutdown-if-multipath-devices-exist.patch
Patch21: 0021-omit-drivers-fix.patch
Patch22: 0022-lsinitrd.sh-fixed-case.patch
Patch23: 0023-dracut-logger.sh-do-not-unset-logging-messages-if-sy.patch
Patch24: 0024-dracut-logger.sh-saveguard-logger-with.patch
Patch25: 0025-dracut.sh-use-local-lsinitrd.sh-for-l.patch
Patch26: 0026-dracut.sh-fixed-typo.patch
Patch27: 0027-base-don-t-install-switch_root-if-systemd-is-used.patch
Patch28: 0028-systemd-dracut-initqueue.sh-added-missing-then.patch
BuildRequires: bash git
@ -150,6 +122,7 @@ Summary: dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: iputils
Requires: iproute
Requires: dhclient
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release}
@ -347,6 +320,7 @@ rm -rf -- $RPM_BUILD_ROOT
%else
%{dracutlibdir}/modules.d/00bootchart
%endif
%{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
@ -472,6 +446,19 @@ rm -rf -- $RPM_BUILD_ROOT
%endif
%changelog
* Tue Aug 20 2013 Harald Hoyer <harald@redhat.com> 032-1
- fix for kdump in FIPS mode
Resolves: rhbz#920931
- fixed iBFT booting
Resolves: rhbz#989944
- fixed FIPS mode initramfs creation
Resolves: rhbz#990250
- shutdown: fixed killall_proc_mountpoint()
Resolves: rhbz#996549
- disable lvmetad in the initramfs
Resolves: rhbz#996627
- require dhclient
* Mon Aug 12 2013 Harald Hoyer <harald@redhat.com> 031-29.git20130812
- added missing "then" in initqueue

View File

@ -1 +1 @@
9c3846424c705fc20f68cc3356c1b187 dracut-031.tar.bz2
c8d7e7f0d8d76b3a646ce2bdb960cb0b dracut-032.tar.bz2