Grub not being updated by online updates

I don’t readily know how far back this issue goes, this is the first I’ve noticed it.

In yast, the installed “kernel-desktop” package says 3.16.7-21.1.

“uname -a” reports something older:

gbn-dev-cm:/> uname -a
Linux gbn-dev-cm 3.16.6-2-desktop #1 SMP PREEMPT Mon Oct 20 13:47:22 UTC 2014 (feb42ea) x86_64 x86_64 x86_64 GNU/Linux

Looking in /boot/grub/menu.lst, there is no mention of 3.16.7, only 3.16.6-2:

default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: linux###
title Desktop – openSUSE - 3.16.6-2
root (hd0,1)
kernel /vmlinuz-3.16.6-2-desktop root=/dev/disk/by-id/scsi-SAdaptec_boot_48C72829-part3 resume=/dev/disk/by-id/scsi-SAdaptec_boot_48C72829-part1 splash=silent quiet showopts vga=0x31a
initrd /initrd-3.16.6-2-desktop

I’m sure I can manually fix the grub options. I’m more interested in finding out why new kernels are not being added to grub.

This is on openSuse 13.2. To the best of my knowledge, I’ve never done anything anything special to the boot options since 13.2 was installed. So I’m at a loss as to why the grub options are so far behind.

In /boot, there is a vmlinuz symlink that points to vmlinuz-3.16.7-21-desktop. So my best guess, from looking at the other files and dates listed in /boot, is that when the 13.2 was installed, it created a grub menu.lst that directly named vmlinuz-3.16.6-2-desktop, instead of using the vmlinuz symlink?

Yes, you should. And perhaps you will need to continue doing that.

I’m more interested in finding out why new kernels are not being added to grub.

I’m pretty sure that it’s because you are using legacy grub (sometimes called “grub1”). The support for that was removed for opensuse 13.2.

Legacy grub is still in the repos. But you have to install it and maintain it yourself. A normal install uses either grub2 or grub2-efi.

On 2015-08-04 00:16, gariann wrote:
>
> I don’t readily know how far back this issue goes, this is the first
> I’ve noticed it.
>
> In yast, the installed “kernel-desktop” package says 3.16.7-21.1.
>
> “uname -a” reports something older:

Please run:


rpm -qa | grep kernel

and post what you get here, same as above, inside a code tags block. It
is the #] button in the forum editor.

Also of interest is what openSUSE version you have, and why it appears
you have grub 1 and not grub 2.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

How can I tell which grub is being used? I don’t believe I explicitly chose grub1 in the install process, so I’m pretty sure this is what the installer gave me by default.

Zypper says currently both grub and grub2 are installed:

gbn-dev-cm:/boot # zypper se grub
Loading repository data…
Reading installed packages…

S | Name | Summary | Type
–±------------------------±------------------------------------------------------±-------
i | grub | Grand Unified Boot Loader | package
i | grub2 | Bootloader with support for Linux, Multiboot and more | package
i | grub2-branding-openSUSE | openSUSE branding for GRUB2’s graphical console | package
| grub2-branding-upstream | Upstream branding for GRUB2’s graphical console | package
| grub2-i386-efi | Bootloader with support for Linux, Multiboot and more | package
i | grub2-i386-pc | Bootloader with support for Linux, Multiboot and more | package
i | grub2-snapper-plugin | Grub2’s snapper plugin | package
i | grub2-x86_64-efi | Bootloader with support for Linux, Multiboot and more | package
| grub2-x86_64-xen | Bootloader with support for Linux, Multiboot and more | package
| grubby | Command line tool for updating bootloader configs | package
| trustedgrub | Grand Unified Boot Loader with TPM support | package

As far as I know, all of this is still the default from when the openSuse 13.2 installer finished (probably over 8 months ago). Could this have something to do with the install process being an update from openSuse 12.2 as opposed to a fresh install?

In the end, it doesn’t matter to me whether grub1 or grub2 is used. I just want the kernel’s listed to be updated by the system updates. I’m hoping that changing the default menu.lst entry to use the symlinks (vmlinuz and initrd, which point to the 3.16.7-21 versions) instead of the older explicitly named kernel and initrd.

Thanks


gbn-dev-cm:/ # rpm -qa | grep kernel
kernel-macros-3.16.7-21.1.noarch
kernel-firmware-20141122git-5.1.noarch
kernel-devel-3.16.7-7.1.noarch
kernel-desktop-3.16.7-7.1.x86_64
nfs-kernel-server-1.3.0-4.2.1.x86_64
kernel-devel-3.16.7-21.1.noarch
kernel-desktop-devel-3.16.6-2.1.x86_64
kernel-source-3.16.6-2.1.noarch
kernel-desktop-3.16.7-21.1.x86_64
kernel-source-vanilla-3.16.7-7.1.noarch
kernel-source-vanilla-3.16.7-21.1.noarch
kernel-desktop-devel-3.16.7-7.1.x86_64
kernel-docs-3.16.7-21.3.noarch
kernel-desktop-3.16.6-2.1.x86_64
kernel-desktop-devel-3.16.7-21.1.x86_64
kernel-source-vanilla-3.16.6-2.1.noarch
kernel-source-3.16.7-7.1.noarch
kernel-devel-3.16.6-2.1.noarch
kernel-source-3.16.7-21.1.noarch
gbn-dev-cm:/ # cat /etc/SuSE-release 
openSUSE 13.2 (x86_64)
VERSION = 13.2
CODENAME = Harlequin
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead

