You are not logged in.

#1 2020-09-05 10:34:41

terepy
Member
Registered: 2020-09-05
Posts: 7

mkinitcpio fails to create initramfs

Whenever I run pacman -Syu, I lose my initramfs, mkinitcpio gets called but errors with:

==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> ERROR: invalid kernel specified: `/boot/vmlinuz-linux'
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: invalid kernel specified: `/boot/vmlinuz-linux'

the same error happens when I call mkinitcpio -p linux
the file /boot/vmlinuz-linux is present, it seems to be a binary or some kind of compressed thing?

I can regenerate the initramfs manually by arch-chrooting in from a live disk and doing mkinitcpio -g /boot/initramfs-linux.img -k 5.8.6-arch1-1 and that seems to work fine, but still the initramfs gets deleted and recreating it fails whenever I update.

Offline

#2 2020-09-05 12:23:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,735

Re: mkinitcpio fails to create initramfs

file /boot/vmlinuz-linux

Offline

#3 2020-09-05 12:32:01

terepy
Member
Registered: 2020-09-05
Posts: 7

Re: mkinitcpio fails to create initramfs

seth wrote:
file /boot/vmlinuz-linux
/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 5.8.6-arch1-1 (linux@archlinux) #1 SMP PREEMPT Sat, 05 Sep 2020 06:31:03 +0000, RO-rootFS, swap_dev 0x7, Normal VGA

Offline

#4 2020-09-05 12:36:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,735

Re: mkinitcpio fails to create initramfs

File looks ok, we previously had https://bbs.archlinux.org/viewtopic.php?id=252418 (it doesn't *have* to fail for hexdump in particular though, but the script could still fail for similar reasons)

Offline

#5 2020-09-06 01:21:47

terepy
Member
Registered: 2020-09-05
Posts: 7

Re: mkinitcpio fails to create initramfs

so you think it's because of an unhappy command from util-linux?

Name            : util-linux
Version         : 2.36-3
Description     : Miscellaneous system utilities for Linux
Architecture    : x86_64
URL             : https://github.com/karelzak/util-linux
Licenses        : GPL2
Groups          : None
Provides        : rfkill
Depends On      : pam  shadow  coreutils  systemd-libs  libsystemd.so=0-64  libudev.so=1-64  libcap-ng  libxcrypt  libcrypt.so=2-64  libutil-linux  libmagic.so=1-64  libncursesw.so=6-64  libreadline.so=8-64
Optional Deps   : python: python bindings to libmount [installed]
                  words: default dictionary for look
Required By     : base  fakeroot  gupnp  jfsutils  lib32-util-linux  libnm-glib  mkinitcpio  ntfs-3g  reiserfsprogs  systemd
Optional For    : None
Conflicts With  : rfkill
Replaces        : rfkill
Installed Size  : 13.18 MiB
Packager        : Christian Hesse <arch@eworm.de>
Build Date      : Wed Sep  2 19:05:50 2020
Install Date    : Fri Sep  4 22:47:38 2020
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

util-linux: 506 total files, 0 altered files

mkinitcpio -g /boot/initramfs-linux.img -k 5.8.6-arch1-1 also works fine when not on a live disk, does that mean it's having some error trying to detect the version or the target destination? so if it's not specified it errors?

Offline

#6 2020-09-06 06:53:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,735

Re: mkinitcpio fails to create initramfs

The issue in the other thread is not a broken package, but a command (hexdump) shadowed by a local file that's not actually hexdump.
passing "-k 5.8.6-arch1-1" will simply skip the function that caused the trouble in the other thread, so if your problem is around the same lines, the used system doesn't matter.
What is for sure is that "kver" is unable to resolve the kernel, because otherwise you would not reach the present error message.

You could edit /usr/lib/initcpio/functions and add "set -x" on the top for more debug output, but the two external calls are dd and hexdump…

Offline

#7 2020-09-06 14:14:19

spiri
Guest

Re: mkinitcpio fails to create initramfs

Oh yes, I remember I had an own version of hexdump located under /usr/local/bin which caused the error.

Problem was immediately solved after inspecting the initcpio functions with set -x.

Board footer

Powered by FluxBB