dracut/0018-mkinitrd-suse-Fix-whitespaces-when-adding-drivers.patch
Hannes Reinecke 3f26422f3a Accepting request 236221 from home:hreinecke:branches:Base:System
- Rename patches to match git repository:
  * old: 0013-Correct-paths-for-openSUSE.patch
    new: 0011-Correct-paths-for-openSUSE.patch
  * old: 0014-Check-for-plymouth-lib-directories.patch
    new: 0012-Check-for-plymouth-lib-directories.patch
  * old: dracut_do_not_update_booloader_if_no_kernel_is_found.patch
    new: 0013-mkinitrd-suse-do-not-update-bootloader-if-no-kernel-.patch
  * old: suse_grub_manpage.patch
    new: 0014-Update-dracut-manpage-for-GRUB-Legacy-and-GRUB2.patch
  * old: replace_dhclient_with_wickedd_dhcp_supplicants.patch
    new: 0015-40network-replace-dhclient-with-wickedd-dhcp-supplic.patch
  * old: 0015-add-new-s390x-specific-rule-files.patch
    new: 0016-Add-new-s390x-specific-rule-files.patch
  * old: change_write_ifcfg_to_suse.patch
    new: 0017-45ifcfg-use-distro-specific-scripts.patch
  * old: dracut-fix-whitespace-add-drivers_call.patch
    new: 0018-mkinitrd-suse-Fix-whitespaces-when-adding-drivers.patch
  * old: wait_for_network_race_condition_fix.patch
    new: 0019-40network-Fix-race-condition-when-wait-for-networks.patch
  * old: dracut-warpclock_module.patch
    new: 0020-00warpclock-Set-correct-timezone.patch
  * old: s390-dcssblk.patch
    new: 0021-95dcssblk-Add-new-module-for-DCSS-block-devices.patch
  * old: dracut-install-persistent-rule.patch
    new: 0022-95udev-rules-add-persistent-network-rule.patch
  * old: dracut-really-always-add-autofs4.patch
    new: 0023-systemd-always-tries-to-load-autofs4.patch
  * old: mdraid-setup.patch
    new: 0024-Fixup-mdraid-setup.patch
  * old: 0015-95udev-rules-Add-59-scsi-sg_utils.rules.patch

OBS-URL: https://build.opensuse.org/request/show/236221
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=156
2014-06-04 12:38:30 +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