Bug 5593 - Missing /boot/initrd.img after old kernel removal
Summary: Missing /boot/initrd.img after old kernel removal
Status: RESOLVED WORKSFORME
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-24 17:25 CEST by Michel Briet
Modified: 2012-05-04 09:04 CEST (History)
10 users (show)

See Also:
Source RPM: bootloader-utils
CVE:
Status comment:


Attachments

Description Michel Briet 2012-04-24 17:25:54 CEST
Description of problem:
After uninstall of previous version of kernel with drakconf, reboot on linux item in grub menu fails because /boot/initrd.img is missing.

Boot on specific version of kernel in grub menu is OK.

Problem is solved by creating /boot/initrd.img as a link to initrd-<version>.img

Version-Release number of selected component (if applicable):
 kernel 3.3.3-desktop586-1.mga2 (but I suspect the problem to be independent of kernel version)


How reproducible: always


Steps to Reproduce:
1.Run drakconf
2.Uninstall an old version of kernel
3.Reboot on linux item of grub menu
Manuel Hiebel 2012-04-25 00:31:02 CEST

Priority: Normal => release_blocker
CC: (none) => thierry.vignaud, tmb
Source RPM: (none) => drakxtools

Comment 1 Thierry Vignaud 2012-04-25 08:37:31 CEST
This is handled by kernel %post{,un} scripts

Source RPM: drakxtools => bootloader-utils

Comment 2 Sander Lepik 2012-04-25 08:48:18 CEST
AFAIK this bug got fixed some time ago. Maybe you had some old kernel with this bug?

CC: (none) => sander.lepik

