Grub looses menu entry after kernel update

Hello,
I have manually added an entry for Ubuntu in my grub menu, using Yast. But every time the kernel is updated, this entry disappears. On the other hand, the one for Windows, that was added during OpenSuse’s installation, is still there.
So how can I keep this entry for Ubuntu ?
Thanks

Edit : when I save the menu configuration in Yast, I get the following message :

Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kbuildsycoca4 running...
kbuildsycoca4 running...
(8114) KConfigGroup::readXdgListEntry: List entry Actions in "ServiceMenus/krename_dir_rec.desktop" is not compliant with XDG standard (missing trailing semicolon). 
(8114) KConfigGroup::readXdgListEntry: List entry Actions in "ServiceMenus/krename_all_nonrec.desktop" is not compliant with XDG standard (missing trailing semicolon). 
(8114)/kdecore (services) KServicePrivate::init: The desktop entry file  "/usr/share/applications/YaST2/groups/apparmor.desktop"  has Type= "Application"  but no Exec line 

(8114) KBuildServiceFactory::createEntry: Invalid Service :  "/usr/share/applications/YaST2/groups/apparmor.desktop" 
(8114) parseLayoutNode: The menu spec file contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix your file. 
klauncher(8071)/kio (KLauncher): SlavePool: No communication with slave. 

YaST got signal 11 at YCP file bootloader/routines/global_widgets.ycp:274
/sbin/yast2: line 399:  7852 Erreur de segmentation  $ybindir/y2base $module "$@" "$SELECTED_GUI" $Y2_GEOMETRY $Y2UI_ARGS

Yast will add an entry based on the exact kernel. There exist symlinks in Ubuntu that never change. If you make the entry in the Suse loader based on the symlinks your problem will go away. Here’s more on that:
HowTo Multiboot Ubuntu from openSUSE using the GRUB bootloader
It doesn’t matter that the tute was written when Ubu used Grub1, still valid now a days with Grub2

Example of the code if Ubu was on sda9:

#Don't change this comment - YaST2 identifier: Original name: none#
title      Ubuntu Rules Supreme (booting via symlinks)
root       (hd0,8)
kernel     /vmlinuz       root=/dev/sda9 ro quiet splash
initrd     /initrd.img

Thanks, but that’s already what I have. The trouble is not when I update Ubuntu’s kernel but OpenSuse’s one.


###Don't change this comment - YaST2 identifier: Original name: linux###
title Ubuntu Maverick
    root (hd0,7)
    kernel /vmlinuz root=/dev/sda8 quiet splash
    initrd /initrd.img

Try to add two blank lines before the comment starting the entry.

Ok, we’ll see if it works on the next kernel update :wink:

That was a really neat bit of deduction.

I manually downgraded and updated again the kernel, and the entry disappeared again although there were three blank lines (1 + 2 added manually) before the comment.

When you downgraded and upgraded the kernel, did you at any time enter the bootloader-GUI area of yast before you noted that the entry had disappeared? (I’m trying to think of a possible way you could have unwittingly caused the entry to be removed, and if there isn’t a way, then there must be a bug).

I have been wondering why all other Linux related boot entries disappeared from openSUSE Grub after kernel update (never use Bootloader-GUI) on 4 or 5 machines but not on others. Curiously chainloading entries (other Grubs, Unix) were untouched. Now I believe I found something …
I did a zypper in kernel-default and zypper rm kernel-default twice. When using the following order in menu.lst, Ubuntu, Mandriva, etc, kernel entries (all entries highlighted in red here) were gone:

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.4 (Desktop)
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-desktop root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 resume=/dev/disk/by-uuid/ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.4 (Failsafe)
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-desktop root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-desktop


###Don't change this comment - YaST2 identifier: Original name: Ubuntu###
title Ubuntu 10.04 (lucid) - kernel 2.6.32-25-generic
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.32-25-generic root=UUID=f4102d7b-66ad-43a8-841c-7ce88f42c180 ro 
    initrd /boot/initrd.img-2.6.32-25-generic


###Don't change this comment - YaST2 identifier: Original name: MandrivaOld###
title Mandriva 2010.1 (Farman) - kernel 2.6.33.7-69
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd1,5)
    kernel /boot/vmlinuz-2.6.33.7-desktop-69mib BOOT_IMAGE=2.6.33.7-desktop-69mib root=UUID=4ecf3517-c7e9-47a1-8930-13a4e188e730 resume=UUID=ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent vga=794 
    initrd /boot/initrd-2.6.33.7-desktop-69mib.img


