You are not logged in.
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
Do:
# mkinitcpio -Pv
$ cat /etc/mkinitcpio.d/*
And post output
Offline
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.preset0 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
Delete the preset and reinstall the kernel to make it get regenerated.
Offline
Sounds good - I'll give that a shot
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
Offline
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' packageALL_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