Bug 15710 - Kernel updates do not update initrd.img and vmlinuz
Summary: Kernel updates do not update initrd.img and vmlinuz
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: release_blocker critical
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-16 01:35 CEST by Barry Jackson
Modified: 2015-05-11 22:50 CEST (History)
6 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Barry Jackson 2015-04-16 01:35:37 CEST
Description of problem:
Kernel updates do not update initrd.img symlink.
The initrd-desktop.img is updated but not initrd.img

After last update:

lrwxrwxrwx 1 root root       32 Apr 16 00:03 initrd-desktop.img -> initrd-3.19.4-desktop-1.mga5.img
lrwxrwxrwx 1 root root       32 Mar 27 22:00 initrd.img -> initrd-3.19.2-desktop-2.mga5.img
-rw------- 1 root root 10013913 Jul 25  2013 initrd-sd.img

When booting from another system's grub2 the initrd.img is used and an old kernel is run. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.


Reproducible: 

Steps to Reproduce:
Barry Jackson 2015-04-16 01:37:30 CEST

Priority: Normal => release_blocker

Comment 1 David Walser 2015-04-16 01:55:39 CEST
So are you saying this only happens when using GRUB2?  I can confirm that I haven't reproduced this issue on any systems running GRUB.
Comment 2 Barry Jackson 2015-04-16 11:03:50 CEST
I have no real h/w systems using legacy, but I would not have related this to the bootloader, as in PC_BIOS machines grub is still installed by default irrespective of whether it is used.

This is on a PC-BIOS machine.

I have a second real test system that's not updated yet I will try to confirm on that one and in VMs time permitting.

I also noticed this had happened in https://bugs.mageia.org/show_bug.cgi?id=15532
Comment 3 Barry Jackson 2015-04-16 11:28:48 CEST
In my up-to-date cauldron system I just ran:
dracut -f 

and it updated ONLY initrd-desktop.img

lrwxrwxrwx 1 root root       32 Apr 16 00:03 /boot/initrd-desktop.img -> initrd-3.19.4-desktop-1.mga5.img
lrwxrwxrwx 1 root root       32 Mar 27 22:00 /boot/initrd.img -> initrd-3.19.2-desktop-2.mga5.img
Barry Jackson 2015-04-16 11:30:35 CEST

Blocks: (none) => 15532

Barry Jackson 2015-04-16 11:32:36 CEST

Blocks: 15532 => (none)
Source RPM: (none) => dracut

Comment 4 Barry Jackson 2015-04-16 13:29:09 CEST
I have just updated another system (using grub2 on btrfs) and it seems that both initrd.img AND vmlinuz are updated incorrectly.
Below is a diff of pre and post update, and whilst the *-desktop symlinks are updated correctly, initrd.img and vmlinuz are changed to more recent, but still old versions.

--- ll_pre-update.txt	2015-04-16 11:51:35.280622442 +0100
+++ ll_post-update.txt	2015-04-16 12:09:52.077098688 +0100
@@ -1,34 +1,39 @@
-total 86692
+total 103556
 -rw-r--r-- 1 root root   167785 Nov  4 00:32 config-3.17.2-desktop-3.mga5
 -rw-r--r-- 1 root root   170054 Dec 15 21:46 config-3.18.1-desktop-1.mga5
 -rw-r--r-- 1 root root   171245 Feb 26 20:31 config-3.19.0-desktop-4.mga5
 -rw-r--r-- 1 root root   171245 Mar 14 22:29 config-3.19.1-desktop-2.mga5
 -rw-r--r-- 1 root root   171245 Mar 18 21:02 config-3.19.2-desktop-1.mga5
-drwxr-xr-x 1 root root        0 Mar 23 23:31 dracut/
+-rw-r--r-- 1 root root   171245 Apr 14 18:47 config-3.19.4-desktop-1.mga5
+drwxr-xr-x 1 root root        0 Apr  6 21:30 dracut/
 -rwxr-xr-x 1 root root   562176 Mar 18 15:38 gfxmenu*
 drwxr-xr-x 1 root root       32 Nov  5 21:52 grub/
-drwxr-xr-x 1 root root      124 Mar 24 14:51 grub2/
+drwxr-xr-x 1 root root      124 Apr 16 12:04 grub2/
 -rw------- 1 root root 10962595 Nov  5 21:56 initrd-3.17.2-desktop-3.mga5.img
 -rw------- 1 root root  9443194 Dec 20 12:18 initrd-3.18.1-desktop-1.mga5.img
 -rw------- 1 root root  9515123 Feb 27 12:58 initrd-3.19.0-desktop-4.mga5.img
 -rw------- 1 root root  9283991 Mar 18 15:42 initrd-3.19.1-desktop-2.mga5.img
 -rw------- 1 root root  9284092 Mar 24 14:50 initrd-3.19.2-desktop-1.mga5.img
