dracut/0182-fix-include-parsing.patch
Thomas Renninger 054341caad Accepting request 346361 from home:favogt:branches:Base:System
Update to dracut-044 and several cleanups.
Works on tumbleweed standard installation and NFS root.

OBS-URL: https://build.opensuse.org/request/show/346361
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=244
2015-11-26 11:35:04 +00:00

42 lines
1.3 KiB
Diff

From 11d6560d7bbd8a4c4610a39c0985e50d728920fb Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.com>
Date: Mon, 21 Sep 2015 15:15:07 +0200
Subject: [PATCH] Fix parsing of "-i" and "--include"
- dracut replaced every instance of "-i" in the cmdline,
even if it was part of a kernel image name, e.g. "vmlinuz-i"
- Fixes boo#908452
Signed-off-by: Fabian Vogt <fvogt@suse.com>
---
dracut.sh | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
Index: dracut-044/dracut.sh
===================================================================
--- dracut-044.orig/dracut.sh
+++ dracut-044/dracut.sh
@@ -279,11 +279,17 @@ dropindirs_sort()
rearrange_params()
{
# Workaround -i, --include taking 2 arguments
- set -- "${@/--include/++include}"
-
- # This prevents any long argument ending with "-i"
- # -i, like --opt-i but I think we can just prevent that
- set -- "${@/%-i/++include}"
+ newat=()
+ for i in "$@"; do
+ if [[ $i =~ ^-i(.*) ]]; then
+ newat+=("++include" "${BASH_REMATCH[1]}") # Replace -i by ++include
+ elif [[ $i == "--include" ]]; then
+ newat+=("++include") # Replace --include by ++include
+ else
+ newat+=("$i")
+ fi
+ done
+ set -- "${newat[@]}" # Set new $@
TEMP=$(unset POSIXLY_CORRECT; getopt \
-o "a:m:o:d:I:k:c:L:fvqlHhMN" \