###Don't change this comment - YaST2 identifier: Original name: Mandriva###
title Mandriva 2010.1 (Farman) - kernel 2.6.33.7-2
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd1,5)
    kernel /boot/vmlinuz-2.6.33.7-desktop-2mnb BOOT_IMAGE=desktop_2.6.33.7-2 root=UUID=4ecf3517-c7e9-47a1-8930-13a4e188e730 resume=UUID=ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent vga=794
    initrd /boot/initrd-2.6.33.7-desktop-2mnb.img


###Don't change this comment - YaST2 identifier: Original name: Arch###
title Arch Linux - kernel 2.6.35.7-1
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root   (hd0,14)
    kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/23c64367-0f52-4195-881b-1e25854ad5a5 ro vga=794
    initrd /boot/kernel26.img


###Don't change this comment - YaST2 identifier: Original name: Debian###
title Debian GNU/Linux, kernel 2.6.32-3-amd64
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,18)
    kernel /boot/vmlinuz-2.6.32-3-amd64 root=UUID=30eac80e-8574-46fb-a4ee-ec2a2ee453f9 ro vga=794
    initrd /boot/initrd.img-2.6.32-3-amd64


###Don't change this comment - YaST2 identifier: Original name: UbuntuGrub###
title Ubuntu Grub
    root (hd0)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: MandrivaGrub###
title Mandriva Grub
    root (hd1,5)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: ArchGrub###
title Arch Grub
    root (hd0,14)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: DebianGrub###
title Debian Grub
    root (hd0,18)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: DOS###
title DOS (IDE)
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    rootnoverify (hd0,0)
    makeactive
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: OpenBSD###
title OpenBSD 4.7
    partnew (hd0,0) 0x06         63     514017 
    partnew (hd0,1) 0xA6  317283750   41945715
    partnew (hd0,2) 0xA9  411729885   50331645
    partnew (hd1,1) 0xA6  510609960   41945715
    partnew (hd1,2) 0xA9  605056095   29366820
    rootnoverify (hd0,1)
    makeactive
    chainloader +1

.../...

But when using the following order instead, everything remained untouched:

# Modified by YaST2. Last modification on Sat Oct 16 16:07:31 PDT 2010
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 2
timeout 120
gfxmenu (hd0,10)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3 - 2.6.34.7-0.4
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-default root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 resume=/dev/disk/by-uuid/ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.3 - 2.6.34.7-0.4
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-default root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-default


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.4 (Desktop)
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-desktop root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 resume=/dev/disk/by-uuid/ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-desktop


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title openSUSE 11.3 (Teal) - kernel 2.6.34.7-0.4 (Failsafe)
    root (hd0,10)
    kernel /boot/vmlinuz-2.6.34.7-0.4-desktop root=/dev/disk/by-uuid/4946e10e-d727-42fb-9ce4-2d09d49d6a52 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-2.6.34.7-0.4-desktop


###Don't change this comment - YaST2 identifier: Original name: UbuntuGrub###
title Ubuntu Grub
    root (hd0)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: MandrivaGrub###
title Mandriva Grub
    root (hd1,5)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: ArchGrub###
title Arch Grub
    root (hd0,14)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: DebianGrub###
title Debian Grub
    root (hd0,18)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: Ubuntu###
title Ubuntu 10.04 (lucid) - kernel 2.6.32-25-generic
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.32-25-generic root=UUID=f4102d7b-66ad-43a8-841c-7ce88f42c180 ro 
    initrd /boot/initrd.img-2.6.32-25-generic


###Don't change this comment - YaST2 identifier: Original name: MandrivaOld###
title Mandriva 2010.1 (Farman) - kernel 2.6.33.7-69
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd1,5)
    kernel /boot/vmlinuz-2.6.33.7-desktop-69mib BOOT_IMAGE=2.6.33.7-desktop-69mib root=UUID=4ecf3517-c7e9-47a1-8930-13a4e188e730 resume=UUID=ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent vga=794 
    initrd /boot/initrd-2.6.33.7-desktop-69mib.img


###Don't change this comment - YaST2 identifier: Original name: Mandriva###
title Mandriva 2010.1 (Farman) - kernel 2.6.33.7-2
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd1,5)
    kernel /boot/vmlinuz-2.6.33.7-desktop-2mnb BOOT_IMAGE=desktop_2.6.33.7-2 root=UUID=4ecf3517-c7e9-47a1-8930-13a4e188e730 resume=UUID=ba9db764-a47e-48d9-b6f9-b627b57c0287 splash=silent vga=794
    initrd /boot/initrd-2.6.33.7-desktop-2mnb.img


