Bug 28831 - initrd symlink not updated with kernel upgrade on RPi4
Summary: initrd symlink not updated with kernel upgrade on RPi4
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: aarch64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-22 22:10 CEST by Filip Komar
Modified: 2021-05-19 01:14 CEST (History)
6 users (show)

See Also:
Source RPM: Mageia-8-rpi-aarch64-noDE.img.gz image
CVE:
Status comment:


Attachments

Description Filip Komar 2021-04-22 22:10:02 CEST
# cd /boot
# ll init*
-rw------- 1 root root 21577326 feb 21 20:22 initrd-5.10.16-desktop-1.mga8.img
-rw------- 1 root root 12675779 apr 22 19:40 initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 21 20:27 initrd-desktop.img -> initrd-5.10.16-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 21 20:27 initrd.img -> initrd-5.10.16-desktop-1.mga8.img


# rm initrd.img 
# rm initrd-desktop.img 
# ln -s initrd-5.10.30-desktop-1.mga8.img initrd-desktop.img
# ln -s initrd-5.10.30-desktop-1.mga8.img initrd.img

# ll init*
-rw------- 1 root root 21577326 feb 21 20:22 initrd-5.10.16-desktop-1.mga8.img
-rw------- 1 root root 12675779 apr 22 19:40 initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 22 20:20 initrd-desktop.img -> initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 22 20:16 initrd.img -> initrd-5.10.30-desktop-1.mga8.img

