From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 73D0A7E6AA for ; Wed, 10 Nov 2021 16:25:57 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 650B81FAA7 for ; Wed, 10 Nov 2021 16:25:27 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 0E62C1FA99 for ; Wed, 10 Nov 2021 16:25:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id D28A642C0E for ; Wed, 10 Nov 2021 16:25:24 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Wed, 10 Nov 2021 16:25:10 +0100 Message-Id: <20211110152510.3979872-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.327 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: [pve-devel] [PATCH pve-kernel-meta v2] proxmox-boot: read only first line of /etc/kernel/cmdline X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 15:25:57 -0000 following the commit of removing the wrong indentation of the linux and initrd lines - this commit strips empty lines (and leading trailing whitespace) in /etc/kernel/cmdline. I managed to reproduce the issue reported in the forum [0] by adding empty lines to /etc/kernel/cmdline) - without this - systemd-boot booted quite happily even with the indentation. considered using perl -pe with multiline matching but thanks to Thomas' suggestion went with the shell-builtin read. the check for existance of 'root=' in the resulting CMDLINE was added, since my test-system had an empty line in the beginning, which again rendered it unbootable. quickly tested on a VM. [0]: https://forum.proxmox.com/threads/problem-with-proxmox-boot-tool.99043/ Signed-off-by: Stoiko Ivanov --- v1->v2: * incorporated Dominik and Thomas' feedback (huge thanks for catching my glitches!) proxmox-boot/zz-proxmox-boot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxmox-boot/zz-proxmox-boot b/proxmox-boot/zz-proxmox-boot index 52171b2..26a9e7e 100755 --- a/proxmox-boot/zz-proxmox-boot +++ b/proxmox-boot/zz-proxmox-boot @@ -50,7 +50,9 @@ update_esps() { exit 0 fi if [ -f /etc/kernel/cmdline ]; then - CMDLINE="$(cat /etc/kernel/cmdline)" + read -r CMDLINE < /etc/kernel/cmdline + echo ${CMDLINE} | grep -q 'root=' || \ + { warn "No root= parameter in /etc/kernel/cmdline found!"; exit 1; } else warn "No /etc/kernel/cmdline found - falling back to /proc/cmdline" # remove initrd entries -- 2.30.2