I have an Atom x5 box on which I run Openwrt. Being minimal, it has no normal serial UART interface, so the grub.cfg needs 4 simple sed-able edits. Without those edits it just won’t boot. This is an ext4, EFI, combined install w the standard /boot, / and BIOS partitions.
I’d rather use the vanilla images, if possible. But I also don’t want to go in and futz about every time I upgrade…
Rather than reinventing the wheel, I thought maybe someone here that is already aware of leverage that I could use in owut or sysupgrade would have an idea or two.
Is there a really natural way to script this?
Also, am I correct that in assuming that there is no way to configure GRUB from /etc?
I've never found a way to do this sort of thing. Every now and then I dig through https://openwrt.org/docs/techref/process.boot, specifically the grub boot loader example about halfway down, and it seems like we need some new hooks somewhere to effect any changes to grub.cfg prior to boot.
Also hand-in-hand with this is the inability to get sysupgrade to restore anything to /boot, as the sequence is out of order (I don't think /boot is mounted when sysupgrade does its restore; the save backup works and you can get /boot files in the backup, it just doesn't restore).
The user u=ikjadoon seems to say that whitelisting the file in /boot worked for him but I’d like to verify that it will work on my setup. iirc, he doesn’t specify ext4 vs squashfs or anything else.
I’ll see if I can duplicate it when I’m back home next week.
Of course, I can just delete the orig grub.cfg and replace it with the edited version, after gunziping, mounting /boot , then unmounting and gzipping again. Makes me tired just thinking about it…