gbn-dev-cm:/ #

Thanks

On 2015-08-04 00:46, gariann wrote:

> How can I tell which grub is being used? I don’t believe I explicitly
> chose grub1 in the install process, so I’m pretty sure this is what the
> installer gave me by default.

Well, /boot/grub/menu.lst belongs to grub1.

Easiest is you take a photo of grub menu on boot, with a camera or
phone, upload to susepaste.org for a limited time, and post a link here.

Basically grub 1 prints a long list of kernel entries; grub 2 prints
one, and an advanced line, or optional, or similar words — sorry, I
forget which exactly :slight_smile:

> As far as I know, all of this is still the default from when the
> openSuse 13.2 installer finished (probably over 8 months ago). Could
> this have something to do with the install process being an update from
> openSuse 12.2 as opposed to a fresh install?

Yes, of course it matters: an upgrade doesn’t change defaults.

> In the end, it doesn’t matter to me whether grub1 or grub2 is used. I
> just want the kernel’s listed to be updated by the system updates. I’m
> hoping that changing the default menu.lst entry to use the symlinks
> (vmlinuz and initrd, which point to the 3.16.7-21 versions) instead of
> the older explicitly named kernel and initrd.

Yes, you can use the symlinks. And possibly there is a symlink to the
older kernel, too.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Yes, that’s very likely.

In the end, it doesn’t matter to me whether grub1 or grub2 is used.

You could switch to grub2, using Yast bootloader. On the other hand, there’s the old rule “if it ain’t broke, don’t fix it.”

Maybe it is broken, but only slightly broken.

I’m hoping that changing the default menu.lst entry to use the symlinks (vmlinuz and initrd, which point to the 3.16.7-21 versions) instead of the older explicitly named kernel and initrd.

Yes, that should solve your problem. The symlinks are updated on a kernel update.

For completely, I’ll note that both “grub2” and “grub1” are installed here. But there is no “menu.lst”, because I’m not using grub1 for booting. The installer support for grub1 was removed, and the Yast support for grub1 was installed. But the scripts to manually install are still there.

I updated the menu.lst to use the symlinks, as suggested. It appears to work.

When upgrading openSuse versions, I usually do an update instead of a fresh install, mostly to preserve package selections. I’m guessing at some point in the past (on openSuse12.2, or maybe 11.4 before that) I must have chosen legacy grub, and the update process has honoured that ever since. Next time I’ll probably do a clean install.

However, I would suggest that whichever installer it was (13.2’s, or 12.2’s, or 11.4’s) should have generated a menu.lst that used the symlinks in the first place, instead of using an explicitly named kernel version. I think it must have been 13.2’s installer, since the kernel it named, 3.16.6-2, is the one that 13.2 had to when it shipped.

Thanks for the help. Hopefully on the reboot after the next kernel update, I’ll see it booting the newest kernel.

On 2015-08-04 01:46, gariann wrote:

> When upgrading openSuse versions, I usually do an update instead of a
> fresh install, mostly to preserve package selections. I’m guessing at
> some point in the past (on openSuse12.2, or maybe 11.4 before that) I
> must have chosen legacy grub,

No, simply there was no choice but grub 1 :slight_smile:

> and the update process has honoured that
> ever since.

Yes.

> Next time I’ll probably do a clean install.

I have been doing upgrades to my desktop since about 5.3, and I intend
to continue :wink:

> However, I would suggest that whichever installer it was (13.2’s, or
> 12.2’s, or 11.4’s) should have generated a menu.lst that used the
> symlinks in the first place, instead of using an explicitly named kernel
> version. I think it must have been 13.2’s installer, since the kernel
> it named, 3.16.6-2, is the one that 13.2 had to when it shipped.

No, that’s a bug since ever.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

bor@opensuse:~> fgrep LOADER_TYPE= /etc/sysconfig/bootloader 
LOADER_TYPE="grub2"
bor@opensuse:~> 

nrickert composed:

(When
Grub is installed, and
Grub2 is not installed)

> Legacy grub is still in the repos.

true

> But you have to install it

true only if a new installation, not if an upgrade installation to one with
only Grub installed

> and maintain it yourself.

false

I have dozens of 13.2 and TW installations. None have Grub2 installed. All
have Grub installed. Kernel updates here via zypper always validly update
menu.lst automatically.

Mine shows “none”


gbn-dev-cm:/ # grep LOADER /etc/sysconfig/bootloader
LOADER_TYPE="none"
LOADER_LOCATION=""
gbn-dev-cm:/ # 

Which explains why bootloader configuration is not updated automatically. If you are using grub legacy, just set LOADER_TYPE=grub. You will not be able to configure it using YaST, but perl-bootloader still supports it so grub configuration will be maintained when installing/removing kernels.