[Solved] Live-kernel-Updater wants to rollback to non-existing kernel

Post Reply
Message
Author
cinclus
Posts: 104
Joined: Sun Mar 13, 2016 5:35 am

[Solved] Live-kernel-Updater wants to rollback to non-existing kernel

#1 Post by cinclus »

I have two kernels installed on a live-usb-stick - currently the active kernel is the default-kernel 4.19.0-1-686-pae of MX 18
and I have installed a Debian liquorix kernel package 4.18.20-lqx2 rebuilt from source today. More on that later. I have successfully tested it on a MX 18 installation.

When trying to live-update this kernel on a live usb-stick I get this:

Code: Select all

  3 all live kernels 
  1 default live kernel      (4.19.0-1-686-pae)
  1 previous live kernel (4.18.20-lqx2)

  2 installed kernels 
  0 newly installed kernel 
                                                                                                  
Please choose an action                                                                       
  > rollback (to old versopm) vmlinuz  4.18.20-lqx2 (2019-01-28)              
  > update the initrd using /usr/lib/iso-template/template-initrd.gz        
  > quit 
If I choose the only possible action 'rollback' I get this

Code: Select all

ready to rollback to the old live kernel?
-------------------------------------------------------------------------------
         Version           date      from          to
 current 4.19.0-1-686-pae  2019-02-21  vmlinuz      vmlinuz.kbad
     old 4.18.20-lqx2      2019-01-28  vmlinuz.kold vmlinuz
Notes: there are only 2(!) live-kernels and the 4.18.20-lqx2 (2019-01-28) is a deleted phantom-kernel. It's actually the newly built 4.18.20-lqx2 (2019-02-21). The error comes from the book-keeping of mx of the manually deleted kernel with same name as the new one 4.18.20-lqx2 from today. The deleted version was not(!) installed from a Debian-kernel-package but directly with a make install of the self-compiled kernel. Before installing the new kernel - with the same version - from the Debian kernel-package I had cleaned up the obvious files of the old kernel in /boot and /lib/modules but I didn't touch the folder /live/boot-dev/antiX/

Code: Select all

$ ls -l
insgesamt 2182616
-rw-r--r-- 1 root root         47 Dez 27 19:11 delete_this_file
-rw-r--r-- 1 root root         10 Dez 27 19:12 esp-uuid
-rw-r--r-- 1 root root 1929379840 Feb 21 23:37 homefs
-rw-r--r-- 1 root root    6161797 Feb 21 21:56 initrd.gz
-rw-r--r-- 1 root root    6320549 Jan 26 17:56 initrd.gz.kbad
-rw-r--r-- 1 root root    6239921 Jan 28 17:26 initrd.gz.kold
-rw-r--r-- 1 root root         44 Feb 21 21:56 initrd.gz.md5
-rw-r--r-- 1 root root 2041069568 Feb 21 21:30 linuxfs
-rw-r--r-- 1 root root         36 Feb 21 21:30 linuxfs.md5
-rw-r--r-- 1 root root         36 Feb 21 21:51 linuxfs.md5.old
-rw------- 1 root root        512 Feb 21 22:36 random-seed
-rw-r--r-- 1 root root 3221225472 Feb 21 22:37 rootfs
drwxr-xr-x 2 root root       4096 Feb 21 22:36 state
drwxr-xr-x 4 root root       4096 Feb 21 21:56 state.old
-rw-r--r-- 1 root root    4185824 Feb 21 21:56 vmlinuz
-rw-r--r-- 1 root root    7144080 Jan 26 17:56 vmlinuz.kbad
-rw-r--r-- 1 root root    7677312 Jan 28 17:26 vmlinuz.kold
-rw-r--r-- 1 root root         42 Feb 21 21:56 vmlinuz.md5


Obviously the live kernel-remaster system has become inconsistent.

Question:
Can I remedy the inconsistency by simply deleting something from this folder?
Last edited by cinclus on Tue Feb 26, 2019 4:47 pm, edited 1 time in total.

User avatar
anticapitalista
Developer
Posts: 4167
Joined: Sat Jul 15, 2006 10:40 am

Re: Live-kernel-Updater wants to rollback to non-existing kernel

#2 Post by anticapitalista »

How did you delete the kernel you didn't want?

You could also run the set up live persistence script and choose the Fix option to remove old files.
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: Live-kernel-Updater wants to rollback to non-existing kernel

#3 Post by BitJam »

TL;DR: You should be able to fix this with two copy commands or one rm command.

If you system is working now how you want it to and you don't want to change kernels then just delete the *.kold and *.kbad files. If you want to manually switch to a different live kernel, read on.

