The commands below are more generic then for kernel version 3.13.0-35 only.
1. Mount the efi partition and copy the kernel files there
$ mount /dev/sda3 /boot/efi
$ mkdir -pv /boot/efi/EFI/ubuntu/
$ cp -uv /boot/vmlinuz-* /boot/initrd.img-* /boot/efi/EFI/ubuntu/
'/boot/vmlinuz-3.13.0-35-generic' -> '/boot/efi/EFI/ubuntu/vmlinuz-3.13.0-35-generic'
'/boot/initrd.img-3.13.0-35-generic' -> '/boot/efi/EFI/ubuntu/initrd.img-3.13.0-35-generic'
2. Change the kernel file name
Shorten the kernel file name by removing -generic
because there seems to be a 39 character length path limit and Rename kernel file(s) to end in .efi
, this ensures compatibility with most systems
$ for f in /boot/efi/EFI/ubuntu/vmlinuz-*-generic; do mv -uv -- "$f" "${f//-generic/}.efi"; done
'/boot/efi/EFI/ubuntu/vmlinuz-3.13.0-35-generic' -> '/boot/efi/EFI/ubuntu/vmlinuz-3.13.0-35-generic.efi'`
The above name kernel file name shortening is not enough for a dpkg
installed mainline kernel, because for example /EFI/ubuntu/vmlinuz-3.16.0-031600rc6.efi
without -generic
is still 40 characters long.
3. Add new entry to EFI boot menu
Replace 3.13.0-35
in this example with your specific kernel version
$ kv=3.13.0-35;efibootmgr -c -p 3 -L $kv -l \EFI\ubuntu\vmlinuz-$kv.efi -u root=/dev/sda1 initrd=\\EFI\\ubuntu\\initrd.img-$kv-generic ro rootfstype=ext4 debug ignore_loglevel libata.force=dump_id crashkernel=384M-:128M
This new boot menu entry will become your default new boot choice.
You might not need the extra debugging parameters debug
, ignore_loglevel
, libata.force=dump_id
and crashkernel=384M-:128M
. Initrd
must be present, otherwise boot hangs at "Switched to clocksource tsc." because the root device sda1 cannot be opened.