-lrwxrwxrwx 1 root root       32 Mar 24 14:50 initrd-desktop.img -> initrd-3.19.2-desktop-1.mga5.img
-lrwxrwxrwx 1 root root       32 Nov  5 21:56 initrd.img -> initrd-3.17.2-desktop-3.mga5.img
+-rw------- 1 root root  9284602 Apr 16 12:05 initrd-3.19.4-desktop-1.mga5.img
+lrwxrwxrwx 1 root root       32 Apr 16 12:05 initrd-desktop.img -> initrd-3.19.4-desktop-1.mga5.img
+lrwxrwxrwx 1 root root       32 Apr 16 11:54 initrd.img -> initrd-3.19.2-desktop-1.mga5.img
 -rw-r--r-- 1 root root   241192 Nov  4 00:32 symvers-3.17.2-desktop-3.mga5.xz
 -rw-r--r-- 1 root root   242344 Dec 15 21:47 symvers-3.18.1-desktop-1.mga5.xz
 -rw-r--r-- 1 root root   245356 Feb 26 20:31 symvers-3.19.0-desktop-4.mga5.xz
 -rw-r--r-- 1 root root   245512 Mar 14 22:29 symvers-3.19.1-desktop-2.mga5.xz
 -rw-r--r-- 1 root root   245512 Mar 18 21:02 symvers-3.19.2-desktop-1.mga5.xz
+-rw-r--r-- 1 root root   245460 Apr 14 18:47 symvers-3.19.4-desktop-1.mga5.xz
 -rw-r--r-- 1 root root  3165755 Nov  4 00:32 System.map-3.17.2-desktop-3.mga5
 -rw-r--r-- 1 root root  3191226 Dec 15 21:46 System.map-3.18.1-desktop-1.mga5
 -rw-r--r-- 1 root root  3222831 Feb 26 20:31 System.map-3.19.0-desktop-4.mga5
 -rw-r--r-- 1 root root  3222968 Mar 14 22:29 System.map-3.19.1-desktop-2.mga5
 -rw-r--r-- 1 root root  3222998 Mar 18 21:02 System.map-3.19.2-desktop-1.mga5
-lrwxrwxrwx 1 root root       29 Nov  5 21:56 vmlinuz -> vmlinuz-3.17.2-desktop-3.mga5
+-rw-r--r-- 1 root root  3223361 Apr 14 18:47 System.map-3.19.4-desktop-1.mga5
+lrwxrwxrwx 1 root root       29 Apr 16 11:54 vmlinuz -> vmlinuz-3.19.2-desktop-1.mga5
 -rw-r--r-- 1 root root  4254000 Nov  4 00:32 vmlinuz-3.17.2-desktop-3.mga5
 -rw-r--r-- 1 root root  4288816 Dec 15 21:47 vmlinuz-3.18.1-desktop-1.mga5
 -rw-r--r-- 1 root root  4342976 Feb 26 20:31 vmlinuz-3.19.0-desktop-4.mga5
 -rw-r--r-- 1 root root  4340928 Mar 14 22:29 vmlinuz-3.19.1-desktop-2.mga5
 -rw-r--r-- 1 root root  4340928 Mar 18 21:02 vmlinuz-3.19.2-desktop-1.mga5
-lrwxrwxrwx 1 root root       29 Mar 24 14:50 vmlinuz-desktop -> vmlinuz-3.19.2-desktop-1.mga5
+-rw-r--r-- 1 root root  4338688 Apr 14 18:47 vmlinuz-3.19.4-desktop-1.mga5
+lrwxrwxrwx 1 root root       29 Apr 16 12:05 vmlinuz-desktop -> vmlinuz-3.19.4-desktop-1.mga5
Barry Jackson 2015-04-16 13:30:30 CEST

Summary: Kernel updates do not update initrd.img => Kernel updates do not update initrd.img and vmlinuz correctly (dracut)

Comment 5 David Walser 2015-04-16 19:37:24 CEST
Ooh that is weird.  I didn't think it was dracut's job to update these symlinks though, I thought that was the job of /sbin/installkernel (called in %posttrans by the kernel packages themselves) from bootloader-utils.

CC: (none) => mageia, shlomif, thierry.vignaud, tmb

Comment 6 Thomas Backlund 2015-04-16 19:46:17 CEST
It _is_ /sbin/installkernel through drakxtools-backend that takes care for the vmlinuz an initrd.img symlinks

kernel %post takes care of vmlinuz-$flavour and initrd-$flavour.img symlinks
Comment 7 Barry Jackson 2015-04-16 20:12:55 CEST
Thanks Thomas - I'm learning something here - removed 'dracut' from subject.

So, when there are no flavourless kernels, why do we have initrd.img and vmlinuz that point to old versions, and are even updated to old versions?