###Don't change this comment - YaST2 identifier: Original name: Arch###
title Arch Linux - kernel 2.6.35.7-1
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,14)
    kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/23c64367-0f52-4195-881b-1e25854ad5a5 ro vga=794
    initrd /boot/kernel26.img


###Don't change this comment - YaST2 identifier: Original name: Debian###
title Debian GNU/Linux, kernel 2.6.32-3-amd64
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    partnew (hd1,1) 0xA5   18539010  534016665 
    partnew (hd1,2) 0xA5  554724450   79698465 
    root (hd0,18)
    kernel /boot/vmlinuz-2.6.32-3-amd64 root=UUID=30eac80e-8574-46fb-a4ee-ec2a2ee453f9 ro vga=794
    initrd /boot/initrd.img-2.6.32-3-amd64


###Don't change this comment - YaST2 identifier: Original name: DOS###
title DOS (IDE)
    partnew (hd0,0) 0x06         63     514017
    partnew (hd0,1) 0xA5   73947195  285282270
    partnew (hd0,2) 0xA5  361398240  100663290
    rootnoverify (hd0,0)
    makeactive
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: OpenBSD###
title OpenBSD 4.7
    partnew (hd0,0) 0x06         63     514017 
    partnew (hd0,1) 0xA6  317283750   41945715
    partnew (hd0,2) 0xA9  411729885   50331645
    partnew (hd1,1) 0xA6  510609960   41945715
    partnew (hd1,2) 0xA9  605056095   29366820
    rootnoverify (hd0,1)
    makeactive
    chainloader +1

See how kernel-default entries (in green) have been added.
The trick would be to add an entry to chainload Ubuntu’s Grub before any other Ubuntu’s (or others) kernel entries. But I agree that it should be considered as a bug. I started to have that problem after I decide to move the chainloading entries after the other Linux kernel boot entries.

Ah – so there is a bug, thanks.

Now it might be that the bug can be neutralised by making the entry for Ubuntu in romainht’s loader to be not just this:

###Don't change this comment - YaST2 identifier: Original name: linux###
title Ubuntu Maverick
    root (hd0,7)
    kernel /vmlinuz root=/dev/sda8 quiet splash
    initrd /initrd.img

but instead to be this:


###Don't change this comment - YaST2 identifier: Original name: trickery for Yast###
title
    root (hd6,0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: linux###
title Ubuntu Maverick
    root (hd0,7)
    kernel /vmlinuz root=/dev/sda8 quiet splash
    initrd /initrd.img

I’ve tested this as a bootloader. On screen it adds a space above the Ubu entry and doesn’t interfere with booting. I didn’t est whether or not it stops Yast from deleting the entries when a kernel update happens because I don’t want to do an upgrade/downgrade to find out.

Yep.
@romainht, can you please try that and tell us if it makes a difference?
@swerdna, I assume you’ll fill the bug report if needed (I’m not good at that). :wink:

How will you get better at it without practice?

I won’t. One cannot be good at everything. :frowning:

I tried with


###Don't change this comment - YaST2 identifier: Original name: other###
title
    rootnoverify (hd6,0)
    chainloader +1

before and after Ubuntu’s entry, and in both cases the result is the same as before : No Ubuntu anymore after kernel update :frowning:

Yes, I confirm. I downgraded with: zypper in --force kernel-desktop-2.6.34-12.3. All sections booting another distro (containing lines starting with “kernel” and “initrd”) were removed that time. All other sections (chainloading other distros or Unix) were still there. I put the removed sections back and ran a normal update from ncurses yast and they got removed again. It happens sometimes that the entries remain untouched, but most of the time they get removed. Well … maybe it’s just a feature after all. :sarcastic:

Then it’s a flaw in the Yast GUI software, a bug for the developers.

I would say it’s in zypper … or whatever modifies menu.lst after adding/removing kernels. I never use yast2.

True, not in Yast then.

I concede to not know little to nothing about this, … still I note this in the /boot/grub/menu.lst :

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader 

Were any of those grub entries initially manually entered by editing the menu.lst text file? Or were they initially entered using YaST as a front end ?

I don’t see anything in this file that would influence that behaviour. However disabling SUSECONFIG would work … but I don’t think that’s what people want.

Were any of those grub entries initially manually entered by editing the menu.lst text file? Or were they initially entered using YaST as a front end ?

In my case they are generated from script. I have too many boot entries and too many computers.