Comment 3 Thomas Backlund 2012-04-25 09:19:56 CEST
(In reply to comment #1)
> This is handled by kernel %post{,un} scripts


Nope.

kernel %post(un) scripts only alter the vmlinuz-$flavour and initrd-$flavour.img

the default /boot/vmlinuz and /boot/initrd.img is handled by bootloader-utils (or the drakx* backend)
Comment 4 Thierry Vignaud 2012-04-25 09:48:11 CEST
...which is used by... kernel %post{,un} scripts
Comment 5 Thomas Backlund 2012-04-25 09:58:47 CEST
yeah, but I cant fix in kernel spec what the bootloader-utils/drakx* does as I only call /sbin/installkernel and /sbin/kernel_remove_initrd

(or technically I can if I do it "behind drakx* back", but...)
Comment 6 Thomas Backlund 2012-04-25 09:59:42 CEST
but we might be hitting another bootsplash bug too
Comment 7 Michel Briet 2012-04-25 19:38:58 CEST
(In reply to comment #2)
> AFAIK this bug got fixed some time ago. Maybe you had some old kernel with this
> bug?

No : I'm running cauldron with daily updates (no risk, no fun !). I keep only the 2 last versions of kernel.
Comment 8 Colin Guthrie 2012-04-25 21:47:12 CEST
Cannot reproduce here.

I've seen something similar in the past (long time ago) but I think the trigger conditions are much more complex than how you state here.

There was a bootspash bug recently that caused the initrd.img symlink to be overwritten with a file rather than a link... perhaps some hangover from that?

CC: (none) => mageia

Comment 9 Angelo Naselli 2012-04-25 21:51:17 CEST
one question, can you boot by choosing the right kernel from the list? i mean not choosing the "linux" default option...

CC: (none) => anaselli

Comment 10 Manuel Hiebel 2012-04-25 22:18:51 CEST
I have set in release_blocker because I have seen somebody with a similar bug on irc after an upgrade of mga1
Comment 11 José Jorge 2012-04-25 23:57:00 CEST
(In reply to comment #9)
> one question, can you boot by choosing the right kernel from the list? i mean
> not choosing the "linux" default option...

I have just reproduced the bug here, using urpme and no I cannot boot choosing the right kernel in the grub list because the line for the new kernel is not added.

I had this message :
(urpme desktop-3.3.1 -a)

Cannot find a bootloader installed. Only taking care of initrd.

CC: (none) => lists.jjorge

Comment 12 Benoît Audouard 2012-04-26 00:05:24 CEST
I can help repair, as I encountered the same kind of problem, but I did not
find the cause of it.

I ended up with many missing links of links still pointing to *2.6.38* in
/boot/

I could not diagnose what caused it, only the result which I tried to analyze
at 
http://mageiacauldron.tuxfamily.org/TestingMageia2Upgrade (see after title for upgrade of my laptop Latitude E6400).


To be short, correcting was "only" a matter of:
1. booting with an usb key with LiveUSB Mageia 1
2. chrooting after mounting my local hard disk partition
3. mounting /dev + /sysfs + /proc correctly
4. running dracut correctly
5. recreating the appropriate symlinks to *3.3.1* files
6. editing /boot/grub/menu.lst to have the appropriate entry

(not really in this order...)

CC: (none) => baud123

Comment 13 Michel Briet 2012-04-26 00:16:48 CEST
(In reply to comment #9)
> one question, can you boot by choosing the right kernel from the list? i mean
> not choosing the "linux" default option...

Yes, it boots without any problem when choosing the right kernel from the list.
Comment 14 Michel Briet 2012-04-26 00:34:23 CEST
(In reply to comment #8)
> Cannot reproduce here.
> 
> I've seen something similar in the past (long time ago) but I think the trigger
> conditions are much more complex than how you state here.
> 
> There was a bootspash bug recently that caused the initrd.img symlink to be
> overwritten with a file rather than a link... perhaps some hangover from that?

In fact, before the problem occurs, the /boot/initrd.img was currently a plain file ! I just saw messages in /var/log/user.log stating : 

 ERROR: /boot/initrd.img is not a symbolic link

May it be a potential cause of the problem ?
Comment 15 Michel Briet 2012-04-26 00:49:21 CEST
(In reply to comment #14)
> (In reply to comment #8)
> > Cannot reproduce here.
> > 
> > I've seen something similar in the past (long time ago) but I think the trigger
> > conditions are much more complex than how you state here.
> > 
> > There was a bootspash bug recently that caused the initrd.img symlink to be
> > overwritten with a file rather than a link... perhaps some hangover from that?
> 
> In fact, before the problem occurs, the /boot/initrd.img was currently a plain
> file ! I just saw messages in /var/log/user.log stating : 
> 
>  ERROR: /boot/initrd.img is not a symbolic link
> 
> May it be a potential cause of the problem ?


To be more precise, error message is :

bootloader-config[20182]: ERROR: /boot/initrd.img is not a symbolic link
Comment 16 Colin Guthrie 2012-04-26 01:02:05 CEST
Yup, see my comment from earlier:

There was a bootspash bug recently that caused the initrd.img symlink to be
overwritten with a file rather than a link... perhaps some hangover from that?

It would certainly be nice if that was the cause (as it's now fixed!).
Comment 17 Colin Guthrie 2012-04-26 01:02:37 CEST
Gah, you quoted my comment... I can't read :p
Comment 18 Colin Guthrie 2012-04-26 10:14:05 CEST
Just another thought. On upgrade we need to ensure that the upgraded bootspash is installed early before it's used as if this bug (the symlink overwrite issue) existed on mga1, it could still be used when the themes or kernel are installed and thus the scripts are used.
Comment 19 Thierry Vignaud 2012-04-26 10:25:55 CEST
Just add conflicts with older version of bootsplash to (all) kernels then.
Or to just dracut. Should be enough since it's a new require of kernels

Hardware: i586 => All

Comment 20 Thomas Backlund 2012-04-26 10:48:15 CEST
dracut 017-9.mga2 will now conflict bootsplash < 3.3.9-1, and kernel-3.3.4-1 (that will be on the RC) will require dracut >= 017-9
Comment 21 Colin Guthrie 2012-04-26 11:07:02 CEST
This will not be enough. Bootsplash scripts are used by e.g. theme RPMs too. So similar tweaks will be needed there.

I don't know how many there are, but mageia-theme at least (I've just fixed it). 

urpmq --what-requires didn't seem to suggest anything else needs them, but there could be some stuff lurking there somewhere....
Guillaume Rousse 2012-05-02 22:42:33 CEST

CC: (none) => guillomovitch
Summary: Missing /boot/initrd.img after removal of old kernel version with drakconf => Missing /boot/initrd.img after old kernel removal

Guillaume Rousse 2012-05-02 22:46:26 CEST

Assignee: bugsquad => mageia

Comment 22 Jin-tong Hu 2012-05-04 07:00:10 CEST
I'm using Cauldron and I have encountered the problem just a few days ago. I have the habit of removing some older kernels to keep the grub menu not too long to display on the screen.

Things were fine when I had a menu of default, failsafe, kernel-desktop-3.3.1-1, kernel-desktop-3.3.1-2, and kernel-desktop-3.3.3-1. Then the kernel-desktop-3.3.4-1 update came and I installed it. After the system rebooted, I removed kernel-desktop-3.3.1-1 and kernel-desktop-3.3.1-2. Rebooting again, and the problem occurred.

I checked the /boot/ dir, and found there didn't exist any /boot/initrd.img symbolic link, but a /boot/initrd-desktop.img one did exist instead. So I went to Mageia Control Center, trying to reinstall the grub thing, and on the step for editing the grub menu, I edited the default and failsafe menu items by choosing /boot/initrd-desktop.img from the drop-down list in the advanced options. This solved the problem for me.

CC: (none) => piscestong

Comment 23 Dave Hodgins 2012-05-04 09:04:30 CEST
I'm pretty sure this bug was caused by a bug that was fixed a couple of
weeks ago. (Can't remember which package it was right now).

As such, it only affects people upgrading older cauldron installations.

I'll close this bug, but feel free to reopen if you can recreate the
problem, installing a new kernel, starting with a Mageia 1 system,
or a clean install of cauldron.

Status: NEW => RESOLVED
CC: (none) => davidwhodgins
Resolution: (none) => WORKSFORME


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