Kernel install in boot with GRUB

jason.morgan at aveillant.com jason.morgan at aveillant.com
Tue Jul 14 09:51:21 UTC 2015


Hi,


The kernel installer in Ubuntu 12.04 to 14.04 often puts grub files and 
kernel (vmlinux/z, initrd.img) files on a separate boot partition, mounted 
under /boot.
Subsequent updated kernels are put into the same place by the apt-get 
dist-upgrade install process.
The actual kernel filename is in the form vmlinuz-3.8.0-29-generic but 
will change with time.

When this is the case the conventional symlinks /initrd.img and /vmlinuz 
are meaningless as grub can't see them.  Grub sees /boot mounted as /.

When adding custom boot menu entries in /etc/grub.d we don't know the 
latest running kernel version without elaborate scripting to 'discover' 
the possibilities.
This means any simple custom menu additions require regular updates or 
they will break.

If the installer were to simply add the symlinks /boot/vmlinuz and 
/boot/inirtd.img, pointing to the latest kernel things would be much 
simpler.
It already adds symlinks in /, so placing them in /boot is trivial.

e.g.
Now custom grub2 menu entries can look like

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type 
the
# menu entries you want to add after this comment.  Be careful not to 
change
# the 'exec tail' line above.
menuentry 'Ubuntu, latest kernel - r/w root' --class ubuntu --class 
gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 
ed0b95eb-abe9-484a-a35f-38f144ac297d
        linux   /vmlinuz root=/dev/mapper/server-vg-root ro
        initrd  /initrd.img
}

And it would not matter if boot is mounted on a separate partition or not.

I am considering adding this as a bug/enhancement, any reasons why this 
would not be possible?

Kind Regards,
Jason Morgan
Aveillant Ltd, Cambridge, UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20150714/1379ba0a/attachment.html>


More information about the Ubuntu-devel-discuss mailing list