[OpenWrt-Devel] [RFC 6/6] grub2: add preinit hook for bootloader upgrade

Tomasz Maciej Nowak tomek_n at o2.pl
Thu Jan 17 10:58:03 EST 2019

Hi Dustin,
find my answers inline.

W dniu 17.01.2019 o 06:02, Dustin Howett pisze:
> I'm somewhat apprehensive about this applying to all targets that consume GRUB2.

All images which employ GRUB2 use the same recipe to create image, I see no reason exempt any x86 subtarget.

> On x86 and x86_64 images, I believe sysupgrade lays down every
> partition in the image over its equivalent already on the device.
> Since the bootloader (MBR, presumably, for most x86 targets) lives in
> the early part of the disk and chain-loads the later phase, does it
> not suffice to update the grub2 core module on the boot patition?

No that can't be done other way.
Opposite to most distributions in OpenWrt we create single monolithic image with selected modules embedded. This image is installed by grub-bios-setup right after MBR for every x86 subtarget. So there is no chain-loading and no modules are copied to boot partition. This probably could be changed but this is not the point of this RFC.

> A few questions, though:
> * Should the grub2 install changes be part of a variant, or a
> target-specific flag?

Don't know if I understand this correctly, could You elaborate more on this.
As I understand it, adding additional config symbols or feature-flags would only complicate this, since it'll be for single target. There are already variants created with patch nr 1 and 5, similar to U-Boot (but not exactly) and proper one is installed in resulting image.
> * Is reinstalling the bootloader after sysupgrade dangerous?

It's always dangerous, just like whole sysupgrade process.

>   * If there is a target that doesn't support BIOS boot, could using
> grub-bios-setup cause problems for it?

There's none officially supported at the moment.

> Sorry if this message comes up out-of-order. I wasn't previously
> subscribed to the list, and I have tried to craft the reply properly .

NP, thank You for Your feedback.

Regards, Tomasz.


openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list