4

In a fresh ubuntu-studio 14.04 install sudo apt-get install linux-generic.

Then the grub-mkconfig will give you a menu as such

Ubuntu (lowlatency)
Ubuntu
Advanced options for Ubuntu

A quick look with the 'e' key will show that both Ubuntu (lowlatency) and Ubuntu point to

linux   /boot/vmlinuz-3.13.0-24-lowlatency

A work around is you can select the desired kernel in the 'Advanced option for Ubuntu' menu.

How can we fix /etc/grub.d/09_lowlatency and /etc/grub.d/10_linux so that they don't select the same default kernel?

Relevant menuentry in /boot/grub/grub.cfg from /etc/grub.d/09_lowlatency

menuentry 'Ubuntu (lowlatency)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0f6e1051-cf9f-4299-b691-76d0d8c532d1' {
recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  0f6e1051-cf9f-4299-b691-76d0d8c532d1
        else
          search --no-floppy --fs-uuid --set=root 0f6e1051-cf9f-4299-b691-76d0d8c532d1
        fi
        linux   /boot/vmlinuz-3.13.0-24-lowlatency root=UUID=0f6e1051-cf9f-4299-b691-76d0d8c532d1 ro   quiet splash $vt_handoff
        initrd  /boot/initrd.img-3.13.0-24-lowlatency
}

And the menu entry in /boot/grub/grub.cfg from /etc/grub.d/10_linux

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0f6e1051-cf9f-4299-b691-76d0d8c532d1' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  0f6e1051-cf9f-4299-b691-76d0d8c532d1
        else
          search --no-floppy --fs-uuid --set=root 0f6e1051-cf9f-4299-b691-76d0d8c532d1
        fi
        linux   /boot/vmlinuz-3.13.0-24-lowlatency root=UUID=0f6e1051-cf9f-4299-b691-76d0d8c532d1 ro  quiet splash $vt_handoff
        initrd  /boot/initrd.img-3.13.0-24-lowlatency
}

Yes I assure you I have a normal kernel installed:

$ ls -l /vmlinuz*
lrwxrwxrwx 1 root root 30 May  5 20:37 /vmlinuz -> boot/vmlinuz-3.13.0-24-generic
lrwxrwxrwx 1 root root 33 May  2 20:25 /vmlinuz.old -> boot/vmlinuz-3.13.0-24-lowlatency
N8tron
  • 724
  • And are the options the same? Are you sure they're supposed to point to different kernels? Can you post the relevant menu entries from /boot/grub/grub.cfg? – terdon May 22 '14 at 15:06
  • @terdon: I'm going to post only the relevant lines. That file is 315 lines long :/ – N8tron May 23 '14 at 00:46
  • Yes, perfect. I just asked for the menu entries, not the entire file. And yes, they look identical. You could always edit the file manually, but you'll have to do that again every time you run update-grub. Every time a new kernel is installed for example. – terdon May 23 '14 at 09:00
  • @terdon yes that would work. Also all the kernels appear under the 'Advanced Options for Ubuntu' submenu. I'd rather have a fix that's automatic and can be passed to the devs. – N8tron May 23 '14 at 11:43
  • How do I hide, rather than exclude? – Polv Jun 20 '21 at 21:45

2 Answers2

2
  1. Open /etc/grub.d/10_linux for editing

  2. Look for kernel list loop:

    machine=`uname -m`
    case "x$machine" in
        xi?86 | xx86_64)
            list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
                      if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
                  done` ;;
        *)
            list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
                      if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
                 done` ;;
    esac
    
  3. Add if clause to skip lowlatency kernels

    machine=`uname -m`
    case "x$machine" in
        xi?86 | xx86_64)
            list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
                      if [ -z "${i##*lowlatency}" ] ; then continue ; fi
                      if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
                  done` ;;
        *)
            list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
                      if [ -z "${i##*lowlatency}" ] ; then continue ; fi
                      if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
                 done` ;;
    esac
    
  4. Update Grub list

    sudo update-grub2
    
user.dz
  • 48,105
  • 1
    I like the idea of filtering out the low latency kernels, but this appears to do a bit more than that. Can you do the same without forcing the only kernels listed to be generic? – N8tron May 23 '14 at 18:48
  • @NateIverson, you are right excluding lowlatency (keeping all other types kernels) is the best way. I have updated the answer. – user.dz May 23 '14 at 21:12
1

In the entry from "/etc/grub.d/10_linux", there's these lines.

 linux   /boot/vmlinuz-3.13.0-24-lowlatency root=UUID=0f6e1051-cf9f-4299-b691-76d0d8c532d1 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-3.13.0-24-lowlatency

I believe that if you change both instances of "lowlatency" as read in these lines to "generic", you may solve the problem. If you can, report back with results. I've not seen a case like this before.

  • No such line exists in '/etc/grub.d/10_linux' – N8tron May 23 '14 at 01:07
  • kinda the root of the problem imho, 9_lowlatency always points to the low latency kernel. 10_linux choses a kernel by some algorithm. In this case they point to the same thing. Clearly it is a design flaw :) – N8tron May 23 '14 at 01:09
  • This is probably the one thing I've never had issues with before, and I can see why. My computer uses the standard kernel updates, with an old kernel I kept as a just-in-case event. It seems to be a complex issue. As for my misquote, I was referring to the second menu entry you listed. Sorry for any confusion. – Drew Stewart May 23 '14 at 01:15
  • The very top of the /boot/grub/grub.cfg file explains that you shouldn't manually edit it because it is automatically updated. So every time you update a kernel, your changes would be erased. Thanks for your interest. :) – N8tron May 23 '14 at 01:27