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 CBC2773F19 for ; Thu, 8 Jul 2021 09:06:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C1D7B12DA8 for ; Thu, 8 Jul 2021 09:06:52 +0200 (CEST) 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 19E4F12D9A for ; Thu, 8 Jul 2021 09:06:51 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DA92B40EE9 for ; Thu, 8 Jul 2021 09:06:50 +0200 (CEST) Date: Thu, 08 Jul 2021 09:06:41 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20210707210954.765260-1-s.ivanov@proxmox.com> <20210707210954.765260-3-s.ivanov@proxmox.com> In-Reply-To: <20210707210954.765260-3-s.ivanov@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1625727759.xarzr6e8sn.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.468 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 PROLO_LEO2 0.1 Meta Catches all Leo drug variations so far 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 2/5] proxmox-boot: divert call to grub-install to p-b-t init 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: Thu, 08 Jul 2021 07:06:52 -0000 On July 7, 2021 11:09 pm, Stoiko Ivanov wrote: > This way all ESPs (in case of a legacy booted system) get an > updated grub installation. >=20 > running only once between reboots (the markerfile is in /tmp) should > be enough. Sadly the environment does not provide a hint which version > grub is installed to. >=20 > Signed-off-by: Stoiko Ivanov > --- > bin/grub-install-wrapper | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) >=20 > diff --git a/bin/grub-install-wrapper b/bin/grub-install-wrapper > index 35f03fa..2e70789 100755 > --- a/bin/grub-install-wrapper > +++ b/bin/grub-install-wrapper > @@ -3,12 +3,33 @@ set -e > =20 > . /usr/share/pve-kernel-helper/scripts/functions > =20 > +init_boot_disks() { > + if ! (echo "${curr_uuid}" | grep -qE '[0-9a-fA-F]{4}-[0-9a-fA-F]{4}'); = then > + warn "WARN: ${curr_uuid} read from ${ESP_LIST} does not look like a VF= AT-UUID - skipping" > + return > + fi > + > + path=3D"/dev/disk/by-uuid/$curr_uuid" > + if [ ! -e "${path}" ]; then > + warn "WARN: ${path} does not exist - clean '${ESP_LIST}'! - skipping" > + return > + fi > + proxmox-boot-tool init "$path" > +} > + > if proxmox-boot-tool status --quiet; then > #detect when being called by dpkg (e.g. grub-pc.postinst > if [ -n "$DPKG_RUNNING_VERSION" ] && \ > echo "$DPKG_MAINTSCRIPT_PACKAGE" | grep -sq "^grub-"; then this could have another guard for whether the system is even booted with=20 grub (as if the system was booted using EFI, re-initing all ESPs is just=20 busy-work), but the current iteration is better than what we currently=20 have so that can be a follow-up.. > - warn "This system is booted via proxmox-boot-tool, ignoring dpkg=20 > call to grub-install" > - exit 0 > + MARKER_FILE=3D"/tmp/proxmox-boot-tool.dpkg.marker" > + if [ ! -e "$MARKER_FILE" ]; then > + warn "This system is booted via proxmox-boot-tool, running=20 > proxmox-boot-tool init for all configured bootdisks" > + loop_esp_list init_boot_disks > + touch "$MARKER_FILE" > + exit 0 > + else this else branch could also have some output - it will be rarely hit=20 (basically only with repeated reinstalls of grub-pc or systems that are=20 never rebooted), but we still ignore the grub-install call here.. > + exit 0 > + fi > fi > warn "grub-install is disabled because this system is booted via=20 > proxmox-boot-tool, if you really need to run it, run=20 > /usr/sbin/grub-install.real" > exit 1 > -- 2.30.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20