Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Keeping an old kernel using zypp.conf

  1. #1

    Default Keeping an old kernel using zypp.conf

    Hi

    This is a follow on to the thread in Virtualisation and the upgrade to kernel 5.8 meaning that VirtualBox didn't work (although it's fixed now)

    I posted that it was possible to edit

    Code:
    /etc/zypp/zypp.conf
    and put an entry like

    Code:
    # multiversion.kernels = latest,latest-1,running
    multiversion.kernels = latest,latest-1,latest-2,5.7.11-1,running
    And although I had kernel 5.7.11-1 at the time I made that entry, it has now gone

    but I do have several 5.8 kernels, so it has kept latest, latest-1,latest-3 but the one I specifically wanted to keep (5.7.11-1) was removed

    And it's not just the files in /boot that I'd carefully made a tgz of

    Code:
    /boot/config-5.7.11-1-default
    /boot/initrd-5.7.11-1-default
    /boot/symtypes-5.7.11-1-default.gz
    /boot/symvers-5.7.11-1-default.gz
    /boot/sysctl.conf-5.7.11-1-default
    /boot/System.map-5.7.11-1-default
    /boot/vmlinux-5.7.11-1-default.xz
    /boot/vmlinuz-5.7.11-1-default
    but obviously when zypper dup removed 5.7.11-1 it also removed all the relevant files from /usr/src/ too

    (which I very stupidly did not think to make a copy of - oops)

    I was following the instructions on

    https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha-tuning-multikernel.html

    section 6.1.4

    So theoretically it should have worked unless it really, really should say that I need to specify

    Code:
    5.7.11-1-default

    In which case the documentation should probably be changed?

    Any thoughts?

    Regards

    iDominic42

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,411
    Blog Entries
    3

    Default Re: Keeping an old kernel using zypp.conf

    Quote Originally Posted by iDominic42 View Post
    put an entry like

    Code:
    # multiversion.kernels = latest,latest-1,running
    multiversion.kernels = latest,latest-1,latest-2,5.7.11-1,running
    I am using:
    Code:
    multiversion.kernels = oldest,latest,latest-1,running
    and I still have 5.7.11.

    Code:
    % ls /boot/vmlinuz*
    /boot/vmlinuz                   /boot/vmlinuz-5.8.2-1-default
    /boot/vmlinuz-5.7.11-1-default  /boot/vmlinuz-5.8.4-1-default
    So kernel 5.8.0 has disappeared, but 5.7.11 is still there.

    Eventually, I will manually remove that kernel, and another one will become the oldest.

    There was a time when I used "oldest,oldest+1,latest,latest-1,running", so that I could keep both a 5.4 kernel and a 5.5 kernel after we went to a 5.6 kernel. But the problem I was dealing with has been fixed. I'm use "oldest" for the most recent of the previous series. When we go to a 5.9 kernel, I will remove 5.7.11 and allow the oldest to refer to a 5.8 kernel. It just seems good practice with Tumbleweed.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  3. #3

    Default Re: Keeping an old kernel using zypp.conf

    Ah, thanks for that, using "oldest" would have worked as per your example

    But why didn't specifying, as I did

    Code:
    multiversion.kernels = latest,latest-1,latest-2,5.7.11-1,running
    keep my 5.7.11-1 kernel

    Is the documentation wrong? Or does that only apply to Leap, not Tumbleweed?

  4. #4
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,411
    Blog Entries
    3

    Default Re: Keeping an old kernel using zypp.conf

    I don't know why that happened. I can only guess.

    I'm guessing that if you had used "5.7.11" instead of "5.7.11-1", it would have worked.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  5. #5
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    2,007

    Default Re: Keeping an old kernel using zypp.conf

    Quote Originally Posted by iDominic42 View Post
    Ah, thanks for that, using "oldest" would have worked as per your example

    But why didn't specifying, as I did

    Code:
    multiversion.kernels = latest,latest-1,latest-2,5.7.11-1,running
    keep my 5.7.11-1 kernel

    Is the documentation wrong? Or does that only apply to Leap, not Tumbleweed?
    If you check the example at /etc/zypp/zypp.conf I think that the correct number should be 5.7.11-1.2 and the trailing ".2" (or whatever build it was) was apparently missing in your entry.
    Sorry I cannot check myself in a system ATM.
    And yes, apparently the documentation you referenced is wrong if /etc/zypp/zypp.conf is correct.
    Leap 15.1 Gnome on i7 4720HQ + Geforce GTX960M
    testing Leap 15.2

  6. #6
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,411
    Blog Entries
    3

    Default Re: Keeping an old kernel using zypp.conf

    Quote Originally Posted by OrsoBruno View Post
    If you check the example at /etc/zypp/zypp.conf I think that the correct number should be 5.7.11-1.2 and the trailing ".2" (or whatever build it was) was apparently missing in your entry.
    It turns out that I was testing that as you were posting.

    Using "5.7.11-1.2" works.

    How I tested:

    I first made a copy of my existing "zypp.conf" so that I could restore it.

    Then I made the change to using "5.7.11" and that did not work. To test, I used
    Code:
    zypper purge-kernels
    and it told me what it would do. I responded to the prompt with "n" (no, don't do that), so it would keep the kernel.

    Next, I tried "5.7.11-1.2" which worked. Then "5.7.11-1" which did not work. And finally, I restored my original "zypp.conf"
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  7. #7
    Join Date
    Sep 2012
    Posts
    5,907

    Default Re: Keeping an old kernel using zypp.conf

    Quote Originally Posted by OrsoBruno View Post
    the correct number should be 5.7.11-1.2
    Version-release without rebuild counter is supposed to match any rebuild (i.e. 5.7.11-1 should match 5.7.11-1.1, 5.7.11-1.2, ...).

    Quote Originally Posted by nrickert View Post
    Next, I tried "5.7.11-1.2" which worked. Then "5.7.11-1" which did not work.
    This is a bug, you should open bug report with zypper logs.

    ... it seems to be introduced by commit
    Code:
    commit 9c842b20aba435bbcbbf329686fca33f845d2cd0
    Author: Benjamin Zeller <bzeller@suse.de>
    Date:   Wed Aug 19 16:43:15 2020 +0200
    
    
        Support buildnr with commit hash in purge-kernels (fixes bsc#1175342)
        
        This adds special behaviour for when a kernel version has the rebuild
        counter before the kernel commit hash:
        
        kernel-default-<version>-<release>.<counter>.<hash>
        e.g.:
        kernel-default-5.8.0-3.1.gd4e7682
    Before this commit libzypp stripped trailing rebuild counter. After this commit it only strips rebuild counter if release number contains GIT hash (i.e. comes from kernel repository).

  8. #8

    Default Re: Keeping an old kernel using zypp.conf

    Ok, thanks, quite a lot of useful comments here

    Looks as though I should have read the /etc/zypp/zypp.conf a bit more carefully, as it also says

    Code:
    ## Note: This entry is not evaluated by libzypp, but by the
    ##       purge-kernels service (via /sbin/purge-kernels).

    So that would have told me how to test it...

    At least it does appear that it is a bug, too, as per arvidjaar's post above

  9. #9
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    14,411
    Blog Entries
    3

    Default Re: Keeping an old kernel using zypp.conf

    Quote Originally Posted by iDominic42 View Post
    Looks as though I should have read the /etc/zypp/zypp.conf a bit more carefully, as it also says

    Code:
    ## Note: This entry is not evaluated by libzypp, but by the
    ##       purge-kernels service (via /sbin/purge-kernels).
    That comment (in "zypp.conf") is another bug. They invented a new zypper command -- "zypper purge-kernels" and the purge-kernels service now uses that. So now it is evaluated by libzypp.
    openSUSE Leap 15.2; KDE Plasma 5.18.5;

  10. #10
    Join Date
    Sep 2012
    Posts
    5,907

    Default Re: Keeping an old kernel using zypp.conf


Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •