FYI: update-grub / grub-mkconfig somewhat "broken"

Robert Heller heller at deepsoft.com
Sun Feb 14 15:06:44 UTC 2021


For what it is worth:

The default setup for grub-mkconfig is somewhat "broken". It poorly handles
the case where there is a shared /boot file system shared by two or more Linux
distros. I have two systems that can dual boot Ubuntu 18.04 (4.15.0-* kernels)
and CentOS 6.10 (2.6.32-* kernels). The default behaviour will include the
options to boot with a 2.6.32 kernel with the Ubuntu root file system (this
really won't work!)

I have managed to hack things (hacked 10_linux to skip centos kernels) to not
do this and created a grub-mkconfig helper script specificly for the CentOS
6.10 kernels (it is hardwired for my systems). I also had to disable
os-prober, since it was just not doing anything good, including trying to set
up booting a VM as a bare metal O/S (!).  Hopefully, apt-get dist-upgrade will 
behave and not screw up my settings or overwrite my hacked 10_linux script.

I don't know if this is a bug or if my setup is just unique -- somehow I don't
really believe that -- I don't really believe that *I* invented the idea of a
separate /boot file system and multi-booting different Linux distros with a
shared /boot file system. A separate /boot file system is actually necessary
with LILO and grub 1.x when using LVM. I'm guessing with grub 2.x, you don't
need to do that (no it is not worth the effort to change how my disks are
partitioned).

Also I found an interesting passage in the grub manual:

" grub-mkconfig does have some limitations. While adding extra custom menu
entries to the end of the list can be done by editing '/etc/grub.d/40_custom'
or creating '/boot/grub/custom.cfg', changing the order of menu entries or
changing their titles may require making complex changes to shell scripts
stored in '/etc/grub.d/'. This may be improved in the future. In the
meantime, those who feel that it would be easier to write 'grub.cfg'
directly are encouraged to do so (see Chapter 5 [Booting], page 15, and
Section 6.3 [Shell-like scripting], page 25), and to disable any system
provided by their distribution to automatically run grub-mkconfig."

So it seems that even the grub devs don't full trust grub-mkconfig...


-- 
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                                                                                         




More information about the ubuntu-users mailing list