summaryrefslogtreecommitdiff
path: root/src/kernel-install/90-loaderentry.install
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2014-08-15 14:39:05 +0200
committerHarald Hoyer <harald@redhat.com>2014-08-15 14:41:50 +0200
commit2f3a215f61d758cd59b3be5b65976a12401ac4ff (patch)
tree183cd54fc19c8a1478fc125c1ce1280ee769b34d /src/kernel-install/90-loaderentry.install
parent926446f4aab62d5fa02840d39d661de61632292c (diff)
kernel-install/90-loaderentry.install: fixed cmdline parsing
If /etc/kernel/cmdline is missing or empty, we read /proc/cmdline and want to filter out the initrd line. Due to a bug, the whole contents was filtered out.
Diffstat (limited to 'src/kernel-install/90-loaderentry.install')
-rw-r--r--src/kernel-install/90-loaderentry.install9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
index c17b8a98d5..6f032b5a4b 100644
--- a/src/kernel-install/90-loaderentry.install
+++ b/src/kernel-install/90-loaderentry.install
@@ -47,11 +47,10 @@ if [[ -f /etc/kernel/cmdline ]]; then
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
- readarray -t line < /proc/cmdline
- for i in ${line[*]}; do
- if [[ "${i#initrd=*}" == "$i" ]]; then
- BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
- fi
+ read -ar line < /proc/cmdline
+ for i in "${line[@]}"; do
+ [[ "${i#initrd=*}" != "$i" ]] && continue
+ BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"
done
fi