* [PATCH 01/33] mkinitrd-suse: Update to sles12 SUSE state
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 02/33] Update dracut manpage for GRUB Legacy and GRUB2 Thomas Renninger
` (31 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
Incorporates these patches:
- 0013 mkinitrd-suse: do not update bootloader if no kernel was found
bnc#858268
- 0018 mkinitrd-suse: Fix whitespaces when adding drivers
- 0032 mkinitrd-suse.sh: Use '--hostonly' and '--hostonly-cmdline' correctly
bnc#874000,bnc#874905,bnc#874363
- 0039 Remove --force parameter from mkinitrd
- 0041 mkinitd-suse: remove --hostonly and --hostonly-cmdline
Should be set via configuration files, not in the script itself.
- 0051 mkinitrd-suse: add 'update bootloader' message
- 0120 mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
bnc#886630
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
mkinitrd-suse.8.asc | 7 +++---
mkinitrd-suse.sh | 66 +++++++++++++++++++++++++----------------------------
2 files changed, 34 insertions(+), 39 deletions(-)
diff --git a/mkinitrd-suse.8.asc b/mkinitrd-suse.8.asc
index 9eb8fc9..cdb8e3a 100644
--- a/mkinitrd-suse.8.asc
+++ b/mkinitrd-suse.8.asc
@@ -76,7 +76,9 @@ OPTIONS
**-A**::
Create a so called "monster initrd" which includes all available
- features and modules.
+ features and modules. This calls dracut with --no-hostonly and
+ --no-hostonly-cmdline parameters internally, instead of the default
+ --hostonly and --hostonly-cmdline.
**-v, --verbose**::
increase verbosity level
@@ -85,9 +87,6 @@ OPTIONS
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
testing if you don’t want to clutter the system log.
-**--force**::
- overwrite existing initramfs file.
-
**--help**::
print a help message and exit.
diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh
index 23dc262..af42cbe 100755
--- a/mkinitrd-suse.sh
+++ b/mkinitrd-suse.sh
@@ -20,8 +20,6 @@
boot_dir="/boot"
quiet=0
-host_only=1
-force=0
logfile=/var/log/YaST2/mkinitrd.log
dracut_cmd=dracut
@@ -68,10 +66,7 @@ usage () {
$cmd " -j device Journal device"
$cmd " -D interface Run dhcp on the specified interface."
$cmd " -I interface Configure the specified interface statically."
- $cmd " -a acpi_dsdt Attach compiled ACPI DSDT (Differentiated"
- $cmd " System Description Table) to initrd. This"
- $cmd " replaces the DSDT of the BIOS. Defaults to"
- $cmd " the ACPI_DSDT variable in /etc/sysconfig/kernel."
+ $cmd " -a acpi_dsdt Obsolete, do not use."
$cmd " -s size Add splash animation and bootscreen to initrd."
[[ $1 = '-n' ]] && exit 0
@@ -204,8 +199,6 @@ default_kernel_images() {
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
- host_only=1
- force=1
}
while (($# > 0)); do
@@ -218,8 +211,6 @@ while (($# > 0)); do
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
- host_only=1
- force=1
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
@@ -261,7 +252,7 @@ while (($# > 0)); do
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
;;
-a) read_arg acpi_dsdt "$@" || shift $?
- echo "mkinitrd: custom DSDT not yet supported"
+ echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
exit 1
;;
-s) read_arg boot_splash "$@" || shift $?
@@ -275,7 +266,6 @@ while (($# > 0)); do
--version|-R)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
- --force) force=1;;
--quiet|-q) quiet=1;;
*) if [[ ! $targets ]]; then
targets=$1
@@ -289,15 +279,17 @@ while (($# > 0)); do
done
[[ $targets && $kernels ]] || default_kernel_images
-[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
+if [[ ! $targets || ! $kernels ]];then
+ error "No kernel found in $boot_dir"
+fi
# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
-[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly"
-[[ $force == 1 ]] && dracut_args="${dracut_args} --force"
+dracut_args="${dracut_args} --force"
+
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
@@ -306,11 +298,9 @@ if [ -f /etc/sysconfig/kernel ] ; then
. /etc/sysconfig/kernel
fi
[[ $module_list ]] || module_list="${INITRD_MODULES}"
-basicmodules="$basicmodules ${module_list}"
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
-[[ $acpi_dsdt ]] || acpi_dsdt="${ACPI_DSDT}"
+shopt -s extglob
-echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
@@ -320,28 +310,34 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
fi
kernel="${kernels[$i]}"
+ if is_xen_kernel $kernel $rootfs ; then
+ modules_all="${module_list} ${domu_module_list}"
+ else
+ modules_all="${module_list}"
+ fi
+
+ # Remove leading and trailing spaces needs (set above): shopt -s extglob
+ modules_all=${modules_all%%+([[:space:]])}
+ modules_all=${modules_all##+([[:space:]])}
+
+ echo "Creating initrd: $target"
+
# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
- echo "$target|$kernel|$dracut_args|$basicmodules"
- if is_xen_kernel $kernel $rootfs ; then
- basicmodules="$basicmodules ${domu_module_list}"
- fi
- if [[ $basicmodules ]]; then
- $dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
- "$kernel" &>/dev/null
- else
+ # Duplicate code: --force-drivers must not be called with empty string
+ # -> dracut bug workarounded ugly, because of complex whitespace
+ # expansion magics
+ if [ -n "${modules_all}" ];then
+ $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
+ else
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
- fi
+ fi
else
- if is_xen_kernel $kernel $rootfs ; then
- basicmodules="$basicmodules ${domu_module_list}"
- fi
- if [[ $basicmodules ]]; then
- $dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
- "$kernel"
- else
+ if [ -n "${modules_all}" ];then
+ $dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
+ else
$dracut_cmd $dracut_args "$target" "$kernel"
- fi
+ fi
fi
done
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 02/33] Update dracut manpage for GRUB Legacy and GRUB2
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 01/33] mkinitrd-suse: Update to sles12 SUSE state Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-3-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 03/33] 00warpclock: Set correct timezone Thomas Renninger
` (30 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, Shawn Dunn
From: Shawn Dunn <sfalken-stAJ6ESoqRxg9hUCZPvPmw@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.usage.asc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut.usage.asc b/dracut.usage.asc
index 9e788c1..1a79638 100644
--- a/dracut.usage.asc
+++ b/dracut.usage.asc
@@ -99,9 +99,9 @@ raid with encryption and LVM on top), as long as you specify the correct
filesystem LABEL or UUID on the kernel command line for your root device, dracut
will find it and boot from it.
-The kernel command line usually can be configured in _/boot/grub/grub.conf_ or
-_/boot/grub2/grub.cfg_, if grub is your bootloader and it also can be edited in
-the real boot process in the grub menu.
+The kernel command line usually can be configured in _/boot/grub/grub.conf_,
+for GRUB legacy, or _/boot/grub2/grub.cfg_, for GRUB2 if grub is your
+bootloader and it also can be edited in the real boot process in the grub menu.
The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 03/33] 00warpclock: Set correct timezone
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 01/33] mkinitrd-suse: Update to sles12 SUSE state Thomas Renninger
2014-11-20 14:56 ` [PATCH 02/33] Update dracut manpage for GRUB Legacy and GRUB2 Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-4-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 04/33] systemd always tries to load autofs4 Thomas Renninger
` (29 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Add module for setting correct timezone.
References: bnc#830060
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/00warpclock/module-setup.sh | 25 +++++++++++++++++++++++++
modules.d/00warpclock/warpclock.sh | 9 +++++++++
2 files changed, 34 insertions(+)
create mode 100755 modules.d/00warpclock/module-setup.sh
create mode 100755 modules.d/00warpclock/warpclock.sh
diff --git a/modules.d/00warpclock/module-setup.sh b/modules.d/00warpclock/module-setup.sh
new file mode 100755
index 0000000..6bd7abd
--- /dev/null
+++ b/modules.d/00warpclock/module-setup.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# called by dracut
+check() {
+ # hwclock does not exist on S390(x), bail out silently then
+ local _arch=$(uname -m)
+ [ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
+
+ [ -e /etc/localtime -a -e /etc/adjtime ] || return 1
+ require_binaries /sbin/hwclock || return 1
+}
+
+# called by dracut
+depends() {
+ return 0
+}
+
+# called by dracut
+install() {
+ inst /usr/share/zoneinfo/UTC
+ inst /etc/localtime
+ inst /etc/adjtime
+ inst_hook pre-trigger 00 "$moddir/warpclock.sh"
+ inst /sbin/hwclock
+}
diff --git a/modules.d/00warpclock/warpclock.sh b/modules.d/00warpclock/warpclock.sh
new file mode 100755
index 0000000..f64818c
--- /dev/null
+++ b/modules.d/00warpclock/warpclock.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if test -e /etc/adjtime ; then
+ while read line ; do
+ if test "$line" = LOCAL ; then
+ hwclock --systz
+ fi
+ done < /etc/adjtime
+fi
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 04/33] systemd always tries to load autofs4
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (2 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 03/33] 00warpclock: Set correct timezone Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 05/33] Fixup mdraid setup Thomas Renninger
` (28 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
During boot systemd tries to load autofs4, but dracut will only
add it if it's loaded by the time dracut is run.
Modify dracut to always load autofs4.
References: bnc#869411
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/98systemd/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
index bd4433e..045bf8b 100755
--- a/modules.d/98systemd/module-setup.sh
+++ b/modules.d/98systemd/module-setup.sh
@@ -18,7 +18,7 @@ depends() {
}
installkernel() {
- instmods autofs4 ipv6
+ hostonly='' instmods autofs4 ipv6
instmods -s efivarfs
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 05/33] Fixup mdraid setup
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (3 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 04/33] systemd always tries to load autofs4 Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 06/33] 95udev-rules: Include correct sg3_utils rules Thomas Renninger
` (27 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, NeilBrown
From: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
This sed script to edit 64-md-raid-assemble.rules needs to
be adjusted for latest mdadm
References: bnc#866660
Signed-off-by: NeilBrown <neilb-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90mdraid/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index bc4c514..ce3394a 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -86,7 +86,7 @@ install() {
for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do
rule_path="${initdir}${udevdir}/rules.d/${rule}"
[ -f "${rule_path}" ] && sed -i -r \
- -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
+ -e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
"${rule_path}"
done
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 06/33] 95udev-rules: Include correct sg3_utils rules
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (4 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 05/33] Fixup mdraid setup Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 07/33] 90multipath: install correct multipath rules Thomas Renninger
` (26 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
sg3_utils now provides two rules 55-scsi-sg3_id.rules and
58-scsi-sg3_symlink.rules, which need to be included instead
of the older 59-scsi-sg3_utils.rules.
References: bnc#873151
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95udev-rules/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95udev-rules/module-setup.sh b/modules.d/95udev-rules/module-setup.sh
index 9d6f960..e50709d 100755
--- a/modules.d/95udev-rules/module-setup.sh
+++ b/modules.d/95udev-rules/module-setup.sh
@@ -31,6 +31,7 @@ install() {
50-udev.rules 95-late.rules \
50-firmware.rules \
59-scsi-sg3_utils.rules \
+ 55-scsi-sg3_id.rules 58-scsi-sg3_symlink.rules \
70-uaccess.rules 71-seat.rules 73-seat-late.rules \
75-net-description.rules \
80-net-name-slot.rules 80-net-setup-link.rules \
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 07/33] 90multipath: install correct multipath rules
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (5 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 06/33] 95udev-rules: Include correct sg3_utils rules Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 08/33] 90multipath: Install libgcc_s library Thomas Renninger
` (25 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The multipath and kpartx rules have different numbers in SUSE.
The 11-dm-mpath.rules file had been missing, causing
blacklisting to not work properly.
References: bnc#873151, bnc#872662, bnc#883149
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90multipath/module-setup.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index c86c5d9..3c2e3a9 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -100,6 +100,9 @@ install() {
inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
- inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
+ inst_rules 40-multipath.rules 56-multipath.rules \
+ 62-multipath.rules 65-multipath.rules \
+ 66-kpartx.rules 67-kpartx-compat.rules \
+ 11-dm-mpath.rules
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 08/33] 90multipath: Install libgcc_s library
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (6 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 07/33] 90multipath: install correct multipath rules Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-9-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 09/33] 90multipath: Load device_handler modules early during boot Thomas Renninger
` (24 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
multipathd is using pthreads, which require libgcc_s for
pthread_cancel to work. Without it multipathd might crash
with SIGABRT.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90multipath/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 3c2e3a9..7a60b2e 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -87,6 +87,7 @@ install() {
inst $(command -v partx) /sbin/partx
inst_libdir_file "libmultipath*" "multipath/*"
+ inst_libdir_file 'libgcc_s.so*'
if dracut_module_included "systemd"; then
inst_multiple \
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 09/33] 90multipath: Load device_handler modules early during boot
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (7 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 08/33] 90multipath: Install libgcc_s library Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-10-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 10/33] 90multipath: install dracut-specific service file Thomas Renninger
` (23 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The device handler modules need to be loaded early during boot
to avoid I/O errors being printed to the system log.
References: bnc#871617
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90multipath/module-setup.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index 7a60b2e..bbee5d9 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -28,6 +28,15 @@ depends() {
}
# called by dracut
+cmdline() {
+ for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
+ if module_is_host_only $m ; then
+ printf 'rd.driver.pre=%s ' "$m"
+ fi
+ done
+}
+
+# called by dracut
installkernel() {
local _ret
local _arch=$(uname -m)
@@ -89,6 +98,11 @@ install() {
inst_libdir_file "libmultipath*" "multipath/*"
inst_libdir_file 'libgcc_s.so*'
+ if [[ $hostonly_cmdline ]] ; then
+ local _conf=$(cmdline)
+ [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf"
+ fi
+
if dracut_module_included "systemd"; then
inst_multiple \
$systemdsystemunitdir/multipathd.service
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 10/33] 90multipath: install dracut-specific service file
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (8 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 09/33] 90multipath: Load device_handler modules early during boot Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-11-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 11/33] 95iscsi: Autodetect iSCSI firmware Thomas Renninger
` (22 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The multipathd package might install a service and a socket
file. Using the original service file from the installed
system without the socket file triggers a bug in systemd,
causing systemd to crash.
As we don't actually need to socket file in the initrd we
should be installing our own service file which does not
reference the socket file at all.
References: bnc#871610
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90multipath/module-setup.sh | 7 +++----
modules.d/90multipath/multipathd.service | 15 +++++++++++++++
2 files changed, 18 insertions(+), 4 deletions(-)
create mode 100644 modules.d/90multipath/multipathd.service
diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh
index bbee5d9..0f88f82 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -104,10 +104,9 @@ install() {
fi
if dracut_module_included "systemd"; then
- inst_multiple \
- $systemdsystemunitdir/multipathd.service
- mkdir -p "${initdir}${systemdsystemconfdir}/sysinit.target.wants"
- ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemconfdir}/sysinit.target.wants/multipathd.service"
+ inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
+ mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
+ ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
else
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service
new file mode 100644
index 0000000..44a7b80
--- /dev/null
+++ b/modules.d/90multipath/multipathd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Device-Mapper Multipath Device Controller
+Before=iscsi.service iscsid.service lvm2-activation-early.service
+DefaultDependencies=no
+Conflicts=shutdown.target
+
+[Service]
+Type=simple
+ExecStartPre=/sbin/modprobe dm-multipath
+ExecStart=/sbin/multipathd -s -d
+ExecReload=/sbin/multipathd reconfigure
+ExecStop=/sbin/multipathd shutdown
+
+[Install]
+WantedBy=sysinit.target
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 11/33] 95iscsi: Autodetect iSCSI firmware
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (9 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 10/33] 90multipath: install dracut-specific service file Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-12-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 12/33] 95iscsi: Install libgcc_s library Thomas Renninger
` (21 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, Pavel Wieczorkiewicz
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Some iSCSI initiator present firmware information in
/sys/firmware/ibft or /sys/firmware/iscsi_bootX
Whenever we detect one of those directories we should assume
that the iSCSI devices should be activated.
Also incorporates SUSE patches:
0049:
95iscsi: Use 'ip=ibft' for ibft autoconfiguration
For iBFT autoconfiguration we should be setting 'ip=ibft'
instead of rd.neednet. This should instruct dracut to only
enable the iBFT interfaces and leave the rest alone.
References: bnc#879038
0054:
95iscsi: update commandline printing
dracut has a separate callout 'cmdline' which should be used
for printing out the generated commandline.
Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/module-setup.sh | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 8b42d3e..5d2a39b 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -28,6 +28,21 @@ check() {
return 0
}
+install_ibft() {
+ # When iBFT / iscsi_boot is detected:
+ # - Use 'ip=ibft' to set up iBFT network interface
+ # - specify firmware booting cmdline parameter
+
+ for d in /sys/firmware/* ; do
+ if [ -d ${d}/initiator ] ; then
+ if [ ${d##*/} = "ibft" ] ; then
+ echo -n "ip=ibft "
+ fi
+ echo -n "rd.iscsi.firmware=1"
+ fi
+ done
+}
+
# called by dracut
depends() {
echo network rootfs-block
@@ -37,6 +52,12 @@ depends() {
installkernel() {
local _arch=$(uname -m)
+ # Detect iBFT and perform mandatory steps
+ if [[ $hostonly_cmdline == "yes" ]] ; then
+ install_ibft > "${initdir}/etc/cmdline.d/95iscsi.conf"
+ echo >> "${initdir}/etc/cmdline.d/95iscsi.conf"
+ fi
+
instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
iscsi_module_filter() {
@@ -77,6 +98,11 @@ installkernel() {
}
# called by dracut
+cmdline() {
+ install_ibft
+}
+
+# called by dracut
install() {
inst_multiple umount iscsistart hostname iscsi-iname
inst_multiple -o iscsiuio
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 12/33] 95iscsi: Install libgcc_s library
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (10 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 11/33] 95iscsi: Autodetect iSCSI firmware Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 13/33] 95iscsi: Set correct iscsi_started value for iSCSI firmware Thomas Renninger
` (20 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
iscsiuio is using pthread, which requires libgcc_s for
pthread_cancel to work.
Without this library iscsiuio will crash with SIGABRT.
References: bnc#881692
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 5d2a39b..3641fb8 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -106,6 +106,7 @@ cmdline() {
install() {
inst_multiple umount iscsistart hostname iscsi-iname
inst_multiple -o iscsiuio
+ inst_libdir_file 'libgcc_s.so*'
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 13/33] 95iscsi: Set correct iscsi_started value for iSCSI firmware
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (11 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 12/33] 95iscsi: Install libgcc_s library Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 14/33] 95iscsi: strip one set of quotes when calling initqueue Thomas Renninger
` (19 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When iSCSI firmware booting is selected we should not rely on
'netroot' or 'iscsiroot' variables to be set.
References: bnc#873448
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/parse-iscsiroot.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index ca57668..85c3027 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -90,8 +90,12 @@ if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; the
fi
fi
-netroot_enc=$(str_replace "$netroot" '/' '\2f')
-echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
+if [ -n "$iscsi_firmware" ] ; then
+ echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
+else
+ netroot_enc=$(str_replace "$netroot" '/' '\2f')
+ echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
+fi
# Done, all good!
rootok=1
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 14/33] 95iscsi: strip one set of quotes when calling initqueue
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (12 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 13/33] 95iscsi: Set correct iscsi_started value for iSCSI firmware Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 15/33] 95iscsi: Fixup bnx2i offload booting Thomas Renninger
` (18 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The bad initqueue parameter passing is already addressed by git commit:
commit bb8c16d12178373f17553294603ff5187e318b51
and
commit 486a8f33e2edaf249e3a09c98a910094e201cf9e
However this appraoch is slightly different:
"$netroot" instead of "'$netroot'", etc.
initqueue will process the arguments, assuming the first non-option
argument to be the program to be executed. Putting the entire
commandline into this argument confuses both, initqueue and the
program in question.
References: bnc#879038
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/parse-iscsiroot.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
index 85c3027..37e46ad 100755
--- a/modules.d/95iscsi/parse-iscsiroot.sh
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
@@ -59,10 +59,10 @@ fi
# iscsi_firmware does not need argument checking
if [ -n "$iscsi_firmware" ] ; then
- netroot=${netroot:-iscsi:}
+ [ -z "$netroot" ] && netroot=iscsi:
modprobe -q iscsi_boot_sysfs 2>/dev/null
modprobe -q iscsi_ibft
- initqueue --onetime --timeout /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
+ initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
fi
# If it's not iscsi we don't continue
@@ -86,7 +86,7 @@ fi
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then
- initqueue --onetime --settled /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
+ initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
fi
fi
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 15/33] 95iscsi: Fixup bnx2i offload booting
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (13 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 14/33] 95iscsi: strip one set of quotes when calling initqueue Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 16/33] 95iscsi: More empty cmdline fixes Thomas Renninger
` (17 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
bnx2i is using a separate iSCSI offload engine with a separate
MAC address. As a result, the iBFT information is displaying
a MAC address which does not relate to any MAC address from
the network interfaces.
In addition, the iSCSI offload engine works independently on
the NIC, so we do not need to enable the NIC for iSCSI offload
to work.
This patch modifies the automatic iBFT detection to not set
the 'ip=ibft' flag when bnx2i offload is detected.
References: bnc#855747
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/module-setup.sh | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 3641fb8..d30e64f 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -28,14 +28,38 @@ check() {
return 0
}
+get_ibft_mod() {
+ local ibft_mac=$1
+ # Return the iSCSI offload module for a given MAC address
+ iscsiadm -m iface | while read iface_name iface_desc ; do
+ IFS=$','
+ set -- $iface_desc
+ if [ "$ibft_mac" = "$2" ] ; then
+ echo $1
+ return 0
+ fi
+ unset IFS
+ done
+}
+
install_ibft() {
# When iBFT / iscsi_boot is detected:
# - Use 'ip=ibft' to set up iBFT network interface
+ # Note: bnx2i is using a different MAC address of iSCSI offloading
+ # so the 'ip=ibft' parameter must not be set
# - specify firmware booting cmdline parameter
for d in /sys/firmware/* ; do
+ if [ -d ${d}/ethernet0 ] ; then
+ read ibft_mac < ${d}/ethernet0/mac
+ ibft_mod=$(get_ibft_mod $ibft_mac)
+ fi
+ if [ -z "$ibft_mod" ] && [ -d ${d}/ethernet1 ] ; then
+ read ibft_mac < ${d}/ethernet1/mac
+ ibft_mod=$(get_ibft_mod $ibft_mac)
+ fi
if [ -d ${d}/initiator ] ; then
- if [ ${d##*/} = "ibft" ] ; then
+ if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then
echo -n "ip=ibft "
fi
echo -n "rd.iscsi.firmware=1"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 16/33] 95iscsi: More empty cmdline fixes
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (14 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 15/33] 95iscsi: Fixup bnx2i offload booting Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 17/33] 95iscsi: generate commandline for software iscsi Thomas Renninger
` (16 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
This fixes up some 95iscsi/module-setup.sh which might print out empty
commandline files.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/module-setup.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index d30e64f..29bba82 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -76,12 +76,6 @@ depends() {
installkernel() {
local _arch=$(uname -m)
- # Detect iBFT and perform mandatory steps
- if [[ $hostonly_cmdline == "yes" ]] ; then
- install_ibft > "${initdir}/etc/cmdline.d/95iscsi.conf"
- echo >> "${initdir}/etc/cmdline.d/95iscsi.conf"
- fi
-
instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
iscsi_module_filter() {
@@ -131,6 +125,13 @@ install() {
inst_multiple umount iscsistart hostname iscsi-iname
inst_multiple -o iscsiuio
inst_libdir_file 'libgcc_s.so*'
+
+ # Detect iBFT and perform mandatory steps
+ if [[ $hostonly_cmdline == "yes" ]] ; then
+ local _ibftconf=$(install_ibft)
+ [[ $_ibftconf ]] && printf "%s\n" "$_ibftconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
+ fi
+
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 17/33] 95iscsi: generate commandline for software iscsi
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (15 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 16/33] 95iscsi: More empty cmdline fixes Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 18/33] iscsi: iscsi.initiator and others can and must only show up once Thomas Renninger
` (15 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When installing on an software iscsi root we need to generate
the correct commandline, otherwise the system cannot boot.
References: bnc#880108
Patch: 0093
When using software iscsi we should be using the existing
configuration from the system for the time being.
References: bnc#884768
Patch: 0095
Avoid bad ip route call on empty address
Patch: 0143
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/module-setup.sh | 91 +++++++++++++++++++++++++++++++++++++--
1 file changed, 88 insertions(+), 3 deletions(-)
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 29bba82..cd6cb4b 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -67,6 +67,84 @@ install_ibft() {
done
}
+install_iscsiroot() {
+ local devpath=$1
+ local scsi_path iscsi_lun session c d conn
+ local iscsi_session iscsi_address iscsi_port iscsi_targetname iscsi_tpgt
+
+ scsi_path=${devpath%%/block*}
+ [ "$scsi_path" = "$devpath" ] && return 1
+ iscsi_lun=${scsi_path##*:}
+ [ "$iscsi_lun" = "$scsi_path" ] && return 1
+ session=${devpath%%/target*}
+ [ "$session" = "$devpath" ] && return 1
+ iscsi_session=${session##*/}
+ [ "$iscsi_session" = "$session" ] && return 1
+
+ for d in ${session}/* ; do
+ case $d in
+ *connection*)
+ c=${d##*/}
+ conn=${d}/iscsi_connection/${c}
+ if [ -d ${conn} ] ; then
+ iscsi_address=$(cat ${conn}/persistent_address)
+ iscsi_port=$(cat ${conn}/persistent_port)
+ fi
+ ;;
+ *session)
+ if [ -d ${d}/${iscsi_session} ] ; then
+ iscsi_initiator=$(cat ${d}/${iscsi_session}/initiatorname)
+ iscsi_targetname=$(cat ${d}/${iscsi_session}/targetname)
+ fi
+ ;;
+ esac
+ done
+
+ [ -z "$iscsi_address" ] && return
+ local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
+ ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
+ printf 'ip=%s:static ' ${ifname}
+
+ if [ -e /sys/class/net/$ifname/address ] ; then
+ ifmac=$(cat /sys/class/net/$ifname/address)
+ printf 'ifname=%s:%s ' ${ifname} ${ifmac}
+ fi
+
+ if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
+ if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
+ iscsi_port=
+ fi
+ if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ] ; then
+ iscsi_lun=
+ fi
+ # In IPv6 case rd.iscsi.initatior= must pass address in [] brackets
+ case "$iscsi_address" in
+ *:*)
+ iscsi_address="[$iscsi_address]"
+ ;;
+ esac
+ echo "rd.iscsi.initiator=${iscsi_initiator} netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
+ fi
+ return 0
+}
+
+
+install_softiscsi() {
+ [ -d /sys/firmware/ibft ] && return 0
+
+ is_softiscsi() {
+ local _dev=$1
+ local iscsi_dev
+
+ [[ -L "/sys/dev/block/$_dev" ]] || return
+ iscsi_dev=$(cd -P /sys/dev/block/$_dev; echo $PWD)
+ install_iscsiroot $iscsi_dev
+ }
+
+ for_each_host_dev_and_slaves_all is_softiscsi || return 255
+ return 0
+}
+
# called by dracut
depends() {
echo network rootfs-block
@@ -117,7 +195,14 @@ installkernel() {
# called by dracut
cmdline() {
- install_ibft
+ local _iscsiconf=$(install_ibft)
+ {
+ if [ "$_iscsiconf" ] ; then
+ echo ${_iscsiconf}
+ else
+ install_softiscsi
+ fi
+ } | sort | uniq
}
# called by dracut
@@ -128,8 +213,8 @@ install() {
# Detect iBFT and perform mandatory steps
if [[ $hostonly_cmdline == "yes" ]] ; then
- local _ibftconf=$(install_ibft)
- [[ $_ibftconf ]] && printf "%s\n" "$_ibftconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
+ local _iscsiconf=$(cmdline)
+ [[ $_iscsiconf ]] && printf "%s\n" "$_iscsiconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
fi
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 18/33] iscsi: iscsi.initiator and others can and must only show up once
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (16 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 17/33] 95iscsi: generate commandline for software iscsi Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 19/33] Restore original IFS value Thomas Renninger
` (14 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
Make sure duplicates of iscsi.initiator vanish.
Only get one rd.iscsi.* paramter value. If getargs is used and several
parameters are parsed, one gets two values separated by whitespace in a
variable which breaks later code and is not suppported.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95iscsi/iscsiroot.sh | 18 +++++++++---------
modules.d/95iscsi/module-setup.sh | 5 ++++-
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
index 7351427..5bfb017 100755
--- a/modules.d/95iscsi/iscsiroot.sh
+++ b/modules.d/95iscsi/iscsiroot.sh
@@ -81,23 +81,23 @@ handle_netroot()
local p
# override conf settings by command line options
- arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
+ arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
[ -n "$arg" ] && iscsi_initiator=$arg
- arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
+ arg=$(getarg rd.iscsi.target.name -d iscsi_target_name=)
[ -n "$arg" ] && iscsi_target_name=$arg
- arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
+ arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip)
[ -n "$arg" ] && iscsi_target_ip=$arg
- arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
+ arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=)
[ -n "$arg" ] && iscsi_target_port=$arg
- arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
+ arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=)
[ -n "$arg" ] && iscsi_target_group=$arg
- arg=$(getargs rd.iscsi.username -d iscsi_username=)
+ arg=$(getarg rd.iscsi.username -d iscsi_username=)
[ -n "$arg" ] && iscsi_username=$arg
- arg=$(getargs rd.iscsi.password -d iscsi_password)
+ arg=$(getarg rd.iscsi.password -d iscsi_password)
[ -n "$arg" ] && iscsi_password=$arg
- arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
+ arg=$(getarg rd.iscsi.in.username -d iscsi_in_username=)
[ -n "$arg" ] && iscsi_in_username=$arg
- arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
+ arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
[ -n "$arg" ] && iscsi_in_password=$arg
for p in $(getargs rd.iscsi.param -d iscsi_param); do
iscsi_param="$iscsi_param --param $p"
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index cd6cb4b..9975e59 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -123,7 +123,10 @@ install_iscsiroot() {
iscsi_address="[$iscsi_address]"
;;
esac
- echo "rd.iscsi.initiator=${iscsi_initiator} netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
+ # Must be two separate lines, so that "sort | uniq" commands later
+ # can sort out rd.iscsi.initiator= duplicates
+ echo "rd.iscsi.initiator=${iscsi_initiator}"
+ echo "netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
fi
return 0
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 19/33] Restore original IFS value
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (17 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 18/33] iscsi: iscsi.initiator and others can and must only show up once Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
[not found] ` <1416495428-36978-20-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-11-20 14:56 ` [PATCH 20/33] Implement 'rd.timeout' to modify the device timeout Thomas Renninger
` (13 subsequent siblings)
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Whenever the IFS setting is modified it needs to be restored to
its original value. Otherwise it'll lead to unexpected results.
References: bnc#883770
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90kernel-modules/insmodpost.sh | 2 ++
modules.d/90kernel-modules/parse-kernel.sh | 4 ++++
modules.d/95iscsi/module-setup.sh | 6 ++++--
modules.d/98systemd/dracut-pre-udev.sh | 4 ++++
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules.d/90kernel-modules/insmodpost.sh b/modules.d/90kernel-modules/insmodpost.sh
index 4362f0a..b4bcdd0 100755
--- a/modules.d/90kernel-modules/insmodpost.sh
+++ b/modules.d/90kernel-modules/insmodpost.sh
@@ -4,9 +4,11 @@
for modlist in $(getargs rd.driver.post -d rdinsmodpost=); do
(
+ OLDIFS="$IFS"
IFS=,
for m in $modlist; do
modprobe $m
done
+ IFS="$OLDIFS"
)
done
diff --git a/modules.d/90kernel-modules/parse-kernel.sh b/modules.d/90kernel-modules/parse-kernel.sh
index cbe7c85..81f7131 100755
--- a/modules.d/90kernel-modules/parse-kernel.sh
+++ b/modules.d/90kernel-modules/parse-kernel.sh
@@ -11,10 +11,12 @@ fi
for i in $(getargs rd.driver.pre -d rdloaddriver=); do
(
+ OLDIFS="$IFS"
IFS=,
for p in $i; do
modprobe $p 2>&1 | vinfo
done
+ IFS="$OLDIFS"
)
done
@@ -23,10 +25,12 @@ done
for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
+ OLDIFS="$IFS"
IFS=,
for p in $i; do
echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf
done
+ IFS="$OLDIFS"
)
done
diff --git a/modules.d/95iscsi/module-setup.sh b/modules.d/95iscsi/module-setup.sh
index 9975e59..f551c49 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -29,16 +29,18 @@ check() {
}
get_ibft_mod() {
- local ibft_mac=$1
+ local ibft_mac=$1 IFS
# Return the iSCSI offload module for a given MAC address
iscsiadm -m iface | while read iface_name iface_desc ; do
+ OLDIFS="$IFS"
IFS=$','
set -- $iface_desc
+ IFS="$OLDIFS"
if [ "$ibft_mac" = "$2" ] ; then
echo $1
return 0
fi
- unset IFS
+
done
}
diff --git a/modules.d/98systemd/dracut-pre-udev.sh b/modules.d/98systemd/dracut-pre-udev.sh
index ca13048..b2be0e0 100755
--- a/modules.d/98systemd/dracut-pre-udev.sh
+++ b/modules.d/98systemd/dracut-pre-udev.sh
@@ -24,10 +24,12 @@ fi
for i in $(getargs rd.driver.pre -d rdloaddriver=); do
(
+ OLDIFS="$IFS"
IFS=,
for p in $i; do
modprobe $p 2>&1 | vinfo
done
+ IFS="$OLDIFS"
)
done
@@ -36,10 +38,12 @@ done
for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
+ OLDIFS="$IFS"
IFS=,
for p in $i; do
echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf
done
+ IFS="$OLDIFS"
)
done
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 20/33] Implement 'rd.timeout' to modify the device timeout
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (18 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 19/33] Restore original IFS value Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 21/33] Do not call 'lvm' for non-LVM device-mapper devices Thomas Renninger
` (12 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When generating units for devices the administrator might
want to use a different timeout than the default.
So implement a new parameter 'rd.timeout' for this.
References: bnc#878770
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.cmdline.7.asc | 7 ++++++-
modules.d/98systemd/rootfs-generator.sh | 7 +++++--
modules.d/99base/dracut-lib.sh | 6 +++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dracut.cmdline.7.asc b/dracut.cmdline.7.asc
index 48356c7..9741cf7 100644
--- a/dracut.cmdline.7.asc
+++ b/dracut.cmdline.7.asc
@@ -142,11 +142,16 @@ Misc
have been loaded. This parameter can be specified multiple times.
**rd.retry=**__<seconds>__::
- specify how long dracut should wait for devices to appear.
+ specify how long dracut should retry the initqueue to configure devices.
The default is 30 seconds. After 2/3 of the time, degraded raids are force
started. If you have hardware, which takes a very long time to announce its
drives, you might want to extend this value.
+**rd.timeout=**__<seconds>__::
+ specify how long dracut should wait for devices to appear. The
+ default is '0', which means 'forever'. Note that this timeout
+ should be longer than rd.retry to allow for proper configuration.
+
**rd.noverifyssl**::
accept self-signed certificates for ssl downloads.
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh
index 9523729..5b06137 100755
--- a/modules.d/98systemd/rootfs-generator.sh
+++ b/modules.d/98systemd/rootfs-generator.sh
@@ -5,8 +5,11 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
generator_wait_for_dev()
{
local _name
+ local _timeout
_name="$(str_replace "$1" '/' '\x2f')"
+ _timeout=$(getarg rd.timeout)
+ _timeout=${_timeout:-0}
[ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
@@ -27,7 +30,7 @@ generator_wait_for_dev()
mkdir -p /run/systemd/generator/${_name}.device.d
{
echo "[Unit]"
- echo "JobTimeoutSec=0"
+ echo "JobTimeoutSec=$_timeout"
} > /run/systemd/generator/${_name}.device.d/timeout.conf
fi
}
@@ -58,6 +61,6 @@ case "$root" in
rootok=1 ;;
esac
-[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}"
+[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" "$RDRETRY"
exit 0
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 8bc6b26..7080f1a 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -886,12 +886,16 @@ wait_for_dev()
local _name
local _needreload
local _noreload
+ local _timeout
if [ "$1" = "-n" ]; then
_noreload=1
shift
fi
+ _timeout=$(getarg rd.timeout)
+ _timeout=${_timeout:-0}
+
_name="$(str_replace "$1" '/' '\x2f')"
type mark_hostonly >/dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
@@ -918,7 +922,7 @@ wait_for_dev()
mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d
{
echo "[Unit]"
- echo "JobTimeoutSec=0"
+ echo "JobTimeoutSec=$_timeout"
} > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/systemd/system/${_name}.device.d/timeout.conf
_needreload=1
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 21/33] Do not call 'lvm' for non-LVM device-mapper devices
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (19 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 20/33] Implement 'rd.timeout' to modify the device timeout Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 22/33] Print stored dracut commandline during initramfs build Thomas Renninger
` (11 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
If a device-mapper device is not created by LVM it's pointless
to call any 'lvm' programs got extract details; they'll be
failing anyway. So check the UUID before calling 'lvm'.
This speeds up initrd creation and avoids I/O errors on
multipath devices.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut-functions.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index b43b766..02aba04 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -698,10 +698,12 @@ for_each_host_dev_and_slaves()
# but you cannot create the logical volume without the volume group.
# And the volume group might be bigger than the devices the LV needs.
check_vol_slaves() {
- local _lv _vg _pv
+ local _lv _vg _pv _dm
for i in /dev/mapper/*; do
[[ $i == /dev/mapper/control ]] && continue
_lv=$(get_maj_min $i)
+ _dm=/sys/dev/block/$_lv/dm
+ [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue
if [[ $_lv = $2 ]]; then
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
# strip space
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 22/33] Print stored dracut commandline during initramfs build
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (20 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 21/33] Do not call 'lvm' for non-LVM device-mapper devices Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 23/33] Align dev_unit_name() with systemd's function Thomas Renninger
` (10 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When generating the initramfs we should be printing out the
generated dracut commandline used for booting.
This will simplify debugging.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 4590f79..9a19b43 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1576,6 +1576,16 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
exit 1
fi
+if [[ $hostonly_cmdline ]] ; then
+ if [ -d $initdir/etc/cmdline.d ];then
+ dinfo "Stored kernel commandline:"
+ for conf in $initdir/etc/cmdline.d/*.conf ; do
+ dinfo "$(< $conf)"
+ done
+ else
+ dinfo "No dracut internal kernel commandline stored in initrd"
+ fi
+fi
rm -f -- "$outfile"
dinfo "*** Creating image file ***"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 23/33] Align dev_unit_name() with systemd's function.
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (21 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 22/33] Print stored dracut commandline during initramfs build Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:56 ` [PATCH 24/33] Generate fallback mount unit for root filesystem Thomas Renninger
` (9 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, Thorsten Behrens
From: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Add more corner cases from systemd's
unit_name_from_path_instance() C function.
Signed-off-by: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/99base/dracut-lib.sh | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 7080f1a..405e3c7 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -862,18 +862,30 @@ wait_for_mount()
} >> "$hookdir/emergency/90-${_name}.sh"
}
+# get a systemd-compatible unit name from a path
+# (mimicks unit_name_from_path_instance())
dev_unit_name()
{
+ local dev="$1"
+
if command -v systemd-escape >/dev/null; then
- systemd-escape -p "$1"
+ systemd-escape -p "$dev"
return
fi
- _name="${1%%/}"
- _name="${_name##/}"
- _name="$(str_replace "$_name" '-' '\x2d')"
- _name="$(str_replace "$_name" '/' '-')"
- echo "$_name"
+ if [ "$dev" = "/" -o -z "$dev" ]; then
+ printf -- "-"
+ exit 0
+ fi
+
+ dev="${1%%/}"
+ dev="${dev##/}"
+ dev="$(str_replace "$dev" '\' '\x5c')"
+ dev="$(str_replace "$dev" '-' '\x2d')"
+ dev=${dev/#\./\\x2e}
+ dev="$(str_replace "$dev" '/' '-')"
+
+ printf -- "%s" "$dev"
}
# wait_for_dev <dev>
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 24/33] Generate fallback mount unit for root filesystem
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (22 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 23/33] Align dev_unit_name() with systemd's function Thomas Renninger
@ 2014-11-20 14:56 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 25/33] 99base: warn on invalid command for initqueue Thomas Renninger
` (8 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:56 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, Thorsten Behrens
From: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
If kernel cmdline has no root= provided, *and* the initrd carries
a default value, create a systemd mount unit to have it available
in /sysroot
References: bnc#855258
Signed-off-by: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/98systemd/rootfs-generator.sh | 34 ++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/modules.d/98systemd/rootfs-generator.sh b/modules.d/98systemd/rootfs-generator.sh
index 5b06137..f3c7d1f 100755
--- a/modules.d/98systemd/rootfs-generator.sh
+++ b/modules.d/98systemd/rootfs-generator.sh
@@ -35,6 +35,35 @@ generator_wait_for_dev()
fi
}
+generator_mount_rootfs()
+{
+ local _type=$2
+ local _flags=$3
+ local _name
+
+ [ -z "$1" ] && return 0
+
+ _name=$(dev_unit_name "$1")
+ [ -d /run/systemd/generator ] || mkdir -p /run/systemd/generator
+ if ! [ -f /run/systemd/generator/sysroot.mount ]; then
+ {
+ echo "[Unit]"
+ echo "Before=initrd-root-fs.target"
+ echo "RequiresOverridable=systemd-fsck@${_name}.service"
+ echo "After=systemd-fsck@${_name}.service"
+ echo "[Mount]"
+ echo "Where=/sysroot"
+ echo "What=$1"
+ echo "Options=${_flags}"
+ echo "Type=${_type}"
+ } > /run/systemd/generator/sysroot.mount
+ fi
+ if ! [ -L /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount ]; then
+ [ -d /run/systemd/generator/initrd-root-fs.target.requires ] || mkdir -p /run/systemd/generator/initrd-root-fs.target.requires
+ ln -s ../sysroot.mount /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount
+ fi
+}
+
root=$(getarg root=)
case "$root" in
block:LABEL=*|LABEL=*)
@@ -61,6 +90,9 @@ case "$root" in
rootok=1 ;;
esac
-[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}" "$RDRETRY"
+if [ "${root%%:*}" = "block" ]; then
+ generator_wait_for_dev "${root#block:}" "$RDRETRY"
+ grep -q 'root=' /proc/cmdline || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
+fi
exit 0
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 25/33] 99base: warn on invalid command for initqueue
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (23 preceding siblings ...)
2014-11-20 14:56 ` [PATCH 24/33] Generate fallback mount unit for root filesystem Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 26/33] Handle module alias properly Thomas Renninger
` (7 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When 'initqueue' is called with an invalid command it'll generate
invalid job scripts. This will lead to confusing error messages
later on.
So abort in these cases and print out a warning.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/99base/initqueue.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/99base/initqueue.sh b/modules.d/99base/initqueue.sh
index 4a07da3..193cc5c 100755
--- a/modules.d/99base/initqueue.sh
+++ b/modules.d/99base/initqueue.sh
@@ -42,6 +42,10 @@ exe=$1
shift
[ -x "$exe" ] || exe=$(command -v $exe)
+if [ -z "$exe" ] ; then
+ echo "Invalid command"
+ exit 1
+fi
{
[ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"'
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 26/33] Handle module alias properly
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (24 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 25/33] 99base: warn on invalid command for initqueue Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 27/33] 99base: Increase initqueue timeout in non systemd case Thomas Renninger
` (6 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Some modules (like ext4) provide aliases by which the modules
can be accessed, too. But when using aliases directly dracut
fails to include the correct module. So translate the alias
into the correct module name before checking the module.
References: bnc#886839
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut-functions.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 02aba04..d85c639 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1689,6 +1689,13 @@ instmods() {
--*) _mpargs+=" $_mod" ;;
*)
_mod=${_mod##*/}
+ # Check for aliased modules
+ _modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null)
+ _modalias=${_modalias%.ko}
+ if [ "${_modalias##*/}" != "$_mod" ] ; then
+ _mod=${_modalias##*/}
+ fi
+
# if we are already installed, skip this module and go on
# to the next one.
if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 27/33] 99base: Increase initqueue timeout in non systemd case
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (25 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 26/33] Handle module alias properly Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 28/33] 90lvm: Install dm-snapshot module Thomas Renninger
` (5 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
In case of systemd is used the timeout already is set to 180s, compare
with file: modules.d/98systemd/dracut-initqueue.sh
Do the same if systemd is not used, e.g. in kdump case.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/99base/init.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
index 3afe6d5..76b1247 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -165,7 +165,7 @@ make_trace_mem "hook initqueue" '1:shortmem' '2+:mem' '3+:slab'
getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
RDRETRY=$(getarg rd.retry -d 'rd_retry=')
-RDRETRY=${RDRETRY:-30}
+RDRETRY=${RDRETRY:-180}
RDRETRY=$(($RDRETRY*2))
export RDRETRY
main_loop=0
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 28/33] 90lvm: Install dm-snapshot module
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (26 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 27/33] 99base: Increase initqueue timeout in non systemd case Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 29/33] Check for logfile (--logfile option) and create it if necessary Thomas Renninger
` (4 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
bnc#888530
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90lvm/module-setup.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 9ddc56e..5515ac0 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -42,6 +42,10 @@ cmdline() {
done
}
+installkernel() {
+ instmods dm-snapshot
+}
+
# called by dracut
install() {
local _i
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 29/33] Check for logfile (--logfile option) and create it if necessary
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (27 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 28/33] 90lvm: Install dm-snapshot module Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 30/33] dracut.sh: Avoid duplicate devices in host_devs Thomas Renninger
` (3 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA, jloeser
From: jloeser <jloeser-l3A5Bk7waGM@public.gmane.org>
If a logfile is passed to dracut via --logfile option and doesn't
exist, dracut doesn't create it and logs nothing. Instead, dracut
should try to touch the file and print a warning if creating fails.
References: bnc#892191
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.sh | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dracut.sh b/dracut.sh
index 9a19b43..c657649 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -816,6 +816,16 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
# eliminate IFS hackery when messing with fw_dir
fw_dir=${fw_dir//:/ }
+# check for logfile and try to create one if it doesn't exist
+if [[ -n "$logfile" ]];then
+ if [[ ! -f "$logfile" ]];then
+ touch "$logfile"
+ if [ ! $? -eq 0 ] ;then
+ printf "%s\n" "dracut: touch $logfile failed." >&2
+ fi
+ fi
+fi
+
# handle compression options.
[[ $compress ]] || compress="gzip"
case $compress in
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 30/33] dracut.sh: Avoid duplicate devices in host_devs
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (28 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 29/33] Check for logfile (--logfile option) and create it if necessary Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 31/33] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed Thomas Renninger
` (2 subsequent siblings)
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.sh | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index c657649..f384f73 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -219,6 +219,16 @@ push() {
done
}
+# Fills up host_devs stack variable and makes sure there are no duplicates
+push_host_devs() {
+ local _dev
+ for _dev in ${host_devs[@]}; do
+ [ "$_dev" = "$1" ] && return
+ done
+ push host_devs "$1"
+}
+
+
# function pop()
# pops the last value from a stack
# assigns value to second argument variable
@@ -1062,25 +1072,25 @@ declare -A host_fs_types
for line in "${fstab_lines[@]}"; do
set -- $line
#dev mp fs fsopts
- push host_devs "$1"
+ push_host_devs "$1"
host_fs_types["$1"]="$3"
done
for f in $add_fstab; do
[[ -e $f ]] || continue
while read dev rest; do
- push host_devs "$dev"
+ push_host_devs "$dev"
done < "$f"
done
for dev in $add_device; do
- push host_devs "$dev"
+ push_host_devs "$dev"
done
if (( ${#add_device_l[@]} )); then
while pop add_device_l val; do
add_device+=" $val "
- push host_devs "$val"
+ push_host_devs "$val"
done
fi
@@ -1109,9 +1119,9 @@ if [[ $hostonly ]]; then
_dev=$(find_block_device "$mp")
_bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
- push host_devs $_dev
+ push_host_devs $_dev
[[ "$mp" == "/" ]] && root_dev="$_dev"
- push host_devs "$_dev"
+ push_host_devs "$_dev"
done
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
@@ -1140,7 +1150,7 @@ if [[ $hostonly ]]; then
done < /etc/crypttab
fi
- push host_devs "$(readlink -f "$dev")"
+ push_host_devs "$(readlink -f "$dev")"
break
done < /etc/fstab
done < /proc/swaps
@@ -1205,7 +1215,7 @@ for dev in "${!host_fs_types[@]}"; do
fi
if [[ $journaldev ]]; then
dev="$(readlink -f "$dev")"
- push host_devs "$dev"
+ push_host_devs "$dev"
_get_fs_type "$dev"
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
fi
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 31/33] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (29 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 30/33] dracut.sh: Avoid duplicate devices in host_devs Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 32/33] dracut.usage.asc: Remove distro specific help from manpage Thomas Renninger
2014-11-20 14:57 ` [PATCH 33/33] nfs: Add ip=... and root=nfs... parameters to internal dracut Thomas Renninger
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
Dracut parses /etc/fstab when --mount is option is passed (e.g. kdump).
In host_devs variable the real block device must be stored, not UUID=
There are other /etc/fstab syntax possibilities we now warn that they
are not correctly parsed. This will be fixed by another patch
when there is time to test this properly.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.sh | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index f384f73..3c3efc1 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1071,9 +1071,25 @@ declare -A host_fs_types
for line in "${fstab_lines[@]}"; do
set -- $line
+ dev="$1"
#dev mp fs fsopts
- push_host_devs "$1"
- host_fs_types["$1"]="$3"
+ case "$dev" in
+ UUID=*)
+ dev=$(blkid -l -t UUID=${dev#UUID=} -o device)
+ ;;
+ LABEL=*)
+ dev=$(blkid -l -t LABEL=${dev#LABEL=} -o device)
+ ;;
+ PARTUUID=*)
+ dev=$(blkid -l -t PARTUUID=${dev#PARTUUID=} -o device)
+ ;;
+ PARTLABEL=*)
+ dev=$(blkid -l -t PARTLABEL=${dev#PARTLABEL=} -o device)
+ ;;
+ esac
+ [ -z "$dev" ] && dwarn "Bad fstab entry $@" && continue
+ push_host_devs "$dev"
+ host_fs_types["$dev"]="$3"
done
for f in $add_fstab; do
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 32/33] dracut.usage.asc: Remove distro specific help from manpage
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (30 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 31/33] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
2014-11-20 14:57 ` [PATCH 33/33] nfs: Add ip=... and root=nfs... parameters to internal dracut Thomas Renninger
32 siblings, 0 replies; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.usage.asc | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/dracut.usage.asc b/dracut.usage.asc
index 1a79638..e2182d9 100644
--- a/dracut.usage.asc
+++ b/dracut.usage.asc
@@ -246,23 +246,6 @@ specified multiple times.
If your root partition is on a network drive, you have to have the network
dracut modules installed to create a network aware initramfs image.
-On a Red Hat Enterprise Linux or Fedora system, this means, you have to install
-the _dracut-network_ rpm package:
-
-
-----
-# yum install dracut-network
-----
-
-The resulting initramfs image can be served by a boot manager residing on your
-local hard drive or it can be served by a PXE/TFTP server.
-
-How to setup your PXE/TFTP server can be found in the
-http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
-Hat Enterprise Linux 6 Storage Administration Guide]
-or http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
-Hat Enterprise Linux 7 Storage Administration Guide].
-
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
server about the ip adress for the machine. The dhcp server can also serve an
additional root-path, which will set the root device for dracut. With this
@@ -302,7 +285,7 @@ This will reduce the size of the initramfs image significantly.
If the boot process does not succeed, you have several options to debug the
situation. Some of the basic operations are covered here. For more information
you should also visit:
-http://fedoraproject.org/wiki/How_to_debug_Dracut_problems
+https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
[[identifying-your-problem-area]]
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread* [PATCH 33/33] nfs: Add ip=... and root=nfs... parameters to internal dracut
[not found] ` <1416495428-36978-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (31 preceding siblings ...)
2014-11-20 14:57 ` [PATCH 32/33] dracut.usage.asc: Remove distro specific help from manpage Thomas Renninger
@ 2014-11-20 14:57 ` Thomas Renninger
[not found] ` <1416495428-36978-34-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
32 siblings, 1 reply; 50+ messages in thread
From: Thomas Renninger @ 2014-11-20 14:57 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: hare-l3A5Bk7waGM, trenn-l3A5Bk7waGM,
initramfs-u79uwXL29TY76Z2rM5mHXA
cmdline
If the rootfs is an nfs mount, also know as nfsroot, add the correct
parameter to the dracut cmdline.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95nfs/module-setup.sh | 46 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index e1340b3..41c6ef7 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -14,7 +14,6 @@ check() {
done
return 255
}
-
return 0
}
@@ -29,14 +28,56 @@ installkernel() {
instmods nfs sunrpc ipv6 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files
}
+cmdline() {
+ local nfs_device
+ local nfs_options
+ local nfs_root
+ local nfs_address
+ local lookup
+ local ifname
+
+ ### nfsroot= ###
+ nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
+ if [ -n "$nfs_device" ];then
+ nfs_root="root=nfs4:$nfs_device"
+ else
+ nfs_device=$(findmnt -t nfs -n -o SOURCE /)
+ [ -z "$nfs_device" ] && return
+ nfs_root="root=nfs:$nfs_device"
+ fi
+ nfs_options=$(findmnt -t nfs4,nfs -n -o OPTIONS /)
+ [ -n "$nfs_options" ] && nfs_root="$nfs_root:$nfs_options"
+ echo "$nfs_root"
+
+ ### ip= ###
+ if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
+ nfs_address="$nfs_device"
+ else
+ lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
+ nfs_address=${lookup##* }
+ fi
+ ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
+ if [ -e /sys/class/net/$ifname/address ] ; then
+ ifmac=$(cat /sys/class/net/$ifname/address)
+ printf 'ifname=%s:%s ' ${ifname} ${ifmac}
+ fi
+
+ printf 'ip=%s:static\n' ${ifname}
+}
+
# called by dracut
install() {
local _i
local _nsslibs
inst_multiple -o portmap rpcbind rpc.statd mount.nfs \
- mount.nfs4 umount rpc.idmapd sed /etc/netconfig
+ mount.nfs4 umount rpc.idmapd sed /etc/netconfig host sed
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
+ if [[ $hostonly_cmdline == "yes" ]]; then
+ local _netconf="$(cmdline)"
+ [[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf"
+ fi
+
if [ -f /lib/modprobe.d/nfs.conf ]; then
inst_multiple /lib/modprobe.d/nfs.conf
else
@@ -75,4 +116,3 @@ install() {
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
dracut_need_initqueue
}
-
--
1.8.5.2
^ permalink raw reply related [flat|nested] 50+ messages in thread