From patchwork Mon Jan 23 13:44:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1730464 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ISIgShaB; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=wAoucISU; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P0rxg5NHcz23gd for ; Tue, 24 Jan 2023 00:47:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=POFqhjz57bnrmhwEeptvyhBuy1OCT0gz5dTdO2V8mow=; b=ISIgShaBDLJhHa F65TpWkVrzIh618ZzgoY300g5mTAGvdRSW6mTYU2w/9uu9UQIbAXAGMM7IZxFZx+m8IeC+kfX8IdP t8Tf6HoGVXsTVPypuoWg4v47jVJtSmLP7EOUHnxC314PzdkaqLfy9lFZKeHgQPnimvGBGNEtzwImd sg9pUTE09UJBMMk38L2NcixjgIUB+EOylpgQGx20gmPh2u+wiy21mpED8Xi0BhP6dzcWYE2BD/oY9 /UiZenkE2MozyiSwizfmHB4ixl9PdwjikR70csw22NoBnE1+Qz4I1VqwX86MO+NpFTlsuWYJlLb7U bLi+0Xn0aU/7L+yGU4BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJx8E-00HOrZ-Tk; Mon, 23 Jan 2023 13:45:07 +0000 Received: from mail.terefe.re ([5.255.96.200]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pJx8B-00HOq3-CK for openwrt-devel@lists.openwrt.org; Mon, 23 Jan 2023 13:45:04 +0000 Received: from localhost.localdomain (unknown [212.106.161.74]) by mail.terefe.re (Postfix) with ESMTPSA id 12A0620C7A; Mon, 23 Jan 2023 14:45:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1674481502; bh=2FqLhQKTe5eNd05I+3c98aHsJhdR5W5ylRlsROB+1Yo=; h=From:To:Cc:Subject:Date:From; b=wAoucISUtfWnUdIwbZQz5sUPavjg9oBcveBvygO1BB+8KNWvl3ihdc4zAt1Meax12 P4DoBl89AP9Oeovf4VYCZuCTqBjyySgRB3jmn4R4yv/en90Zfr5WiuXWjsOVlRMFov XXuLOwpvGV2uC1NPibT01msHtqSABElZZjRXujVSXZjCbu0+jsHV4HpBgoA2up4rQ+ eb8pBquWe8wxgKHd08u0F8K5To0q5xmW1wewYLyFv7oTHfrjiUVJ2M10wJnu3k5eyP n0qVl5wKTIvrpe0TSVHz2+K9NaSl6lBYrkfv7m5/BrQhFWFMftFFtofczbPPHR8EHS lqFQWxVq5wRNw== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH 1/2] x86: remove bootloader upgrade from preinit Date: Mon, 23 Jan 2023 14:44:49 +0100 Message-Id: <20230123134450.10623-1-tmn505@terefe.re> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230123_054503_619458_20C5F104 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Tomasz Maciej Nowak This hack was to bring all existing installations to the newest GRUB version as fast as possible. Since 19.07.x is EoL we can assume this task is completed. Now sysupgrade will solely be responsible f [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Tomasz Maciej Nowak This hack was to bring all existing installations to the newest GRUB version as fast as possible. Since 19.07.x is EoL we can assume this task is completed. Now sysupgrade will solely be responsible for bootloader upgrade. Signed-off-by: Tomasz Maciej Nowak --- .../lib/preinit/81_upgrade_bootloader | 18 ------------------ .../x86/base-files/lib/upgrade/platform.sh | 3 +-- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader diff --git a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader b/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader deleted file mode 100644 index 42f04d76a7ec..000000000000 --- a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader +++ /dev/null @@ -1,18 +0,0 @@ -upgrade_bootloader() { - local diskdev - - . /lib/upgrade/common.sh - - if [ ! -f /boot/grub/upgraded ] && export_bootdevice && export_partdevice diskdev 0; then - part_magic_efi "/dev/$diskdev" && return 0 - echo "(hd0) /dev/$diskdev" > /tmp/device.map - /usr/sbin/grub-bios-setup \ - -m "/tmp/device.map" \ - -d "/boot/grub" \ - -r "hd0,msdos1" \ - "/dev/$diskdev" \ - && touch /boot/grub/upgraded - fi -} - -[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main upgrade_bootloader diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh index d8f2eba97ecb..5dad7a538a59 100644 --- a/target/linux/x86/base-files/lib/upgrade/platform.sh +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh @@ -62,8 +62,7 @@ platform_do_bootloader_upgrade() { -m "/tmp/device.map" \ -d "/tmp/boot/boot/grub" \ -r "hd0,${parttable}1" \ - "/dev/$diskdev" \ - && touch /tmp/boot/boot/grub/upgraded + "/dev/$diskdev" umount /tmp/boot fi