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 47F2F7E641 for ; Wed, 10 Nov 2021 15:49:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3EB531ED1C for ; Wed, 10 Nov 2021 15:48:51 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 503A11ED10 for ; Wed, 10 Nov 2021 15:48:50 +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 25E3941F74 for ; Wed, 10 Nov 2021 15:48:50 +0100 (CET) Message-ID: <3169edbf-181c-34ec-eec0-2dd54980cdcd@proxmox.com> Date: Wed, 10 Nov 2021 15:48:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Thunderbird/95.0 Content-Language: en-US To: Proxmox VE development discussion , Dominik Csapak , Stoiko Ivanov References: <20211110141511.3617927-1-s.ivanov@proxmox.com> From: Thomas Lamprecht In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.976 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 NICE_REPLY_A -1.678 Looks like a legit reply (A) 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: Re: [pve-devel] [PATCH pve-kernel-meta] proxmox-boot: trim /etc/kernel/cmdline before appending 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 14:49:21 -0000 On 10.11.21 15:28, Dominik Csapak wrote: > comment inline >=20 > On 11/10/21 15:15, Stoiko Ivanov wrote: >> 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. >> >> quickly tested on a VM. >> >> [0]: https://forum.proxmox.com/threads/problem-with-proxmox-boot-tool.= 99043/ >> >> Signed-off-by: Stoiko Ivanov >> --- >> =C2=A0 proxmox-boot/zz-proxmox-boot | 2 +- >> =C2=A0 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/proxmox-boot/zz-proxmox-boot b/proxmox-boot/zz-proxmox-bo= ot >> index 52171b2..2356c74 100755 >> --- a/proxmox-boot/zz-proxmox-boot >> +++ b/proxmox-boot/zz-proxmox-boot >> @@ -50,7 +50,7 @@ update_esps() { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 exit 0 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fi >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if [ -f /etc/kernel/cmdline ]; then >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CMDLINE=3D"$(cat /etc/kern= el/cmdline)" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CMDLINE=3D"$(sed -re '/^\s= *$/d;s/^\s+(\S*)\s+$/\1/g' /etc/kernel/cmdline)" >=20 > while the first=C2=A0 part of the regex looks good (delete all lines th= at only contain whitespace (or nothing), the second part will often not t= rigger since there is not *only* non-whitespace in the middle? >=20 > should it not be more like: >=20 > '^\s+(.*?)\s+$/\1/g' ? or just care for trailing whitespaces, i.e. use `head -n 1 /etc/kernel/cm= dline` ? Or alternatively using read should work too: read -r CMDLINE < /etc/kernel/cmdline=20 Important in general is that we only get a single line to not break tools= that expect that during the boot process.