chiark / gitweb /
kernel-install/90-loaderentry.install: fix cmdline parsing
authorMichael Chapman <mike@very.puzzling.org>
Wed, 29 Oct 2014 00:54:07 +0000 (11:54 +1100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 1 Nov 2014 18:39:48 +0000 (14:39 -0400)
A recent commit (2f3a215) changed the parsing of /proc/cmdline to use a
shell array. Unfortunately, this introduced a bug: "read -ar line"
populates the shell variable $r, not $line. This breaks installation of
new loader entries:

  # kernel-install add 3.17.1-304.fc21.x86_64 \
      /boot/vmlinuz-3.17.1-304.fc21.x86_64
  Could not determine the kernel command line parameters.
  Please specify the kernel command line in /etc/kernel/cmdline!

This commit alters the read command to correctly populate the $line
array instead.

src/kernel-install/90-loaderentry.install

index 6f032b5a4b7b47e26c5537755472a730210ec8c6..d433e00a5c3fc1508024431558d8c614d9c6c4d2 100644 (file)
@@ -47,7 +47,7 @@ if [[ -f /etc/kernel/cmdline ]]; then
 fi
 
 if ! [[ ${BOOT_OPTIONS[*]} ]]; then
-    read -ar line < /proc/cmdline
+    read -a line -r < /proc/cmdline
     for i in "${line[@]}"; do
         [[ "${i#initrd=*}" != "$i" ]] && continue
         BOOT_OPTIONS[${#BOOT_OPTIONS[@]}]="$i"