dracut-020-1

- version 020
- new /usr/bin/dracut-install tool
- major speedup of the image creation
This commit is contained in:
Harald Hoyer 2012-06-29 13:52:38 +02:00
parent 53e9906e08
commit 094c9e4151
95 changed files with 10 additions and 5211 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/dracut-017.tar.bz2 /dracut-017.tar.bz2
/dracut-018.tar.bz2 /dracut-018.tar.bz2
/dracut-019.tar.bz2 /dracut-019.tar.bz2
/dracut-020.tar.bz2

View File

@ -1,138 +0,0 @@
From d77540c8e4caf557d472786711ef17838a4a24f1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 4 Jun 2012 15:23:15 +0200
Subject: [PATCH] get rid of libdir and usrlibdir
---
dracut.sh | 23 ++++++++--------------
modules.d/01fips/module-setup.sh | 2 +-
modules.d/50plymouth/plymouth-populate-initrd.sh | 12 ++++-------
modules.d/95nfs/module-setup.sh | 8 +++-----
4 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index c9e412e..65398a8 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -527,22 +527,15 @@ ddebug "Executing $0 $dracut_args"
}
# Detect lib paths
-if ! [[ $libdir ]] || ! [[ $usrlibdir ]] ; then
+if ! [[ $libdirs ]] ; then
if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
&& [[ -d /lib64 ]]; then
- libdir=/lib64
- usrlibdir=/usr/lib64
+ libdirs+=" /lib64"
+ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
else
- libdir=/lib
- usrlibdir=/usr/lib
+ libdirs+=" /lib"
+ [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
fi
- for i in $libdir $usrlibdir; do
- if [[ -d $i ]]; then
- libdirs+=" $i"
- else
- dwarn 'No $i directory??!!'
- fi
- done
fi
# This is kinda legacy -- eventually it should go away.
@@ -660,7 +653,7 @@ done
export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems \
- use_fstab fstab_lines libdir usrlibdir fscks nofscks \
+ use_fstab fstab_lines libdirs fscks nofscks \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug host_fs_types host_devs sshkey add_fstab \
DRACUT_VERSION
@@ -672,13 +665,13 @@ export initdir dracutbasedir dracutmodules drivers \
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
if [[ $prefix ]]; then
- for d in bin etc lib "$libdir" sbin tmp usr var; do
+ for d in bin etc lib $libdirs sbin tmp usr var; do
ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
done
fi
if [[ $kernel_only != yes ]]; then
- for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log var/run var/lock; do
+ for d in usr/bin usr/sbin bin etc lib $libdirs sbin tmp usr var var/log var/run var/lock; do
[[ -e "${initdir}${prefix}/$d" ]] && continue
if [ -L "/$d" ]; then
inst_symlink "/$d" "${prefix}/$d"
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh
index 075fc24..a576a4a 100755
--- a/modules.d/01fips/module-setup.sh
+++ b/modules.d/01fips/module-setup.sh
@@ -41,7 +41,7 @@ install() {
inst_libdir_file libfreebl3.so
inst_libdir_file libfreebl3.chk
- dracut_install $usrlibdir/hmaccalc/sha512hmac.hmac
+ inst_libdir_file 'hmaccalc/sha512hmac.hmac'
if command -v prelink >/dev/null; then
dracut_install prelink
fi
diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh
index 25657ae..7ab1a5d 100755
--- a/modules.d/50plymouth/plymouth-populate-initrd.sh
+++ b/modules.d/50plymouth/plymouth-populate-initrd.sh
@@ -12,8 +12,8 @@ dracut_install /bin/plymouth \
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
if [[ $hostonly ]]; then
- dracut_install "${usrlibdir}/plymouth/text.so" \
- "${usrlibdir}/plymouth/details.so" \
+ inst_libdir_file "plymouth/text.so" "plymouth/details.so"
+ dracut_install \
"/usr/share/plymouth/themes/details/details.plymouth" \
"/usr/share/plymouth/themes/text/text.plymouth" \
@@ -28,7 +28,7 @@ if [[ $hostonly ]]; then
inst /usr/share/plymouth/themes/default.plymouth
# Install plugin for this theme
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
- inst "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so"
+ inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
fi
else
for x in /usr/share/plymouth/themes/{text,details}/* ; do
@@ -37,11 +37,7 @@ else
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
dracut_install "$x"
done
- for x in "${usrlibdir}"/plymouth/{text,details}.so ; do
- [[ -f "$x" ]] || continue
- [[ "$x" != "${x%%/label.so}" ]] && continue
- dracut_install "$x"
- done
+ inst_libdir_file "/plymouth/{text,details}.so"
(
cd ${initdir}/usr/share/plymouth/themes;
ln -s text/text.plymouth default.plymouth 2>&1;
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 1d62e95..bf87762 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -43,11 +43,9 @@ install() {
dracut_install rpc.idmapd
dracut_install sed
- for _i in {"$libdir","$usrlibdir"}/libnfsidmap_nsswitch.so* \
- {"$libdir","$usrlibdir"}/libnfsidmap/*.so \
- {"$libdir","$usrlibdir"}/libnfsidmap*.so*; do
- [ -e "$_i" ] && dracut_install "$_i"
- done
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so'
+ inst_libdir_file 'libnfsidmap*.so*'
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
| tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')

View File

@ -1,85 +0,0 @@
From 4d76a85df17b600553af1f58ced1dc7bea8a0e7c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 5 Jun 2012 20:23:35 +0200
Subject: [PATCH] dasd_mod: change rd.dasd to dasd_mod kernel parameter
---
dracut.cmdline.7.asc | 9 ++-------
modules.d/95dasd_mod/parse-dasd-mod.sh | 34 --------------------------------
2 files changed, 2 insertions(+), 41 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 8a74cf5..9fa0ee8 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -434,14 +434,9 @@ NBD
DASD
~~~~
-**rd.dasd_mod.dasd=**....::
+**rd.dasd=**....::
same syntax as the kernel module parameter (s390 only)
-**rd.dasd=**_<dasd_adaptor device bus ID>_[,readonly=_X_][,use_diag=_X_][,erplog=_X_]::
- activate DASD device with the given adaptor device bus ID and setting the
- sysfs attributes to the specified values. This parameter can be specified
- multiple times.
-
ZFCP
~~~~
**rd.zfcp=**_<zfcp adaptor device bus ID>_,_<WWPN>_,_<FCPLUN>_::
@@ -510,7 +505,7 @@ rdbreak:: rd.break
rd_CCW:: rd.ccw
-rd_DASD_MOD:: rd.dasd_mod.dasd
+rd_DASD_MOD:: rd.dasd
rd_DASD:: rd.dasd
diff --git a/modules.d/95dasd_mod/parse-dasd-mod.sh b/modules.d/95dasd_mod/parse-dasd-mod.sh
index 7b197d1..c37aca8 100755
--- a/modules.d/95dasd_mod/parse-dasd-mod.sh
+++ b/modules.d/95dasd_mod/parse-dasd-mod.sh
@@ -3,41 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
mod_args=""
-convert_dasd_param() {
- local bus_id params
- params=""
- bus_id=$1; shift
- while [ $# -gt 0 ]; do
- case "$1" in
- use_diag\=1)
- params="$params,diag"
- ;;
- readonly\=1)
- params="$params,ro"
- ;;
- erplog\=1)
- params="$params,erplog"
- ;;
- failfast\=1)
- params="$params,failfast"
- ;;
- esac
- shift
- done
- params="${params#*,}"
- if [ -n "$params" ]; then
- echo "$bus_id($params)"
- else
- echo "$bus_id"
- fi
-}
-
for dasd_arg in $(getargs rd.dasd= rd_DASD= DASD=); do
- OLD_IFS=$IFS
- IFS=","
- set -- $dasd_arg
- IFS=$OLD_IFS
- dasd_arg=$(convert_dasd_param "$@")
mod_args="$mod_args,$dasd_arg"
done

View File

@ -1,23 +0,0 @@
From b6fd45163a18d19434de33de3f3ed324bc560a97 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 6 Jun 2012 11:45:30 +0200
Subject: [PATCH] kernel-modules/module-setup.sh: include omapdrm in the arm
modules to include
---
modules.d/90kernel-modules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 4df180b..1d39c85 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -36,7 +36,7 @@ installkernel() {
hostonly='' instmods usb_storage sdhci sdhci-pci
# arm specific modules
- hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap sdhci_dove ahci_platform pata_imx sata_mv
+ hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap omapdrm sdhci_dove ahci_platform pata_imx sata_mv
# install keyboard support
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd

View File

@ -1,43 +0,0 @@
From 2cf4f4fb747803ff31d53507bc047232c4ef99ea Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Wed, 6 Jun 2012 14:19:59 +0200
Subject: [PATCH] Avoid annonying warnings when pkg-config is not installed.
---
dracut-functions.sh | 2 +-
modules.d/95udev-rules/module-setup.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index f788878..4180f03 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -531,7 +531,7 @@ inst_symlink() {
ln -sfn $(convert_abs_rel "${_target}" "${_realsrc}") "$initdir/$_target"
}
-udevdir=$(pkg-config udev --variable=udevdir)
+udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
[[ -d /lib/udev ]] && udevdir=/lib/udev
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
index e8c1c04..ff47021 100755
--- a/modules.d/95udev-rules/module-setup.sh
+++ b/modules.d/95udev-rules/module-setup.sh
@@ -5,13 +5,13 @@
install() {
local _i
- systemdutildir=$(pkg-config systemd --variable=systemdutildir)
+ systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
if ! [[ -d "$systemdutildir" ]]; then
[[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
fi
- udevdir=$(pkg-config udev --variable=udevdir)
+ udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
[[ -d /lib/udev ]] && udevdir=/lib/udev
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev

View File

@ -1,127 +0,0 @@
From d161561290909523818e5ec16271e5f88b6152de Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 6 Jun 2012 15:12:59 +0200
Subject: [PATCH] make udevdir systemdutildir systemdsystemunitdir global vars
your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf
see dracut.conf.d/fedora.conf.example
---
dracut-functions.sh | 6 ------
dracut.conf.d/fedora.conf.example | 3 +++
dracut.sh | 20 +++++++++++++++++++-
modules.d/95udev-rules/module-setup.sh | 12 ------------
modules.d/98systemd/module-setup.sh | 11 -----------
5 files changed, 22 insertions(+), 30 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 4180f03..8aba88d 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -531,12 +531,6 @@ inst_symlink() {
ln -sfn $(convert_abs_rel "${_target}" "${_realsrc}") "$initdir/$_target"
}
-udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
-if ! [[ -d "$udevdir" ]]; then
- [[ -d /lib/udev ]] && udevdir=/lib/udev
- [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
-fi
-
# attempt to install any programs specified in a udev rule
inst_rule_programs() {
local _prog _bin
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index e362e73..f3f57f1 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -8,3 +8,6 @@ stdloglvl=3
realinitpath="/usr/lib/systemd/systemd"
install_items+=" vi /etc/virc ps grep cat rm "
prefix="/"
+systemdutildir=/usr/lib/systemd
+systemdsystemunitdir=/usr/lib/systemd/system
+udevdir=/usr/lib/udev
diff --git a/dracut.sh b/dracut.sh
index 65398a8..49ea503 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -650,13 +650,31 @@ for dev in "${host_devs[@]}"; do
done
done
+[[ -d $udevdir ]] \
+ || udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
+if ! [[ -d "$udevdir" ]]; then
+ [[ -d /lib/udev ]] && udevdir=/lib/udev
+ [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
+fi
+
+[[ -d $systemdutildir ]] \
+ || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
+[[ -d $systemdsystemunitdir ]] \
+ || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null)
+
+if ! [[ -d "$systemdutildir" ]]; then
+ [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
+ [[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
+fi
+[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system
+
export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems \
use_fstab fstab_lines libdirs fscks nofscks \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug host_fs_types host_devs sshkey add_fstab \
- DRACUT_VERSION
+ DRACUT_VERSION udevdir systemdutildir systemdsystemunitdir
# Create some directory structure first
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
index ff47021..a48b0cb 100755
--- a/modules.d/95udev-rules/module-setup.sh
+++ b/modules.d/95udev-rules/module-setup.sh
@@ -5,18 +5,6 @@
install() {
local _i
- systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
- if ! [[ -d "$systemdutildir" ]]; then
- [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
- [[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
- fi
-
- udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
- if ! [[ -d "$udevdir" ]]; then
- [[ -d /lib/udev ]] && udevdir=/lib/udev
- [[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
- fi
-
# Fixme: would be nice if we didn't have to know which rules to grab....
# 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
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 1d8aefc..4fda2a2 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -16,17 +16,6 @@ depends() {
}
install() {
- local systemdutildir systemdsystemunitdir
-
- systemdutildir=$(pkg-config systemd --variable=systemdutildir)
- systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir)
-
- if ! [[ -d "$systemdutildir" ]]; then
- [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
- [[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
- fi
- [[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system
-
dracut_install -o "$i" \
$systemdutildir/systemd \
$systemdutildir/systemd-cgroups-agent \

View File

@ -1,207 +0,0 @@
From fe1484f3db0c7fe7fe8e6d5cc1e6e4d8f0b17052 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 6 Jun 2012 18:20:35 +0200
Subject: [PATCH] modules are now only handled with /sys/modules and
modules.dep
No more "find" and /proc/modules checking. We now rely entirely on
depmod and modules.dep
---
TODO | 3 +-
dracut-functions.sh | 56 +++++++-----------------------
dracut.sh | 5 +++
modules.d/50plymouth/module-setup.sh | 62 +++++++++++++++++++++++++---------
4 files changed, 65 insertions(+), 61 deletions(-)
diff --git a/TODO b/TODO
index acbb0a2..095ec97 100644
--- a/TODO
+++ b/TODO
@@ -17,7 +17,8 @@ INITRAMFS TODO
GENERATOR TODO
-- remove /proc/modules use /sys/module
+- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
+- provide "installkernel" and "new-kernel-pkg"
- add mechanism for module specific command line options
- pkg-config integration, to make it easy for other packages to use us.
- add recovery image creator (mkrecovery)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 8aba88d..6a72fce 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1053,7 +1053,7 @@ install_kmod_with_fw() {
fi
done
if [[ $_found != yes ]]; then
- if ! grep -qe "\<${_modname//-/_}\>" /proc/modules; then
+ if ! [[ -d $(echo /sys/module/${_modname//-/_}|{ read a b; echo $a; }) ]]; then
dinfo "Possible missing firmware \"${_fw}\" for kernel module" \
"\"${_modname}.ko\""
else
@@ -1086,54 +1086,21 @@ for_each_kmod_dep() {
)
}
-# filter kernel modules to install certain modules that meet specific
-# requirements.
-# $1 = search only in subdirectory of /kernel/$1
-# $2 = function to call with module name to filter.
-# This function will be passed the full path to the module to test.
-# The behaviour of this function can vary depending on whether $hostonly is set.
-# If it is, we will only look at modules that are already in memory.
-# If it is not, we will look at all kernel modules
-# This function returns the full filenames of modules that match $1
-filter_kernel_modules_by_path () (
- local _modname _filtercmd
- if ! [[ $hostonly ]]; then
- _filtercmd='find "$srcmods/kernel/$1" "$srcmods/extra"'
- _filtercmd+=' "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz"'
- _filtercmd+=' -o -name "*.ko.xz"'
- _filtercmd+=' 2>/dev/null'
- else
- _filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename '
- _filtercmd+='-k $kernel 2>/dev/null'
- fi
- for _modname in $(eval $_filtercmd); do
- case $_modname in
- *.ko) "$2" "$_modname" && echo "$_modname";;
- *.ko.gz) gzip -dc "$_modname" > $initdir/$$.ko
- $2 $initdir/$$.ko && echo "$_modname"
- rm -f $initdir/$$.ko
- ;;
- *.ko.xz) xz -dc "$_modname" > $initdir/$$.ko
- $2 $initdir/$$.ko && echo "$_modname"
- rm -f $initdir/$$.ko
- ;;
- esac
- done
-)
+
find_kernel_modules_by_path () (
if ! [[ $hostonly ]]; then
- find "$srcmods/kernel/$1" "$srcmods/extra" "$srcmods/weak-updates" \
- -name "*.ko" -o -name "*.ko.gz" -o -name "*.ko.xz" 2>/dev/null
+ while read a rest; do
+ if [[ "${a##kernel}" != "$a" ]]; then
+ [[ "${a##kernel/$1}" != "$a" ]] || continue
+ fi
+ echo $srcmods/${a%:}
+ done < $srcmods/modules.dep
else
- cut -d " " -f 1 </proc/modules \
+ ( cd /sys/module; echo *; ) \
| xargs modinfo -F filename -k $kernel 2>/dev/null
fi
)
-filter_kernel_modules () {
- filter_kernel_modules_by_path drivers "$1"
-}
-
find_kernel_modules () {
find_kernel_modules_by_path drivers
}
@@ -1180,8 +1147,9 @@ instmods() {
fi
# If we are building a host-specific initramfs and this
# module is not already loaded, move on to the next one.
- [[ $hostonly ]] && ! grep -qe "\<${_mod//-/_}\>" /proc/modules \
- && ! echo $add_drivers | grep -qe "\<${_mod}\>" \
+ [[ $hostonly ]] \
+ && ! [[ -d $(echo /sys/module/${_mod//-/_}|{ read a b; echo $a; }) ]] \
+ && ! [[ "$add_drivers" =~ " ${_mod} " ]] \
&& return
# We use '-d' option in modprobe only if modules prefix path
diff --git a/dracut.sh b/dracut.sh
index 49ea503..78e7ac8 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -555,6 +555,11 @@ srcmods="/lib/modules/$kernel/"
}
export srcmods
+[[ -f $srcmods/modules.dep ]] || {
+ dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
+ exit 1
+}
+
if [[ -f $outfile && ! $force ]]; then
dfatal "Will not override existing initramfs ($outfile) without --force"
exit 1
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index 8a675ec..69f1bc7 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -14,23 +14,53 @@ depends() {
installkernel() {
local _modname
# Include KMS capable drm drivers
- for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' -o -name '*.ko.xz' \) 2>/dev/null); do
- case $_modname in
- *.ko) grep -q drm_crtc_init $_modname ;;
- *.ko.gz) zgrep -q drm_crtc_init $_modname ;;
- *.ko.xz) xzgrep -q drm_crtc_init $_modname ;;
- esac
- if test $? -eq 0; then
- # if the hardware is present, include module even if it is not currently loaded,
- # as we could e.g. be in the installer; nokmsboot boot parameter will disable
- # loading of the driver if needed
- if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
- | grep -qxf - /sys/bus/pci/devices/*/modalias; then
- hostonly='' instmods $_modname
- continue
- fi
- instmods $_modname
+
+ drm_module_filter() {
+ local _drm_drivers='drm_crtc_init'
+ local _ret
+ # subfunctions inherit following FDs
+ local _merge=8 _side2=9
+ function nmf1() {
+ local _fname _fcont
+ while read _fname; do
+ case "$_fname" in
+ *.ko) _fcont="$(< $_fname)" ;;
+ *.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
+ *.ko.xz) _fcont="$(xz -dc $_fname)" ;;
+ esac
+ [[ $_fcont =~ $_drm_drivers
+ && ! $_fcont =~ iw_handler_get_spy ]] \
+ && echo "$_fname"
+ done
+ }
+ function rotor() {
+ local _f1 _f2
+ while read _f1; do
+ echo "$_f1"
+ if read _f2; then
+ echo "$_f2" 1>&${_side2}
+ fi
+ done | nmf1 1>&${_merge}
+ }
+ # Use two parallel streams to filter alternating modules.
+ set +x
+ eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
+ _ret=$?
+ [[ $debug ]] && set -x
+ return $_ret
+ }
+
+ for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
+ | drm_module_filter) ; do
+ # if the hardware is present, include module even if it is not currently loaded,
+ # as we could e.g. be in the installer; nokmsboot boot parameter will disable
+ # loading of the driver if needed
+ if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
+ | grep -qxf - /sys/bus/pci/devices/*/modalias; then
+ hostonly='' instmods $_modname
+ continue
fi
+ instmods $_modname
done
}

View File

@ -1,35 +0,0 @@
From 547bbe4876f2cc8b3eab47dd0ca25b481c54731b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 7 Jun 2012 10:38:31 +0200
Subject: [PATCH] systemd: strip down the installation of some unused tools
---
modules.d/98systemd/module-setup.sh | 5 -----
1 file changed, 5 deletions(-)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 4fda2a2..dbb9063 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -20,21 +20,16 @@ install() {
$systemdutildir/systemd \
$systemdutildir/systemd-cgroups-agent \
$systemdutildir/systemd-initctl \
- $systemdutildir/systemd-shutdownd \
$systemdutildir/systemd-shutdown \
$systemdutildir/systemd-modules-load \
$systemdutildir/systemd-remount-fs \
$systemdutildir/systemd-reply-password \
$systemdutildir/systemd-fsck \
- $systemdutildir/systemd-timestamp \
- $systemdutildir/systemd-ac-power \
$systemdutildir/systemd-sysctl \
$systemdutildir/systemd-udevd \
$systemdutildir/systemd-journald \
- $systemdutildir/systemd-coredump \
$systemdutildir/systemd-vconsole-setup \
$systemdutildir/systemd-cryptsetup \
- $systemdutildir/systemd-localed \
$systemdsystemunitdir/emergency.target \
$systemdsystemunitdir/sysinit.target \
$systemdsystemunitdir/basic.target \

View File

@ -1,35 +0,0 @@
From ede0532c580fdbace548511b07857fb2e004b299 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 29 May 2012 16:34:58 +0200
Subject: [PATCH] network/ifup.sh: do not default to dhcp, for interfaces
without ip=...
Don't try to be smarter than the admin configuring the machine.
Does also conflict with other methods trying to setup the interfaces,
like cmsifup.sh from the cms module.
---
modules.d/40network/ifup.sh | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index c9516bb..f785968 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -213,17 +213,6 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi
-# No ip lines default to dhcp
-ip=$(getarg ip)
-
-if [ -z "$ip" ]; then
- if [ "$netroot" = "dhcp6" ]; then
- do_dhcp -6
- else
- do_dhcp -4
- fi
-fi
-
# Specific configuration, spin through the kernel command line
# looking for ip= lines
for p in $(getargs ip=); do

View File

@ -1,22 +0,0 @@
From 521c57aca554f72c7e51ddf22f9c36bfc202cecd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 7 Jun 2012 11:31:45 +0200
Subject: [PATCH] systemd/dracut-initqueue.sh: remove pre-trigger sourcing
Thanks ms77 on #dracut!
---
modules.d/98systemd/dracut-initqueue.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 52b9cf5..5544e71 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -8,7 +8,6 @@ if [ -f /dracut-state.sh ]; then
fi
. /lib/dracut-lib.sh
source_conf /etc/conf.d
-source_hook pre-trigger
getarg 'rd.break=initqueue' 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"

View File

@ -1,33 +0,0 @@
From 57038a41fac7db2ae90a6cbc10cf9b737768a115 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 8 Jun 2012 10:28:31 +0200
Subject: [PATCH] mdraid/md-shutdown.sh: wait until md devices are clean
---
modules.d/90mdraid/md-shutdown.sh | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh
index 0d41008..1e6c9f6 100755
--- a/modules.d/90mdraid/md-shutdown.sh
+++ b/modules.d/90mdraid/md-shutdown.sh
@@ -5,12 +5,15 @@ _do_md_shutdown() {
local ret
local final=$1
local _offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
- info "Disassembling mdraid devices."
- mdadm $_offroot -v --stop --scan
+ info "Waiting for mdraid devices to be clean."
+ mdadm $_offroot -vv --wait-clean --scan| vinfo
ret=$?
+ info "Disassembling mdraid devices."
+ mdadm $_offroot -vv --stop --scan | vinfo
+ ret=$(($ret+$?))
if [ "x$final" != "x" ]; then
- info "cat /proc/mdstat"
- cat /proc/mdstat | vinfo
+ info "/proc/mdstat:"
+ vinfo < /proc/mdstat
fi
return $ret
}

View File

@ -1,36 +0,0 @@
From fbaf1517c352e34ede77613536ce12bd14b7ec2c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 8 Jun 2012 10:29:35 +0200
Subject: [PATCH] s/Unable to process initqueue/Could not boot/g
---
modules.d/98systemd/dracut-initqueue.sh | 2 +-
modules.d/99base/init.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 5544e71..5d51a80 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -61,7 +61,7 @@ while :; do
main_loop=$(($main_loop+1))
[ $main_loop -gt $RDRETRY ] \
- && { flock -s 9 ; emergency_shell "Unable to process initqueue"; } 9>/.console_lock
+ && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock
done
unset job
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 7f8370e..5c693e4 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -180,7 +180,7 @@ while :; do
main_loop=$(($main_loop+1))
[ $main_loop -gt $RDRETRY ] \
- && { flock -s 9 ; emergency_shell "Unable to process initqueue"; } 9>/.console_lock
+ && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock
done
unset job
unset queuetriggered

View File

@ -1,30 +0,0 @@
From d2a9c4a8e7920cc01107b7cbab953da5c6cab100 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 8 Jun 2012 10:41:59 +0200
Subject: [PATCH] dracut.sh: mkdir of $libdirs at then end
---
dracut.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 78e7ac8..a1b39e3 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -688,13 +688,14 @@ export initdir dracutbasedir dracutmodules drivers \
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
if [[ $prefix ]]; then
- for d in bin etc lib $libdirs sbin tmp usr var; do
+ for d in bin etc lib sbin tmp usr var $libdirs; do
+ strstr "$d" "/" && continue
ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
done
fi
if [[ $kernel_only != yes ]]; then
- for d in usr/bin usr/sbin bin etc lib $libdirs sbin tmp usr var var/log var/run var/lock; do
+ for d in usr/bin usr/sbin bin etc lib sbin tmp usr var var/log var/run var/lock $libdirs; do
[[ -e "${initdir}${prefix}/$d" ]] && continue
if [ -L "/$d" ]; then
inst_symlink "/$d" "${prefix}/$d"

View File

@ -1,37 +0,0 @@
From df96787019aadea63f6398a8ca8ba0a1e4d10202 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 8 Jun 2012 12:41:49 +0200
Subject: [PATCH] dm: check for presence of dmsetup
---
modules.d/90dm/dm-shutdown.sh | 7 ++++++-
modules.d/90dm/module-setup.sh | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/modules.d/90dm/dm-shutdown.sh b/modules.d/90dm/dm-shutdown.sh
index 80d80d0..bf97637 100755
--- a/modules.d/90dm/dm-shutdown.sh
+++ b/modules.d/90dm/dm-shutdown.sh
@@ -13,4 +13,9 @@ _do_dm_shutdown() {
fi
return $ret
}
-_do_dm_shutdown $1
+
+if command -v dmsetup >/dev/null; then
+ _do_dm_shutdown $1
+else
+ :
+fi
diff --git a/modules.d/90dm/module-setup.sh b/modules.d/90dm/module-setup.sh
index bac854a..4209537 100755
--- a/modules.d/90dm/module-setup.sh
+++ b/modules.d/90dm/module-setup.sh
@@ -3,6 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
+ type -P dmsetup >/dev/null || return 1
return 255
}

View File

@ -1,23 +0,0 @@
From b4692ce3889d5e165a9aa51db7732baf2996fd7a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 8 Jun 2012 12:42:12 +0200
Subject: [PATCH] mdraid/md-shutdown.sh: check for presence of mdadm
---
modules.d/90mdraid/md-shutdown.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules.d/90mdraid/md-shutdown.sh b/modules.d/90mdraid/md-shutdown.sh
index 1e6c9f6..17eafa5 100755
--- a/modules.d/90mdraid/md-shutdown.sh
+++ b/modules.d/90mdraid/md-shutdown.sh
@@ -18,4 +18,8 @@ _do_md_shutdown() {
return $ret
}
-_do_md_shutdown $1
+if command -v mdadm >/dev/null; then
+ _do_md_shutdown $1
+else
+ :
+fi

View File

@ -1,27 +0,0 @@
From bebb12fd0ec3cbb88006e384a9a277391a2f3a37 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 11 Jun 2012 17:11:49 +0200
Subject: [PATCH] network/ifup.sh: default to dhcp for BOOTIF
---
modules.d/40network/ifup.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index f785968..35ae3c6 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -213,6 +213,13 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi
+# BOOTIF= defaults to dhcpv4
+bootif=$(getargs BOOTIF=)
+if [ -n "$bootif" ] ; then
+ do_dhcp -4
+ exit 0
+fi
+
# Specific configuration, spin through the kernel command line
# looking for ip= lines
for p in $(getargs ip=); do

View File

@ -1,33 +0,0 @@
From 43fed15129dc4916c37ebd8980aba78b6609943b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 12 Jun 2012 11:35:49 -0400
Subject: [PATCH] dracut.sh: mkdir $initdir/lib/dracut
---
dracut.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dracut.sh b/dracut.sh
index a1b39e3..c26e0f8 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -731,7 +731,10 @@ if [[ $kernel_only != yes ]]; then
mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d
done
if [[ "$UID" = "0" ]]; then
- cp -a /dev/kmsg /dev/null /dev/console $initdir/dev
+ for i in /dev/kmsg /dev/null /dev/console; do
+ [ -e $i ] || continue
+ cp -a $i $initdir/dev
+ done
fi
fi
@@ -780,6 +783,7 @@ done
unset moddir
for i in $modules_loaded; do
+ mkdir -p $initdir/lib/dracut
echo "$i" >> $initdir/lib/dracut/modules.txt
done

View File

@ -1,34 +0,0 @@
From 50b08e7b85085169459dd971b711f712744598ef Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Mon, 11 Jun 2012 13:46:21 -0400
Subject: [PATCH] fix ifup for static ipv6
"brd +" is not valid for ipv6. This causes the 'ip addr add' command to
fail with the message "Broadcast can be set only for IPv4 addresses".
So: don't use "brd +" for ipv6.
---
modules.d/40network/ifup.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 35ae3c6..ae434a8 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -105,10 +105,13 @@ do_static() {
wait_for_if_up $netif
[ -n "$macaddr" ] && ip link set address $macaddr
[ -n "$mtu" ] && ip link set mtu $mtu
- # do not flush addr for ipv6
- strstr $ip '*:*:*' || \
+ if strstr $ip '*:*:*'; then
+ # note no ip addr flush for ipv6
+ ip addr add $ip/$mask dev $netif
+ else
ip addr flush dev $netif
- ip addr add $ip/$mask brd + dev $netif
+ ip addr add $ip/$mask brd + dev $netif
+ fi
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname

View File

@ -1,48 +0,0 @@
From 30430fbe3096da363a2ef6b8c791e701643e15aa Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Mon, 11 Jun 2012 13:46:22 -0400
Subject: [PATCH] ifcfg: fix output for ipv6 static addressing
IPV6 configuration is pretty different than IPV4; write out the correct
set of values to make static IPV6 addressing work.
---
modules.d/45ifcfg/write-ifcfg.sh | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index 202a16a..b62170d 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -109,16 +109,25 @@ for netif in $IFACES ; do
echo "BOOTPROTO=dhcp"
cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
else
- echo "BOOTPROTO=none"
- # If we've booted with static ip= lines, the override file is there
+ # If we've booted with static ip= lines, the override file is there
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
- echo "IPADDR=$ip"
- if strstr "$mask" "."; then
- echo "NETMASK=$mask"
+ if strstr "$ip" '*:*:*'; then
+ echo "IPV6_AUTOCONF=no"
+ echo "IPV6ADDR=$ip/$mask"
else
- echo "PREFIX=$mask"
+ echo "BOOTPROTO=none"
+ echo "IPADDR=$ip"
+ if strstr "$mask" "."; then
+ echo "NETMASK=$mask"
+ else
+ echo "PREFIX=$mask"
+ fi
+ fi
+ if strstr "$gw" '*:*:*'; then
+ echo "IPV6_DEFAULTGW=$gw"
+ elif [ -n "$gw" ]; then
+ echo "GATEWAY=$gw"
fi
- [ -n "$gw" ] && echo "GATEWAY=$gw"
fi
} > /tmp/ifcfg/ifcfg-$netif

View File

@ -1,37 +0,0 @@
From b23a2837db758215c9855f14b7d1081b7ad0077c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 14 Jun 2012 13:04:22 +0200
Subject: [PATCH] add PARTUUID as root=PARTUUID=<partition uuid> parameter
---
dracut.cmdline.7.asc | 1 +
modules.d/95rootfs-block/parse-block.sh | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 9fa0ee8..883223c 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -47,6 +47,7 @@ root=/dev/disk/by-label/Root
root=LABEL=Root
root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
+root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
----
**rootfstype=**_<filesystem type>_:: "auto" if not specified, e.g.:
diff --git a/modules.d/95rootfs-block/parse-block.sh b/modules.d/95rootfs-block/parse-block.sh
index 69f38be..3745352 100755
--- a/modules.d/95rootfs-block/parse-block.sh
+++ b/modules.d/95rootfs-block/parse-block.sh
@@ -12,6 +12,10 @@ case "$root" in
root="${root#block:}"
root="block:/dev/disk/by-uuid/${root#UUID=}"
rootok=1 ;;
+ block:PARTUUID=*|PARTUUID=*)
+ root="${root#block:}"
+ root="block:/dev/disk/by-partuuid/${root#PARTUUID=}"
+ rootok=1 ;;
/dev/*)
root="block:${root}"
rootok=1 ;;

View File

@ -1,45 +0,0 @@
From cacaa90c63512a068720d61d671ce3ddd1fbd81d Mon Sep 17 00:00:00 2001
From: Thomas Lange <lange@informatik.uni-koeln.de>
Date: Thu, 14 Jun 2012 17:42:34 +0200
Subject: [PATCH] Debian multiarch support
Hi Jon,
here's the diff which works for me. The quotation marks around $@ do
not work for me. Instead of "$@" I must to use $_dir/$@ (or
"$_dir"/$@) but no quotation marks around $@. Could you please review
my patch.
---
dracut-functions.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 6a72fce..38367b4 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -699,13 +699,13 @@ dracut_install() {
# inst_libdir_file [-n <pattern>] <file> [<file>...]
# Install a <file> located on a lib directory to the initramfs image
-# -n <pattern> install non-matching files
+# -n <pattern> install matching files
inst_libdir_file() {
if [[ "$1" == "-n" ]]; then
- local _pattern=$1
+ local _pattern=$2
shift 2
for _dir in $libdirs; do
- for _i in "$@"; do
+ for _i in $_dir/$@; do
for _f in "$_dir"/$_i; do
[[ "$_i" =~ $_pattern ]] || continue
[[ -e "$_i" ]] && dracut_install "$_i"
@@ -714,7 +714,7 @@ inst_libdir_file() {
done
else
for _dir in $libdirs; do
- for _i in "$@"; do
+ for _i in $_dir/$@; do
for _f in "$_dir"/$_i; do
[[ -e "$_f" ]] && dracut_install "$_f"
done

View File

@ -1,34 +0,0 @@
From 7828692f97c2db3af36ad8ac3e75b60cfd971875 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 09:34:00 +0200
Subject: [PATCH] dracut-functions.sh: fixup inst_libdir_file() again
---
dracut-functions.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 38367b4..7439131 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -705,16 +705,16 @@ inst_libdir_file() {
local _pattern=$2
shift 2
for _dir in $libdirs; do
- for _i in $_dir/$@; do
+ for _i in "$@"; do
for _f in "$_dir"/$_i; do
- [[ "$_i" =~ $_pattern ]] || continue
- [[ -e "$_i" ]] && dracut_install "$_i"
+ [[ "$_f" =~ $_pattern ]] || continue
+ [[ -e "$_f" ]] && dracut_install "$_f"
done
done
done
else
for _dir in $libdirs; do
- for _i in $_dir/$@; do
+ for _i in "$@"; do
for _f in "$_dir"/$_i; do
[[ -e "$_f" ]] && dracut_install "$_f"
done

View File

@ -1,21 +0,0 @@
From 1d2c070071996dc6a31e4981b770e01746fa0ff0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:11:10 +0200
Subject: [PATCH] dracut.sh: output unknown argument
---
dracut.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.sh b/dracut.sh
index c26e0f8..309fd7d 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -289,6 +289,7 @@ while (($# > 0)); do
elif ! [[ ${kernel+x} ]]; then
kernel=$1
else
+ echo "Unknown argument: $1"
usage; exit 1;
fi
;;

View File

@ -1,22 +0,0 @@
From f79e587cf34e9d9c68e87ebad3e5620b0a190581 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:11:30 +0200
Subject: [PATCH] dracut.sh: unset some variables
---
dracut.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 309fd7d..64cd75e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -217,6 +217,8 @@ push_arg() {
}
verbosity_mod_l=0
+unset kernel
+unset outfile
while (($# > 0)); do
case ${1%%=*} in

View File

@ -1,22 +0,0 @@
From 9f6baa127aa6a4fb6cec9a6ef4e8d5b3299362b0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:12:08 +0200
Subject: [PATCH] nfs: extend libnss wildcard
---
modules.d/95nfs/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index bf87762..fb4dc9c 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -52,7 +52,7 @@ install() {
_nsslibs=${_nsslibs#|}
_nsslibs=${_nsslibs%|}
- inst_libdir_file -n "$_nsslibs" "libnss*.so"
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
inst_hook cmdline 90 "$moddir/parse-nfsroot.sh"
inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh"

View File

@ -1,206 +0,0 @@
From 3eca0cc846e89675949abb11e9606f3222a2e266 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:12:46 +0200
Subject: [PATCH] TEST-50-MULTINIC: install correct nss libs
---
test/TEST-50-MULTINIC/test.sh | 118 ++++++++++++++++++++++++++---------------
1 file changed, 74 insertions(+), 44 deletions(-)
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index 712f90e..6efa8ef 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -12,7 +12,7 @@ run_server() {
# Start server first
echo "MULTINIC TEST SETUP: Starting DHCP/NFS server"
- $testdir/run-qemu -hda $TESTDIR/server.ext2 -m 256M -nographic \
+ $testdir/run-qemu -hda $TESTDIR/server.ext3 -m 512M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12350 \
-serial $SERIAL \
@@ -122,15 +122,41 @@ test_client() {
test_setup() {
# Make server root
- dd if=/dev/null of=$TESTDIR/server.ext2 bs=1M seek=60
- mke2fs -F $TESTDIR/server.ext2
- mkdir $TESTDIR/mnt
- sudo mount -o loop $TESTDIR/server.ext2 $TESTDIR/mnt
+ dd if=/dev/null of=$TESTDIR/server.ext3 bs=1M seek=60
+ mke2fs -j -F $TESTDIR/server.ext3
+ mkdir $TESTDIR/mnt
+ sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
+
+ export kernel=$KVERSION
+ export srcmods="/lib/modules/$kernel/"
+ # Detect lib paths
+
+ . $basedir/dracut-functions.sh
+ if ! [[ $libdirs ]] ; then
+ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
+ && [[ -d /lib64 ]]; then
+ libdirs+=" /lib64"
+ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
+ else
+ libdirs+=" /lib"
+ [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
+ fi
+ fi
- kernel=$KVERSION
- (
+ (
initdir=$TESTDIR/mnt
- . $basedir/dracut-functions.sh
+
+ for _f in modules.builtin.bin modules.builtin; do
+ [[ $srcmods/$_f ]] && break
+ done || {
+ dfatal "No modules.builtin.bin and modules.builtin found!"
+ return 1
+ }
+
+ for _f in modules.builtin.bin modules.builtin modules.order; do
+ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+ done
+
dracut_install sh ls shutdown poweroff stty cat ps ln ip \
dmesg mkdir cp ping exportfs \
modprobe rpc.nfsd rpc.mountd showmount tcpdump \
@@ -144,36 +170,32 @@ test_setup() {
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
type -P dhcpd >/dev/null && dracut_install dhcpd
[ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
- instmods nfsd sunrpc ipv6
+ instmods nfsd sunrpc ipv6 lockd
inst ./server-init.sh /sbin/init
inst ./hosts /etc/hosts
inst ./exports /etc/exports
inst ./dhcpd.conf /etc/dhcpd.conf
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
dracut_install rpc.idmapd /etc/idmapd.conf
- if ldd $(type -P rpc.idmapd) |grep -q lib64; then
- LIBDIR="/lib64"
- else
- LIBDIR="/lib"
- fi
- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null )
- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap/*.so 2>/dev/null )
- dracut_install $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null)
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
+ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ _nsslibs=${_nsslibs#|}
+ _nsslibs=${_nsslibs%|}
- nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
- nsslibs=${nsslibs#|}
- nsslibs=${nsslibs%|}
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
- dracut_install $(for i in $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null); do echo $i;done | egrep "$nsslibs")
(
cd "$initdir";
mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind}
mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
chmod 777 var/lib/rpcbind var/lib/nfs
)
+
inst /etc/nsswitch.conf /etc/nsswitch.conf
inst /etc/passwd /etc/passwd
inst /etc/group /etc/group
@@ -181,49 +203,57 @@ test_setup() {
inst_library $i
done
- /sbin/depmod -a -b "$initdir" $kernel
+ /sbin/depmod -a -b "$initdir" $kernel
+
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
- )
+ )
# Make client root inside server root
initdir=$TESTDIR/mnt/nfs/client
mkdir -p $initdir
(
- . $basedir/dracut-functions.sh
- dracut_install sh shutdown poweroff stty cat ps ln ip \
- mount dmesg mkdir \
- cp ping grep ls
+ dracut_install sh shutdown poweroff stty cat ps ln ip \
+ mount dmesg mkdir cp ping grep ls
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -f ${_terminfodir}/l/linux ] && break
done
dracut_install -o ${_terminfodir}/l/linux
- inst ./client-init.sh /sbin/init
- (
- cd "$initdir"
- mkdir -p dev sys proc etc run
- mkdir -p var/lib/nfs/rpc_pipefs
+ inst ./client-init.sh /sbin/init
+ (
+ cd "$initdir"
+ mkdir -p dev sys proc etc run
+ mkdir -p var/lib/nfs/rpc_pipefs
)
- inst /etc/nsswitch.conf /etc/nsswitch.conf
- inst /etc/passwd /etc/passwd
- inst /etc/group /etc/group
- for i in /lib*/libnss_files*;do
- inst_library $i
- done
+ inst /etc/nsswitch.conf /etc/nsswitch.conf
+ inst /etc/passwd /etc/passwd
+ inst /etc/group /etc/group
+
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
+
+ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ _nsslibs=${_nsslibs#|}
+ _nsslibs=${_nsslibs%|}
+
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
- )
+ )
+
+ chroot $initdir
- sudo umount $TESTDIR/mnt
- rm -fr $TESTDIR/mnt
+ sudo umount $TESTDIR/mnt
+ rm -fr $TESTDIR/mnt
# Make an overlay with needed tools for the test harness
(
initdir=$TESTDIR/overlay
mkdir $TESTDIR/overlay
- . $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
@@ -232,7 +262,7 @@ test_setup() {
# Make server's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
-m "dash udev-rules base rootfs-block debug kernel-modules" \
- -d "piix ide-gd_mod ata_piix ext2 sd_mod e1000" \
+ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \
-f $TESTDIR/initramfs.server $KVERSION || return 1
# Make client's dracut image

View File

@ -1,28 +0,0 @@
From f9ad49c2a59d1c452a2137a6332ff77afcde1be3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:55:59 +0200
Subject: [PATCH] Revert "network/ifup.sh: default to dhcp for BOOTIF"
This reverts commit bebb12fd0ec3cbb88006e384a9a277391a2f3a37.
---
modules.d/40network/ifup.sh | 7 -------
1 file changed, 7 deletions(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index ae434a8..245b450 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -216,13 +216,6 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi
-# BOOTIF= defaults to dhcpv4
-bootif=$(getargs BOOTIF=)
-if [ -n "$bootif" ] ; then
- do_dhcp -4
- exit 0
-fi
-
# Specific configuration, spin through the kernel command line
# looking for ip= lines
for p in $(getargs ip=); do

View File

@ -1,33 +0,0 @@
From c9aa3cc950ebec597e51cbc0899777c2a99ca276 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 15 Jun 2012 11:56:05 +0200
Subject: [PATCH] Revert "network/ifup.sh: do not default to dhcp, for
interfaces without ip=..."
This reverts commit ede0532c580fdbace548511b07857fb2e004b299.
---
modules.d/40network/ifup.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 245b450..31eb966 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -216,6 +216,17 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi
+# No ip lines default to dhcp
+ip=$(getarg ip)
+
+if [ -z "$ip" ]; then
+ if [ "$netroot" = "dhcp6" ]; then
+ do_dhcp -6
+ else
+ do_dhcp -4
+ fi
+fi
+
# Specific configuration, spin through the kernel command line
# looking for ip= lines
for p in $(getargs ip=); do

View File

@ -1,36 +0,0 @@
From 8fab6e0463e0b0c70327c2733911098aa56137a7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 12 Jun 2012 14:40:43 +0200
Subject: [PATCH] resolve conflict between cms network rules and default rules
---
modules.d/40network/net-genrules.sh | 2 +-
modules.d/80cms/cmssetup.sh | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index 2d3dff2..99d0fe5 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -53,7 +53,7 @@ fix_bootif() {
# Default: We don't know the interface to use, handle all
else
- printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup"
+ printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup" > /etc/udev/rules.d/61-default-net.rules
fi
} > /etc/udev/rules.d/60-net.rules
diff --git a/modules.d/80cms/cmssetup.sh b/modules.d/80cms/cmssetup.sh
index 41c853c..2208803 100755
--- a/modules.d/80cms/cmssetup.sh
+++ b/modules.d/80cms/cmssetup.sh
@@ -166,6 +166,8 @@ processcmsfile()
fi
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
+ # remove the default net rules
+ rm -f /etc/udev/rules.d/61-default-net.rules
[[ -f /etc/udev/rules.d/60-net.rules ]] \
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules

View File

@ -1,108 +0,0 @@
From 7abd426438984f9c3112fd409e9c019408fe85a4 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 12:51:21 +0200
Subject: [PATCH] fixed instmods() return code and set pipefail globally
---
dracut-functions.sh | 21 +++++++++------------
dracut.sh | 2 ++
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 7439131..68c81f2 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1028,11 +1028,11 @@ install_kmod_with_fw() {
_kmod=${_kmod/-/_}
if [[ "$_kmod" =~ $omit_drivers ]]; then
dinfo "Omitting driver $_kmod"
- return 1
+ return 0
fi
if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
dinfo "Omitting driver $_kmod"
- return 1
+ return 0
fi
fi
@@ -1073,16 +1073,13 @@ install_kmod_with_fw() {
# rest of args = arguments to modprobe
# _fderr specifies FD passed from surrounding scope
for_each_kmod_dep() {
- local _func=$1 _kmod=$2 _cmd _modpath _options _found=0
+ local _func=$1 _kmod=$2 _cmd _modpath _options
shift 2
modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | (
while read _cmd _modpath _options; do
[[ $_cmd = insmod ]] || continue
$_func ${_modpath} || exit $?
- _found=1
done
- [[ $_found -eq 0 ]] && exit 1
- exit 0
)
}
@@ -1127,14 +1124,16 @@ instmods() {
( [[ "$_mpargs" ]] && echo $_mpargs
cat "${srcmods}/modules.${_mod#=}" ) \
| instmods
+ ((_ret+=$?))
else
( [[ "$_mpargs" ]] && echo $_mpargs
- find "$srcmods" -path "*/${_mod#=}/*" -printf '%f\n' ) \
+ find "$srcmods" -type f -path "*/${_mod#=}/*" -printf '%f\n' ) \
| instmods
+ ((_ret+=$?))
fi
;;
--*) _mpargs+=" $_mod" ;;
- i2o_scsi) return ;; # Do not load this diagnostic-only module
+ i2o_scsi) return 0;; # Do not load this diagnostic-only module
*)
_mod=${_mod##*/}
# if we are already installed, skip this module and go on
@@ -1143,14 +1142,14 @@ instmods() {
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
dinfo "Omitting driver ${_mod##$srcmods}"
- return
+ return 0
fi
# If we are building a host-specific initramfs and this
# module is not already loaded, move on to the next one.
[[ $hostonly ]] \
&& ! [[ -d $(echo /sys/module/${_mod//-/_}|{ read a b; echo $a; }) ]] \
&& ! [[ "$add_drivers" =~ " ${_mod} " ]] \
- && return
+ && return 0
# We use '-d' option in modprobe only if modules prefix path
# differs from default '/'. This allows us to use Dracut with
@@ -1193,12 +1192,10 @@ instmods() {
}
local _ret _filter_not_found='FATAL: Module .* not found.'
- set -o pipefail
# Capture all stderr from modprobe to _fderr. We could use {var}>...
# redirections, but that would make dracut require bash4 at least.
eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \
| while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
_ret=$?
- set +o pipefail
return $_ret
}
diff --git a/dracut.sh b/dracut.sh
index 64cd75e..919f78e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -26,6 +26,8 @@
# store for logging
dracut_args="$@"
+set -o pipefail
+
usage() {
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
if [[ -f $dracutbasedir/dracut-version.sh ]]; then

View File

@ -1,109 +0,0 @@
From 8d95b8b338d65188c517b3bda8a4697867c6ef01 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 12:52:39 +0200
Subject: [PATCH] Set some global variables in dracut-functions.sh
---
dracut-functions.sh | 34 +++++++++++++++++++++++++++++++---
dracut.sh | 22 ----------------------
2 files changed, 31 insertions(+), 25 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 68c81f2..1137919 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -20,6 +20,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+# Generic substring function. If $2 is in $1, return 0.
+strstr() { [ "${1#*$2*}" != "$1" ]; }
+
if ! [[ $dracutbasedir ]]; then
dracutbasedir=${BASH_SOURCE[0]%/*}
[[ $dracutbasedir = "dracut-functions" ]] && dracutbasedir="."
@@ -27,6 +30,34 @@ if ! [[ $dracutbasedir ]]; then
dracutbasedir="$(readlink -f $dracutbasedir)"
fi
+# Detect lib paths
+if ! [[ $libdirs ]] ; then
+ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
+ && [[ -d /lib64 ]]; then
+ libdirs+=" /lib64"
+ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
+ else
+ libdirs+=" /lib"
+ [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
+ fi
+ export libdirs
+fi
+
+if ! [[ $kernel ]]; then
+ kernel=$(uname -r)
+ export kernel
+fi
+
+srcmods="/lib/modules/$kernel/"
+[[ $drivers_dir ]] && {
+ if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then
+ dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
+ exit 1
+ fi
+ srcmods="$drivers_dir"
+}
+export srcmods
+
if ! type dinfo >/dev/null 2>&1; then
. "$dracutbasedir/dracut-logger.sh"
dlog_init
@@ -41,9 +72,6 @@ fi
export hookdirs
}
-# Generic substring function. If $2 is in $1, return 0.
-strstr() { [ "${1#*$2*}" != "$1" ]; }
-
# Create all subdirectories for given path without creating the last element.
# $1 = path
mksubdirs() { mkdir -m 0755 -p ${1%/*}; }
diff --git a/dracut.sh b/dracut.sh
index 919f78e..5600ec0 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -531,18 +531,6 @@ ddebug "Executing $0 $dracut_args"
exit 0
}
-# Detect lib paths
-if ! [[ $libdirs ]] ; then
- if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
- && [[ -d /lib64 ]]; then
- libdirs+=" /lib64"
- [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
- else
- libdirs+=" /lib"
- [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
- fi
-fi
-
# This is kinda legacy -- eventually it should go away.
case $dracutmodules in
""|auto) dracutmodules="all" ;;
@@ -550,16 +538,6 @@ esac
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
-srcmods="/lib/modules/$kernel/"
-[[ $drivers_dir ]] && {
- if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then
- dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
- exit 1
- fi
- srcmods="$drivers_dir"
-}
-export srcmods
-
[[ -f $srcmods/modules.dep ]] || {
dfatal "$srcmods/modules.dep is missing. Did you run depmod?"
exit 1

View File

@ -1,33 +0,0 @@
From 4f9f76cd629cfe7c31586eb2bfd0d4c61322db86 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 13:26:55 +0200
Subject: [PATCH] iscsi/module-setup.sh: only install s390 driver on s390 arch
---
modules.d/95iscsi/module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index bfd9d73..fefc240 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -37,6 +37,8 @@ depends() {
}
installkernel() {
+ local _arch=$(uname -m)
+
instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
iscsi_module_filter() {
local _iscsifuncs='iscsi_register_transport'
@@ -47,8 +49,9 @@ installkernel() {
*.ko.xz) [[ $(xz -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
esac
done
+ return 0;
}
- { find_kernel_modules_by_path drivers/scsi; find_kernel_modules_by_path drivers/s390/scsi; } \
+ { find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \
| iscsi_module_filter | instmods
}

View File

@ -1,33 +0,0 @@
From 0efc6c716a0f4e0def943e3c661decc75fe6f958 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 13:45:13 +0200
Subject: [PATCH] plymouth: fixed inst_libdir_file() call
https://bugzilla.redhat.com/show_bug.cgi?id=831349
---
modules.d/50plymouth/plymouth-populate-initrd.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh
index 7ab1a5d..1e2ffe7 100755
--- a/modules.d/50plymouth/plymouth-populate-initrd.sh
+++ b/modules.d/50plymouth/plymouth-populate-initrd.sh
@@ -11,8 +11,9 @@ dracut_install /bin/plymouth \
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
+inst_libdir_file "plymouth/text.so" "plymouth/details.so"
+
if [[ $hostonly ]]; then
- inst_libdir_file "plymouth/text.so" "plymouth/details.so"
dracut_install \
"/usr/share/plymouth/themes/details/details.plymouth" \
"/usr/share/plymouth/themes/text/text.plymouth" \
@@ -37,7 +38,6 @@ else
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
dracut_install "$x"
done
- inst_libdir_file "/plymouth/{text,details}.so"
(
cd ${initdir}/usr/share/plymouth/themes;
ln -s text/text.plymouth default.plymouth 2>&1;

View File

@ -1,80 +0,0 @@
From ef914f7d833b7ea7a5916e7d56c9e9c158d3783a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:17:22 +0200
Subject: [PATCH] add 04watchdog dracut module
---
dracut.spec | 1 +
modules.d/04watchdog/module-setup.sh | 23 +++++++++++++++++++++++
modules.d/04watchdog/watchdog.sh | 6 ++++++
modules.d/99base/dracut-lib.sh | 2 ++
4 files changed, 32 insertions(+)
create mode 100755 modules.d/04watchdog/module-setup.sh
create mode 100755 modules.d/04watchdog/watchdog.sh
diff --git a/dracut.spec b/dracut.spec
index eb5df2c..6e8c733 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -254,6 +254,7 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man5/dracut.conf.5*
%{dracutlibdir}/modules.d/00bootchart
%{dracutlibdir}/modules.d/00dash
+%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
diff --git a/modules.d/04watchdog/module-setup.sh b/modules.d/04watchdog/module-setup.sh
new file mode 100755
index 0000000..eb46143
--- /dev/null
+++ b/modules.d/04watchdog/module-setup.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+check() {
+ return 255
+}
+
+depends() {
+ return 0
+}
+
+install() {
+ inst_hook cmdline 00 "$moddir/watchdog.sh"
+ inst_hook cmdline 50 "$moddir/watchdog.sh"
+ inst_hook pre-trigger 00 "$moddir/watchdog.sh"
+ inst_hook initqueue 00 "$moddir/watchdog.sh"
+ inst_hook mount 00 "$moddir/watchdog.sh"
+ inst_hook mount 50 "$moddir/watchdog.sh"
+ inst_hook pre-pivot 00 "$moddir/watchdog.sh"
+ inst_hook cleanup 00 "$moddir/watchdog.sh"
+}
+
diff --git a/modules.d/04watchdog/watchdog.sh b/modules.d/04watchdog/watchdog.sh
new file mode 100755
index 0000000..712969f
--- /dev/null
+++ b/modules.d/04watchdog/watchdog.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ -e /dev/watchdog ]; then
+ >/dev/watchdog
+else
+ modprobe ib700wdt
+fi
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 3ecba9a..8cfd7b3 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -832,6 +832,8 @@ emergency_shell()
fi
[ -c "$_ctty" ] || _ctty=/dev/tty1
strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
+ # stop watchdog
+ echo 'V' > /dev/watchdog
setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
else
warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."

View File

@ -1,61 +0,0 @@
From c8f3a1c057ffd4ea288f9e38d9e396eebdafcd0c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:20:16 +0200
Subject: [PATCH] TEST-01-BASIC: add watchdog
---
test/TEST-01-BASIC/test-init.sh | 3 ++-
test/TEST-01-BASIC/test.sh | 11 +++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh
index f8d6693..5fc02d9 100755
--- a/test/TEST-01-BASIC/test-init.sh
+++ b/test/TEST-01-BASIC/test-init.sh
@@ -1,10 +1,11 @@
#!/bin/sh
+>/dev/watchdog
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
strstr() { [ "${1#*$2*}" != "$1" ]; }
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
plymouth --quit
exec >/dev/console 2>&1
-echo "dracut-root-block-success" >/dev/sda1
+echo "dracut-root-block-success" >/dev/sdb
export TERM=linux
export PS1='initramfs-test:\w\$ '
[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index 46e75c7..6c39d7b 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -7,13 +7,16 @@ KVERSION=${KVERSION-$(uname -r)}
#DEBUGFAIL="rd.shell rd.break"
test_run() {
+ dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
$testdir/run-qemu \
-hda $TESTDIR/root.ext3 \
+ -hdb $TESTDIR/result \
-m 256M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
+ -watchdog ib700 -watchdog-action poweroff \
-append "root=LABEL=dracut rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
- -initrd $TESTDIR/initramfs.testing
- grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1
+ -initrd $TESTDIR/initramfs.testing || return 1
+ grep -m 1 -q dracut-root-block-success $TESTDIR/result || return 1
}
test_setup() {
@@ -81,8 +84,8 @@ test_setup() {
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -a "debug" \
- -d "piix ide-gd_mod ata_piix ext3 sd_mod" \
+ -a "debug watchdog" \
+ -d "piix ide-gd_mod ata_piix ext3 sd_mod ib700wdt" \
-f $TESTDIR/initramfs.testing $KVERSION || return 1
# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"

View File

@ -1,62 +0,0 @@
From 483b1e3aa83c5bd56b2f2c75144b0a8c276d5bec Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:13:09 +0200
Subject: [PATCH] TEST-20-NFS: add watchdog
---
test/TEST-20-NFS/server-init.sh | 2 +-
test/TEST-20-NFS/test.sh | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh
index 26a2abd..a60a013 100755
--- a/test/TEST-20-NFS/server-init.sh
+++ b/test/TEST-20-NFS/server-init.sh
@@ -31,6 +31,6 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
#sh -i
# Wait forever for the VM to die
echo "Serving NFS mounts"
-while sleep 60; do sleep 60; done
+while sleep 30; do >/dev/watchdog; done
mount -n -o remount,ro /
poweroff -f
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index a6bde0e..ea65c2a 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -18,6 +18,7 @@ run_server() {
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12320 \
-serial $SERIAL \
+ -watchdog ib700 -watchdog-action poweroff \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/sda rw quiet console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.server \
@@ -53,6 +54,7 @@ client_test() {
-net nic,macaddr=$mac,model=e1000 \
-net socket,connect=127.0.0.1:12320 \
-kernel /boot/vmlinuz-$KVERSION \
+ -watchdog ib700 -watchdog-action poweroff \
-append "$cmdline $DEBUGFAIL rd.debug rd.retry=10 rd.info quiet ro console=ttyS0,115200n81 selinux=0" \
-initrd $TESTDIR/initramfs.testing
@@ -307,15 +309,15 @@ test_setup() {
# Make server's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -m "dash udev-rules base rootfs-block debug kernel-modules" \
- -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \
+ -m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \
+ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000 ib700wdt" \
-f $TESTDIR/initramfs.server $KVERSION || return 1
# Make client's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
-o "plymouth" \
- -a "debug" \
- -d "piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc" \
+ -a "debug watchdog" \
+ -d "piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc ib700wdt" \
-f $TESTDIR/initramfs.testing $KVERSION || return 1
}

View File

@ -1,84 +0,0 @@
From 2dbd71b77a72a88cd4b8ccd50a40de3b7bfd1dd0 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:22:35 +0200
Subject: [PATCH] TEST-50-MULTINIC: add watchdog
---
test/TEST-50-MULTINIC/server-init.sh | 2 +-
test/TEST-50-MULTINIC/test.sh | 34 ++++++++++++++++++----------------
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/test/TEST-50-MULTINIC/server-init.sh b/test/TEST-50-MULTINIC/server-init.sh
index 39f6a1d..c02d84c 100755
--- a/test/TEST-50-MULTINIC/server-init.sh
+++ b/test/TEST-50-MULTINIC/server-init.sh
@@ -26,6 +26,6 @@ dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
#sh -i
# Wait forever for the VM to die
echo "Serving NFS mounts"
-while sleep 60; do sleep 60; done
+while sleep 30; do echo >/dev/watchdog; done
mount -n -o remount,ro /
poweroff -f
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index 6efa8ef..1655608 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -13,12 +13,13 @@ run_server() {
echo "MULTINIC TEST SETUP: Starting DHCP/NFS server"
$testdir/run-qemu -hda $TESTDIR/server.ext3 -m 512M -nographic \
- -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
- -net socket,listen=127.0.0.1:12350 \
- -serial $SERIAL \
- -kernel /boot/vmlinuz-$KVERSION \
- -append "selinux=0 root=/dev/sda rd.debug rd.info rw quiet console=ttyS0,115200n81" \
- -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
+ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
+ -net socket,listen=127.0.0.1:12350 \
+ -serial $SERIAL \
+ -watchdog ib700 -watchdog-action poweroff \
+ -kernel /boot/vmlinuz-$KVERSION \
+ -append "selinux=0 root=/dev/sda rd.debug rd.info rw quiet console=ttyS0,115200n81" \
+ -initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
sudo chmod 644 $TESTDIR/server.pid || return 1
# Cleanup the terminal if we have one
@@ -50,9 +51,10 @@ client_test() {
-net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
-net socket,connect=127.0.0.1:12350 \
-hdc /dev/null \
- -kernel /boot/vmlinuz-$KVERSION \
- -append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro quiet console=ttyS0,115200n81 selinux=0 rd.copystate" \
- -initrd $TESTDIR/initramfs.testing
+ -watchdog ib700 -watchdog-action poweroff \
+ -kernel /boot/vmlinuz-$KVERSION \
+ -append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro quiet console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \
+ -initrd $TESTDIR/initramfs.testing
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
@@ -261,16 +263,16 @@ test_setup() {
# Make server's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -m "dash udev-rules base rootfs-block debug kernel-modules" \
- -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000" \
- -f $TESTDIR/initramfs.server $KVERSION || return 1
+ -m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \
+ -d "piix ide-gd_mod ata_piix ext3 sd_mod e1000 ib700wdt" \
+ -f $TESTDIR/initramfs.server $KVERSION || return 1
# Make client's dracut image
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
- -o "plymouth" \
- -a "debug" \
- -d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc" \
- -f $TESTDIR/initramfs.testing $KVERSION || return 1
+ -o "plymouth" \
+ -a "debug watchdog" \
+ -d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc ib700wdt" \
+ -f $TESTDIR/initramfs.testing $KVERSION || return 1
}
kill_server() {

View File

@ -1,138 +0,0 @@
From 9f88b0370dc9433b87686f67c1156f2080b35a1d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:23:25 +0200
Subject: [PATCH] TEST-20-NFS: libnss cleanup
---
test/TEST-20-NFS/test.sh | 75 +++++++++++++++++++++++++++++++++-------------
1 file changed, 55 insertions(+), 20 deletions(-)
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index ea65c2a..faa2bb3 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -211,10 +211,37 @@ test_setup() {
mkdir $TESTDIR/mnt
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
- kernel=$KVERSION
- (
+
+ export kernel=$KVERSION
+ export srcmods="/lib/modules/$kernel/"
+ # Detect lib paths
+
+ . $basedir/dracut-functions.sh
+ if ! [[ $libdirs ]] ; then
+ if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
+ && [[ -d /lib64 ]]; then
+ libdirs+=" /lib64"
+ [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
+ else
+ libdirs+=" /lib"
+ [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
+ fi
+ fi
+
+ (
initdir=$TESTDIR/mnt
- . $basedir/dracut-functions.sh
+
+ for _f in modules.builtin.bin modules.builtin; do
+ [[ $srcmods/$_f ]] && break
+ done || {
+ dfatal "No modules.builtin.bin and modules.builtin found!"
+ return 1
+ }
+
+ for _f in modules.builtin.bin modules.builtin modules.order; do
+ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+ done
+
dracut_install sh ls shutdown poweroff stty cat ps ln ip \
dmesg mkdir cp ping exportfs \
modprobe rpc.nfsd rpc.mountd showmount tcpdump \
@@ -235,26 +262,28 @@ test_setup() {
inst ./dhcpd.conf /etc/dhcpd.conf
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
dracut_install rpc.idmapd /etc/idmapd.conf
- if ldd $(type -P rpc.idmapd) |grep -q lib64; then
- LIBDIR="/lib64"
- else
- LIBDIR="/lib"
- fi
- dracut_install $(ls {/usr,}$LIBDIR/libnfsidmap*.so* 2>/dev/null )
- dracut_install $(ls {/usr,}$LIBDIR/libnss*.so 2>/dev/null)
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
+
+ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ _nsslibs=${_nsslibs#|}
+ _nsslibs=${_nsslibs%|}
+
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
+
(
cd "$initdir";
- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind}
+ mkdir -p dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind}
mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
chmod 777 var/lib/rpcbind var/lib/nfs
)
inst /etc/nsswitch.conf /etc/nsswitch.conf
+
inst /etc/passwd /etc/passwd
inst /etc/group /etc/group
- for i in /lib*/libnss_files**;do
- inst_library $i
- done
/sbin/depmod -a -b "$initdir" $kernel
cp -a /etc/ld.so.conf* $initdir/etc
@@ -266,7 +295,6 @@ test_setup() {
mkdir -p $initdir
(
- . $basedir/dracut-functions.sh
dracut_install sh shutdown poweroff stty cat ps ln ip \
mount dmesg mkdir cp ping grep
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
@@ -276,15 +304,23 @@ test_setup() {
inst ./client-init.sh /sbin/init
(
cd "$initdir"
- mkdir -p dev sys proc etc
+ mkdir -p dev sys proc etc run
mkdir -p var/lib/nfs/rpc_pipefs
)
inst /etc/nsswitch.conf /etc/nsswitch.conf
inst /etc/passwd /etc/passwd
inst /etc/group /etc/group
- for i in /lib*/libnss_files*;do
- inst_library $i
- done
+
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
+
+ _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ _nsslibs=${_nsslibs#|}
+ _nsslibs=${_nsslibs%|}
+
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
@@ -301,7 +337,6 @@ test_setup() {
(
initdir=$TESTDIR/overlay
mkdir $TESTDIR/overlay
- . $basedir/dracut-functions.sh
dracut_install poweroff shutdown
inst_hook emergency 000 ./hard-off.sh
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules

View File

@ -1,351 +0,0 @@
From d6862983155c31896ac46dc9d43f4086850a0d44 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:28:44 +0200
Subject: [PATCH] TEST-50-MULTINIC: libnss cleanup
---
test/TEST-50-MULTINIC/test.sh | 235 +++++++++++++++++++----------------------
1 file changed, 110 insertions(+), 125 deletions(-)
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
index 1655608..5c7ca6c 100755
--- a/test/TEST-50-MULTINIC/test.sh
+++ b/test/TEST-50-MULTINIC/test.sh
@@ -1,4 +1,6 @@
#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
TEST_DESCRIPTION="root filesystem on NFS with multiple nics"
KVERSION=${KVERSION-$(uname -r)}
@@ -41,15 +43,15 @@ client_test() {
# Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then
- echo "Unable to make client sda image" 1>&2
- return 1
+ echo "Unable to make client sda image" 1>&2
+ return 1
fi
$testdir/run-qemu -hda $TESTDIR/client.img -m 512M -nographic \
- -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
- -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
- -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
- -net socket,connect=127.0.0.1:12350 \
+ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
+ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
+ -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
+ -net socket,connect=127.0.0.1:12350 \
-hdc /dev/null \
-watchdog ib700 -watchdog-action poweroff \
-kernel /boot/vmlinuz-$KVERSION \
@@ -57,17 +59,17 @@ client_test() {
-initrd $TESTDIR/initramfs.testing
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
- echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
- return 1
+ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
+ return 1
fi
for i in $check ; do
- echo $i
- if ! grep -m 1 -q $i $TESTDIR/client.img; then
- echo "CLIENT TEST END: $test_name [FAILED - BAD IF]"
- return 1
- fi
+ echo $i
+ if ! grep -m 1 -q $i $TESTDIR/client.img; then
+ echo "CLIENT TEST END: $test_name [FAILED - BAD IF]"
+ return 1
+ fi
done
echo "CLIENT TEST END: $test_name [OK]"
@@ -77,8 +79,8 @@ client_test() {
test_run() {
if ! run_server; then
- echo "Failed to start server" 1>&2
- return 1
+ echo "Failed to start server" 1>&2
+ return 1
fi
test_client || { kill_server; return 1; }
}
@@ -90,33 +92,33 @@ test_client() {
# PXE Style BOOTIF=
client_test "MULTINIC root=nfs BOOTIF=" \
- 00 01 02 \
- "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
- "eth0" || return 1
+ 00 01 02 \
+ "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
+ "eth0" || return 1
# PXE Style BOOTIF= with dhcp root-path
client_test "MULTINIC root=dhcp BOOTIF=" \
- 00 01 02 \
- "root=dhcp BOOTIF=52-54-00-12-34-02" \
- "eth2" || return 1
+ 00 01 02 \
+ "root=dhcp BOOTIF=52-54-00-12-34-02" \
+ "eth2" || return 1
# Multinic case, where only one nic works
client_test "MULTINIC root=nfs ip=dhcp" \
- FF 00 FE \
- "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \
- "eth1" || return 1
+ FF 00 FE \
+ "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \
+ "eth1" || return 1
# Require two interfaces
client_test "MULTINIC root=nfs ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
- 00 01 02 \
- "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
- "eth1 eth2" || return 1
+ 00 01 02 \
+ "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
+ "eth1 eth2" || return 1
# Require three interfaces with dhcp root-path
client_test "MULTINIC root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
- 00 01 02 \
- "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
- "eth0 eth1 eth2" || return 1
+ 00 01 02 \
+ "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
+ "eth0 eth1 eth2" || return 1
kill_server
return 0
@@ -129,86 +131,70 @@ test_setup() {
mkdir $TESTDIR/mnt
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
- export kernel=$KVERSION
- export srcmods="/lib/modules/$kernel/"
- # Detect lib paths
-
. $basedir/dracut-functions.sh
- if ! [[ $libdirs ]] ; then
- if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
- && [[ -d /lib64 ]]; then
- libdirs+=" /lib64"
- [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
- else
- libdirs+=" /lib"
- [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
- fi
- fi
(
- initdir=$TESTDIR/mnt
-
- for _f in modules.builtin.bin modules.builtin; do
- [[ $srcmods/$_f ]] && break
- done || {
- dfatal "No modules.builtin.bin and modules.builtin found!"
- return 1
- }
+ initdir=$TESTDIR/mnt
+
+ (
+ cd "$initdir";
+ mkdir -p dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind}
+ mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
+ chmod 777 var/lib/rpcbind var/lib/nfs
+ )
+
+ for _f in modules.builtin.bin modules.builtin; do
+ [[ $srcmods/$_f ]] && break
+ done || {
+ dfatal "No modules.builtin.bin and modules.builtin found!"
+ return 1
+ }
for _f in modules.builtin.bin modules.builtin modules.order; do
- [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
- done
+ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
+ done
- dracut_install sh ls shutdown poweroff stty cat ps ln ip \
- dmesg mkdir cp ping exportfs \
- modprobe rpc.nfsd rpc.mountd showmount tcpdump \
- /etc/services sleep mount chmod
+ dracut_install sh ls shutdown poweroff stty cat ps ln ip \
+ dmesg mkdir cp ping exportfs \
+ modprobe rpc.nfsd rpc.mountd showmount tcpdump \
+ /etc/services sleep mount chmod
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
- [ -f ${_terminfodir}/l/linux ] && break
- done
- dracut_install -o ${_terminfodir}/l/linux
- type -P portmap >/dev/null && dracut_install portmap
- type -P rpcbind >/dev/null && dracut_install rpcbind
- [ -f /etc/netconfig ] && dracut_install /etc/netconfig
- type -P dhcpd >/dev/null && dracut_install dhcpd
- [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
- instmods nfsd sunrpc ipv6 lockd
- inst ./server-init.sh /sbin/init
- inst ./hosts /etc/hosts
- inst ./exports /etc/exports
- inst ./dhcpd.conf /etc/dhcpd.conf
- dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
- dracut_install rpc.idmapd /etc/idmapd.conf
-
- inst_libdir_file 'libnfsidmap_nsswitch.so*'
- inst_libdir_file 'libnfsidmap/*.so*'
- inst_libdir_file 'libnfsidmap*.so*'
+ [ -f ${_terminfodir}/l/linux ] && break
+ done
+ dracut_install -o ${_terminfodir}/l/linux
+ type -P portmap >/dev/null && dracut_install portmap
+ type -P rpcbind >/dev/null && dracut_install rpcbind
+ [ -f /etc/netconfig ] && dracut_install /etc/netconfig
+ type -P dhcpd >/dev/null && dracut_install dhcpd
+ [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
+ instmods nfsd sunrpc ipv6 lockd
+ inst ./server-init.sh /sbin/init
+ inst ./hosts /etc/hosts
+ inst ./exports /etc/exports
+ inst ./dhcpd.conf /etc/dhcpd.conf
+ dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
+
+ dracut_install rpc.idmapd /etc/idmapd.conf
+
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
_nsslibs=${_nsslibs#|}
_nsslibs=${_nsslibs%|}
- inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
- (
- cd "$initdir";
- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind}
- mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
- chmod 777 var/lib/rpcbind var/lib/nfs
- )
+ inst /etc/nsswitch.conf /etc/nsswitch.conf
+ inst /etc/passwd /etc/passwd
+ inst /etc/group /etc/group
- inst /etc/nsswitch.conf /etc/nsswitch.conf
- inst /etc/passwd /etc/passwd
- inst /etc/group /etc/group
- for i in /lib*/libnss_files**;do
- inst_library $i
- done
+ /sbin/depmod -a -b "$initdir" $kernel
- /sbin/depmod -a -b "$initdir" $kernel
-
- cp -a /etc/ld.so.conf* $initdir/etc
- sudo ldconfig -r "$initdir"
+ cp -a /etc/ld.so.conf* $initdir/etc
+ sudo ldconfig -r "$initdir"
)
# Make client root inside server root
@@ -216,49 +202,48 @@ test_setup() {
mkdir -p $initdir
(
- dracut_install sh shutdown poweroff stty cat ps ln ip \
+ dracut_install sh shutdown poweroff stty cat ps ln ip \
mount dmesg mkdir cp ping grep ls
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
- [ -f ${_terminfodir}/l/linux ] && break
- done
- dracut_install -o ${_terminfodir}/l/linux
- inst ./client-init.sh /sbin/init
- (
- cd "$initdir"
- mkdir -p dev sys proc etc run
- mkdir -p var/lib/nfs/rpc_pipefs
- )
- inst /etc/nsswitch.conf /etc/nsswitch.conf
- inst /etc/passwd /etc/passwd
- inst /etc/group /etc/group
-
- inst_libdir_file 'libnfsidmap_nsswitch.so*'
- inst_libdir_file 'libnfsidmap/*.so*'
- inst_libdir_file 'libnfsidmap*.so*'
+ [ -f ${_terminfodir}/l/linux ] && break
+ done
+ dracut_install -o ${_terminfodir}/l/linux
+ inst ./client-init.sh /sbin/init
+ (
+ cd "$initdir"
+ mkdir -p dev sys proc etc run
+ mkdir -p var/lib/nfs/rpc_pipefs
+ )
+ inst /etc/nsswitch.conf /etc/nsswitch.conf
+ inst /etc/passwd /etc/passwd
+ inst /etc/group /etc/group
+
+ dracut_install rpc.idmapd /etc/idmapd.conf
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
+ inst_libdir_file 'libnfsidmap/*.so*'
+ inst_libdir_file 'libnfsidmap*.so*'
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
_nsslibs=${_nsslibs#|}
_nsslibs=${_nsslibs%|}
- inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
- cp -a /etc/ld.so.conf* $initdir/etc
- sudo ldconfig -r "$initdir"
+ cp -a /etc/ld.so.conf* $initdir/etc
+ sudo ldconfig -r "$initdir"
)
- chroot $initdir
-
sudo umount $TESTDIR/mnt
rm -fr $TESTDIR/mnt
# Make an overlay with needed tools for the test harness
(
- initdir=$TESTDIR/overlay
- mkdir $TESTDIR/overlay
- dracut_install poweroff shutdown
- inst_hook emergency 000 ./hard-off.sh
- inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
+ initdir=$TESTDIR/overlay
+ mkdir $TESTDIR/overlay
+ dracut_install poweroff shutdown
+ inst_hook emergency 000 ./hard-off.sh
+ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)
# Make server's dracut image
@@ -277,8 +262,8 @@ test_setup() {
kill_server() {
if [[ -s $TESTDIR/server.pid ]]; then
- sudo kill -TERM $(cat $TESTDIR/server.pid)
- rm -f $TESTDIR/server.pid
+ sudo kill -TERM $(cat $TESTDIR/server.pid)
+ rm -f $TESTDIR/server.pid
fi
}

View File

@ -1,22 +0,0 @@
From f48f9341a5a5b7f4e14d4419ce7f969e665d9c42 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Mon, 18 Jun 2012 19:20:39 +0200
Subject: [PATCH] disable TEST-16-DMSQUASH for now
---
test/TEST-16-DMSQUASH/test.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh
index 9a10058..3816c18 100755
--- a/test/TEST-16-DMSQUASH/test.sh
+++ b/test/TEST-16-DMSQUASH/test.sh
@@ -11,7 +11,7 @@ test_check() {
echo "python-imgcreate not installed"
return 1
fi
- return 0
+ return 1
}
test_run() {

View File

@ -1,36 +0,0 @@
From 361306c131a31c85d4b7ce40e33d6cbb589cb8b4 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:28:35 +0200
Subject: [PATCH] check for arch before installing drivers/s390
---
modules.d/40network/module-setup.sh | 2 +-
modules.d/90multipath/module-setup.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 4ed8d03..a8efbc5 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -61,7 +61,7 @@ installkernel() {
return $_ret
}
- { find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \
+ { find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
| net_module_filter | instmods
instmods =drivers/net/phy
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index bf71fdc..0e8857c 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -44,7 +44,7 @@ installkernel() {
done
}
- ( find_kernel_modules_by_path drivers/scsi; find_kernel_modules_by_path drivers/s390/scsi ;
+ ( find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | instmods
_ret=$?
[[ $debug ]] && set -x

View File

@ -1,23 +0,0 @@
From c7896f125183bbae0ef1403fb8aa5e46adf464ac Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:29:42 +0200
Subject: [PATCH] dracut-shutdown.service: fixed ordering to be before
shutdown.target
---
dracut-shutdown.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-shutdown.service b/dracut-shutdown.service
index 6756355..f96418b 100644
--- a/dracut-shutdown.service
+++ b/dracut-shutdown.service
@@ -8,7 +8,7 @@
[Unit]
Description=Restore /run/initramfs
After=getty@tty1.service prefdm.service
-Before=reboot.service
+Before=reboot.service shutdown.target
DefaultDependencies=no
ConditionPathExists=/run/initramfs/.need_shutdown
ConditionPathExists=!/run/initramfs/bin/sh

View File

@ -1,104 +0,0 @@
From 9f037266ee5b8da70e04b48bd69d8c2f602bbd4d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 20 Jun 2012 18:34:35 +0200
Subject: [PATCH] systemd: output all service output to the journal also
---
modules.d/98systemd/dracut-initqueue.service | 4 ++--
modules.d/98systemd/dracut-pre-pivot.service | 4 ++--
modules.d/98systemd/dracut-pre-trigger.service | 4 ++--
modules.d/98systemd/dracut-pre-udev.service | 4 ++--
modules.d/98systemd/emergency.service | 4 ++--
modules.d/98systemd/rescue.service | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index b0c8509..c87e6a0 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-initqueue
Type=simple
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index 410e03e..0e04cb4 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-pivot
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 080b1f5..18eb8fc 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -18,8 +18,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-trigger
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 09a349d..2447fc8 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -17,8 +17,8 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-udev
Type=oneshot
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index 7c705c4..86fc13f 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -19,8 +19,8 @@ WorkingDirectory=/
ExecStart=-/bin/sh -i -l
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service
index 652308c..afd04f7 100644
--- a/modules.d/98systemd/rescue.service
+++ b/modules.d/98systemd/rescue.service
@@ -21,8 +21,8 @@ ExecStart=-/bin/sh -i -l
#ExecStopPost=-/usr/bin/systemctl --fail --no-block switch-root /sysroot /sbin/init
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty-force
-StandardOutput=inherit
+StandardInput=tty
+StandardOutput=journal+console
StandardError=inherit
KillMode=process

View File

@ -1,29 +0,0 @@
From 529f7bf358d30f5e76cd680bd82fc5d954fa8a33 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:01:07 +0200
Subject: [PATCH] systemd/module-setup.sh: add old udev systemd services
---
modules.d/98systemd/module-setup.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index dbb9063..2160eb4 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -102,6 +102,15 @@ install() {
$systemdsystemunitdir/initrd-switch-root.target \
$systemdsystemunitdir/initrd-switch-root.service \
$systemdsystemunitdir/umount.target \
+ $systemdsystemunitdir/udev-control.socket \
+ $systemdsystemunitdir/udev-kernel.socket \
+ $systemdsystemunitdir/udev.service \
+ $systemdsystemunitdir/udev-settle.service \
+ $systemdsystemunitdir/udev-trigger.service \
+ $systemdsystemunitdir/basic.target.wants/udev.service \
+ $systemdsystemunitdir/basic.target.wants/udev-trigger.service \
+ $systemdsystemunitdir/sockets.target.wants/udev-control.socket \
+ $systemdsystemunitdir/sockets.target.wants/udev-kernel.socket
for i in /etc/systemd/*.conf; do
dracut_install "$i"

View File

@ -1,82 +0,0 @@
From b47e023767ae6c8dad816d44b3ffd8dcd5048afe Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:01:51 +0200
Subject: [PATCH] systemd: fix emergency.service and rescue.service
---
modules.d/98systemd/emergency.service | 10 +++++-----
modules.d/98systemd/module-setup.sh | 2 +-
modules.d/98systemd/rescue.service | 11 +++++------
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index 86fc13f..431e2b0 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -10,17 +10,17 @@
[Unit]
Description=Emergency Shell
DefaultDependencies=no
-Conflicts=shutdown.target
-Before=shutdown.target
[Service]
Environment=HOME=/
WorkingDirectory=/
+ExecStartPre=-/bin/plymouth quit
+ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\n'
ExecStart=-/bin/sh -i -l
-ExecStopPost=-/usr/bin/systemctl --fail --no-block default
+ExecStopPost=-/bin/rm -f /.console_lock
Type=idle
-StandardInput=tty
-StandardOutput=journal+console
+StandardInput=tty-force
+StandardOutput=inherit
StandardError=inherit
KillMode=process
IgnoreSIGPIPE=no
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 2160eb4..91f50af 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -116,7 +116,7 @@ install() {
dracut_install "$i"
done
- dracut_install journalctl systemctl
+ dracut_install journalctl systemctl echo
ln -fs $systemdutildir/systemd "$initdir/init"
diff --git a/modules.d/98systemd/rescue.service b/modules.d/98systemd/rescue.service
index afd04f7..b5fb663 100644
--- a/modules.d/98systemd/rescue.service
+++ b/modules.d/98systemd/rescue.service
@@ -10,21 +10,20 @@
[Unit]
Description=Rescue Shell
DefaultDependencies=no
-Conflicts=shutdown.target
-After=basic.target plymouth-start.service
-Before=shutdown.target
[Service]
Environment=HOME=/
WorkingDirectory=/
+ExecStartPre=-/bin/plymouth quit
ExecStart=-/bin/sh -i -l
-#ExecStopPost=-/usr/bin/systemctl --fail --no-block switch-root /sysroot /sbin/init
+ExecStopPost=-/bin/rm -f /.console_lock
ExecStopPost=-/usr/bin/systemctl --fail --no-block default
Type=idle
-StandardInput=tty
-StandardOutput=journal+console
+StandardInput=tty-force
+StandardOutput=inherit
StandardError=inherit
KillMode=process
+IgnoreSIGPIPE=no
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.

View File

@ -1,74 +0,0 @@
From f6eb1f1d1f608b9b9983bdfaf4a867143e21b2b7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:02:48 +0200
Subject: [PATCH] systemd: do not redirect to /dev/console
---
modules.d/98systemd/dracut-cmdline.sh | 2 --
modules.d/98systemd/dracut-initqueue.sh | 1 -
modules.d/98systemd/dracut-pre-pivot.sh | 1 -
modules.d/98systemd/dracut-pre-trigger.sh | 1 -
modules.d/98systemd/dracut-pre-udev.sh | 1 -
5 files changed, 6 deletions(-)
diff --git a/modules.d/98systemd/dracut-cmdline.sh b/modules.d/98systemd/dracut-cmdline.sh
index 26ca9c2..e1a75ea 100755
--- a/modules.d/98systemd/dracut-cmdline.sh
+++ b/modules.d/98systemd/dracut-cmdline.sh
@@ -7,8 +7,6 @@ NEWROOT="/sysroot"
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
-exec </dev/console >/dev/console 2>&1
-
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 5d51a80..830dbee 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -1,7 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index a8e9fc1..eb7e932 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -2,7 +2,6 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi
diff --git a/modules.d/98systemd/dracut-pre-trigger.sh b/modules.d/98systemd/dracut-pre-trigger.sh
index 0539a01..9521eaa 100755
--- a/modules.d/98systemd/dracut-pre-trigger.sh
+++ b/modules.d/98systemd/dracut-pre-trigger.sh
@@ -1,7 +1,6 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
diff --git a/modules.d/98systemd/dracut-pre-udev.sh b/modules.d/98systemd/dracut-pre-udev.sh
index 5740174..3b5ac37 100755
--- a/modules.d/98systemd/dracut-pre-udev.sh
+++ b/modules.d/98systemd/dracut-pre-udev.sh
@@ -2,7 +2,6 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-exec </dev/console >/dev/console 2>&1
if [ -f /dracut-state.sh ]; then
. /dracut-state.sh || :
fi

View File

@ -1,33 +0,0 @@
From 3d3ddf082b6b61ae559520ff039f7592a58e88b2 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:03:22 +0200
Subject: [PATCH] systemd: do not flock for console
---
modules.d/98systemd/dracut-initqueue.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.sh b/modules.d/98systemd/dracut-initqueue.sh
index 830dbee..03f1c9b 100755
--- a/modules.d/98systemd/dracut-initqueue.sh
+++ b/modules.d/98systemd/dracut-initqueue.sh
@@ -59,8 +59,7 @@ while :; do
fi
main_loop=$(($main_loop+1))
- [ $main_loop -gt $RDRETRY ] \
- && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock
+ [ $main_loop -gt $RDRETRY ] && emergency_shell "Could not boot."
done
unset job
@@ -95,8 +94,7 @@ while :; do
done
i=$(($i+1))
- [ $i -gt 20 ] \
- && { flock -s 9 ; emergency_shell "Can't mount root filesystem"; } 9>/.console_lock
+ [ $i -gt 20 ] && emergency_shell "Can't mount root filesystem"
done
{

View File

@ -1,26 +0,0 @@
From edcbd379d50218695681e9bb13288f9603da04f6 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:04:15 +0200
Subject: [PATCH] systemd/dracut-pre-pivot.sh: stop old udev services
---
modules.d/98systemd/dracut-pre-pivot.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index eb7e932..6685210 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -34,7 +34,11 @@ done
echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
udevadm control --stop-exec-queue
-systemctl stop systemd-udev.service
+
+for i in systemd-udev.service udev.service; do
+ systemctl is-active $i >/dev/null 2>&1 && systemctl stop $i
+done
+
udevadm info --cleanup-db
# remove helper symlink

View File

@ -1,66 +0,0 @@
From f653c8622995fc39d0715a6bed60618c61ed0b5e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:05:15 +0200
Subject: [PATCH] systemd/dracut-cmdline: make dracut-cmdline a service
convert dracut-cmdline from hook to service after the journal
---
modules.d/98systemd/dracut-cmdline.service | 29 ++++++++++++++++++++++++++++
modules.d/98systemd/module-setup.sh | 7 +++++--
2 files changed, 34 insertions(+), 2 deletions(-)
create mode 100644 modules.d/98systemd/dracut-cmdline.service
diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service
new file mode 100644
index 0000000..938ccbe
--- /dev/null
+++ b/modules.d/98systemd/dracut-cmdline.service
@@ -0,0 +1,29 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# See systemd.special(7) for details
+
+[Unit]
+Description=Dracut cmdline hook
+DefaultDependencies=no
+Before=dracut-pre-udev.service
+After=systemd-journald.socket
+Wants=systemd-journald.socket
+
+[Service]
+Environment=HOME=/
+WorkingDirectory=/
+ExecStart=-/bin/dracut-cmdline
+Type=oneshot
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
+KillMode=process
+
+# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
+# terminates cleanly.
+KillSignal=SIGHUP
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 91f50af..adef939 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -130,9 +130,12 @@ install() {
inst "$moddir/initrd-switch-root.service" ${systemdsystemunitdir}/initrd-switch-root.service
ln -s basic.target "${initdir}${systemdsystemunitdir}/default.target"
- inst "$moddir/dracut-cmdline.sh" ${systemdsystemunitdir}-generators/dracut-cmdline.sh
-
mkdir -p "${initdir}${systemdsystemunitdir}/basic.target.wants"
+
+ inst "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
+ inst "$moddir/dracut-cmdline.service" ${systemdsystemunitdir}/dracut-cmdline.service
+ ln -s ../dracut-cmdline.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-cmdline.service"
+
inst "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
inst "$moddir/dracut-pre-udev.service" ${systemdsystemunitdir}/dracut-pre-udev.service
ln -s ../dracut-pre-udev.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-udev.service"

View File

@ -1,22 +0,0 @@
From f82659c552b453f832c84c808e4e721c18be6a24 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:06:30 +0200
Subject: [PATCH] systemd/dracut-pre-pivot.sh: remove trailing space
---
modules.d/98systemd/dracut-pre-pivot.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 6685210..38e9c3c 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -18,7 +18,7 @@ getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break
source_hook cleanup
# By the time we get here, the root filesystem should be mounted.
-# Try to find init.
+# Try to find init.
for i in "$(getarg real_init=)" "$(getarg init=)"; do
[ -n "$i" ] || continue

View File

@ -1,22 +0,0 @@
From a51aa0d0e281dc9f72a99141156e88ecbfdf55dd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:07:08 +0200
Subject: [PATCH] systemd/dracut-pre-udev.service: fixed description
---
modules.d/98systemd/dracut-pre-udev.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 2447fc8..9b2d929 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -8,7 +8,7 @@
# See systemd.special(7) for details
[Unit]
-Description=Dracut pre-trigger hook
+Description=Dracut pre-udev hook
DefaultDependencies=no
Before=systemd-udev.service

View File

@ -1,56 +0,0 @@
From b03e991113f7e33c0fd072e16d4ebd862542e720 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:08:03 +0200
Subject: [PATCH] systemd: fixed ordering of services
---
modules.d/98systemd/dracut-initqueue.service | 3 ++-
modules.d/98systemd/dracut-pre-trigger.service | 5 +++--
modules.d/98systemd/dracut-pre-udev.service | 4 +++-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index c87e6a0..89aa304 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -10,7 +10,8 @@
[Unit]
Description=Dracut initqueue hook
DefaultDependencies=no
-After=systemd-udev-trigger.service
+After=systemd-udev-trigger.service udev-trigger.service
+Wants=systemd-udev-trigger.service udev-trigger.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 18eb8fc..1ab07a1 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -10,8 +10,9 @@
[Unit]
Description=Dracut pre-trigger hook
DefaultDependencies=no
-After=systemd-udev.service
-Before=systemd-udev-trigger.service
+Before=systemd-udev-trigger.service udev-trigger.service dracut-initqueue.service
+After=dracut-pre-udev.service systemd-udev.service udev.service
+Wants=dracut-pre-udev.service systemd-udev.service udev.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 9b2d929..579316e 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -10,7 +10,9 @@
[Unit]
Description=Dracut pre-udev hook
DefaultDependencies=no
-Before=systemd-udev.service
+Before=systemd-udev.service udev.service dracut-pre-trigger.service
+After=dracut-cmdline.service
+Wants=dracut-cmdline.service
[Service]
Environment=HOME=/

View File

@ -1,80 +0,0 @@
From e08710a28979575f676be63658310df849b29076 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:08:29 +0200
Subject: [PATCH] systemd: fixed I/O of services
---
modules.d/98systemd/dracut-initqueue.service | 6 +++---
modules.d/98systemd/dracut-pre-pivot.service | 6 +++---
modules.d/98systemd/dracut-pre-trigger.service | 6 +++---
modules.d/98systemd/dracut-pre-udev.service | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index 89aa304..4f86eaf 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -18,9 +18,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-initqueue
Type=simple
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index 0e04cb4..e61750b 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -17,9 +17,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-pivot
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 1ab07a1..234839c 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -19,9 +19,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-trigger
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 579316e..11be61b 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -19,9 +19,9 @@ Environment=HOME=/
WorkingDirectory=/
ExecStart=-/bin/dracut-pre-udev
Type=oneshot
-StandardInput=tty
-StandardOutput=journal+console
-StandardError=inherit
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog+console
KillMode=process
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash

View File

@ -1,58 +0,0 @@
From d9087a2d85dd65e1e33c8c2247d4fccfd7fbc5da Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:09:38 +0200
Subject: [PATCH] base/dracut-lib.sh: change output of info() and warn() for
systemd
---
modules.d/99base/dracut-lib.sh | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 8cfd7b3..e0c4c19 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -323,18 +323,32 @@ check_quiet() {
fi
}
-warn() {
- check_quiet
- echo "<28>dracut Warning: $@" > /dev/kmsg
- echo "dracut Warning: $@" >&2
-}
+if [ ! -x /lib/systemd/systemd ]; then
-info() {
- check_quiet
- echo "<30>dracut: $@" > /dev/kmsg
- [ "$DRACUT_QUIET" != "yes" ] && \
- echo "dracut: $@"
-}
+ warn() {
+ check_quiet
+ echo "<28>dracut Warning: $@" > /dev/kmsg
+ echo "dracut Warning: $@" >&2
+ }
+
+ info() {
+ check_quiet
+ echo "<30>dracut: $@" > /dev/kmsg
+ [ "$DRACUT_QUIET" != "yes" ] && \
+ echo "dracut: $@"
+ }
+
+else
+
+ warn() {
+ echo "Warning: $@" >&2
+ }
+
+ info() {
+ echo "$@"
+ }
+
+fi
vwarn() {
while read line; do

View File

@ -1,74 +0,0 @@
From 1e570bf8e3010c1cc4cec2f67e0cefd658f90b48 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:10:13 +0200
Subject: [PATCH] base/dracut-lib.sh: for systemd start emergency.service
do not spawn the shell, start the emergency.service for systemd
---
modules.d/99base/dracut-lib.sh | 47 +++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index e0c4c19..5dc3fbd 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -825,30 +825,41 @@ emergency_shell()
_rdshell_name=$2; action="Shutdown"; hook="shutdown-emergency"
shift 2
fi
+
echo ; echo
warn $@
source_hook "$hook"
echo
+
if getargbool 1 rd.shell -y rdshell || getarg rd.break rdbreak; then
- echo "Dropping to debug shell."
- echo
- export PS1="$_rdshell_name:\${PWD}# "
- [ -e /.profile ] || >/.profile
-
- _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
- if [ -z "$_ctty" ]; then
- _ctty=console
- while [ -f /sys/class/tty/$_ctty/active ]; do
- _ctty=$(cat /sys/class/tty/$_ctty/active)
- _ctty=${_ctty##* } # last one in the list
- done
- _ctty=/dev/$_ctty
- fi
- [ -c "$_ctty" ] || _ctty=/dev/tty1
- strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
+ if [ -x /lib/systemd/systemd ]; then
+ > /.console_lock
+ echo "PS1=\"$_rdshell_name:\${PWD}# \"" >/etc/profile
+ systemctl start emergency.service
+ debug_off
+ while [ -e /.console_lock ]; do sleep 1; done
+ debug_on
+ else
+ echo "Dropping to debug shell."
+ echo
+ export PS1="$_rdshell_name:\${PWD}# "
+ [ -e /.profile ] || >/.profile
+
+ _ctty="$(getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}"
+ if [ -z "$_ctty" ]; then
+ _ctty=console
+ while [ -f /sys/class/tty/$_ctty/active ]; do
+ _ctty=$(cat /sys/class/tty/$_ctty/active)
+ _ctty=${_ctty##* } # last one in the list
+ done
+ _ctty=/dev/$_ctty
+ fi
+ [ -c "$_ctty" ] || _ctty=/dev/tty1
+ strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
# stop watchdog
- echo 'V' > /dev/watchdog
- setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ echo 'V' > /dev/watchdog
+ setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
+ fi
else
warn "$action has failed. To debug this issue add \"rd.shell\" to the kernel command line."
# cause a kernel panic

View File

@ -1,21 +0,0 @@
From 16c88e493f87aeba449434947a2a1924cf49db43 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:09:02 +0200
Subject: [PATCH] dracut.conf.d/fedora.conf.example: make systemd default
---
dracut.conf.d/fedora.conf.example | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example
index f3f57f1..25b5cfa 100644
--- a/dracut.conf.d/fedora.conf.example
+++ b/dracut.conf.d/fedora.conf.example
@@ -4,6 +4,7 @@
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
omit_dracutmodules+=" dash "
omit_drivers+=" .*/fs/ocfs/.* "
+add_dracutmodules+=" systemd "
stdloglvl=3
realinitpath="/usr/lib/systemd/systemd"
install_items+=" vi /etc/virc ps grep cat rm "

View File

@ -1,21 +0,0 @@
From 1e2673fd98d05ae5103f24fbd8fb748c9dfc5a45 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:20:11 +0200
Subject: [PATCH] dracut.spec: require systemd >= 44-15
---
dracut.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/dracut.spec b/dracut.spec
index 6e8c733..982a66d 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -80,6 +80,7 @@ Requires: file
Requires: udev > 166
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
+Requires: systemd >= 44-15
%else
Requires: util-linux-ng >= 2.21
%endif

View File

@ -1,54 +0,0 @@
From a20d24ded292bfcf96f4fdab78ec20b92a07bbf1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 01:57:11 +0200
Subject: [PATCH] dracut-functions.sh: use "ln -r" instead of shell functions
---
dracut-functions.sh | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 1137919..d4a766b 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -188,6 +188,19 @@ convert_abs_rel() {
echo "$__newpath"
}
+if strstr "$(ln --help)" "relative"; then
+ ln_r() {
+ ln -sfnr "${initdir}/$1" "${initdir}/$2"
+ }
+else
+ ln_r() {
+ local _source=$1
+ local _dest=$2
+ [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
+ ln -sfn $(convert_abs_rel "${_dest}" "${_source}") "${initdir}/${_dest}"
+ }
+fi
+
# get_fs_env <device>
# Get and set the ID_FS_TYPE and ID_FS_UUID variable from udev for a device.
# Example:
@@ -465,8 +478,7 @@ inst_library() {
_reallib=$(readlink -f "$_src")
inst_simple "$_reallib" "$_reallib"
inst_dir "${_dest%/*}"
- [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
- ln -sfn $(convert_abs_rel "${_dest}" "${_reallib}") "${initdir}/${_dest}"
+ ln_r "${_reallib}" "${_dest}"
else
inst_simple "$_src" "$_dest"
fi
@@ -555,8 +567,8 @@ inst_symlink() {
fi
fi
[[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
- [[ -d ${_target%/*} ]] && _target=$(readlink -f ${_target%/*})/${_target##*/}
- ln -sfn $(convert_abs_rel "${_target}" "${_realsrc}") "$initdir/$_target"
+
+ ln_r "${_realsrc}" "${_target}"
}
# attempt to install any programs specified in a udev rule

View File

@ -1,74 +0,0 @@
From 579ca216b426923ea312ebd46582e38a683b5531 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 03:36:58 +0200
Subject: [PATCH] systemd: remove unneeded systemd services
---
modules.d/98systemd/module-setup.sh | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index adef939..d11aa8a 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -21,15 +21,10 @@ install() {
$systemdutildir/systemd-cgroups-agent \
$systemdutildir/systemd-initctl \
$systemdutildir/systemd-shutdown \
- $systemdutildir/systemd-modules-load \
- $systemdutildir/systemd-remount-fs \
$systemdutildir/systemd-reply-password \
$systemdutildir/systemd-fsck \
- $systemdutildir/systemd-sysctl \
$systemdutildir/systemd-udevd \
$systemdutildir/systemd-journald \
- $systemdutildir/systemd-vconsole-setup \
- $systemdutildir/systemd-cryptsetup \
$systemdsystemunitdir/emergency.target \
$systemdsystemunitdir/sysinit.target \
$systemdsystemunitdir/basic.target \
@@ -53,19 +48,13 @@ install() {
$systemdsystemunitdir/swap.target \
$systemdsystemunitdir/systemd-initctl.socket \
$systemdsystemunitdir/systemd-shutdownd.socket \
- $systemdsystemunitdir/bluetooth.target \
$systemdsystemunitdir/systemd-ask-password-console.path \
$systemdsystemunitdir/systemd-udev-control.socket \
$systemdsystemunitdir/systemd-udev-kernel.socket \
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
$systemdsystemunitdir/systemd-journald.socket \
- $systemdsystemunitdir/cryptsetup.target \
- $systemdsystemunitdir/console-shell.service \
- $systemdsystemunitdir/console-getty.service \
$systemdsystemunitdir/systemd-initctl.service \
$systemdsystemunitdir/systemd-shutdownd.service \
- $systemdsystemunitdir/systemd-modules-load.service \
- $systemdsystemunitdir/systemd-remount-fs.service \
$systemdsystemunitdir/systemd-ask-password-console.service \
$systemdsystemunitdir/halt.service \
$systemdsystemunitdir/poweroff.service \
@@ -78,12 +67,9 @@ install() {
$systemdsystemunitdir/systemd-ask-password-plymouth.service \
$systemdsystemunitdir/systemd-journald.service \
$systemdsystemunitdir/systemd-vconsole-setup.service \
- $systemdsystemunitdir/systemd-localed.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
$systemdsystemunitdir/sysinit.target.wants/systemd-journald.service \
- $systemdsystemunitdir/sysinit.target.wants/systemd-vconsole-setup.service \
- $systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
$systemdsystemunitdir/sockets.target.wants/systemd-initctl.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-shutdownd.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-udev-control.socket \
@@ -91,11 +77,8 @@ install() {
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
$systemdsystemunitdir/sysinit.target.wants/systemd-udev.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
- $systemdsystemunitdir/local-fs.target.wants/systemd-remount-fs.service \
- $systemdsystemunitdir/local-fs.target.wants/fsck-root.service \
$systemdsystemunitdir/local-fs.target.wants/tmp.mount \
$systemdsystemunitdir/ctrl-alt-del.target \
- $systemdsystemunitdir/autovt@.service \
$systemdsystemunitdir/single.service \
$systemdsystemunitdir/syslog.socket \
$systemdsystemunitdir/syslog.target \

View File

@ -1,79 +0,0 @@
From ee876e03b9c88bed7fb3d2a337b2361e07bbb0e3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 09:24:44 +0200
Subject: [PATCH] fixed i18n for systemd and include more config files in
host-only
---
modules.d/10i18n/console_init.sh | 2 ++
modules.d/98systemd/module-setup.sh | 17 ++++++++++++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/modules.d/10i18n/console_init.sh b/modules.d/10i18n/console_init.sh
index b46046b..37efdd1 100755
--- a/modules.d/10i18n/console_init.sh
+++ b/modules.d/10i18n/console_init.sh
@@ -2,6 +2,8 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
+[ -x /lib/systemd/systemd-vconsole-setup ] && exit 0
+
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
DEFAULT_FONT=LatArCyrHeb-16
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index d11aa8a..4c68a9a 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -7,7 +7,8 @@ check() {
if [[ -x /lib/systemd/systemd ]] || [[ -x /usr/lib/systemd/systemd ]]; then
return 255
fi
- pkg-config systemd --variable=systemdutildir >/dev/null && return 255
+ [[ $systemdutildir ]] && return 255
+
return 1
}
@@ -69,6 +70,7 @@ install() {
$systemdsystemunitdir/systemd-vconsole-setup.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
+ $systemdsystemunitdir/sysinit.target.wants/systemd-vconsole-setup.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-journald.service \
$systemdsystemunitdir/sockets.target.wants/systemd-initctl.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-shutdownd.socket \
@@ -77,7 +79,6 @@ install() {
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
$systemdsystemunitdir/sysinit.target.wants/systemd-udev.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
- $systemdsystemunitdir/local-fs.target.wants/tmp.mount \
$systemdsystemunitdir/ctrl-alt-del.target \
$systemdsystemunitdir/single.service \
$systemdsystemunitdir/syslog.socket \
@@ -101,6 +102,17 @@ install() {
dracut_install journalctl systemctl echo
+ if [[ $hostonly ]]; then
+ dracut_install -o /etc/systemd/journald.conf \
+ /etc/systemd/system.conf \
+ /etc/hostname \
+ /etc/machine-id \
+ /etc/vconsole.conf \
+ /etc/locale.conf
+ else
+ > "$initdir/etc/machine-id"
+ fi
+
ln -fs $systemdutildir/systemd "$initdir/init"
rm -f "${initdir}${systemdsystemunitdir}/emergency.service"
@@ -136,6 +148,5 @@ install() {
mkdir -p "${initdir}${systemdsystemunitdir}/initrd-switch-root.target.wants"
ln -s ../dracut-pre-pivot.service "${initdir}${systemdsystemunitdir}/initrd-switch-root.target.wants/dracut-pre-pivot.service"
- > "$initdir/etc/machine-id"
}

View File

@ -1,79 +0,0 @@
From 55cb17c677d6e4658b4356cf5a594acfec01366b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 10:50:01 +0200
Subject: [PATCH] systemd: remove old udev services
---
modules.d/98systemd/dracut-initqueue.service | 4 ++--
modules.d/98systemd/dracut-pre-trigger.service | 6 +++---
modules.d/98systemd/dracut-pre-udev.service | 2 +-
modules.d/98systemd/module-setup.sh | 11 +----------
4 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index 4f86eaf..31fe9e4 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -10,8 +10,8 @@
[Unit]
Description=Dracut initqueue hook
DefaultDependencies=no
-After=systemd-udev-trigger.service udev-trigger.service
-Wants=systemd-udev-trigger.service udev-trigger.service
+After=systemd-udev-trigger.service
+Wants=systemd-udev-trigger.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index 234839c..b06d17f 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -10,9 +10,9 @@
[Unit]
Description=Dracut pre-trigger hook
DefaultDependencies=no
-Before=systemd-udev-trigger.service udev-trigger.service dracut-initqueue.service
-After=dracut-pre-udev.service systemd-udev.service udev.service
-Wants=dracut-pre-udev.service systemd-udev.service udev.service
+Before=systemd-udev-trigger.service dracut-initqueue.service
+After=dracut-pre-udev.service systemd-udev.service
+Wants=dracut-pre-udev.service systemd-udev.service
[Service]
Environment=HOME=/
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index 11be61b..d867b38 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -10,7 +10,7 @@
[Unit]
Description=Dracut pre-udev hook
DefaultDependencies=no
-Before=systemd-udev.service udev.service dracut-pre-trigger.service
+Before=systemd-udev.service dracut-pre-trigger.service
After=dracut-cmdline.service
Wants=dracut-cmdline.service
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 4c68a9a..a6e2365 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -85,16 +85,7 @@ install() {
$systemdsystemunitdir/syslog.target \
$systemdsystemunitdir/initrd-switch-root.target \
$systemdsystemunitdir/initrd-switch-root.service \
- $systemdsystemunitdir/umount.target \
- $systemdsystemunitdir/udev-control.socket \
- $systemdsystemunitdir/udev-kernel.socket \
- $systemdsystemunitdir/udev.service \
- $systemdsystemunitdir/udev-settle.service \
- $systemdsystemunitdir/udev-trigger.service \
- $systemdsystemunitdir/basic.target.wants/udev.service \
- $systemdsystemunitdir/basic.target.wants/udev-trigger.service \
- $systemdsystemunitdir/sockets.target.wants/udev-control.socket \
- $systemdsystemunitdir/sockets.target.wants/udev-kernel.socket
+ $systemdsystemunitdir/umount.target
for i in /etc/systemd/*.conf; do
dracut_install "$i"

View File

@ -1,24 +0,0 @@
From cc51bc6fdbe3962d5ca81808ed685ddc41770935 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 10:50:36 +0200
Subject: [PATCH] systemd/dracut-pre-pivot.sh: copy service files to
/run/systemd/system
and remove the last info, so that the journal is not restarted again.
---
modules.d/98systemd/dracut-pre-pivot.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
index 38e9c3c..89d7e6d 100755
--- a/modules.d/98systemd/dracut-pre-pivot.sh
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
@@ -45,6 +45,7 @@ udevadm info --cleanup-db
[ -h /dev/root ] && rm -f /dev/root
getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
-info "Switching root"
+
+cp -avr /lib/systemd/system/dracut*.service /run/systemd/system/
export -p > /dracut-state.sh

View File

@ -1,71 +0,0 @@
From 472edf825e478826bc7735961961576fe7c94c5f Mon Sep 17 00:00:00 2001
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Thu, 21 Jun 2012 11:44:35 +0800
Subject: [PATCH] network: support vlan tagged bonding
This patch adds support of vlan tagged bonding, for example,
bond0.2. In case of regression, I also tested bond0 and eth0.2,
all work fine.
Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
modules.d/40network/ifup.sh | 8 ++++++--
modules.d/40network/net-genrules.sh | 6 +++---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
index 31eb966..316a21a 100755
--- a/modules.d/40network/ifup.sh
+++ b/modules.d/40network/ifup.sh
@@ -188,7 +188,7 @@ if [ -e /tmp/bridge.info ]; then
brctl setfd $bridgename 0
for ethname in $ethnames ; do
if [ "$ethname" = "$bondname" ] ; then
- DO_BOND_SETUP=yes ifup $bondname
+ DO_BOND_SETUP=yes ifup $bondname -m
else
ip link set $ethname up
fi
@@ -211,7 +211,11 @@ get_vid() {
if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
modprobe 8021q
- ip link set "$phydevice" up
+ if [ "$phydevice" = "$bondname" ] ; then
+ DO_BOND_SETUP=yes ifup $phydevice -m
+ else
+ ip link set "$phydevice" up
+ fi
wait_for_if_up "$phydevice"
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
fi
diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh
index 99d0fe5..867abcf 100755
--- a/modules.d/40network/net-genrules.sh
+++ b/modules.d/40network/net-genrules.sh
@@ -21,19 +21,19 @@ fix_bootif() {
# bridge: attempt only the defined interface
if [ -e /tmp/bridge.info ]; then
. /tmp/bridge.info
- IFACES=${ethnames%% *}
+ IFACES+=" ${ethnames%% *}"
fi
# bond: attempt only the defined interface (override bridge defines)
if [ -e /tmp/bond.info ]; then
. /tmp/bond.info
# It is enough to fire up only one
- IFACES=${bondslaves%% *}
+ IFACES+=" ${bondslaves%% *}"
fi
if [ -e /tmp/vlan.info ]; then
. /tmp/vlan.info
- IFACES=$phydevice
+ IFACES+=" $phydevice"
fi
ifup='/sbin/ifup $env{INTERFACE}'

View File

@ -1,22 +0,0 @@
From e3295047b101a9a92c8548909cd18b2675bc9977 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 13:51:49 +0200
Subject: [PATCH] systemd/emergency.service: remove Type=idle
Type=idle might cause a 3 second delay.
---
modules.d/98systemd/emergency.service | 1 -
1 file changed, 1 deletion(-)
diff --git a/modules.d/98systemd/emergency.service b/modules.d/98systemd/emergency.service
index 431e2b0..b79af22 100644
--- a/modules.d/98systemd/emergency.service
+++ b/modules.d/98systemd/emergency.service
@@ -18,7 +18,6 @@ ExecStartPre=-/bin/plymouth quit
ExecStartPre=-/bin/echo -e '\n\nEntering emergency mode. Exit the shell to continue.\nType "journalctl" to view system logs.\n'
ExecStart=-/bin/sh -i -l
ExecStopPost=-/bin/rm -f /.console_lock
-Type=idle
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit

View File

@ -1,74 +0,0 @@
From d17e0fcd431e823c3f93bbcff8e853578d6bfdc9 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 21 Jun 2012 14:10:41 +0200
Subject: [PATCH] systemd: add ConditionPathExists=/etc/initrd-release to
services
---
modules.d/98systemd/dracut-cmdline.service | 1 +
modules.d/98systemd/dracut-initqueue.service | 1 +
modules.d/98systemd/dracut-pre-pivot.service | 1 +
modules.d/98systemd/dracut-pre-trigger.service | 1 +
modules.d/98systemd/dracut-pre-udev.service | 1 +
5 files changed, 5 insertions(+)
diff --git a/modules.d/98systemd/dracut-cmdline.service b/modules.d/98systemd/dracut-cmdline.service
index 938ccbe..c84f62b 100644
--- a/modules.d/98systemd/dracut-cmdline.service
+++ b/modules.d/98systemd/dracut-cmdline.service
@@ -23,6 +23,7 @@ StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
KillMode=process
+ConditionPathExists=/etc/initrd-release
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
diff --git a/modules.d/98systemd/dracut-initqueue.service b/modules.d/98systemd/dracut-initqueue.service
index 31fe9e4..4fde539 100644
--- a/modules.d/98systemd/dracut-initqueue.service
+++ b/modules.d/98systemd/dracut-initqueue.service
@@ -22,6 +22,7 @@ StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
KillMode=process
+ConditionPathExists=/etc/initrd-release
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
index e61750b..38d252d 100644
--- a/modules.d/98systemd/dracut-pre-pivot.service
+++ b/modules.d/98systemd/dracut-pre-pivot.service
@@ -21,6 +21,7 @@ StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
KillMode=process
+ConditionPathExists=/etc/initrd-release
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
diff --git a/modules.d/98systemd/dracut-pre-trigger.service b/modules.d/98systemd/dracut-pre-trigger.service
index b06d17f..97c505d 100644
--- a/modules.d/98systemd/dracut-pre-trigger.service
+++ b/modules.d/98systemd/dracut-pre-trigger.service
@@ -23,6 +23,7 @@ StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
KillMode=process
+ConditionPathExists=/etc/initrd-release
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.
diff --git a/modules.d/98systemd/dracut-pre-udev.service b/modules.d/98systemd/dracut-pre-udev.service
index d867b38..9b83e3e 100644
--- a/modules.d/98systemd/dracut-pre-udev.service
+++ b/modules.d/98systemd/dracut-pre-udev.service
@@ -23,6 +23,7 @@ StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
KillMode=process
+ConditionPathExists=/etc/initrd-release
# Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash
# terminates cleanly.

View File

@ -1,23 +0,0 @@
From bc616b4d5660d8d79465202bdc3a1b43b4ea3ba1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 08:57:20 +0200
Subject: [PATCH] dracut-functions.sh: replace strstr()
the new strstr() is faster, when compared
---
dracut-functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index d4a766b..ace5a0b 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -21,7 +21,7 @@
#
# Generic substring function. If $2 is in $1, return 0.
-strstr() { [ "${1#*$2*}" != "$1" ]; }
+strstr() { [[ $1 = *$2* ]]; }
if ! [[ $dracutbasedir ]]; then
dracutbasedir=${BASH_SOURCE[0]%/*}

View File

@ -1,23 +0,0 @@
From 68966a1d7e6dc9d6be054effa62d61836704714b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 08:58:39 +0200
Subject: [PATCH] dracut-functions.sh: mksubdirs(): check for dir existence
first
---
dracut-functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index ace5a0b..3b562e7 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -74,7 +74,7 @@ fi
# Create all subdirectories for given path without creating the last element.
# $1 = path
-mksubdirs() { mkdir -m 0755 -p ${1%/*}; }
+mksubdirs() { [[ -e ${1%/*} ]] || mkdir -m 0755 -p ${1%/*}; }
# Version comparision function. Assumes Linux style version scheme.
# $1 = version a

View File

@ -1,26 +0,0 @@
From f550ba07400662633295c9681a80787fc44e61fa Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 08:59:22 +0200
Subject: [PATCH] dracut-functions.sh: cp with --reflink=auto and
--sparse=auto
cp will use COW data copy most of the time. So, it's even better than
hardlink, because we don't have to care about hardlinks, when modifying
files in post.
---
dracut-functions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 3b562e7..b9ce688 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -435,7 +435,7 @@ inst_simple() {
inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
ddebug "Installing $_src"
- cp --sparse=always -pfL "$_src" "${initdir}/$target"
+ cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$target"
}
# find symlinks linked to given library file

View File

@ -1,79 +0,0 @@
From a6b48b4c239d8ebacf545c27aa801ba0f8762a2b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 14:50:06 +0200
Subject: [PATCH] Add qemu kernel modules, if we detect a qemu instance
Regardless of the host-only setting, add all know kernel driver for qemu
instances to support changing the virtual hardware.
---
dracut.spec | 2 ++
modules.d/90qemu-net/module-setup.sh | 16 ++++++++++++++++
modules.d/90qemu/module-setup.sh | 16 ++++++++++++++++
3 files changed, 34 insertions(+)
create mode 100755 modules.d/90qemu-net/module-setup.sh
create mode 100755 modules.d/90qemu/module-setup.sh
diff --git a/dracut.spec b/dracut.spec
index 982a66d..b19d15b 100644
--- a/dracut.spec
+++ b/dracut.spec
@@ -271,6 +271,7 @@ rm -rf $RPM_BUILD_ROOT
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
+%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95resume
@@ -313,6 +314,7 @@ rm -rf $RPM_BUILD_ROOT
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/90livenet
+%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
diff --git a/modules.d/90qemu-net/module-setup.sh b/modules.d/90qemu-net/module-setup.sh
new file mode 100755
index 0000000..3d61792
--- /dev/null
+++ b/modules.d/90qemu-net/module-setup.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+check() {
+ vm=$(systemd-detect-virt --vm)
+ (($? != 0)) && return 255
+ [[ $vm = "qemu" ]] && return 0
+ [[ $vm = "kvm" ]] && return 0
+ return 255
+}
+
+installkernel() {
+ # qemu specific modules
+ hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci
+}
diff --git a/modules.d/90qemu/module-setup.sh b/modules.d/90qemu/module-setup.sh
new file mode 100755
index 0000000..094f5a3
--- /dev/null
+++ b/modules.d/90qemu/module-setup.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+check() {
+ vm=$(systemd-detect-virt --vm)
+ (($? != 0)) && return 255
+ [[ $vm = "qemu" ]] && return 0
+ [[ $vm = "kvm" ]] && return 0
+ return 255
+}
+
+installkernel() {
+ # qemu specific modules
+ hostonly='' instmods virtio_blk virtio virtio_ring virtio_pci ata_piix ata_generic pata_acpi cdrom sr_mod ahci virtio_scsi
+}

View File

@ -1,43 +0,0 @@
From 7953a6ab718185096e5729482f91b319d4a67e90 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:09:07 +0200
Subject: [PATCH] dracut-functions.sh:inst_simple() do inst_symlink for
symlinks
---
dracut-functions.sh | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index b9ce688..273d2a5 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -424,18 +424,21 @@ inst_simple() {
[[ -f "$1" ]] || return 1
strstr "$1" "/" || return 1
- local _src=$1 target="${2:-$1}"
- if ! [[ -d ${initdir}/$target ]]; then
- [[ -e ${initdir}/$target ]] && return 0
- [[ -L ${initdir}/$target ]] && return 0
- [[ -d "${initdir}/${target%/*}" ]] || inst_dir "${target%/*}"
+ local _src=$1 _target="${2:-$1}"
+
+ [[ -L $_src ]] && return inst_symlink $_src $_target
+
+ if ! [[ -d ${initdir}/$_target ]]; then
+ [[ -e ${initdir}/$_target ]] && return 0
+ [[ -L ${initdir}/$_target ]] && return 0
+ [[ -d "${initdir}/${_target%/*}" ]] || inst_dir "${_target%/*}"
fi
# install checksum files also
if [[ -e "${_src%/*}/.${_src##*/}.hmac" ]]; then
- inst "${_src%/*}/.${_src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
+ inst "${_src%/*}/.${_src##*/}.hmac" "${_target%/*}/.${_target##*/}.hmac"
fi
ddebug "Installing $_src"
- cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$target"
+ cp --reflink=auto --sparse=auto -pfL "$_src" "${initdir}/$_target"
}
# find symlinks linked to given library file

View File

@ -1,44 +0,0 @@
From 04569ec8da0a553a7e4dfd37ce1d62508e3441eb Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:09:45 +0200
Subject: [PATCH] dracut-functions.sh:inst_decompress() simplify function
---
dracut-functions.sh | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 273d2a5..9861bb7 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -773,7 +773,7 @@ inst_libdir_file() {
# Function install targets in the same paths inside overlay but decompressed
# and without extensions (.gz, .bz2).
inst_decompress() {
- local _src _dst _realsrc _realdst _cmd
+ local _src _cmd
for _src in $@
do
@@ -782,20 +782,7 @@ inst_decompress() {
*.bz2) _cmd='bzip2 -d' ;;
*) return 1 ;;
esac
-
- if [[ -L ${_src} ]]
- then
- _realsrc="$(readlink -f ${_src})" # symlink target with extension
- _dst="${_src%.*}" # symlink without extension
- _realdst="${_realsrc%.*}" # symlink target without extension
- mksubdirs "${initdir}/${_src}"
- # Create symlink without extension to target without extension.
- ln -sfn "${_realdst}" "${initdir}/${_dst}"
- fi
-
- # If the source is symlink we operate on its target.
- [[ ${_realsrc} ]] && _src=${_realsrc}
- inst ${_src}
+ inst_simple ${_src}
# Decompress with chosen tool. We assume that tool changes name e.g.
# from 'name.gz' to 'name'.
${_cmd} "${initdir}${_src}"

View File

@ -1,38 +0,0 @@
From 48e4a9a11c3d1ccd138e8a6dbea68010f47a1359 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:10:11 +0200
Subject: [PATCH] dracut-functions.sh:find_kernel_modules_by_path() use IFS=:
For modules.dep use simpler IFS=: to read the file.
---
dracut-functions.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 9861bb7..cecd59a 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1115,17 +1115,22 @@ for_each_kmod_dep() {
find_kernel_modules_by_path () (
+ local _OLDIFS
if ! [[ $hostonly ]]; then
+ _OLDIFS=$IFS
+ IFS=:
while read a rest; do
if [[ "${a##kernel}" != "$a" ]]; then
[[ "${a##kernel/$1}" != "$a" ]] || continue
fi
- echo $srcmods/${a%:}
+ echo $srcmods/$a
done < $srcmods/modules.dep
+ IFS=$_OLDIFS
else
( cd /sys/module; echo *; ) \
| xargs modinfo -F filename -k $kernel 2>/dev/null
fi
+ return 0
)
find_kernel_modules () {

View File

@ -1,39 +0,0 @@
From 8e41fb1dfd47f99d374bf7190344400e6bb1d018 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:13:47 +0200
Subject: [PATCH] dracut.sh: speedup "strip"
---
dracut.sh | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 5600ec0..cc3669a 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -844,7 +844,7 @@ fi
# strip binaries
if [[ $do_strip = yes ]] ; then
- for p in strip grep find; do
+ for p in strip xargs find; do
if ! type -P $p >/dev/null; then
derror "Could not find '$p'. You should run $0 with '--nostrip'."
do_strip=no
@@ -853,12 +853,10 @@ if [[ $do_strip = yes ]] ; then
fi
if [[ $do_strip = yes ]] ; then
- for f in $(find "$initdir" -type f \
- \( -perm -0100 -or -perm -0010 -or -perm -0001 \
- -or -path '*/lib/modules/*.ko' \) ); do
- dinfo "Stripping $f"
- strip -g "$f" 2>/dev/null|| :
- done
+ find "$initdir" -type f \
+ \( -perm -0100 -or -perm -0010 -or -perm -0001 \
+ -or -path '*/lib/modules/*.ko' \) -print0 \
+ | xargs -0 strip -g 2>/dev/null
fi
type hardlink &>/dev/null && {

View File

@ -1,23 +0,0 @@
From b5f5a081d1b6c4c1890a26e637b10234164ab388 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:14:27 +0200
Subject: [PATCH] profile.py: do not count negative timestamp differences
---
profile.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/profile.py b/profile.py
index e1d0cab..7f98a13 100644
--- a/profile.py
+++ b/profile.py
@@ -36,7 +36,8 @@ def gen_times(t):
fx=float(x[0])
if oldx:
#print fx - float(oldx[0]), x[0], x[1], oldx[0], oldx[1]
- yield (fx - float(oldx[0]), oldx[1])
+ if ((fx - float(oldx[0])) > 0):
+ yield (fx - float(oldx[0]), oldx[1])
oldx = x

View File

@ -1,84 +0,0 @@
From 8f01a6a775fe9599fa8171d9cca17fb1b3c990af Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:16:55 +0200
Subject: [PATCH] fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs
mount/umount check only costs time and we fail later anyway.
mount can take very long on large filesystems. Better fail on the real
mount.
---
modules.d/99fs-lib/fs-lib.sh | 58 +++---------------------------------------
1 file changed, 4 insertions(+), 54 deletions(-)
diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh
index 75bee92..d1b7a9d 100755
--- a/modules.d/99fs-lib/fs-lib.sh
+++ b/modules.d/99fs-lib/fs-lib.sh
@@ -80,63 +80,13 @@ fsck_able() {
# note: all drivers inherit: _drv _fop _dev
fsck_drv_xfs() {
- local _ret
-
- # fs must be cleanly mounted (and umounted) first, before attempting any
- # xfs tools - if this works, nothing else should be needed
- # note, that user is always dropped into the shell, if the filesystem is
- # not mountable or if -f flag is found among _fop
- mkdir -p /tmp/.xfs
-
- info "trying to mount $_dev"
- if mount -t xfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
- _ret=0
- info "xfs: $_dev is clean"
- umount "$_dev" >/dev/null 2>&1
- else
- _ret=4
- warn "*** $_dev is unmountable"
- fi
- if [ $_ret -gt 0 ] || strstr "$_fop" "-f"; then
- warn "*** Dropping you to a shell. You have"
- warn "*** xfs_repair and xfs_check (xfs_db) available."
- warn "*** Note that if xfs didn't mount properly, it's"
- warn "*** probably pretty serious condition."
- emergency_shell -n "(Repair filesystem)"
- fi
-
- rm -r /tmp/.xfs
- return $_ret
+ # xfs fsck is not necessary... Either it mounts or not
+ return 0
}
fsck_drv_btrfs() {
- local _ret
-
- # fs must be cleanly mounted (and umounted) first, before attempting any
- # btrfs tools - if this works, nothing else should be needed
- # note, that user is always dropped into the shell, if the filesystem is
- # not mountable or if -f flag is found among _fop
- mkdir -p /tmp/.btrfs
-
- info "trying to mount $_dev"
- if mount -t btrfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
- _ret=0
- info "btrfs: $_dev is clean"
- umount "$_dev" >/dev/null 2>&1
- else
- _ret=4
- warn "*** $_dev is unmountable"
- fi
- if [ $_ret -gt 0 ] || strstr "$_fop" "-f"; then
- warn "*** Dropping you to a shell. You have"
- warn "*** btrfsck available."
- warn "*** Note that if btrfs didn't mount properly, it's"
- warn "*** probably pretty serious condition."
- emergency_shell -n "(Repair filesystem)"
- fi
-
- rm -r /tmp/.btrfs
- return $_ret
+ # btrfs fsck is not necessary... Either it mounts or not
+ return 0
}

View File

@ -1,43 +0,0 @@
From 9d6458faa41039b6e63cf08bc60fc4660563597d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:18:45 +0200
Subject: [PATCH] base/module-setup.sh: use --force for ln
---
modules.d/99base/module-setup.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 96c18ab..75afa72 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -24,6 +24,7 @@ install() {
#add common users in /etc/passwd, it will be used by nfs/ssh currently
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 our scripts and hooks
inst "$moddir/init.sh" "/init"
inst "$moddir/initqueue.sh" "/sbin/initqueue"
@@ -43,12 +44,12 @@ install() {
mkdir -p "${initdir}/var"
[ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp
if [[ $realinitpath ]]; then
- for i in $realinitpath; do
+ for i in $realinitpath; do
echo "rd.distroinit=$i"
done > "${initdir}/etc/cmdline.d/distroinit.conf"
fi
- ln -s /proc/self/mounts "$initdir/etc/mtab"
+ ln -fs /proc/self/mounts "$initdir/etc/mtab"
if [ -e /etc/os-release ]; then
. /etc/os-release
@@ -74,5 +75,5 @@ install() {
echo ANSI_COLOR=\"$ANSI_COLOR\"
} > $initdir/etc/initrd-release
echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION
- ln -s initrd-release $initdir/etc/os-release
+ ln -sf initrd-release $initdir/etc/os-release
}

View File

@ -1,25 +0,0 @@
From af83b70cf27150d981844f508b55d50dd0cbc6c1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:19:32 +0200
Subject: [PATCH] systemd/module-setup.sh: only create empty machine-id if non
existing
---
modules.d/98systemd/module-setup.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index a6e2365..206f341 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -101,7 +101,9 @@ install() {
/etc/vconsole.conf \
/etc/locale.conf
else
- > "$initdir/etc/machine-id"
+ if ! [[ -e "$initdir/etc/machine-id" ]]; then
+ > "$initdir/etc/machine-id"
+ fi
fi
ln -fs $systemdutildir/systemd "$initdir/init"

View File

@ -1,50 +0,0 @@
From 5e7bff1fee8f98a8444be56ca8b206ee32962a62 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:20:06 +0200
Subject: [PATCH] systemd/module-setup.sh: ln with --force
---
modules.d/98systemd/module-setup.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index 206f341..338f14d 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -116,30 +116,30 @@ install() {
inst "$moddir/initrd-switch-root.target" ${systemdsystemunitdir}/initrd-switch-root.target
inst "$moddir/initrd-switch-root.service" ${systemdsystemunitdir}/initrd-switch-root.service
- ln -s basic.target "${initdir}${systemdsystemunitdir}/default.target"
+ ln -fs basic.target "${initdir}${systemdsystemunitdir}/default.target"
mkdir -p "${initdir}${systemdsystemunitdir}/basic.target.wants"
inst "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
inst "$moddir/dracut-cmdline.service" ${systemdsystemunitdir}/dracut-cmdline.service
- ln -s ../dracut-cmdline.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-cmdline.service"
+ ln -fs ../dracut-cmdline.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-cmdline.service"
inst "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
inst "$moddir/dracut-pre-udev.service" ${systemdsystemunitdir}/dracut-pre-udev.service
- ln -s ../dracut-pre-udev.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-udev.service"
+ ln -fs ../dracut-pre-udev.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-udev.service"
inst "$moddir/dracut-pre-trigger.sh" /bin/dracut-pre-trigger
inst "$moddir/dracut-pre-trigger.service" ${systemdsystemunitdir}/dracut-pre-trigger.service
- ln -s ../dracut-pre-trigger.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-trigger.service"
+ ln -fs ../dracut-pre-trigger.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-pre-trigger.service"
inst "$moddir/dracut-initqueue.sh" /bin/dracut-initqueue
inst "$moddir/dracut-initqueue.service" ${systemdsystemunitdir}/dracut-initqueue.service
- ln -s ../dracut-initqueue.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-initqueue.service"
+ ln -fs ../dracut-initqueue.service "${initdir}${systemdsystemunitdir}/basic.target.wants/dracut-initqueue.service"
inst "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot
inst "$moddir/dracut-pre-pivot.service" ${systemdsystemunitdir}/dracut-pre-pivot.service
mkdir -p "${initdir}${systemdsystemunitdir}/initrd-switch-root.target.wants"
- ln -s ../dracut-pre-pivot.service "${initdir}${systemdsystemunitdir}/initrd-switch-root.target.wants/dracut-pre-pivot.service"
+ ln -fs ../dracut-pre-pivot.service "${initdir}${systemdsystemunitdir}/initrd-switch-root.target.wants/dracut-pre-pivot.service"
}

View File

@ -1,26 +0,0 @@
From 0dd85327dfbb788a5b23820a7413c4e1e96deafe Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:21:11 +0200
Subject: [PATCH] i18n/module-setup.sh:install_all_kbd(): speedup install
---
modules.d/10i18n/module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
index d1854c2..7c8cd66 100755
--- a/modules.d/10i18n/module-setup.sh
+++ b/modules.d/10i18n/module-setup.sh
@@ -92,9 +92,9 @@ install() {
install_all_kbd() {
local rel f
- find $(eval echo ${kbddir}/{${KBDSUBDIRS}}) -type f -print | \
- while read f; do
- inst_simple $f
+ for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
+ inst_dir "$_src"
+ cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src%/*}" "$_src"
done
# remove unnecessary files

View File

@ -1,21 +0,0 @@
From 07a8e55f418f9362f074eb4de59070e297f54fd6 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:23:56 +0200
Subject: [PATCH] bootchart/module-setup.sh: no need for mknod anymore
---
modules.d/00bootchart/module-setup.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/modules.d/00bootchart/module-setup.sh b/modules.d/00bootchart/module-setup.sh
index 17dd137..a2a2c00 100755
--- a/modules.d/00bootchart/module-setup.sh
+++ b/modules.d/00bootchart/module-setup.sh
@@ -25,7 +25,5 @@ install() {
inst /bin/grep
inst /bin/usleep
inst /usr/bin/[ /bin/[
-
- mknod -m 0666 "${initdir}/dev/null" c 1 3
}

View File

@ -1,62 +0,0 @@
From 070433429368aa721af68a250279483dea0b19fd Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:27:40 +0200
Subject: [PATCH] no more "mknod" in the initramfs!!
---
modules.d/50gensplash/gensplash-pretrigger.sh | 4 ----
modules.d/50plymouth/plymouth-pretrigger.sh | 6 ------
modules.d/99base/init.sh | 2 --
3 files changed, 12 deletions(-)
diff --git a/modules.d/50gensplash/gensplash-pretrigger.sh b/modules.d/50gensplash/gensplash-pretrigger.sh
index 074aa78..b697438 100755
--- a/modules.d/50gensplash/gensplash-pretrigger.sh
+++ b/modules.d/50gensplash/gensplash-pretrigger.sh
@@ -3,10 +3,6 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
if getargbool 1 rd.splash -n rd_NO_SPLASH; then
- [ -c /dev/null ] || mknod /dev/null c 1 3
- [ -c /dev/console ] || mknod /dev/console c 5 1
- [ -c /dev/tty0 ] || mknod /dev/tty0 c 4 0
-
info "Starting Gentoo Splash"
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
diff --git a/modules.d/50plymouth/plymouth-pretrigger.sh b/modules.d/50plymouth/plymouth-pretrigger.sh
index 483cc70..5cc9112 100755
--- a/modules.d/50plymouth/plymouth-pretrigger.sh
+++ b/modules.d/50plymouth/plymouth-pretrigger.sh
@@ -4,18 +4,12 @@
if [ -x /bin/plymouthd ]; then
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
- [ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
# first trigger graphics subsystem
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
# first trigger graphics and tty subsystem
udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
udevadm settle --timeout=30 2>&1 | vinfo
- [ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
- [ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
- [ -e /dev/systty ] || ln -s tty0 /dev/systty
- [ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
- [ -e /dev/fb ] || ln -s fb0 /dev/fb
info "Starting plymouth daemon"
mkdir -m 0755 /run/plymouth
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 5c693e4..d395a99 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -22,8 +22,6 @@ RD_DEBUG=""
trap "emergency_shell Signal caught!" 0
-[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
-
# mount some important things
[ ! -d /proc/self ] && \
mount -t proc -o nosuid,noexec,nodev proc /proc >/dev/null 2>&1

View File

@ -1,22 +0,0 @@
From 8148fd4a73345449828198396cb9d149f8f3dc6b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:28:23 +0200
Subject: [PATCH] udev-rules/module-setup.sh: ln with --force
---
modules.d/95udev-rules/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
index a48b0cb..f98de57 100755
--- a/modules.d/95udev-rules/module-setup.sh
+++ b/modules.d/95udev-rules/module-setup.sh
@@ -15,7 +15,7 @@ install() {
inst "$_i"
if ! [[ -f ${initdir}/lib/systemd/systemd-udevd ]]; then
- ln -s "$_i" ${initdir}/lib/systemd/systemd-udevd
+ ln -fs "$_i" ${initdir}/lib/systemd/systemd-udevd
fi
break
done

View File

@ -1,25 +0,0 @@
From cb8d852cdcfda3774a0c5aee15dd85511ab21fa1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:29:04 +0200
Subject: [PATCH] terminfo/module-setup.sh: speedup install() of all terminfo
---
modules.d/95terminfo/module-setup.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/modules.d/95terminfo/module-setup.sh b/modules.d/95terminfo/module-setup.sh
index 32a3fe9..e1914a5 100755
--- a/modules.d/95terminfo/module-setup.sh
+++ b/modules.d/95terminfo/module-setup.sh
@@ -10,9 +10,7 @@ install() {
done
if [ -d ${_terminfodir} ]; then
- for f in ${_terminfodir}/*/*; do
- inst_simple $f
- done
+ inst_dir "$_terminfodir"
+ cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_terminfodir%/*}" "$_terminfodir"
fi
}
-

View File

@ -1,45 +0,0 @@
From fe9bb86bb2d34cbcde7970a0b5a24fffa4e8404e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:24:28 +0200
Subject: [PATCH] network/module-setup.sh: fixed installkernel() return code
---
modules.d/40network/module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index a8efbc5..6077f53 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -4,7 +4,6 @@
check() {
local _program
- . $dracutfunctions
for _program in ip arping dhclient ; do
if ! type -P $_program >/dev/null; then
@@ -43,6 +42,7 @@ installkernel() {
&& ! $_fcont =~ iw_handler_get_spy ]] \
&& echo "$_fname"
done
+ return 0
}
function rotor() {
local _f1 _f2
@@ -52,13 +52,13 @@ installkernel() {
echo "$_f2" 1>&${_side2}
fi
done | nmf1 1>&${_merge}
+ return 0
}
# Use two parallel streams to filter alternating modules.
set +x
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
- _ret=$?
[[ $debug ]] && set -x
- return $_ret
+ return 0
}
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \

View File

@ -1,61 +0,0 @@
From 483e770b4302fc7e3384982657500221e0ec327d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:30:58 +0200
Subject: [PATCH] iscsi/module-setup.sh: speedup installkernel()
---
modules.d/95iscsi/module-setup.sh | 40 ++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index fefc240..5f935d7 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -41,16 +41,38 @@ installkernel() {
instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
iscsi_module_filter() {
- local _iscsifuncs='iscsi_register_transport'
- local _f
- while read _f; do case "$_f" in
- *.ko) [[ $(< $_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
- *.ko.gz) [[ $(gzip -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
- *.ko.xz) [[ $(xz -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
- esac
- done
- return 0;
+ local _funcs='iscsi_register_transport'
+ # subfunctions inherit following FDs
+ local _merge=8 _side2=9
+ function bmf1() {
+ local _f
+ while read _f; do
+ case "$_f" in
+ *.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
+ *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+ *.ko.xz) [[ $(xz -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+ esac
+ done
+ return 0
+ }
+
+ function rotor() {
+ local _f1 _f2
+ while read _f1; do
+ echo "$_f1"
+ if read _f2; then
+ echo "$_f2" 1>&${_side2}
+ fi
+ done | bmf1 1>&${_merge}
+ return 0
+ }
+ # Use two parallel streams to filter alternating modules.
+ set +x
+ eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
+ [[ $debug ]] && set -x
+ return 0
}
+
{ find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \
| iscsi_module_filter | instmods
}

View File

@ -1,24 +0,0 @@
From efeea5257568523d45b0f873579c4d16f7631c9a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:31:26 +0200
Subject: [PATCH] plymouth/module-setup.sh:installkernel() fix return code
---
modules.d/50plymouth/module-setup.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/50plymouth/module-setup.sh b/modules.d/50plymouth/module-setup.sh
index 69f1bc7..616d9b2 100755
--- a/modules.d/50plymouth/module-setup.sh
+++ b/modules.d/50plymouth/module-setup.sh
@@ -45,9 +45,8 @@ installkernel() {
# Use two parallel streams to filter alternating modules.
set +x
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
- _ret=$?
[[ $debug ]] && set -x
- return $_ret
+ return 0
}
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \

View File

@ -1,38 +0,0 @@
From 0663a883d77149b505cb08671d2ebd054eb5bc28 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:32:15 +0200
Subject: [PATCH] kernel-modules/module-setup.sh:installkernel() fix return
code
---
modules.d/90kernel-modules/module-setup.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh
index 1d39c85..08f745a 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -16,6 +16,7 @@ installkernel() {
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
esac
done
+ return 0
}
function rotor() {
local _f1 _f2
@@ -25,12 +26,15 @@ installkernel() {
echo "$_f2" 1>&${_side2}
fi
done | bmf1 1>&${_merge}
+ return 0
}
# Use two parallel streams to filter alternating modules.
set +x
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
[[ $debug ]] && set -x
+ return 0
}
+
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc ata_piix
hostonly='' instmods pcmcia firewire-ohci
hostonly='' instmods usb_storage sdhci sdhci-pci

View File

@ -1,68 +0,0 @@
From 7997d8764313d5dc10689e3b6bbdde3dcc373498 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:33:15 +0200
Subject: [PATCH] multipath/module-setup.sh:installkernel() fix return code
---
modules.d/90multipath/module-setup.sh | 43 ++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 0e8857c..8791560 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -32,23 +32,42 @@ depends() {
installkernel() {
local _ret
- set +x
+ local _arch=$(uname -m)
mp_mod_filter() {
- local _mpfuncs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
- local _f
- while read _f; do case "$_f" in
- *.ko) [[ $(< $_f) =~ $_mpfuncs ]] && echo "$_f" ;;
- *.ko.gz) [[ $(gzip -dc <$_f) =~ $_mpfuncs ]] && echo "$_f" ;;
- *.ko.xz) [[ $(xz -dc <$_f) =~ $_mpfuncs ]] && echo "$_f" ;;
- esac
- done
+ local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
+ # subfunctions inherit following FDs
+ local _merge=8 _side2=9
+ function bmf1() {
+ local _f
+ while read _f; do
+ case "$_f" in
+ *.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
+ *.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+ *.ko.xz) [[ $(xz -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
+ esac
+ done
+ return 0
+ }
+
+ function rotor() {
+ local _f1 _f2
+ while read _f1; do
+ echo "$_f1"
+ if read _f2; then
+ echo "$_f2" 1>&${_side2}
+ fi
+ done | bmf1 1>&${_merge}
+ return 0
+ }
+ # Use two parallel streams to filter alternating modules.
+ set +x
+ eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
+ [[ $debug ]] && set -x
+ return 0
}
( find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | instmods
- _ret=$?
- [[ $debug ]] && set -x
- return $_ret
}
install() {

View File

@ -1,127 +0,0 @@
From 6a767ee403095cdeb67b7cb5f69e8586ad19650a Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:33:42 +0200
Subject: [PATCH] modules.d/*/module-setup.sh: no more sourcing of
dracutfunctions
---
modules.d/90btrfs/module-setup.sh | 3 ---
modules.d/90crypt/module-setup.sh | 2 --
modules.d/90dmraid/module-setup.sh | 3 ---
modules.d/90lvm/module-setup.sh | 3 ---
modules.d/90mdraid/module-setup.sh | 3 ---
modules.d/90multipath/module-setup.sh | 3 ---
modules.d/95iscsi/module-setup.sh | 4 ----
modules.d/95nbd/module-setup.sh | 1 -
8 files changed, 22 deletions(-)
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
index 135abc6..7d8fae0 100755
--- a/modules.d/90btrfs/module-setup.sh
+++ b/modules.d/90btrfs/module-setup.sh
@@ -8,9 +8,6 @@ check() {
# no point in trying to support it in the initramfs.
type -P btrfs >/dev/null || return 1
- . $dracutfunctions
- [[ $debug ]] && set -x
-
[[ $hostonly ]] || [[ $mount_needs ]] && {
local _found
for fs in ${host_fs_types[@]}; do
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 5082434..16d6f89 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -7,8 +7,6 @@ check() {
# if cryptsetup is not installed, then we cannot support encrypted devices.
type -P cryptsetup >/dev/null || return 1
- . $dracutfunctions
-
check_crypt() {
local dev=$1 fs=$2
[[ $fs = "crypto_LUKS" ]] || return 1
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index 5ce7051..dad54a4 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -8,9 +8,6 @@ check() {
# in trying to support it in the initramfs.
type -P dmraid >/dev/null || return 1
- . $dracutfunctions
- [[ $debug ]] && set -x
-
check_dmraid() {
local dev=$1 fs=$2 holder DEVPATH DM_NAME
[[ "$fs" = "${fs%%_raid_member}" ]] && return 1
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 2ce5c50..5182b79 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -7,9 +7,6 @@ check() {
# No point trying to support lvm if the binaries are missing
type -P lvm >/dev/null || return 1
- . $dracutfunctions
- [[ $debug ]] && set -x
-
check_lvm() {
local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
eval $(udevadm info --query=property --name=$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index 350aff8..56f881e 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -7,9 +7,6 @@ check() {
# No mdadm? No mdraid support.
type -P mdadm >/dev/null || return 1
- . $dracutfunctions
- [[ $debug ]] && set -x
-
check_mdraid() {
local dev=$1 fs=$2 holder DEVPATH MD_UUID
[[ "$fs" = "${fs%%_raid_member}" ]] && return 1
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 8791560..bfa4bf8 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -7,9 +7,6 @@ check() {
# if there's no multipath binary, no go.
type -P multipath >/dev/null || return 1
- . $dracutfunctions
- [[ $debug ]] && set -x
-
is_mpath() {
local _dev
_dev=$(get_maj_min $1)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 5f935d7..1787f92 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -10,10 +10,6 @@ check() {
# If hostonly was requested, fail the check if we are not actually
# booting from root.
- . $dracutfunctions
-
- [[ $debug ]] && set -x
-
is_iscsi() (
local _dev
_dev=$(get_maj_min $1)
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh
index c0f71cc..092aade 100755
--- a/modules.d/95nbd/module-setup.sh
+++ b/modules.d/95nbd/module-setup.sh
@@ -11,7 +11,6 @@ check() {
# mounted on, fail the hostonly check.
[[ $hostonly ]] || [[ $mount_needs ]] && {
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
- . $dracutfunctions
_rootdev=$(find_root_block_device)
[[ -b /dev/block/$_rootdev ]] || return 1

View File

@ -1,80 +0,0 @@
From 6f006ae0c1efbbb90d00cbb340001e74d8d12db1 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:34:24 +0200
Subject: [PATCH] dracut-logger.sh: use (( )) for numeric comparisons
---
dracut-logger.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dracut-logger.sh b/dracut-logger.sh
index f1b3a7e..a78e18e 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -116,7 +116,7 @@ dlog_init() {
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
- elif [ $fileloglvl -gt 0 ]; then
+ elif (( $fileloglvl >= 0 )); then
__oldumask=$(umask)
umask 0377
! [ -e "$logfile" ] && >"$logfile"
@@ -138,7 +138,7 @@ dlog_init() {
fi
fi
- if [ $sysloglvl -gt 0 ]; then
+ if (( $sysloglvl >= 0 )); then
if ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null
then
# We cannot log to syslog, so turn this facility off.
@@ -148,7 +148,7 @@ dlog_init() {
fi
fi
- if [ $sysloglvl -gt 0 -o $kmsgloglvl -gt 0 ]; then
+ if (($sysloglvl >= 0)) || (($kmsgloglvl >= 0 )); then
if [ -n "$dracutbasedir" ]; then
readonly syslogfacility=user
else
@@ -159,7 +159,7 @@ dlog_init() {
local lvl; local maxloglvl_l=0
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
- [ $lvl -gt $maxloglvl_l ] && maxloglvl_l=$lvl
+ (( $lvl > $maxloglvl_l )) && maxloglvl_l=$lvl
done
readonly maxloglvl=$maxloglvl_l
export maxloglvl
@@ -275,14 +275,14 @@ _do_dlog() {
local lvlc=$(_lvl2char "$lvl") || return 0
local msg="$lvlc: $*"
- [ $lvl -le $stdloglvl ] && echo "$msg" >&2
- if [ $lvl -le $sysloglvl ]; then
+ (( $lvl <= $stdloglvl )) && echo "$msg" >&2
+ if (( $lvl <= $sysloglvl )); then
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
fi
- if [ $lvl -le $fileloglvl -a -w "$logfile" -a -f "$logfile" ]; then
+ if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
echo "$msg" >>"$logfile"
fi
- [ $lvl -le $kmsgloglvl ] && \
+ (( $lvl <= $kmsgloglvl )) && \
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
}
@@ -304,9 +304,9 @@ _do_dlog() {
# echo "This is a warning" | dwarn
dlog() {
[ -z "$maxloglvl" ] && return 0
- [ $1 -le $maxloglvl ] || return 0
+ (( $1 <= $maxloglvl )) || return 0
- if [ $# -gt 1 ]; then
+ if (( $# > 1 )); then
_do_dlog "$@"
else
while read line; do

View File

@ -1,54 +0,0 @@
From a790a8b395b3baddddd099769f3f29c72b29799b Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:35:09 +0200
Subject: [PATCH] dracut-logger.sh: empty functions for log funcs, which are
below level
---
dracut-logger.sh | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/dracut-logger.sh b/dracut-logger.sh
index a78e18e..dbe26ee 100755
--- a/dracut-logger.sh
+++ b/dracut-logger.sh
@@ -164,6 +164,39 @@ dlog_init() {
readonly maxloglvl=$maxloglvl_l
export maxloglvl
+
+ if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)); then
+ unset dtrace
+ dtrace() { :; };
+ fi
+
+ if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)); then
+ unset ddebug
+ ddebug() { :; };
+ fi
+
+ if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)); then
+ unset dinfo
+ dinfo() { :; };
+ fi
+
+ if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)); then
+ unset dwarn
+ dwarn() { :; };
+ unset dwarning
+ dwarning() { :; };
+ fi
+
+ if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)); then
+ unset derror
+ derror() { :; };
+ fi
+
+ if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)); then
+ unset dfatal
+ dfatal() { :; };
+ fi
+
[ -n "$errmsg" ] && derror "$errmsg"
return $ret

View File

@ -1,27 +0,0 @@
From fabe8a8c29ff657e29f3c33bf6c564cfd0ee613f Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 22 Jun 2012 15:49:25 +0200
Subject: [PATCH] dracut.sh: do not copy devices nodes, mknod them
---
dracut.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index cc3669a..0fb0a18 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -714,10 +714,9 @@ if [[ $kernel_only != yes ]]; then
mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d
done
if [[ "$UID" = "0" ]]; then
- for i in /dev/kmsg /dev/null /dev/console; do
- [ -e $i ] || continue
- cp -a $i $initdir/dev
- done
+ [ -c ${initdir}/dev/null ] || mknod ${initdir}/dev/null c 1 3
+ [ -c ${initdir}/dev/kmsg ] || mknod ${initdir}/dev/kmsg c 1 11
+ [ -c ${initdir}/dev/console ] || mknod ${initdir}/dev/console c 5 1
fi
fi

View File

@ -1,11 +0,0 @@
--- dracut-019/modules.d/90kernel-modules/module-setup.sh.orig 2012-06-05 14:48:37.805013809 -0500
+++ dracut-019/modules.d/90kernel-modules/module-setup.sh 2012-06-05 14:48:58.704142946 -0500
@@ -36,7 +36,7 @@
hostonly='' instmods usb_storage sdhci sdhci-pci
# arm specific modules
- hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap sdhci_dove ahci_platform pata_imx sata_mv
+ hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap sdhci_dove ahci_platform pata_imx sata_mv omapdrm
# install keyboard support
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd

View File

@ -9,8 +9,8 @@
%endif %endif
Name: dracut Name: dracut
Version: 019 Version: 020
Release: 92.git20120625%{?dist} Release: 1%{?dist}
Summary: Initramfs generator using udev Summary: Initramfs generator using udev
%if 0%{?fedora} || 0%{?rhel} %if 0%{?fedora} || 0%{?rhel}
@ -24,100 +24,8 @@ URL: https://dracut.wiki.kernel.org/
# Source can be generated by # Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz # 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 Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
Patch1: 0001-get-rid-of-libdir-and-usrlibdir.patch
Patch2: 0002-dasd_mod-change-rd.dasd-to-dasd_mod-kernel-parameter.patch
Patch3: 0003-kernel-modules-module-setup.sh-include-omapdrm-in-th.patch
Patch4: 0004-Avoid-annonying-warnings-when-pkg-config-is-not-inst.patch
Patch5: 0005-make-udevdir-systemdutildir-systemdsystemunitdir-glo.patch
Patch6: 0006-modules-are-now-only-handled-with-sys-modules-and-mo.patch
Patch7: 0007-systemd-strip-down-the-installation-of-some-unused-t.patch
Patch8: 0008-network-ifup.sh-do-not-default-to-dhcp-for-interface.patch
Patch9: 0009-systemd-dracut-initqueue.sh-remove-pre-trigger-sourc.patch
Patch10: 0010-mdraid-md-shutdown.sh-wait-until-md-devices-are-clea.patch
Patch11: 0011-s-Unable-to-process-initqueue-Could-not-boot-g.patch
Patch12: 0012-dracut.sh-mkdir-of-libdirs-at-then-end.patch
Patch13: 0013-dm-check-for-presence-of-dmsetup.patch
Patch14: 0014-mdraid-md-shutdown.sh-check-for-presence-of-mdadm.patch
Patch15: 0015-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch
Patch16: 0016-dracut.sh-mkdir-initdir-lib-dracut.patch
Patch17: 0017-fix-ifup-for-static-ipv6.patch
Patch18: 0018-ifcfg-fix-output-for-ipv6-static-addressing.patch
Patch19: 0019-add-PARTUUID-as-root-PARTUUID-partition-uuid-paramet.patch
Patch20: 0020-Debian-multiarch-support.patch
Patch21: 0021-dracut-functions.sh-fixup-inst_libdir_file-again.patch
Patch22: 0022-dracut.sh-output-unknown-argument.patch
Patch23: 0023-dracut.sh-unset-some-variables.patch
Patch24: 0024-nfs-extend-libnss-wildcard.patch
Patch25: 0025-TEST-50-MULTINIC-install-correct-nss-libs.patch
Patch26: 0026-Revert-network-ifup.sh-default-to-dhcp-for-BOOTIF.patch
Patch27: 0027-Revert-network-ifup.sh-do-not-default-to-dhcp-for-in.patch
Patch28: 0028-resolve-conflict-between-cms-network-rules-and-defau.patch
Patch29: 0029-fixed-instmods-return-code-and-set-pipefail-globally.patch
Patch30: 0030-Set-some-global-variables-in-dracut-functions.sh.patch
Patch31: 0031-iscsi-module-setup.sh-only-install-s390-driver-on-s3.patch
Patch32: 0032-plymouth-fixed-inst_libdir_file-call.patch
Patch33: 0033-add-04watchdog-dracut-module.patch
Patch34: 0034-TEST-01-BASIC-add-watchdog.patch
Patch35: 0035-TEST-20-NFS-add-watchdog.patch
Patch36: 0036-TEST-50-MULTINIC-add-watchdog.patch
Patch37: 0037-TEST-20-NFS-libnss-cleanup.patch
Patch38: 0038-TEST-50-MULTINIC-libnss-cleanup.patch
Patch39: 0039-disable-TEST-16-DMSQUASH-for-now.patch
Patch40: 0040-check-for-arch-before-installing-drivers-s390.patch
Patch41: 0041-dracut-shutdown.service-fixed-ordering-to-be-before-.patch
Patch42: 0042-systemd-output-all-service-output-to-the-journal-als.patch
Patch43: 0043-systemd-module-setup.sh-add-old-udev-systemd-service.patch
Patch44: 0044-systemd-fix-emergency.service-and-rescue.service.patch
Patch45: 0045-systemd-do-not-redirect-to-dev-console.patch
Patch46: 0046-systemd-do-not-flock-for-console.patch
Patch47: 0047-systemd-dracut-pre-pivot.sh-stop-old-udev-services.patch
Patch48: 0048-systemd-dracut-cmdline-make-dracut-cmdline-a-service.patch
Patch49: 0049-systemd-dracut-pre-pivot.sh-remove-trailing-space.patch
Patch50: 0050-systemd-dracut-pre-udev.service-fixed-description.patch
Patch51: 0051-systemd-fixed-ordering-of-services.patch
Patch52: 0052-systemd-fixed-I-O-of-services.patch
Patch53: 0053-base-dracut-lib.sh-change-output-of-info-and-warn-fo.patch
Patch54: 0054-base-dracut-lib.sh-for-systemd-start-emergency.servi.patch
Patch55: 0055-dracut.conf.d-fedora.conf.example-make-systemd-defau.patch
Patch56: 0056-dracut.spec-require-systemd-44-15.patch
Patch57: 0057-dracut-functions.sh-use-ln-r-instead-of-shell-functi.patch
Patch58: 0058-systemd-remove-unneeded-systemd-services.patch
Patch59: 0059-fixed-i18n-for-systemd-and-include-more-config-files.patch
Patch60: 0060-systemd-remove-old-udev-services.patch
Patch61: 0061-systemd-dracut-pre-pivot.sh-copy-service-files-to-ru.patch
Patch62: 0062-network-support-vlan-tagged-bonding.patch
Patch63: 0063-systemd-emergency.service-remove-Type-idle.patch
Patch64: 0064-systemd-add-ConditionPathExists-etc-initrd-release-t.patch
Patch65: 0065-dracut-functions.sh-replace-strstr.patch
Patch66: 0066-dracut-functions.sh-mksubdirs-check-for-dir-existenc.patch
Patch67: 0067-dracut-functions.sh-cp-with-reflink-auto-and-sparse-.patch
Patch68: 0068-Add-qemu-kernel-modules-if-we-detect-a-qemu-instance.patch
Patch69: 0069-dracut-functions.sh-inst_simple-do-inst_symlink-for-.patch
Patch70: 0070-dracut-functions.sh-inst_decompress-simplify-functio.patch
Patch71: 0071-dracut-functions.sh-find_kernel_modules_by_path-use-.patch
Patch72: 0072-dracut.sh-speedup-strip.patch
Patch73: 0073-profile.py-do-not-count-negative-timestamp-differenc.patch
Patch74: 0074-fs-lib-fs-lib.sh-removed-test-mounting-of-btrfs-and-.patch
Patch75: 0075-base-module-setup.sh-use-force-for-ln.patch
Patch76: 0076-systemd-module-setup.sh-only-create-empty-machine-id.patch
Patch77: 0077-systemd-module-setup.sh-ln-with-force.patch
Patch78: 0078-i18n-module-setup.sh-install_all_kbd-speedup-install.patch
Patch79: 0079-bootchart-module-setup.sh-no-need-for-mknod-anymore.patch
Patch80: 0080-no-more-mknod-in-the-initramfs.patch
Patch81: 0081-udev-rules-module-setup.sh-ln-with-force.patch
Patch82: 0082-terminfo-module-setup.sh-speedup-install-of-all-term.patch
Patch83: 0083-network-module-setup.sh-fixed-installkernel-return-c.patch
Patch84: 0084-iscsi-module-setup.sh-speedup-installkernel.patch
Patch85: 0085-plymouth-module-setup.sh-installkernel-fix-return-co.patch
Patch86: 0086-kernel-modules-module-setup.sh-installkernel-fix-ret.patch
Patch87: 0087-multipath-module-setup.sh-installkernel-fix-return-c.patch
Patch88: 0088-modules.d-module-setup.sh-no-more-sourcing-of-dracut.patch
Patch89: 0089-dracut-logger.sh-use-for-numeric-comparisons.patch
Patch90: 0090-dracut-logger.sh-empty-functions-for-log-funcs-which.patch
Patch91: 0091-dracut.sh-do-not-copy-devices-nodes-mknod-them.patch
BuildArch: noarch
BuildRequires: dash bash git BuildRequires: dash bash git
%if 0%{?fedora} || 0%{?rhel} %if 0%{?fedora} || 0%{?rhel}
@ -328,6 +236,7 @@ rm -rf $RPM_BUILD_ROOT
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999 %if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd %{_bindir}/mkinitrd
%{_bindir}/lsinitrd %{_bindir}/lsinitrd
%{_bindir}/dracut-install
%endif %endif
%dir %{dracutlibdir} %dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d %dir %{dracutlibdir}/modules.d
@ -438,6 +347,11 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/lib/dracut/overlay %dir /var/lib/dracut/overlay
%changelog %changelog
* Fri Jun 29 2012 Harald Hoyer <harald@redhat.com> 020-1
- version 020
- new /usr/bin/dracut-install tool
- major speedup of the image creation
* Mon Jun 25 2012 Harald Hoyer <harald@redhat.com> 019-92.git20120625 * Mon Jun 25 2012 Harald Hoyer <harald@redhat.com> 019-92.git20120625
- support vlan tagged binding - support vlan tagged binding
- speedup initramfs emergency service - speedup initramfs emergency service

View File

@ -1 +1 @@
826f6a475e36faec875db3bfe2e446c3 dracut-019.tar.bz2 cc05586b1d8f9ed7895adf13e9834690 dracut-020.tar.bz2