Note also the huge difference in size.
It's very strange for me that content of both initrd seems very different (not just the kernel version).
Comment 1 Dave Hodgins 2021-04-22 23:36:24 CEST
On my rpi4 ...
$ ls -l /boot/*init*
-rw------- 1 root root 14027069 Mar 31 07:27 /boot/initrd-5.10.27-desktop-1.mga8.img
-rw------- 1 root root 14025220 Apr 10 00:41 /boot/initrd-5.10.28-desktop-1.mga8.img
-rw------- 1 root root 14024672 Apr 10 13:19 /boot/initrd-5.10.29-desktop-1.mga8.img
-rw------- 1 root root 14024347 Apr 15 13:06 /boot/initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 Apr 15 13:06 /boot/initrd-desktop.img -> initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 Apr 15 13:06 /boot/initrd.img -> initrd-5.10.30-desktop-1.mga8.img

So it's working ok on mine. Did you create a separate partition for /boot?

Also check ...
[dave@rp4 ~]$ df -h |grep -v tmpfs
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   22G  8.1G   13G  40% /
/dev/mmcblk0p1 1021M   24M  998M   3% /boot/EFI
[dave@rp4 ~]$ df -hi |grep -v tmpfs
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/mmcblk0p2   1.4M  255K  1.2M   19% /
/dev/mmcblk0p1      0     0     0     - /boot/EFI

CC: (none) => davidwhodgins

Comment 2 Filip Komar 2021-04-23 15:30:36 CEST
That's odd. Which image did you install from?
I can try fresh dd on USB key and boot from there to double check if only noDE image is affected.

$ LC_ALL=C df -h | grep -v tmpfs
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   20G   11G  8.6G  55% /
/dev/sda1       877G  400G  433G  49% /mnt/SSD
/dev/mmcblk0p1  128M   76M   53M  59% /boot/EFI

$ LC_ALL=C df -hi | grep -v tmpfs
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/mmcblk0p2   1.3M  189K  1.1M   15% /
/dev/sda1         56M  2.0M   54M    4% /mnt/SSD
/dev/mmcblk0p1      0     0     0     - /boot/EFI

CC: (none) => filip.komar

Comment 3 Filip Komar 2021-04-23 15:33:25 CEST
(In reply to Filip Komar from comment #0)
> # ll init*
> -rw------- 1 root root 21577326 feb 21 20:22 initrd-5.10.16-desktop-1.mga8.img
> -rw------- 1 root root 12675779 apr 22 19:40 initrd-5.10.30-desktop-1.mga8.img

> Note also the huge difference in size.
> It's very strange for me that content of both initrd seems very different
> (not just the kernel version).

Any comment on the content/size matter?
Comment 4 Thomas Backlund 2021-04-23 16:29:56 CEST
(In reply to Filip Komar from comment #3)
> (In reply to Filip Komar from comment #0)
> > # ll init*
> > -rw------- 1 root root 21577326 feb 21 20:22 initrd-5.10.16-desktop-1.mga8.img
> > -rw------- 1 root root 12675779 apr 22 19:40 initrd-5.10.30-desktop-1.mga8.img
> 
> > Note also the huge difference in size.
> > It's very strange for me that content of both initrd seems very different
> > (not just the kernel version).
> 
> Any comment on the content/size matter?

I assume the first one is a install-time "include-all", whereas the second one only contains stuff that dracut detect is needed to boot
Comment 5 Dave Hodgins 2021-04-23 18:59:47 CEST
From rpm -q --scripts kernel-desktop-5.10.30-1.mga8-1-1.mga8,
it has the lines ...
pushd /boot > /dev/null
if [ -e initrd-5.10.30-desktop-1.mga8.img ]; then
        ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz-desktop
        ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz
        ln -sf initrd-5.10.30-desktop-1.mga8.img initrd-desktop.img
        ln -sf initrd-5.10.30-desktop-1.mga8.img initrd.img
fi
popd > /dev/null

Please save the lines from the pushd to the popd, inclusive to a text file,
in /root, then run (as root) "bash -x -v ./thattextfile". Does it create the
symlinks?
Comment 6 Lewis Smith 2021-04-23 20:08:03 CEST
Thanks to Dave & tmb for your comments. Leaving with bugsquad for now.

Status: NEW => NEEDINFO
CC: (none) => lewyssmith

Comment 7 Filip Komar 2021-04-24 01:36:34 CEST
I tried fresh dd on USB key and boot from there with no other change to double check if only noDE image is affected and the results were very different.
Besides constant very annoying and useless (due to USB boot so w/o SD) emmc timeout errors I noticed that the initrd-5.10.16 was rebuild during update.
I don't know if that is intentionally but I guess it might be useful in some cases. The sizes are comparable and the symlinks are fine.

Unfortunately I forget to use tee before urpmi.update -a && urpmi --auto-select but the end result is here.
cat /run/media/user/e45a161d-aa49-4c6c-b8b7-af67a32a9f80/root/ll.txt 
-rw------- 1 root root 12018119 Apr 23 22:43 /boot/initrd-5.10.16-desktop-1.mga8.img
-rw------- 1 root root 12015024 Apr 23 22:56 /boot/initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 Apr 23 22:57 /boot/initrd-desktop.img -> initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 Apr 23 22:57 /boot/initrd.img -> initrd-5.10.30-desktop-1.mga8.img

Forgot to add that I didn't add or remove any partition on original SD but I did resize root one in gparted before first boot. AFAIK that should not matter.

(In reply to Thomas Backlund from comment #4)
> (In reply to Filip Komar from comment #3)
> > Any comment on the content/size matter?
> 
> I assume the first one is a install-time "include-all", whereas the second
> one only contains stuff that dracut detect is needed to boot
Makes sense.

Thx to all.

Strange. Closing as noise ;). I really hope that SD card is not acting up or even dying. Quick Gparted test didn't find any errors. Need to test more.

Status: NEEDINFO => RESOLVED
Resolution: (none) => INVALID

Comment 8 Filip Komar 2021-04-24 03:32:25 CEST
(In reply to Dave Hodgins from comment #5)
> Does it create the symlinks?
Yes.

I'm unsure but I reopened as I reproduced the bug with old kernel install and it's kinda funny as symlink were not from the latest installed nor bigger version but last one in urpmi line.



$ sudo urpmi kernel-desktop-5.10.27-1.mga8 kernel-desktop-5.10.25-1.mga8 
$ ls -l /boot/*init*
-rw------- 1 root root 21577326 feb 21 20:22 /boot/initrd-5.10.16-desktop-1.mga8.img
-rw------- 1 root root 13024789 apr 24 01:58 /boot/initrd-5.10.25-desktop-1.mga8.img
-rw------- 1 root root 13024995 apr 24 01:57 /boot/initrd-5.10.27-desktop-1.mga8.img
-rw------- 1 root root 12675779 apr 22 19:40 /boot/initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 24 01:58 /boot/initrd-desktop.img -> initrd-5.10.25-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 24 01:58 /boot/initrd.img -> initrd-5.10.25-desktop-1.mga8.img

# chmod u+x bug_test.sh 
# bash -x -v ./bug_test.sh 
pushd /boot > /dev/null
+ pushd /boot
if [ -e initrd-5.10.30-desktop-1.mga8.img ]; then
        ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz-desktop
        ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz
        ln -sf initrd-5.10.30-desktop-1.mga8.img initrd-desktop.img
        ln -sf initrd-5.10.30-desktop-1.mga8.img initrd.img
fi
+ '[' -e initrd-5.10.30-desktop-1.mga8.img ']'
+ ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz-desktop
+ ln -sf vmlinuz-5.10.30-desktop-1.mga8 vmlinuz
+ ln -sf initrd-5.10.30-desktop-1.mga8.img initrd-desktop.img
+ ln -sf initrd-5.10.30-desktop-1.mga8.img initrd.img
popd > /dev/null
+ popd
# ls -l /boot/*init*
-rw------- 1 root root 21577326 feb 21 20:22 /boot/initrd-5.10.16-desktop-1.mga8.img
-rw------- 1 root root 13024789 apr 24 01:58 /boot/initrd-5.10.25-desktop-1.mga8.img
-rw------- 1 root root 13024995 apr 24 01:57 /boot/initrd-5.10.27-desktop-1.mga8.img
-rw------- 1 root root 12675779 apr 22 19:40 /boot/initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 24 02:07 /boot/initrd-desktop.img -> initrd-5.10.30-desktop-1.mga8.img
lrwxrwxrwx 1 root root       33 apr 24 02:07 /boot/initrd.img -> initrd-5.10.30-desktop-1.mga8.img

Status: RESOLVED => REOPENED
Resolution: INVALID => (none)

Comment 9 Thomas Backlund 2021-04-24 10:19:48 CEST
(In reply to Filip Komar from comment #8)
> (In reply to Dave Hodgins from comment #5)
> > Does it create the symlinks?
> Yes.
> 
> I'm unsure but I reopened as I reproduced the bug with old kernel install
> and it's kinda funny as symlink were not from the latest installed nor
> bigger version but last one in urpmi line.


please check "rpm -qa --last |less" for the install order
Comment 10 Aurelien Oudelet 2021-04-24 18:48:53 CEST
Thanks reporting this.
Assigning.

Status: REOPENED => NEW
Assignee: bugsquad => pkg-bugs
Component: Release (media or process) => RPM Packages
CC: sysadmin-bugs => j.biernacki+mga, ouaurelien, pterjan

Comment 11 Filip Komar 2021-04-24 19:00:50 CEST
(In reply to Thomas Backlund from comment #9)
> (In reply to Filip Komar from comment #8)
> > (In reply to Dave Hodgins from comment #5)
> > > Does it create the symlinks?
> > Yes.
> > 
> > I'm unsure but I reopened as I reproduced the bug with old kernel install
> > and it's kinda funny as symlink were not from the latest installed nor
> > bigger version but last one in urpmi line.
> 
> 
> please check "rpm -qa --last |less" for the install order

# rpm -qa --last |head -3
kernel-desktop-5.10.25-1.mga8-1-1.mga8.aarch64 sob 24 apr 2021 01:56:05
kernel-desktop-5.10.27-1.mga8-1-1.mga8.aarch64 sob 24 apr 2021 01:56:01
hdparm-9.60-1.mga8.aarch64                    čet 22 apr 2021 22:21:46
Comment 12 Pascal Terjan 2021-04-24 19:05:00 CEST
Yes the size difference is expected, as Thomas explained in comment #4. The image is not using hostonly as it is not generated on that hardware (and the image could in theory be used on several types of storage).
Comment 13 Dave Hodgins 2021-04-24 21:00:33 CEST
If the symlinks are pointing to the latest kernel installed (not necessarily
the one with the highest version number), then it's working as designed.
Comment 14 Filip Komar 2021-04-24 22:28:19 CEST
(In reply to Dave Hodgins from comment #13)
> If the symlinks are pointing to the latest kernel installed (not necessarily
> the one with the highest version number), then it's working as designed.

Ok. Implications are small I guess. And with simple workaround. 
I'll wait for another kernel update. Or another test report.

Bug 24084 is way more critical anyway.

Status: NEW => UNCONFIRMED
Ever confirmed: 1 => 0

Comment 15 Filip Komar 2021-05-19 01:14:27 CEST
Seems fine with 5.10.30 and 33.

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


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