You are not logged in.

#1 2021-03-13 18:42:08

eartheaterrr
Member
Registered: 2014-09-22
Posts: 4

Upgrading the linux image deletes initramfs-linux.img

When I run

pacman -Syu

and there is a linux image update, the "/boot/initramfs-linux.img" is deleted, and not re-generated. Running "mkinitcpio -P" fails to create it as well.

I'm able to work around the issue by regenerating the initram file manually using the new kernel version:

# after running `ls /usr/lib/modules` to get the available kernel (ie: 5.5.7-arch1-1)
mkinitcpio -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img -k 5.5.7-arch1-1

but I have to do that every time I update the linux kernel, or else my machine won't boot. Does anyone know how to automate this process?

It used to work for me, but then a did an Arch re-install, updating the bootloader, etc, and now the initram file doesn't auto-generate.

Here's the logs from /var/log/pacman.log while running the post-transaction hooks:

[2021-03-12T23:42:22-0800] [ALPM] transaction completed
[2021-03-12T23:42:24-0800] [ALPM] running '20-systemd-sysusers.hook'...
[2021-03-12T23:42:24-0800] [ALPM] running '30-systemd-daemon-reload.hook'...
[2021-03-12T23:42:25-0800] [ALPM] running '30-systemd-tmpfiles.hook'...
[2021-03-12T23:42:25-0800] [ALPM] running '30-systemd-udev-reload.hook'...
[2021-03-12T23:42:25-0800] [ALPM] running '30-systemd-update.hook'...
[2021-03-12T23:42:25-0800] [ALPM] running '60-depmod.hook'...
[2021-03-12T23:42:33-0800] [ALPM] running '70-dkms-install.hook'...
[2021-03-12T23:42:33-0800] [ALPM-SCRIPTLET] ==> dkms install --no-depmod -m vboxhost -v 6.1.18_OSE -k 5. 11.6-arch1-1
[2021-03-12T23:42:53-0800] [ALPM-SCRIPTLET] ==> depmod 5.11.6-arch1-1
[2021-03-12T23:43:01-0800] [ALPM] running '90-mkinitcpio-install.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'dbus-reload.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'detect-old-perl-modules.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'gdk-pixbuf-query-loaders.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'gio-querymodules.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'glib-compile-schemas.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'gtk-query-immodules-3.0.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'gtk-update-icon-cache.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'texinfo-install.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'update-desktop-database.hook'...
[2021-03-12T23:43:01-0800] [ALPM] running 'update-mime-database.hook'...

And here's some detail about my relevant mkinitcpio configs:

❯ cat /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*

[Action]
Description = Updating linux initcpios...
When = PostTransaction
Exec = /usr/share/libalpm/scripts/mkinitcpio-install
NeedsTargets

and my mkinitcpio.conf (removed all comments for brevity):

❯ cat /etc/mkinitcpio.conf
MODULES=()

BINARIES=()

FILES=()

HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

Not sure if it's relevant, but I'm using systemd-boot, and here's some info about my /boot dir:

❯ tree /boot
/boot
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Linux
│   └── systemd
│       └── systemd-bootx64.efi
├── initramfs-linux.img
├── intel-ucode.img
├── loader
│   ├── entries
│   │   └── arch.conf
│   ├── loader.conf
│   └── random-seed
└── vmlinuz-linux

Offline

#2 2021-03-13 18:52:46

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: Upgrading the linux image deletes initramfs-linux.img

Do:

# mkinitcpio -Pv
$ cat /etc/mkinitcpio.d/*

And post output


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2021-03-13 20:33:38

eartheaterrr
Member
Registered: 2014-09-22
Posts: 4

Re: Upgrading the linux image deletes initramfs-linux.img

I ran "mkinitcpio -Pv" as suggested, and here's some info from my "/etc/mkinitcpio.d/" dir:

❯ cat /etc/mkinitcpio.d/*

❯ tree /etc/mkinitcpio.d
/etc/mkinitcpio.d
└── linux.preset

0 directories, 1 file

I don't think anything was changed - I believe this is the same state that the dir was in before: just an empty /etc/mkinitcpio.d/linux.preset file.

Is my configuration incorrect?

Last edited by eartheaterrr (2021-03-13 20:48:08)

Offline

#4 2021-03-13 20:49:51

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: Upgrading the linux image deletes initramfs-linux.img

Delete the preset and reinstall the kernel to make it get regenerated.


My reposSome snippets

Heisenberg might have been here.

Offline

#5 2021-03-13 21:10:30

eartheaterrr
Member
Registered: 2014-09-22
Posts: 4

Re: Upgrading the linux image deletes initramfs-linux.img

Sounds good - I'll give that a shot smile

Just to be sure, does this seem like a reasonable way to re-install the kernel?

# After booting from an installation image, and mounting all of my partitions:
pacstrap /mnt base linux linux-firmware

Which is listed in the install guide here:
https://wiki.archlinux.org/index.php/In … l_packages

Offline

#6 2021-03-13 21:12:04

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Upgrading the linux image deletes initramfs-linux.img

Just do...

pacman -S linux

No need to mess about with boot media.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2021-03-13 22:35:06

eartheaterrr
Member
Registered: 2014-09-22
Posts: 4

Re: Upgrading the linux image deletes initramfs-linux.img

Yes! That worked!!!

Thanks for the help. I can confirm that my linux.preset file is no longer empty and that my initramfs-linux.img file is being re-generated when the kernel is (re)installed/updated.

❯ cat /etc/mkinitcpio.d/*
# mkinitcpio preset file for the 'linux' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"

Last edited by eartheaterrr (2021-03-13 22:35:35)

Offline

Board footer

Powered by FluxBB