]> git.proxmox.com Git - pve-kernel-meta.git/commitdiff
proxmox-boot: handle /etc/kernel/cmdline without any newline
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Nov 2021 17:53:55 +0000 (18:53 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Nov 2021 17:53:55 +0000 (18:53 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxmox-boot/zz-proxmox-boot

index faeac94be6dde8470cd98537e3cae0ef7e4dc05d..48ab29d369b8c3e79a148415e52a6ca4460289c2 100755 (executable)
@@ -50,7 +50,11 @@ update_esps() {
            exit 0
        fi
        if [ -f /etc/kernel/cmdline ]; then
-               read -r CMDLINE < /etc/kernel/cmdline
+               # we can have cmdline files with multiple or no new line at all, handle both!
+               while IFS= read -r CMDLINE || [ -n "$CMDLINE" ]; do
+                       CMDLINE="$CMDLINE"
+                       break
+               done < /etc/kernel/cmdline
                echo ${CMDLINE} | grep -q 'root=' || \
                        { warn "No root= parameter in /etc/kernel/cmdline found!"; exit 1; }
        else