I have seen grub2/os-prober on other systems creating links to vmlinuz and initrd.img in this situation (but not always) resulting in the old kernel being run.

Source RPM: dracut => (none)
Summary: Kernel updates do not update initrd.img and vmlinuz correctly (dracut) => Kernel updates do not update initrd.img and vmlinuz

Comment 8 Thomas Backlund 2015-04-16 20:40:59 CEST
They are supposed to be a link to latest installed core kernel, but there seems to still be a bug/check in drakx making it bail out before it changes the links.

iirc the logic is supposed to be:

- drakx get called from kernel %post with info that new kernel is installed and we want initrd + symlink change 
- drakx creates initrd
- if initrd succeeded, change the symlinks

So for some reason either initrd creation fails, or we fail to detect it geets created...

One way to fix this is if we cant figure it out in drakx is to move the symlink change to kernel %post
Comment 9 Barry Jackson 2015-04-20 11:25:15 CEST
All symlinks were created correctly on update to 3.19.4-desktop-2.mga5 :)

-rw------- 1 root root  9201410 Apr 19 00:12 initrd-3.19.4-desktop-2.mga5.img
lrwxrwxrwx 1 root root       32 Apr 19 00:12 initrd-desktop.img -> initrd-3.19.4-desktop-2.mga5.img
lrwxrwxrwx 1 root root       32 Apr 19 00:12 initrd.img -> initrd-3.19.4-desktop-2.mga5.img
lrwxrwxrwx 1 root root       29 Apr 19 00:12 vmlinuz -> vmlinuz-3.19.4-desktop-2.mga5
-rw-r--r-- 1 root root  4343296 Apr 17 22:51 vmlinuz-3.19.4-desktop-2.mga5
lrwxrwxrwx 1 root root       29 Apr 19 00:12 vmlinuz-desktop -> vmlinuz-3.19.4-desktop-2.mga5

I will check other systems later.
Comment 10 Chris Denice 2015-04-27 10:19:21 CEST
You should also check what are you settings in there?

cat /etc/sysconfig/installkernel

CC: (none) => dirteat

Comment 11 Thierry Vignaud 2015-04-27 12:26:17 CEST
@Colin: not using the blkid cache does hurt when there's quite a lot of partitions
http://gitweb.mageia.org/software/drakx/commit/perl-install?id=ecd8db27c8ffb76ebf799e0de0dcf64c3ce256fe
Comment 12 Thierry Vignaud 2015-04-27 12:29:54 CEST
Oops, wrong bug
Comment 13 Barry Jackson 2015-04-27 20:39:19 CEST
(In reply to Chris Denice from comment #10)
> You should also check what are you settings in there?
> 
> cat /etc/sysconfig/installkernel

Is that still used?

sbin/installkernel:# deprecated /etc/sysconfig/installkernel variables
Comment 14 Chris Denice 2015-04-27 21:10:14 CEST
I hope it is, I hate having new entries with new kernels :)
So far the NOENTRY seems to be used

mine ----->

# -*- Mode: shell-script -*-
#       $Id: installkernel.sysconfig 30419 2004-06-29 04:50:42Z prigaux $
# Configuration option when installing a kernel and initrscript.

# Set this to yes if you never want link from /boot/vmlinuz to the
# kernel.
NOLINK=""

# Set this to yes if you don't want to add entry to your bootloader
NOENTRY="yes"

# If you want to pass options to the "make-initrd" helper script you
# can do it here.
INITRDOPTS=""
Comment 15 Colin Guthrie 2015-04-28 10:49:53 CEST
(In reply to Barry Jackson from comment #13)
> (In reply to Chris Denice from comment #10)
> > You should also check what are you settings in there?
> > 
> > cat /etc/sysconfig/installkernel
> 
> Is that still used?
> 
> sbin/installkernel:# deprecated /etc/sysconfig/installkernel variables

You underquoted:

# /etc/sysconfig/installkernel variables
NOLINK=""
NOENTRY=""
INITRDOPTS=""

# deprecated /etc/sysconfig/installkernel variables
NOLAUNCH=""


It's only referring to the NOLAUNCH variable.

I think we should probably try to move away from our installkernel scripts however, as systemd ships with some that are quite nice and modular and have dropins provided by dracut and other tools that can trigger initrd regeneration etc.

But time is always the enemy.
Comment 16 Barry Jackson 2015-04-28 12:50:32 CEST
Ah yes, thanks Colin (grep found that, out of context)
Comment 17 Anne Nicolas 2015-04-28 21:47:38 CEST
ok so we are in RC now. What solution can we choose given the fact that we need to close the release?

CC: (none) => ennael1

Comment 18 Anne Nicolas 2015-05-08 13:50:55 CEST
Guys ?
Comment 19 Anne Nicolas 2015-05-11 22:50:01 CEST
Fix was provided by tmb since 3.19.4-2. Please reopen this bug if needed

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.