* [PATCH 01/42] mkinitrd-suse: Update to sles12 SUSE state
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 02/42] systemd always tries to load autofs4 Thomas Renninger
` (41 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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] 52+ messages in thread* [PATCH 02/42] systemd always tries to load autofs4
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:45 ` [PATCH 01/42] mkinitrd-suse: Update to sles12 SUSE state Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 03/42] Fixup mdraid setup Thomas Renninger
` (40 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 8052984..53e07a2 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] 52+ messages in thread* [PATCH 03/42] Fixup mdraid setup
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:45 ` [PATCH 01/42] mkinitrd-suse: Update to sles12 SUSE state Thomas Renninger
2014-12-11 14:45 ` [PATCH 02/42] systemd always tries to load autofs4 Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 04/42] 95udev-rules: Include correct sg3_utils rules Thomas Renninger
` (39 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM, 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] 52+ messages in thread* [PATCH 04/42] 95udev-rules: Include correct sg3_utils rules
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (2 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 03/42] Fixup mdraid setup Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
[not found] ` <1418309193-11208-5-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:45 ` [PATCH 05/42] 90multipath: install correct multipath rules Thomas Renninger
` (38 subsequent siblings)
42 siblings, 1 reply; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 05/42] 90multipath: install correct multipath rules
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (3 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 04/42] 95udev-rules: Include correct sg3_utils rules Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 06/42] 95iscsi: Autodetect iSCSI firmware Thomas Renninger
` (37 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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 a8700f4..0f88f82 100755
--- a/modules.d/90multipath/module-setup.sh
+++ b/modules.d/90multipath/module-setup.sh
@@ -114,6 +114,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] 52+ messages in thread* [PATCH 06/42] 95iscsi: Autodetect iSCSI firmware
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (4 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 05/42] 90multipath: install correct multipath rules Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 07/42] 95iscsi: Install libgcc_s library Thomas Renninger
` (36 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke, 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] 52+ messages in thread* [PATCH 07/42] 95iscsi: Install libgcc_s library
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (5 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 06/42] 95iscsi: Autodetect iSCSI firmware Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:45 ` [PATCH 08/42] 95iscsi: Set correct iscsi_started value for iSCSI firmware Thomas Renninger
` (35 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 08/42] 95iscsi: Set correct iscsi_started value for iSCSI firmware
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (6 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 07/42] 95iscsi: Install libgcc_s library Thomas Renninger
@ 2014-12-11 14:45 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 09/42] 95iscsi: strip one set of quotes when calling initqueue Thomas Renninger
` (34 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:45 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 09/42] 95iscsi: strip one set of quotes when calling initqueue
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (7 preceding siblings ...)
2014-12-11 14:45 ` [PATCH 08/42] 95iscsi: Set correct iscsi_started value for iSCSI firmware Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 10/42] 95iscsi: Fixup bnx2i offload booting Thomas Renninger
` (33 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 10/42] 95iscsi: Fixup bnx2i offload booting
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (8 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 09/42] 95iscsi: strip one set of quotes when calling initqueue Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 11/42] 95iscsi: More empty cmdline fixes Thomas Renninger
` (32 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 11/42] 95iscsi: More empty cmdline fixes
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (9 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 10/42] 95iscsi: Fixup bnx2i offload booting Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 12/42] 95iscsi: generate commandline for software iscsi Thomas Renninger
` (31 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 12/42] 95iscsi: generate commandline for software iscsi
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (10 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 11/42] 95iscsi: More empty cmdline fixes Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 13/42] iscsi: iscsi.initiator and others can and must only show up once Thomas Renninger
` (30 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 13/42] iscsi: iscsi.initiator and others can and must only show up once
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (11 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 12/42] 95iscsi: generate commandline for software iscsi Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 14/42] Implement 'rd.timeout' to modify the device timeout Thomas Renninger
` (29 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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] 52+ messages in thread* [PATCH 14/42] Implement 'rd.timeout' to modify the device timeout
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (12 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 13/42] iscsi: iscsi.initiator and others can and must only show up once Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 15/42] Do not call 'lvm' for non-LVM device-mapper devices Thomas Renninger
` (28 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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 8e4835d..5ff84ef 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 5fc5615..f7cffc4 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -890,12 +890,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"
@@ -922,7 +926,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] 52+ messages in thread* [PATCH 15/42] Do not call 'lvm' for non-LVM device-mapper devices
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (13 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 14/42] Implement 'rd.timeout' to modify the device timeout Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 16/42] Print stored dracut commandline during initramfs build Thomas Renninger
` (27 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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 17a71f0..edd8ea9 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] 52+ messages in thread* [PATCH 16/42] Print stored dracut commandline during initramfs build
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (14 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 15/42] Do not call 'lvm' for non-LVM device-mapper devices Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 17/42] Align dev_unit_name() with systemd's function Thomas Renninger
` (26 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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 a542f33..cda7955 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1584,6 +1584,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] 52+ messages in thread* [PATCH 17/42] Align dev_unit_name() with systemd's function.
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (15 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 16/42] Print stored dracut commandline during initramfs build Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
[not found] ` <1418309193-11208-18-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:46 ` [PATCH 18/42] Generate fallback mount unit for root filesystem Thomas Renninger
` (25 subsequent siblings)
42 siblings, 1 reply; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
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 f7cffc4..5c1504f 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -866,18 +866,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] 52+ messages in thread* [PATCH 18/42] Generate fallback mount unit for root filesystem
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (16 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 17/42] Align dev_unit_name() with systemd's function Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 19/42] 99base: warn on invalid command for initqueue Thomas Renninger
` (24 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
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] 52+ messages in thread* [PATCH 19/42] 99base: warn on invalid command for initqueue
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (17 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 18/42] Generate fallback mount unit for root filesystem Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 20/42] Handle module alias properly Thomas Renninger
` (23 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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] 52+ messages in thread* [PATCH 20/42] Handle module alias properly
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (18 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 19/42] 99base: warn on invalid command for initqueue Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 21/42] 99base: Increase initqueue timeout in non systemd case Thomas Renninger
` (22 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
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 edd8ea9..7a12a76 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] 52+ messages in thread* [PATCH 21/42] 99base: Increase initqueue timeout in non systemd case
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (19 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 20/42] Handle module alias properly Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 22/42] 90lvm: Install dm-snapshot module Thomas Renninger
` (21 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 7fcea4a..918dea5 100755
--- a/modules.d/99base/init.sh
+++ b/modules.d/99base/init.sh
@@ -166,7 +166,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] 52+ messages in thread* [PATCH 22/42] 90lvm: Install dm-snapshot module
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (20 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 21/42] 99base: Increase initqueue timeout in non systemd case Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 23/42] Check for logfile (--logfile option) and create it if necessary Thomas Renninger
` (20 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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] 52+ messages in thread* [PATCH 23/42] Check for logfile (--logfile option) and create it if necessary
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (21 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 22/42] 90lvm: Install dm-snapshot module Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 24/42] dracut.sh: Avoid duplicate devices in host_devs Thomas Renninger
` (19 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM, 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 cda7955..79f36b6 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] 52+ messages in thread* [PATCH 24/42] dracut.sh: Avoid duplicate devices in host_devs
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (22 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 23/42] Check for logfile (--logfile option) and create it if necessary Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 25/42] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed Thomas Renninger
` (18 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 79f36b6..a4c7ce5 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] 52+ messages in thread* [PATCH 25/42] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (23 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 24/42] dracut.sh: Avoid duplicate devices in host_devs Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 26/42] dracut.usage.asc: Remove distro specific help from manpage Thomas Renninger
` (17 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 a4c7ce5..2eba19b 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] 52+ messages in thread* [PATCH 26/42] dracut.usage.asc: Remove distro specific help from manpage
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (24 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 25/42] dracut.sh: Fix UUID= fstab parsing in case --mount option is passed Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 27/42] nfs: Add ip=... and root=nfs... parameters to internal dracut Thomas Renninger
` (16 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 9e788c1..b4a8663 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] 52+ messages in thread* [PATCH 27/42] nfs: Add ip=... and root=nfs... parameters to internal dracut
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (25 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 26/42] dracut.usage.asc: Remove distro specific help from manpage Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 28/42] 95iscsi: parse output from iscsiadm correctly Thomas Renninger
` (15 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
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 | 44 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index e1340b3..8eb542c 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,6 +28,43 @@ 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
@@ -37,6 +73,11 @@ install() {
mount.nfs4 umount rpc.idmapd sed /etc/netconfig
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] 52+ messages in thread* [PATCH 28/42] 95iscsi: parse output from iscsiadm correctly
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (26 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 27/42] nfs: Add ip=... and root=nfs... parameters to internal dracut Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 29/42] dracut: Do not stop installing drivers if one fails Thomas Renninger
` (14 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Due to some obsure reason the IFS parameter is not set correctly
when evaluating get_ibft_mod(). So change the parsing to not rely
on IFS altogether.
References: bnc#886199
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 9975e59..f13119f 100755
--- a/modules.d/95iscsi/module-setup.sh
+++ b/modules.d/95iscsi/module-setup.sh
@@ -30,15 +30,16 @@ check() {
get_ibft_mod() {
local ibft_mac=$1
+ local iface_mac iface_mod
# 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
+ for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do
+ iface_mod=${iface_desc%%,*}
+ iface_mac=${iface_desc#*,}
+ iface_mac=${iface_mac%%,*}
+ if [ "$ibft_mac" = "$iface_mac" ] ; then
+ echo $iface_mod
return 0
fi
- unset IFS
done
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 29/42] dracut: Do not stop installing drivers if one fails
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (27 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 28/42] 95iscsi: parse output from iscsiadm correctly Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 30/42] 95fcoe: update fcoe interface check Thomas Renninger
` (13 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
--add-drivers and --filesystems kernel drivers are added via:
instmods -c
The check option makes the function return if one driver could not get
installed without trying to install further drivers which is bad.
The user is still informed ($_silent is by default no), but all modules
passed to instmods are tried to be loaded, even if one fails.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut-functions.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dracut-functions.sh b/dracut-functions.sh
index 7a12a76..b91d8dc 100755
--- a/dracut-functions.sh
+++ b/dracut-functions.sh
@@ -1742,18 +1742,16 @@ instmods() {
if (($# == 0)); then # filenames from stdin
while read _mod; do
inst1mod "${_mod%.ko*}" || {
- if [[ "$_check" == "yes" ]]; then
- [[ "$_silent" == "no" ]] && dfatal "Failed to install module $_mod"
- return 1
+ if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
+ dfatal "Failed to install module $_mod"
fi
}
done
fi
while (($# > 0)); do # filenames as arguments
inst1mod ${1%.ko*} || {
- if [[ "$_check" == "yes" ]]; then
- [[ "$_silent" == "no" ]] && dfatal "Failed to install module $1"
- return 1
+ if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
+ dfatal "Failed to install module $1"
fi
}
shift
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 30/42] 95fcoe: update fcoe interface check
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (28 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 29/42] dracut: Do not stop installing drivers if one fails Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 31/42] 95fcoe: Store current configuration in dracut cmdline Thomas Renninger
` (12 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The 'create' sysfs entry has been removed for newer fcoe modules,
so just check if the module directory exists.
References: bnc#877288
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95fcoe/parse-fcoe.sh | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/modules.d/95fcoe/parse-fcoe.sh b/modules.d/95fcoe/parse-fcoe.sh
index 59de56f..9604503 100755
--- a/modules.d/95fcoe/parse-fcoe.sh
+++ b/modules.d/95fcoe/parse-fcoe.sh
@@ -20,14 +20,11 @@
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
-[ -e /sys/module/fcoe/parameters/create ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
+[ -d /sys/module/fcoe ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
modprobe bnx2fc >/dev/null 2>&1
udevadm settle --timeout=30
-# FCoE actually supported?
-[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
-
parse_fcoe_opts() {
local IFS=:
set $fcoe
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 31/42] 95fcoe: Store current configuration in dracut cmdline
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (29 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 30/42] 95fcoe: update fcoe interface check Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
[not found] ` <1418309193-11208-32-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:46 ` [PATCH 32/42] 95fcoe: skip VLAN devices in fcoe-up Thomas Renninger
` (11 subsequent siblings)
42 siblings, 1 reply; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
When running with --hostonly-cmdline we should be storing
the current configuration in /etc/cmdline.d so that dracut
will be configure the system automatically.
References: bnc#877288
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95fcoe/module-setup.sh | 52 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
index b67aa04..174745a 100755
--- a/modules.d/95fcoe/module-setup.sh
+++ b/modules.d/95fcoe/module-setup.sh
@@ -2,7 +2,16 @@
# called by dracut
check() {
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
+ for c in /sys/bus/fcoe/devices/ctlr_* ; do
+ [ -L $c ] || continue
+ fcoe_ctlr=$c
+ done
+ [ -z "$fcoe_ctlr" ] && return 255
+ }
+
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
+
return 0
}
@@ -17,12 +26,55 @@ installkernel() {
instmods fcoe 8021q edd
}
+get_vlan_parent() {
+ local link=$1
+
+ [ -d $link ] || return
+ read iflink < $link/iflink
+ for if in /sys/class/net/* ; do
+ read idx < $if/ifindex
+ if [ $idx -eq $iflink ] ; then
+ echo ${if##*/}
+ fi
+ done
+}
+
+# called by dracut
+cmdline() {
+
+ for c in /sys/bus/fcoe/devices/ctlr_* ; do
+ [ -L $c ] || continue
+ read enabled < $c/enabled
+ [ $enabled -eq 0 ] && continue
+ d=$(cd -P $c; echo $PWD)
+ i=${d%/*}
+ read mac < ${i}/address
+ s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
+ if [ -z "$s" ] ; then
+ p=$(get_vlan_parent ${i})
+ if [ "$p" ] ; then
+ s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
+ fi
+ fi
+ if [ "$s" = "on" ] ; then
+ dcb="dcb"
+ else
+ dcb="nodcb"
+ fi
+ echo "fcoe=${mac}:${dcb}"
+ done
+}
+
# called by dracut
install() {
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
+ if [[ $hostonly_cmdline == "yes" ]] ; then
+ local _fcoeconf=$(cmdline)
+ [[ $_fcoeconf ]] && printf "%s\n" "$_fcoeconf" >> "${initdir}/etc/cmdline.d/95fcoe.conf"
+ fi
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 32/42] 95fcoe: skip VLAN devices in fcoe-up
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (30 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 31/42] 95fcoe: Store current configuration in dracut cmdline Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 33/42] 95fcoe: start lldpad separately Thomas Renninger
` (10 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
DCB & fipvlan can only be called on real devices, not VLAN
ones. So skip any VLAN devices which might been added to the
list of network interfaces.
References: bnc#878583
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95fcoe/fcoe-up.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
index b9d0411..7f6eb1b 100755
--- a/modules.d/95fcoe/fcoe-up.sh
+++ b/modules.d/95fcoe/fcoe-up.sh
@@ -16,6 +16,14 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
netif=$1
dcb=$2
+iflink=$(cat /sys/class/net/$netif/iflink)
+ifindex=$(cat /sys/class/net/$netif/ifindex)
+if [ "$iflink" != "$ifindex" ] ; then
+ # Skip VLAN devices
+ exit 0
+fi
+
+ip link set dev $netif up
linkup "$netif"
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 33/42] 95fcoe: start lldpad separately
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (31 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 32/42] 95fcoe: skip VLAN devices in fcoe-up Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 34/42] Enhance suse.conf and debug module example with SUSE-specific settings Thomas Renninger
` (9 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
lldpad is a system-wide process, which must be started only once.
So we should be separate it from fcoe-up, as it might be called
several times.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95fcoe/fcoe-up.sh | 8 --------
modules.d/95fcoe/lldpad.sh | 14 ++++++++++++++
modules.d/95fcoe/module-setup.sh | 1 +
3 files changed, 15 insertions(+), 8 deletions(-)
create mode 100644 modules.d/95fcoe/lldpad.sh
diff --git a/modules.d/95fcoe/fcoe-up.sh b/modules.d/95fcoe/fcoe-up.sh
index 7f6eb1b..43a0ad5 100755
--- a/modules.d/95fcoe/fcoe-up.sh
+++ b/modules.d/95fcoe/fcoe-up.sh
@@ -30,10 +30,6 @@ netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
netdriver=${netdriver##*/}
if [ "$dcb" = "dcb" ]; then
- # Note lldpad will stay running after switchroot, the system initscripts
- # are to kill it and start a new lldpad to take over. Data is transfered
- # between the 2 using a shm segment
- lldpad -d
# wait for lldpad to be ready
i=0
while [ $i -lt 60 ]; do
@@ -43,10 +39,6 @@ if [ "$dcb" = "dcb" ]; then
i=$(($i+1))
done
- # on some systems lldpad needs some time
- # sleep until we find a better solution
- sleep 30
-
while [ $i -lt 60 ]; do
dcbtool sc "$netif" dcb on && break
info "Retrying to turn dcb on"
diff --git a/modules.d/95fcoe/lldpad.sh b/modules.d/95fcoe/lldpad.sh
new file mode 100644
index 0000000..d06a3bd
--- /dev/null
+++ b/modules.d/95fcoe/lldpad.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Note lldpad will stay running after switchroot, the system initscripts
+# are to kill it and start a new lldpad to take over. Data is transfered
+# between the 2 using a shm segment
+lldpad -d
+# wait for lldpad to be ready
+i=0
+while [ $i -lt 60 ]; do
+ lldptool -p && break
+ info "Waiting for lldpad to be ready"
+ sleep 1
+ i=$(($i+1))
+done
diff --git a/modules.d/95fcoe/module-setup.sh b/modules.d/95fcoe/module-setup.sh
index 174745a..9c67f17 100755
--- a/modules.d/95fcoe/module-setup.sh
+++ b/modules.d/95fcoe/module-setup.sh
@@ -78,6 +78,7 @@ install() {
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
+ inst_hook pre-trigger 03 "$moddir/lldpad.sh"
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
dracut_need_initqueue
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 34/42] Enhance suse.conf and debug module example with SUSE-specific settings
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (32 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 33/42] 95fcoe: start lldpad separately Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 35/42] 40network: add missing _arch variable declaration Thomas Renninger
` (8 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
SUSE is using specific settings for dracut, so add them
to the suse.conf.example file.
Add vi and find to the debug module add some help text to the suse.conf
file when and how to use it.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.conf.d/suse.conf.example | 21 +++++++++++++++++++++
modules.d/95debug/module-setup.sh | 3 +--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/dracut.conf.d/suse.conf.example b/dracut.conf.d/suse.conf.example
index 1e7f80e..37ffd72 100644
--- a/dracut.conf.d/suse.conf.example
+++ b/dracut.conf.d/suse.conf.example
@@ -1,3 +1,24 @@
+# SUSE specifc dracut settings
+#
+# SUSE by default always builds a as small as possible initrd for performance
+# and resource reasons.
+# If you like to build a generic initrd which works on other platforms than
+# on the one dracut/mkinitrd got called comment out below setting(s).
+hostonly="yes"
+hostonly_cmdline="yes"
+
+compress="xz -0 --check=crc32 --memlimit-compress=50%"
+
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
omit_drivers+=" i2o_scsi"
+# Below adds additional tools to the initrd which are not urgently necessary to
+# bring up the system, but help to debug problems.
+# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
+# are installed and add more if you need them. This specifically helps if you
+# use:
+# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
+# mount|pre-pivot|cleanup]
+# boot parameter or if you are forced to enter the dracut emergency shell.
+
+# add_dracutmodules+=debug
diff --git a/modules.d/95debug/module-setup.sh b/modules.d/95debug/module-setup.sh
index 625f7fb..5a9aaac 100755
--- a/modules.d/95debug/module-setup.sh
+++ b/modules.d/95debug/module-setup.sh
@@ -14,8 +14,7 @@ depends() {
# called by dracut
install() {
inst_multiple -o ps grep more cat rm strace free showmount \
- ping netstat rpcinfo vi scp ping6 ssh \
+ ping netstat rpcinfo vi scp ping6 ssh find vi \
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
-
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 35/42] 40network: add missing _arch variable declaration
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (33 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 34/42] Enhance suse.conf and debug module example with SUSE-specific settings Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 36/42] 99base: Add chown binary Thomas Renninger
` (7 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
The module_setup.sh script was missing an '_arch' declaration,
causing network not to be installed on s390.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/40network/module-setup.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules.d/40network/module-setup.sh b/modules.d/40network/module-setup.sh
index 55bee4c..f7e0a87 100755
--- a/modules.d/40network/module-setup.sh
+++ b/modules.d/40network/module-setup.sh
@@ -17,6 +17,7 @@ depends() {
# called by dracut
installkernel() {
# Include wired net drivers, excluding wireless
+ local _arch=$(uname -m)
net_module_filter() {
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 36/42] 99base: Add chown binary
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (34 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 35/42] 40network: add missing _arch variable declaration Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 37/42] 90kernel-modules: install scsi_dh_alua Thomas Renninger
` (6 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
nvidia driver needs this via modprobe script.
Needs to do change the group after a device node got created.
Add chown instead of chgrp which can also change the owner of a file.
Ask Stefand Dirsch <sndirsch-l3A5Bk7waGM@public.gmane.org> for details.
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/99base/module-setup.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh
index 7d30320..a1046af 100755
--- a/modules.d/99base/module-setup.sh
+++ b/modules.d/99base/module-setup.sh
@@ -15,7 +15,7 @@ depends() {
install() {
local _d
- inst_multiple mount mknod mkdir sleep chroot \
+ inst_multiple mount mknod mkdir sleep chroot chown \
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid
inst $(command -v modprobe) /sbin/modprobe
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 37/42] 90kernel-modules: install scsi_dh_alua
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (35 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 36/42] 99base: Add chown binary Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 38/42] Fix non-export of journal dev boot options Thomas Renninger
` (5 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Install the missing scsi_dh_alua module, too.
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/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 2fa263c..1a8fcff 100755
--- a/modules.d/90kernel-modules/module-setup.sh
+++ b/modules.d/90kernel-modules/module-setup.sh
@@ -41,7 +41,7 @@ installkernel() {
uhci-hcd \
xhci-hcd
- instmods yenta_socket scsi_dh_rdac scsi_dh_emc \
+ instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
hid-logitech-dj hid-microsoft hid-lcpower firewire-ohci \
pcmcia hid-hyperv hv-vmbus hyperv-keyboard
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 38/42] Fix non-export of journal dev boot options.
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (36 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 37/42] 90kernel-modules: install scsi_dh_alua Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 39/42] Also export root= boot param for hostonly-cmdline case Thomas Renninger
` (4 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Thorsten Behrens
From: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
cmdline_journal does not contain linefeeds anymore, so read
silently skipped it altogether.
Signed-off-by: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95rootfs-block/module-setup.sh | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh
index 258b32f..c2f71bb 100755
--- a/modules.d/95rootfs-block/module-setup.sh
+++ b/modules.d/95rootfs-block/module-setup.sh
@@ -43,9 +43,8 @@ cmdline() {
# called by dracut
install() {
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline_journal | while read journaldev; do
- [[ $journaldev ]] && printf "%s\n" "$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
- done
+ local _journaldev=$(cmdline_journal)
+ [[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
fi
inst_multiple umount
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 39/42] Also export root= boot param for hostonly-cmdline case.
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (37 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 38/42] Fix non-export of journal dev boot options Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 40/42] Don't create lots of empty cmdline files " Thomas Renninger
` (3 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Thorsten Behrens
From: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
If there's a root fallback, at least attempt to have it falling
back to the last root filesystem this system ran off of.
Signed-off-by: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95rootfs-block/module-setup.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh
index c2f71bb..81de177 100755
--- a/modules.d/95rootfs-block/module-setup.sh
+++ b/modules.d/95rootfs-block/module-setup.sh
@@ -29,14 +29,18 @@ cmdline_journal() {
return 0
}
-# called by dracut
-cmdline() {
+cmdline_rootfs() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
printf " rootflags=%s" "$(find_mp_fsopts /)"
printf " rootfstype=%s" "$(find_mp_fstype /)"
fi
+}
+
+# called by dracut
+cmdline() {
+ cmdline_rootfs
cmdline_journal
}
@@ -45,6 +49,8 @@ install() {
if [[ $hostonly_cmdline == "yes" ]]; then
local _journaldev=$(cmdline_journal)
[[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
+ local _rootdev=$(cmdline_rootfs)
+ [[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf"
fi
inst_multiple umount
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 40/42] Don't create lots of empty cmdline files for hostonly-cmdline case
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (38 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 39/42] Also export root= boot param for hostonly-cmdline case Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-11 14:46 ` [PATCH 41/42] 95rootfs-block: Correctly terminate commandline parameter Thomas Renninger
` (2 subsequent siblings)
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Thorsten Behrens
From: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
This aligns other places piping cmdline() output to cmdline.d files
with the earlier fix for 95rootfs-block.
Signed-off-by: Thorsten Behrens <tbehrens-IBi9RG/b67k@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/90crypt/module-setup.sh | 4 ++--
modules.d/90dmraid/module-setup.sh | 4 ++--
modules.d/90lvm/module-setup.sh | 4 ++--
modules.d/90mdraid/module-setup.sh | 4 ++--
modules.d/95resume/module-setup.sh | 4 ++--
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index 37ae859..ea1e340 100755
--- a/modules.d/90crypt/module-setup.sh
+++ b/modules.d/90crypt/module-setup.sh
@@ -50,8 +50,8 @@ cmdline() {
install() {
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
- echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
+ local _cryptconf=$(cmdline)
+ [[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf"
fi
inst_multiple cryptsetup rmdir readlink umount
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
index 508598b..044e01f 100755
--- a/modules.d/90dmraid/module-setup.sh
+++ b/modules.d/90dmraid/module-setup.sh
@@ -64,8 +64,8 @@ install() {
local _i
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
- echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
+ local _raidconf=$(cmdline)
+ [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
fi
inst_multiple dmraid
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
index 5515ac0..592a2e2 100755
--- a/modules.d/90lvm/module-setup.sh
+++ b/modules.d/90lvm/module-setup.sh
@@ -53,8 +53,8 @@ install() {
inst lvm
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
- echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
+ local _lvmconf=$(cmdline)
+ [[ $_lvmconf ]] && printf "%s\n" "$_lvmconf" >> "${initdir}/etc/cmdline.d/90lvm.conf"
fi
inst_rules "$moddir/64-lvm.rules"
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
index ce3394a..747ea8a 100755
--- a/modules.d/90mdraid/module-setup.sh
+++ b/modules.d/90mdraid/module-setup.sh
@@ -71,8 +71,8 @@ install() {
inst $(command -v mdadm) /sbin/mdadm
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf"
- echo >> "${initdir}/etc/cmdline.d/90mdraid.conf"
+ local _raidconf=$(cmdline)
+ [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf"
fi
# <mdadm-3.3 udev rule
diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh
index 1ddb6e4..dfd4350 100755
--- a/modules.d/95resume/module-setup.sh
+++ b/modules.d/95resume/module-setup.sh
@@ -29,8 +29,8 @@ install() {
local _bin
if [[ $hostonly_cmdline == "yes" ]]; then
- cmdline >> "${initdir}/etc/cmdline.d/95resume.conf"
- echo >> "${initdir}/etc/cmdline.d/95resume.conf"
+ local _resumeconf=$(cmdline)
+ [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
fi
# Optional uswsusp support
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 41/42] 95rootfs-block: Correctly terminate commandline parameter
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (39 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 40/42] Don't create lots of empty cmdline files " Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
[not found] ` <1418309193-11208-42-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
2014-12-11 14:46 ` [PATCH 42/42] dracut: nbd: Only complain of missing binary in hostonly mode if Thomas Renninger
2014-12-17 10:26 ` [RESEND] SUSE patches which should show up mainline Harald Hoyer
42 siblings, 1 reply; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM,
Hannes Reinecke
From: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
95rootfs-block would not terminate the commandline parameter with
a space or newline, instead it'll rely on the main routine from
dracut.sh to do this.
Which will cause unexpected problems for any modules called
after this.
So terminate the commandline parameters correctly here and remove
the newline from dracut.sh.
Signed-off-by: Hannes Reinecke <hare-l3A5Bk7waGM@public.gmane.org>
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
dracut.sh | 1 -
modules.d/95rootfs-block/module-setup.sh | 8 ++++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index 2eba19b..f384d2d 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1299,7 +1299,6 @@ if [[ $print_cmdline ]]; then
module_cmdline "$_d_mod"
done
unset moddir
- printf "\n"
exit 0
fi
diff --git a/modules.d/95rootfs-block/module-setup.sh b/modules.d/95rootfs-block/module-setup.sh
index 81de177..33875f8 100755
--- a/modules.d/95rootfs-block/module-setup.sh
+++ b/modules.d/95rootfs-block/module-setup.sh
@@ -22,7 +22,7 @@ cmdline_journal() {
fi
if [ -n "$journaldev" ]; then
- printf " root.journaldev=%s" "$journaldev"
+ echo "root.journaldev=${journaldev}"
fi
done
fi
@@ -32,9 +32,9 @@ cmdline_journal() {
cmdline_rootfs() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
- printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
- printf " rootflags=%s" "$(find_mp_fsopts /)"
- printf " rootfstype=%s" "$(find_mp_fstype /)"
+ printf "root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
+ printf "rootflags=%s" "$(find_mp_fsopts /)"
+ printf "rootfstype=%s\n" "$(find_mp_fstype /)"
fi
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* [PATCH 42/42] dracut: nbd: Only complain of missing binary in hostonly mode if
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (40 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 41/42] 95rootfs-block: Correctly terminate commandline parameter Thomas Renninger
@ 2014-12-11 14:46 ` Thomas Renninger
2014-12-17 10:26 ` [RESEND] SUSE patches which should show up mainline Harald Hoyer
42 siblings, 0 replies; 52+ messages in thread
From: Thomas Renninger @ 2014-12-11 14:46 UTC (permalink / raw)
To: harald-H+wXaHxf7aLQT0dZR+AlfA
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, trenn-l3A5Bk7waGM
rootfs is on nbd
In not hostonly mode, require_binaries will still complain.
If in hostonly mode and the module is explicitly added via -a nbd, then
install() section will still complain later:
dracut-install: ERROR: installing 'nbd-client'
Signed-off-by: Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>
---
modules.d/95nbd/module-setup.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh
index 4f9e350..3cb6f49 100755
--- a/modules.d/95nbd/module-setup.sh
+++ b/modules.d/95nbd/module-setup.sh
@@ -3,8 +3,6 @@
# called by dracut
check() {
local _rootdev
- # If our prerequisites are not met, fail.
- require_binaries nbd-client || return 1
# if an nbd device is not somewhere in the chain of devices root is
# mounted on, fail the hostonly check.
@@ -15,6 +13,7 @@ check() {
[[ -b /dev/block/$_rootdev ]] || return 1
check_block_and_slaves is_nbd "$_rootdev" || return 255
}
+ require_binaries nbd-client || return 1
return 0
}
--
1.8.5.2
^ permalink raw reply related [flat|nested] 52+ messages in thread* Re: [RESEND] SUSE patches which should show up mainline
[not found] ` <1418309193-11208-1-git-send-email-trenn-l3A5Bk7waGM@public.gmane.org>
` (41 preceding siblings ...)
2014-12-11 14:46 ` [PATCH 42/42] dracut: nbd: Only complain of missing binary in hostonly mode if Thomas Renninger
@ 2014-12-17 10:26 ` Harald Hoyer
[not found] ` <54915A3C.9050409-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
42 siblings, 1 reply; 52+ messages in thread
From: Harald Hoyer @ 2014-12-17 10:26 UTC (permalink / raw)
To: Thomas Renninger; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On 11.12.2014 15:45, Thomas Renninger wrote:
> Hi,
>
> Changes to last post:
> - Removed unnecessary IFS variable restoring
> - Removed inst_multiple sed and host from nfs module
> - Removed warpclock patch/module (according Chao Wang this is done by systemd
> by copying /etc/{localtime,adjtime} to initramfs)
>
> One cleanup for the future I have in mind:
> As udev rules are often moved around in timeline (just the number changes),
> it would be nice if systemd enforces that udev rules must be unique.
> That would mean this is forbidden:
> 01-ruleXXX
> 05-ruleXXX
> Then dracut could implement:
> inst_rule ruleXXX
> and it would work for all distros and versions.
> But this needs clarification with systemd people first.
>
> Would be great to see as many of these applied already.
> E.g. mkinitrd-suse: Update to sles12 SUSE state
> should not be a big deal to apply.
>
> Thanks a lot,
>
> Thomas
>
Reviewed the patches, added one patch for module handling.
Test suite passed!
Pushed! Many thanks!
^ permalink raw reply [flat|nested] 52+ messages in thread