dracut/dracut-fix-whitespace-add-drivers_call.patch
Shawn Dunn 7955a4d13a Accepting request 229484 from home:hreinecke:branches:Base:System
- Update dracut to 037
  * Add --hostonly_cmdline switch
  * Update --mount syntax
  * Include modules from /updates directory
  * Fixes for network setup
  * Some small fixes
- Rediff patches
- Include iscsiuio again (bnc#872474)
  Remove: remove-iscsiuio.patch
- Install 59-scsi-sg_utils.rules (bnc#872478)
  Add: 0015-95udev-rules-Add-59-scsi-sg_utils.rules.patch
- Install 67-kpartx-compat.rules (bnc#872662)
  Add: 0016-90multipath-add-67-kpartx-compat.rules.patch
- Install separate multipath service file (bnc#871610)
  Add: 0017-90multipath-install-dracut-specific-service-file.patch
- Do not fsck and mount from fstab if systemd is used (bnc#
  Add: 0018-fstab-do-not-mount-and-fsck-from-fstab-if-using-syst.patch
- Fixup initqueue for remote-fs
  Add: 0019-dracut-initqueue-service-runs-before-remote-fs-pre.t.patch

OBS-URL: https://build.opensuse.org/request/show/229484
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=124
2014-04-09 12:44:32 +00:00

95 lines
3.3 KiB
Diff

From 942274be37437eefad4ebebae40af43d7bd336b6 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 8 Apr 2014 08:49:53 +0200
Subject: [PATCH] mkinitrd-suse: Fix whitespaces when adding drivers
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
mkinitrd-suse.sh | 49 +++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/mkinitrd-suse.sh b/mkinitrd-suse.sh
index b31ea36..1c2634f 100755
--- a/mkinitrd-suse.sh
+++ b/mkinitrd-suse.sh
@@ -70,10 +70,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
@@ -310,11 +307,10 @@ 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 "
+echo "Creating: target|kernel|dracut args "
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
@@ -324,28 +320,33 @@ 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:]])}
+
# 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
+ echo "$target|$kernel|$dracut_args_all"
+ # Duplicate code: --add-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 --add-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 --add-drivers "${modules_all}" "$target" "$kernel"
+ else
$dracut_cmd $dracut_args "$target" "$kernel"
- fi
+ fi
fi
done
--
1.8.1.4