[PATCH 1/2] x86: remove bootloader upgrade from preinit

Tomasz Maciej Nowak tmn505 at terefe.re
Mon Jan 23 05:49:25 PST 2023


From: Tomasz Maciej Nowak <tmn505 at gmail.com>

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 <tmn505 at gmail.com>
---

Some glitch rejected this email. Re-sending.

 .../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
-- 
2.39.1




More information about the openwrt-devel mailing list