cinclus wrote: Thu Feb 21, 2019 6:05 pm Notes: there are only 2(!) live-kernels and the 4.18.20-lqx2 (2019-01-28) is a deleted phantom-kernel.
It depends on how you count. ISTM you do have 3 *live* kernels: vmlinuz, vmlinuz.kold, and vmlinuz.kbad.
It's actually the newly built 4.18.20-lqx2 (2019-02-21). The error comes from the book-keeping of mx of the manually deleted kernel with same name as the new one 4.18.20-lqx2 from today.
IMO this is a serious bug. Two different things, especially kernels, with the same version identifier is a disaster. At least your computer didn't catch fire and burn down your home/apartment.

Thanks for the "ls". Here is the relevant part:

Code: Select all

$ ls -l
insgesamt 2182616
-rw-r--r-- 1 root root    6161797 Feb 21 21:56 initrd.gz
-rw-r--r-- 1 root root    6320549 Jan 26 17:56 initrd.gz.kbad
-rw-r--r-- 1 root root    6239921 Jan 28 17:26 initrd.gz.kold
-rw-r--r-- 1 root root 2041069568 Feb 21 21:30 linuxfs
-rw-r--r-- 1 root root    4185824 Feb 21 21:56 vmlinuz
-rw-r--r-- 1 root root    7144080 Jan 26 17:56 vmlinuz.kbad
-rw-r--r-- 1 root root    7677312 Jan 28 17:26 vmlinuz.kold

Perhaps you already know but in case you don't, you want to find out which kernel version each vmlinuz* file is. We provide a tool for this. Do:

Code: Select all

/usr/local/lib/cli-shell-utils/bin/vmlinuz-version /live/boot-dev/antiX
Of course this won't work perfectly if two of the kernels are named exactly the same. If the live-usb is mounted on another system then you want to look at $MOUNT_POINT/antiX/ instead of the directory I gave above.

You should be able to easily fix this problem by copying vmlinux.$X to vmlinuz and initrd.gz.$X to initrd.gz. Where $X is either "kold" or "kbad". You may want to back up vmlinuz and initrd.gz first. Once that done and the system is working then you should be able to reset everything be deleting *.kold and *.kbad from that directory.

To be squeaky clean, after it is working cd to that directory and run:

Code: Select all

md5sum vmlinuz | sudo tee vmlinuz.md5
md5sum initrd.gz | sudo too initrd.gz.md5
HTH
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."

-- Richard Feynman

cinclus
Posts: 104
Joined: Sun Mar 13, 2016 5:35 am

Re: Live-kernel-Updater wants to rollback to non-existing kernel

#4 Post by cinclus »

@Anticapitalista: Because for the older kernel I had no deb-package to install I could not uninstall with Debian tools. So have deleted the mentioned files manually, please see the thread "[Resolved] ]missing microcode after Liquorix kernel update" in "Bugs ..."

@BitJam: Many thanx for the solution.

Code: Select all

root@mx1:/live/boot-dev/antiX# /usr/local/lib/cli-shell-utils/bin/vmlinuz-version /live/boot-dev/antiX
File                               Version                      Date
/live/boot-dev/antiX/vmlinuz       4.19.0-1-686-pae             2019-02-21
/live/boot-dev/antiX/vmlinuz.kold  4.18.20-lqx2                 2019-01-28
/live/boot-dev/antiX/vmlinuz.kbad  4.17.0-19.2-liquorix-686-pae 2019-01-26
I have deleted *.kold and *.kbad

And now I get the desired self-compiled kernel as an update option in live-kernel-remaster:

Code: Select all

Found:
  1 live kernel      (4.19.0-1-686-pae)
  1 default live kernel      (4.19.0-1-686-pae)
  0 previous live kernel 

  2 installed kernels 
  1 newly installed kernel (4.18.20-lqx2)

Only one newly installed kernel found
 version      date
 4.18.20-lqx2 2019-02-21
                                                                                                  
Please choose an action                                                                       
  > update vmlinuz von 4.19.0-1-686-pae (2019-02-21) 
  

Code: Select all

Ready, to update live kernel
-------------------------------------------------------------------------------
         Version           date      from     to
 actual 4.19.0-1-686-pae  2019-02-21  vmlinuz vmlinuz.kold
     new 4.18.20-lqx2      2019-02-21  (neu)   vmlinuz

cinclus
Posts: 104
Joined: Sun Mar 13, 2016 5:35 am

Re: Live-kernel-Updater wants to rollback to non-existing kernel

#5 Post by cinclus »

For information on the new kernel package I used please look into the thread "[Resolved] ]missing microcode after Liquorix kernel update" in "Bugs ..."

Post Reply

Return to “Software / Configuration”