You are not logged in.

#1 2025-05-10 12:21:36

stefanr
Member
Registered: 2025-05-10
Posts: 5

[SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

Hello, yesterday I booted into Arch and did the usual things, like watching YT, playing games, etc.
Then, I remembered I didn't update my system for a few days, and ran "yay -Syu".

The problem

One of the packages being updated was one of my kernels. Naturally, when a kernel gets updated, the initramfs gets regenerated. But while yay was updating the system, I noticed a strange thing. Mkinitcpio produced this kind of log (just for linux and linux-lts too, not just zen):

(3/4) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-zen'
==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-zen'
error: command failed to execute correctly

I just thought of it as a minor inconvenience to be fixed easily, but I literally everything I could think of, and it wasn't fixed.

My system

I have my root on /dev/sda4, with windows being on the first 3 partitions (and /dev/nvme0n1 too, but that's beside the point), and my /boot was on /dev/sda6, with /dev/sda5 not even existing (somehow). After, it became /dev/sda5 (because I reformatted it, more on that later). /boot was and is on fat32 while / is on btrfs. My subvolumes are;

❯ sudo-rs btrfs su li /
[sudo: authenticate] Password: 
ID 256 gen 2770 top level 5 path @
ID 257 gen 2775 top level 5 path @home
ID 258 gen 2756 top level 5 path @root
ID 259 gen 15 top level 5 path @srv
ID 260 gen 2772 top level 5 path @log
ID 261 gen 2768 top level 5 path @cache
ID 262 gen 2775 top level 5 path @tmp

(with of course a bunch of snapshots but that's not really important)

I have an AMD CPU and GPU, an ASUS motherboard (UEFI), and /dev/sda is a Kingston SATA SSD.

What I tried

I tried some commands everyone would try at first, like just reinstalling the kernels and mkinitcpio, nothing. I got a bit more extreme and ran;

sudo-rs rm -rf /etc/mkinitcpio.d
sudo-rs rm -rf /etc/mkinitcpio.conf
yay -S --overwrite linux linux-zen linux-lts mkinitcpio

But, nothing.
I got an Arch live USB, booted into it, and did some more extreme things (yes, I knew when to chroot and when to not), such as;

  • Completely reformatting my /boot partition (yes I remembered to change my /etc/fstab).

  • Reinstalling GRUB.

  • Trying refind (after wiping my /boot again).

  • Downgrading mkinitcpio to a bunch of different versions.

  • Removing both linux-zen and linux-lts and trying with only the official kernel.

  • Trying with only linux-lts.

Absolutely nothing worked.
In the end I settled with GRUB after deleting refind, reinstalled all 3 kernels (like it was previously), and rebooted (after I changed the fstab to /boot's new UUID, again). And now I'm here, writing this post. My system somehow booted without the initramfs, although I have no idea how it did that. I am 100% sure it doesn't exist, because usually after selecting Arch Linux inside GRUB, I get something along the lines of these messages:

Loading linux linux-zen ...
Loading initial initramfs ...

but when booting now, I just get this:

Loading linux linux-zen ...

And here's some info I believe will be useful;

Additional Info
❯ yay -Q|grep linux
archlinux-keyring 20250430.1-1
lib32-util-linux 2.41-1
linux 6.14.5.arch1-1
linux-api-headers 6.14-1
linux-firmware 20250508.788aadc8-1
linux-firmware-whence 20250508.788aadc8-1
linux-lts 6.12.28-1
linux-zen 6.14.5.zen1-1
linux-zen-headers 6.14.5.zen1-1
python-proton-keyring-linux 0.2.0-4
util-linux 2.41-4
util-linux-libs 2.41-4
❯ \cat /etc/mkinitcpio.conf | grep "HOOKS"
# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
#    HOOKS=(base)
#    HOOKS=(base udev autodetect modconf block filesystems fsck)
#    HOOKS=(base udev modconf block filesystems fsck)
#    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
#    HOOKS=(base udev modconf block lvm2 filesystems fsck)
#    HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)
HOOKS=(base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
❯ \ls /etc/mkinitcpio.d
linux-lts.preset  linux.preset	linux-zen.preset
❯ \cat /etc/mkinitcpio.d/linux-zen.preset
# mkinitcpio preset file for the 'linux-zen' package

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

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux-zen.img"
#default_uki="/efi/EFI/Linux/arch-linux-zen.efi"
#default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-zen-fallback.img"
#fallback_uki="/efi/EFI/Linux/arch-linux-zen-fallback.efi"
fallback_options="-S autodetect"
❯ \ls -lAh /etc/initcpio/
total 0
drwxr-xr-x 1 root root 0 Dec 18 21:54 hooks
drwxr-xr-x 1 root root 0 Dec 18 21:54 install
drwxr-xr-x 1 root root 0 Dec 18 21:54 post
❯ \ls -lAh /etc/initcpio/hooks
total 0
❯ \ls -lAh /etc/initcpio/install
total 0
❯ \ls -lAh /etc/initcpio/post
total 0

they're empty, for some reason, even after all that reinstalling of packages.

❯ \ls -lAh /boot
total 44M
drwxr-xr-x 3 root root 4.0K May 10 12:50 EFI
drwxr-xr-x 6 root root 4.0K May 10 12:50 grub
-rwxr-xr-x 1 root root  15M May 10 12:22 vmlinuz-linux
-rwxr-xr-x 1 root root  14M May 10 12:22 vmlinuz-linux-lts
-rwxr-xr-x 1 root root  16M May 10 13:36 vmlinuz-linux-zen
❯ yay -Q|grep mkinitcpio
mkinitcpio 39.2-3
mkinitcpio-btrfs 0.4.3-1
mkinitcpio-busybox 1.36.1-1
mkinitcpio-utils 0.0.4-2
❯ \cat /etc/fstab
# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/         	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/root     	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@root	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/tmp      	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@tmp	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/srv      	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@srv	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/home     	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@home	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/var/cache	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@cache	0 0

# /dev/sda4
UUID=434a00fb-1bfb-4121-8f2b-a7a313e2a326	/var/log  	btrfs     	rw,noatime,compress=zstd:3,ssd,discard=async,space_cache=v2,commit=120,subvol=/@log	0 0

# /dev/sda6
UUID=6457-7CEB      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/sda3 LABEL=Shared\134x20Files
UUID=3074A69D74A66576	/mnt/s    	ntfs-3g      	rw,windows_names,permissions,autodefrag,nosuid,nodev,uid=0,gid=0,allow_other,blksize=4096	0 0

# /dev/nvme0n1p3
UUID=98D02B31D02B14D2	/mnt/c    	ntfs-3g      	rw,windows_names,permissions,autodefrag,nosuid,nodev,uid=0,gid=0,allow_other,blksize=4096	0 0

# /dev/sda2 LABEL=New\134x20Volume
UUID=C6086B9B086B896F	/mnt/d    	ntfs-3g      	rw,windows_names,permissions,autodefrag,nosuid,nodev,uid=0,gid=0,allow_other,blksize=4096	0 0

# /mnt/c/Users/Q/AppData/Roaming/Vencord/themes
/mnt/c/Users/Q/AppData/Roaming/Vencord/themes	/home/stefan/.config/vesktop/themes	none	bind,ro,uid=1000,gid=1000	0 0

I also followed some articles, but most were 10+ years old, and usually were fixed after running

pacman -Syu linux

which didn't work for me.

I was debating whether to post this here, or on The Kernel & Hardware page, but I don't know most of these things work and why they're needed, so I posted this here.

I am happy to provide any additional info if needed for fixing the problem; I don't really like not having an initramfs.

(EDIT: added contents of fstab)

Last edited by stefanr (2025-05-11 18:08:51)

Offline

#2 2025-05-10 15:36:31

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

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

You get this for manually running "sudo mkinitcpio -p linux" as well?

pacman -Qikk mkinitcpio

/usr/bin/mkinitcpio is a bash script - add "set -x"
Around #115 you'll find the "resolve_kernver()" function, add "set -x" to its head and run mkinitcpio.
Look at and in doubt post the output - I seem to vaguely remember some haskell or perl function shadowing a binary resulting in this going completely wrong.

Offline

#3 2025-05-10 19:54:49

stefanr
Member
Registered: 2025-05-10
Posts: 5

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

Yes, running

sudo mkinitcpio -p linux

also breaks. But I was just about to post that I found a partial solution when I saw someone replied, so I added that.

Well, here's what I found and originally wanted to say:

Running

sudo mkinitcpio -P

or

sudo mkinitcpio -p linux

just gives the same error.
But, for some reason, when I run

sudo mkinitcpio -k $(uname -r) -g /boot/initramfs-linux-zen.img

it works (obviously without the -g it works too, but I need an actual image).
By the way;

❯ uname -r
6.14.5-zen1-1-zen

I was trying to figure it out on my own, too, and I remembered the command uname. So, out of desperation, I just typed it out. Because it couldn't get any worse than it is, and it worked.
The command

mkinitcpio -P

still doesn't work, and I'd really appreciate any help on how to fix it, but I've gotten somewhere.

Offline

#4 2025-05-10 20:06:07

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

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

file /boot/initramfs-linux-zen.img

But also try to trace the script (set -x) because "mkinitcpio -g" probably just sidesteps the failing call.

Offline

#5 2025-05-11 14:20:47

stefanr
Member
Registered: 2025-05-10
Posts: 5

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

I added

set -x

after the line

#!/bin/bash

and also after the line

resolve_kernver() {

and now when I run

sudo mkinitcpio -P

it shows this mess of a log:

...
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux-lts ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux-lts.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts.img --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux-lts
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux-lts.img
++ local mode=w opt=-g path=/boot/initramfs-linux-lts.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux-lts.img
++ path=/boot/initramfs-linux-lts.img
++ mesg+=' -- '\''/boot/initramfs-linux-lts.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux-lts.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux-lts.img ]]
++ [[ ! -e /boot/initramfs-linux-lts.img ]]
++ [[ -d /boot/. ]]
++ [[ -w /boot/. ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux-lts.img
+ _optgenimg=/boot/initramfs-linux-lts.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux-lts != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux-lts
++ resolve_kernver /boot/vmlinuz-linux-lts
++ set -x
++ local kernel=/boot/vmlinuz-linux-lts arch=
++ [[ -z /boot/vmlinuz-linux-lts ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux-lts ]]
++ kver /boot/vmlinuz-linux-lts
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux-lts
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux-lts
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux-lts bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux-lts
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux-lts
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-lts'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ for p in "${PRESETS[@]}"
+ ((  _optremove  ))
+ msg 'Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: '\''fallback'\'''
+ local 'mesg=Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: '\''fallback'\'''
+ shift
+ printf '==> Building image from preset: /etc/mkinitcpio.d/linux-lts.preset: '\''fallback'\''\n'
+ preset_cmd=("${preset_mkopts[@]}")
+ preset_remove_cmd=()
+ preset_kver=fallback_kver
+ [[ -n /boot/vmlinuz-linux-lts ]]
+ preset_cmd+=(-k "${!preset_kver:-$ALL_kver}")
+ preset_config=fallback_config
+ [[ -n '' ]]
+ msg 'Using default configuration file: '\''%s'\''' /etc/mkinitcpio.conf
+ local 'mesg=Using default configuration file: '\''%s'\'''
+ shift
+ printf '==> Using default configuration file: '\''%s'\''\n' /etc/mkinitcpio.conf
+ preset_uki=fallback_uki
+ [[ ! -v fallback_uki ]]
+ [[ -v fallback_efi_image ]]
+ [[ -n '' ]]
+ preset_image=fallback_image
+ [[ -n /boot/initramfs-linux-lts-fallback.img ]]
+ preset_cmd+=(-g "${!preset_image}")
+ preset_remove_cmd+=("${!preset_image}")
+ local -n preset_options=fallback_options
+ [[ '' == *a* ]]
+ [[ -n -S autodetect ]]
+ mapfile -d ' ' -O 4 -t preset_cmd
++ printf %s '-S autodetect'
+ local -n preset_microcode=fallback_microcode
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  _optremove  ))
+ local preset_name=linux-lts.preset
+ preset_name=linux-lts-fallback
+ preset_cmd+=("${OPTREST[@]}")
+ msg2 '-k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect'
+ local 'mesg=-k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect'
+ shift
+ printf '  -> -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect\n'
+ MKINITCPIO_PROCESS_PRESET=linux-lts-fallback
+ /usr/bin/mkinitcpio -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect
+ declare -r version=39.2
+ shopt -s extglob
+ _f_functions=/usr/lib/initcpio/functions
+ _f_config=/etc/mkinitcpio.conf
+ _d_config=/etc/mkinitcpio.conf.d
+ _d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks
+ _d_install=/etc/initcpio/install:/usr/lib/initcpio/install
+ _d_post=/etc/initcpio/post:/usr/lib/initcpio/post
+ _d_flag_hooks=
+ _d_flag_install=
+ _d_flag_post=
+ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
+ _d_fwpath=()
+ _d_presets=/etc/mkinitcpio.d
+ _optmoduleroot=
+ _optgenimg=
+ _optcompress=
+ _opttargetdir=
+ _optosrelease=
+ _optukiconfig=
+ _optuki=
+ _optcmdline=
+ _optsplash=
+ _optkernelimage=
+ _optuefistub=
+ _optshowautomods=0
+ _optsavetree=0
+ _optshowmods=0
+ _optremove=0
+ _optnocmdline=0
+ _optnoukify=0
+ _optquiet=1
+ _optcolor=1
+ _optconfd=1
+ _optskiphooks=()
+ _optaddhooks=()
+ _hooks=()
+ _optpreset=()
+ _tmpfiles=()
+ _generated=()
+ declare -A _runhooks _addedmodules _modpaths _autodetect_cache
+ export PATH=/usr/bin
+ PATH=/usr/bin
+ unset GREP_OPTIONS CDPATH
+ . /usr/lib/initcpio/functions
++ shopt -s extglob
++ [[ /usr/bin/mkinitcpio == *\/\f\u\n\c\t\i\o\n\s ]]
+ trap cleanup EXIT
+ _opt_short=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ _opt_long=('add:' 'addhooks:' 'config:' 'generate:' 'hookdir': 'hookhelp:' 'help' 'kernel:' 'listhooks' 'automods' 'moduleroot:' 'nocolor' 'allpresets' 'preset:' 'remove' 'skiphooks:' 'save' 'generatedir:' 'builddir:' 'version' 'verbose' 'compress:' 'uki:' 'uefi:' 'microcode:' 'splash:' 'kernelimage:' 'uefistub:' 'cmdline:' 'osrelease:' 'no-cmdline' 'ukiconfig:' 'no-ukify')
+ parseopts A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: add: addhooks: config: generate: hookdir: hookhelp: help kernel: listhooks automods moduleroot: nocolor allpresets preset: remove skiphooks: save generatedir: builddir: version verbose compress: uki: uefi: microcode: splash: kernelimage: uefistub: cmdline: osrelease: no-cmdline ukiconfig: no-ukify -- -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect
+ local opt= optarg= i= shortopts=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add: ]]
+ [[ add: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n addhooks: ]]
+ [[ addhooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generate: ]]
+ [[ generate: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookdir: ]]
+ [[ hookdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookhelp: ]]
+ [[ hookhelp: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernel: ]]
+ [[ kernel: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n listhooks ]]
+ [[ listhooks != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n automods ]]
+ [[ automods != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n moduleroot: ]]
+ [[ moduleroot: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n allpresets ]]
+ [[ allpresets != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n preset: ]]
+ [[ preset: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n remove ]]
+ [[ remove != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n skiphooks: ]]
+ [[ skiphooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n save ]]
+ [[ save != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generatedir: ]]
+ [[ generatedir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n builddir: ]]
+ [[ builddir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n compress: ]]
+ [[ compress: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uki: ]]
+ [[ uki: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefi: ]]
+ [[ uefi: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n microcode: ]]
+ [[ microcode: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n splash: ]]
+ [[ splash: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernelimage: ]]
+ [[ kernelimage: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefistub: ]]
+ [[ uefistub: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n cmdline: ]]
+ [[ cmdline: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n osrelease: ]]
+ [[ osrelease: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-cmdline ]]
+ [[ no-cmdline != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n ukiconfig: ]]
+ [[ ukiconfig: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  6  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux-lts ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux-lts-fallback.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=S
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *S* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\S\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n autodetect ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux-lts -g /boot/initramfs-linux-lts-fallback.img -S autodetect --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux-lts
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux-lts-fallback.img
++ local mode=w opt=-g path=/boot/initramfs-linux-lts-fallback.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux-lts-fallback.img
++ path=/boot/initramfs-linux-lts-fallback.img
++ mesg+=' -- '\''/boot/initramfs-linux-lts-fallback.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux-lts-fallback.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux-lts-fallback.img ]]
++ [[ ! -e /boot/initramfs-linux-lts-fallback.img ]]
++ [[ -d /boot/. ]]
++ [[ -w /boot/. ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux-lts-fallback.img
+ _optgenimg=/boot/initramfs-linux-lts-fallback.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ IFS=,
+ read -r -a skip
+ _optskiphooks+=("${skip[@]}")
+ unset skip
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux-lts != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux-lts
++ resolve_kernver /boot/vmlinuz-linux-lts
++ set -x
++ local kernel=/boot/vmlinuz-linux-lts arch=
++ [[ -z /boot/vmlinuz-linux-lts ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux-lts ]]
++ kver /boot/vmlinuz-linux-lts
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux-lts
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux-lts
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux-lts bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux-lts
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux-lts
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-lts'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ exit 1
+ ((  4 > 255 ? r=1 : ++r  ))
+ for _ in "${@:2}"
+ process_preset /etc/mkinitcpio.d/linux.preset
+ local preset=/etc/mkinitcpio.d/linux.preset preset_image= preset_options=
+ local -a preset_mkopts preset_cmd preset_remove_cmd
+ [[ -n '' ]]
+ [[ /etc/mkinitcpio.d/linux.preset != */* ]]
+ . /etc/mkinitcpio.d/linux.preset
++ ALL_kver=/boot/vmlinuz-linux
++ PRESETS=('default' 'fallback')
++ default_image=/boot/initramfs-linux.img
++ fallback_image=/boot/initramfs-linux-fallback.img
++ fallback_options='-S autodetect'
+ ((  ! 2  ))
+ ((  _optquiet  ))
+ ((  _optcolor  ))
+ ((  _optsavetree  ))
+ ret=0
+ for p in "${PRESETS[@]}"
+ ((  _optremove  ))
+ msg 'Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''default'\'''
+ local 'mesg=Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''default'\'''
+ shift
+ printf '==> Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''default'\''\n'
+ preset_cmd=("${preset_mkopts[@]}")
+ preset_remove_cmd=()
+ preset_kver=default_kver
+ [[ -n /boot/vmlinuz-linux ]]
+ preset_cmd+=(-k "${!preset_kver:-$ALL_kver}")
+ preset_config=default_config
+ [[ -n '' ]]
+ msg 'Using default configuration file: '\''%s'\''' /etc/mkinitcpio.conf
+ local 'mesg=Using default configuration file: '\''%s'\'''
+ shift
+ printf '==> Using default configuration file: '\''%s'\''\n' /etc/mkinitcpio.conf
+ preset_uki=default_uki
+ [[ ! -v default_uki ]]
+ [[ -v default_efi_image ]]
+ [[ -n '' ]]
+ preset_image=default_image
+ [[ -n /boot/initramfs-linux.img ]]
+ preset_cmd+=(-g "${!preset_image}")
+ preset_remove_cmd+=("${!preset_image}")
+ local -n preset_options=default_options
+ [[ '' == *a* ]]
+ [[ -n '' ]]
+ local -n preset_microcode=default_microcode
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  _optremove  ))
+ local preset_name=linux.preset
+ preset_name=linux-default
+ preset_cmd+=("${OPTREST[@]}")
+ msg2 '-k /boot/vmlinuz-linux -g /boot/initramfs-linux.img'
+ local 'mesg=-k /boot/vmlinuz-linux -g /boot/initramfs-linux.img'
+ shift
+ printf '  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img\n'
+ MKINITCPIO_PROCESS_PRESET=linux-default
+ /usr/bin/mkinitcpio -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img
+ declare -r version=39.2
+ shopt -s extglob
+ _f_functions=/usr/lib/initcpio/functions
+ _f_config=/etc/mkinitcpio.conf
+ _d_config=/etc/mkinitcpio.conf.d
+ _d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks
+ _d_install=/etc/initcpio/install:/usr/lib/initcpio/install
+ _d_post=/etc/initcpio/post:/usr/lib/initcpio/post
+ _d_flag_hooks=
+ _d_flag_install=
+ _d_flag_post=
+ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
+ _d_fwpath=()
+ _d_presets=/etc/mkinitcpio.d
+ _optmoduleroot=
+ _optgenimg=
+ _optcompress=
+ _opttargetdir=
+ _optosrelease=
+ _optukiconfig=
+ _optuki=
+ _optcmdline=
+ _optsplash=
+ _optkernelimage=
+ _optuefistub=
+ _optshowautomods=0
+ _optsavetree=0
+ _optshowmods=0
+ _optremove=0
+ _optnocmdline=0
+ _optnoukify=0
+ _optquiet=1
+ _optcolor=1
+ _optconfd=1
+ _optskiphooks=()
+ _optaddhooks=()
+ _hooks=()
+ _optpreset=()
+ _tmpfiles=()
+ _generated=()
+ declare -A _runhooks _addedmodules _modpaths _autodetect_cache
+ export PATH=/usr/bin
+ PATH=/usr/bin
+ unset GREP_OPTIONS CDPATH
+ . /usr/lib/initcpio/functions
++ shopt -s extglob
++ [[ /usr/bin/mkinitcpio == *\/\f\u\n\c\t\i\o\n\s ]]
+ trap cleanup EXIT
+ _opt_short=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ _opt_long=('add:' 'addhooks:' 'config:' 'generate:' 'hookdir': 'hookhelp:' 'help' 'kernel:' 'listhooks' 'automods' 'moduleroot:' 'nocolor' 'allpresets' 'preset:' 'remove' 'skiphooks:' 'save' 'generatedir:' 'builddir:' 'version' 'verbose' 'compress:' 'uki:' 'uefi:' 'microcode:' 'splash:' 'kernelimage:' 'uefistub:' 'cmdline:' 'osrelease:' 'no-cmdline' 'ukiconfig:' 'no-ukify')
+ parseopts A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: add: addhooks: config: generate: hookdir: hookhelp: help kernel: listhooks automods moduleroot: nocolor allpresets preset: remove skiphooks: save generatedir: builddir: version verbose compress: uki: uefi: microcode: splash: kernelimage: uefistub: cmdline: osrelease: no-cmdline ukiconfig: no-ukify -- -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img
+ local opt= optarg= i= shortopts=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add: ]]
+ [[ add: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n addhooks: ]]
+ [[ addhooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generate: ]]
+ [[ generate: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookdir: ]]
+ [[ hookdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookhelp: ]]
+ [[ hookhelp: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernel: ]]
+ [[ kernel: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n listhooks ]]
+ [[ listhooks != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n automods ]]
+ [[ automods != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n moduleroot: ]]
+ [[ moduleroot: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n allpresets ]]
+ [[ allpresets != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n preset: ]]
+ [[ preset: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n remove ]]
+ [[ remove != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n skiphooks: ]]
+ [[ skiphooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n save ]]
+ [[ save != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generatedir: ]]
+ [[ generatedir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n builddir: ]]
+ [[ builddir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n compress: ]]
+ [[ compress: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uki: ]]
+ [[ uki: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefi: ]]
+ [[ uefi: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n microcode: ]]
+ [[ microcode: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n splash: ]]
+ [[ splash: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernelimage: ]]
+ [[ kernelimage: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefistub: ]]
+ [[ uefistub: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n cmdline: ]]
+ [[ cmdline: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n osrelease: ]]
+ [[ osrelease: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-cmdline ]]
+ [[ no-cmdline != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n ukiconfig: ]]
+ [[ ukiconfig: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux -g /boot/initramfs-linux.img --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux.img
++ local mode=w opt=-g path=/boot/initramfs-linux.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux.img
++ path=/boot/initramfs-linux.img
++ mesg+=' -- '\''/boot/initramfs-linux.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux.img ]]
++ [[ ! -e /boot/initramfs-linux.img ]]
++ [[ -d /boot/. ]]
++ [[ -w /boot/. ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux.img
+ _optgenimg=/boot/initramfs-linux.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux
++ resolve_kernver /boot/vmlinuz-linux
++ set -x
++ local kernel=/boot/vmlinuz-linux arch=
++ [[ -z /boot/vmlinuz-linux ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux ]]
++ kver /boot/vmlinuz-linux
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ for p in "${PRESETS[@]}"
+ ((  _optremove  ))
+ msg 'Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''fallback'\'''
+ local 'mesg=Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''fallback'\'''
+ shift
+ printf '==> Building image from preset: /etc/mkinitcpio.d/linux.preset: '\''fallback'\''\n'
+ preset_cmd=("${preset_mkopts[@]}")
+ preset_remove_cmd=()
+ preset_kver=fallback_kver
+ [[ -n /boot/vmlinuz-linux ]]
+ preset_cmd+=(-k "${!preset_kver:-$ALL_kver}")
+ preset_config=fallback_config
+ [[ -n '' ]]
+ msg 'Using default configuration file: '\''%s'\''' /etc/mkinitcpio.conf
+ local 'mesg=Using default configuration file: '\''%s'\'''
+ shift
+ printf '==> Using default configuration file: '\''%s'\''\n' /etc/mkinitcpio.conf
+ preset_uki=fallback_uki
+ [[ ! -v fallback_uki ]]
+ [[ -v fallback_efi_image ]]
+ [[ -n '' ]]
+ preset_image=fallback_image
+ [[ -n /boot/initramfs-linux-fallback.img ]]
+ preset_cmd+=(-g "${!preset_image}")
+ preset_remove_cmd+=("${!preset_image}")
+ local -n preset_options=fallback_options
+ [[ '' == *a* ]]
+ [[ -n -S autodetect ]]
+ mapfile -d ' ' -O 4 -t preset_cmd
++ printf %s '-S autodetect'
+ local -n preset_microcode=fallback_microcode
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  _optremove  ))
+ local preset_name=linux.preset
+ preset_name=linux-fallback
+ preset_cmd+=("${OPTREST[@]}")
+ msg2 '-k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect'
+ local 'mesg=-k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect'
+ shift
+ printf '  -> -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect\n'
+ MKINITCPIO_PROCESS_PRESET=linux-fallback
+ /usr/bin/mkinitcpio -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect
+ declare -r version=39.2
+ shopt -s extglob
+ _f_functions=/usr/lib/initcpio/functions
+ _f_config=/etc/mkinitcpio.conf
+ _d_config=/etc/mkinitcpio.conf.d
+ _d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks
+ _d_install=/etc/initcpio/install:/usr/lib/initcpio/install
+ _d_post=/etc/initcpio/post:/usr/lib/initcpio/post
+ _d_flag_hooks=
+ _d_flag_install=
+ _d_flag_post=
+ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
+ _d_fwpath=()
+ _d_presets=/etc/mkinitcpio.d
+ _optmoduleroot=
+ _optgenimg=
+ _optcompress=
+ _opttargetdir=
+ _optosrelease=
+ _optukiconfig=
+ _optuki=
+ _optcmdline=
+ _optsplash=
+ _optkernelimage=
+ _optuefistub=
+ _optshowautomods=0
+ _optsavetree=0
+ _optshowmods=0
+ _optremove=0
+ _optnocmdline=0
+ _optnoukify=0
+ _optquiet=1
+ _optcolor=1
+ _optconfd=1
+ _optskiphooks=()
+ _optaddhooks=()
+ _hooks=()
+ _optpreset=()
+ _tmpfiles=()
+ _generated=()
+ declare -A _runhooks _addedmodules _modpaths _autodetect_cache
+ export PATH=/usr/bin
+ PATH=/usr/bin
+ unset GREP_OPTIONS CDPATH
+ . /usr/lib/initcpio/functions
++ shopt -s extglob
++ [[ /usr/bin/mkinitcpio == *\/\f\u\n\c\t\i\o\n\s ]]
+ trap cleanup EXIT
+ _opt_short=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ _opt_long=('add:' 'addhooks:' 'config:' 'generate:' 'hookdir': 'hookhelp:' 'help' 'kernel:' 'listhooks' 'automods' 'moduleroot:' 'nocolor' 'allpresets' 'preset:' 'remove' 'skiphooks:' 'save' 'generatedir:' 'builddir:' 'version' 'verbose' 'compress:' 'uki:' 'uefi:' 'microcode:' 'splash:' 'kernelimage:' 'uefistub:' 'cmdline:' 'osrelease:' 'no-cmdline' 'ukiconfig:' 'no-ukify')
+ parseopts A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: add: addhooks: config: generate: hookdir: hookhelp: help kernel: listhooks automods moduleroot: nocolor allpresets preset: remove skiphooks: save generatedir: builddir: version verbose compress: uki: uefi: microcode: splash: kernelimage: uefistub: cmdline: osrelease: no-cmdline ukiconfig: no-ukify -- -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect
+ local opt= optarg= i= shortopts=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add: ]]
+ [[ add: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n addhooks: ]]
+ [[ addhooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generate: ]]
+ [[ generate: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookdir: ]]
+ [[ hookdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookhelp: ]]
+ [[ hookhelp: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernel: ]]
+ [[ kernel: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n listhooks ]]
+ [[ listhooks != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n automods ]]
+ [[ automods != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n moduleroot: ]]
+ [[ moduleroot: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n allpresets ]]
+ [[ allpresets != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n preset: ]]
+ [[ preset: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n remove ]]
+ [[ remove != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n skiphooks: ]]
+ [[ skiphooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n save ]]
+ [[ save != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generatedir: ]]
+ [[ generatedir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n builddir: ]]
+ [[ builddir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n compress: ]]
+ [[ compress: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uki: ]]
+ [[ uki: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefi: ]]
+ [[ uefi: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n microcode: ]]
+ [[ microcode: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n splash: ]]
+ [[ splash: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernelimage: ]]
+ [[ kernelimage: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefistub: ]]
+ [[ uefistub: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n cmdline: ]]
+ [[ cmdline: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n osrelease: ]]
+ [[ osrelease: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-cmdline ]]
+ [[ no-cmdline != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n ukiconfig: ]]
+ [[ ukiconfig: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  6  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux-fallback.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=S
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *S* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\S\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n autodetect ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux -g /boot/initramfs-linux-fallback.img -S autodetect --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux-fallback.img
++ local mode=w opt=-g path=/boot/initramfs-linux-fallback.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux-fallback.img
++ path=/boot/initramfs-linux-fallback.img
++ mesg+=' -- '\''/boot/initramfs-linux-fallback.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux-fallback.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux-fallback.img ]]
++ [[ ! -e /boot/initramfs-linux-fallback.img ]]
++ [[ -d /boot/. ]]
++ [[ -w /boot/. ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux-fallback.img
+ _optgenimg=/boot/initramfs-linux-fallback.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ IFS=,
+ read -r -a skip
+ _optskiphooks+=("${skip[@]}")
+ unset skip
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux
++ resolve_kernver /boot/vmlinuz-linux
++ set -x
++ local kernel=/boot/vmlinuz-linux arch=
++ [[ -z /boot/vmlinuz-linux ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux ]]
++ kver /boot/vmlinuz-linux
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ exit 1
+ ((  4 > 255 ? r=1 : ++r  ))
+ for _ in "${@:2}"
+ process_preset /etc/mkinitcpio.d/linux-zen.preset
+ local preset=/etc/mkinitcpio.d/linux-zen.preset preset_image= preset_options=
+ local -a preset_mkopts preset_cmd preset_remove_cmd
+ [[ -n '' ]]
+ [[ /etc/mkinitcpio.d/linux-zen.preset != */* ]]
+ . /etc/mkinitcpio.d/linux-zen.preset
++ ALL_kver=/boot/vmlinuz-linux-zen
++ PRESETS=('default' 'fallback')
++ default_image=/boot/initramfs-linux-zen.img
++ fallback_image=/boot/initramfs-linux-zen-fallback.img
++ fallback_options='-S autodetect'
+ ((  ! 2  ))
+ ((  _optquiet  ))
+ ((  _optcolor  ))
+ ((  _optsavetree  ))
+ ret=0
+ for p in "${PRESETS[@]}"
+ ((  _optremove  ))
+ msg 'Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''default'\'''
+ local 'mesg=Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''default'\'''
+ shift
+ printf '==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''default'\''\n'
+ preset_cmd=("${preset_mkopts[@]}")
+ preset_remove_cmd=()
+ preset_kver=default_kver
+ [[ -n /boot/vmlinuz-linux-zen ]]
+ preset_cmd+=(-k "${!preset_kver:-$ALL_kver}")
+ preset_config=default_config
+ [[ -n '' ]]
+ msg 'Using default configuration file: '\''%s'\''' /etc/mkinitcpio.conf
+ local 'mesg=Using default configuration file: '\''%s'\'''
+ shift
+ printf '==> Using default configuration file: '\''%s'\''\n' /etc/mkinitcpio.conf
+ preset_uki=default_uki
+ [[ ! -v default_uki ]]
+ [[ -v default_efi_image ]]
+ [[ -n '' ]]
+ preset_image=default_image
+ [[ -n /boot/initramfs-linux-zen.img ]]
+ preset_cmd+=(-g "${!preset_image}")
+ preset_remove_cmd+=("${!preset_image}")
+ local -n preset_options=default_options
+ [[ '' == *a* ]]
+ [[ -n '' ]]
+ local -n preset_microcode=default_microcode
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  _optremove  ))
+ local preset_name=linux-zen.preset
+ preset_name=linux-zen-default
+ preset_cmd+=("${OPTREST[@]}")
+ msg2 '-k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img'
+ local 'mesg=-k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img'
+ shift
+ printf '  -> -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img\n'
+ MKINITCPIO_PROCESS_PRESET=linux-zen-default
+ /usr/bin/mkinitcpio -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img
+ declare -r version=39.2
+ shopt -s extglob
+ _f_functions=/usr/lib/initcpio/functions
+ _f_config=/etc/mkinitcpio.conf
+ _d_config=/etc/mkinitcpio.conf.d
+ _d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks
+ _d_install=/etc/initcpio/install:/usr/lib/initcpio/install
+ _d_post=/etc/initcpio/post:/usr/lib/initcpio/post
+ _d_flag_hooks=
+ _d_flag_install=
+ _d_flag_post=
+ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
+ _d_fwpath=()
+ _d_presets=/etc/mkinitcpio.d
+ _optmoduleroot=
+ _optgenimg=
+ _optcompress=
+ _opttargetdir=
+ _optosrelease=
+ _optukiconfig=
+ _optuki=
+ _optcmdline=
+ _optsplash=
+ _optkernelimage=
+ _optuefistub=
+ _optshowautomods=0
+ _optsavetree=0
+ _optshowmods=0
+ _optremove=0
+ _optnocmdline=0
+ _optnoukify=0
+ _optquiet=1
+ _optcolor=1
+ _optconfd=1
+ _optskiphooks=()
+ _optaddhooks=()
+ _hooks=()
+ _optpreset=()
+ _tmpfiles=()
+ _generated=()
+ declare -A _runhooks _addedmodules _modpaths _autodetect_cache
+ export PATH=/usr/bin
+ PATH=/usr/bin
+ unset GREP_OPTIONS CDPATH
+ . /usr/lib/initcpio/functions
++ shopt -s extglob
++ [[ /usr/bin/mkinitcpio == *\/\f\u\n\c\t\i\o\n\s ]]
+ trap cleanup EXIT
+ _opt_short=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ _opt_long=('add:' 'addhooks:' 'config:' 'generate:' 'hookdir': 'hookhelp:' 'help' 'kernel:' 'listhooks' 'automods' 'moduleroot:' 'nocolor' 'allpresets' 'preset:' 'remove' 'skiphooks:' 'save' 'generatedir:' 'builddir:' 'version' 'verbose' 'compress:' 'uki:' 'uefi:' 'microcode:' 'splash:' 'kernelimage:' 'uefistub:' 'cmdline:' 'osrelease:' 'no-cmdline' 'ukiconfig:' 'no-ukify')
+ parseopts A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: add: addhooks: config: generate: hookdir: hookhelp: help kernel: listhooks automods moduleroot: nocolor allpresets preset: remove skiphooks: save generatedir: builddir: version verbose compress: uki: uefi: microcode: splash: kernelimage: uefistub: cmdline: osrelease: no-cmdline ukiconfig: no-ukify -- -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img
+ local opt= optarg= i= shortopts=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add: ]]
+ [[ add: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n addhooks: ]]
+ [[ addhooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generate: ]]
+ [[ generate: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookdir: ]]
+ [[ hookdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookhelp: ]]
+ [[ hookhelp: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernel: ]]
+ [[ kernel: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n listhooks ]]
+ [[ listhooks != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n automods ]]
+ [[ automods != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n moduleroot: ]]
+ [[ moduleroot: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n allpresets ]]
+ [[ allpresets != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n preset: ]]
+ [[ preset: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n remove ]]
+ [[ remove != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n skiphooks: ]]
+ [[ skiphooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n save ]]
+ [[ save != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generatedir: ]]
+ [[ generatedir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n builddir: ]]
+ [[ builddir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n compress: ]]
+ [[ compress: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uki: ]]
+ [[ uki: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefi: ]]
+ [[ uefi: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n microcode: ]]
+ [[ microcode: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n splash: ]]
+ [[ splash: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernelimage: ]]
+ [[ kernelimage: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefistub: ]]
+ [[ uefistub: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n cmdline: ]]
+ [[ cmdline: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n osrelease: ]]
+ [[ osrelease: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-cmdline ]]
+ [[ no-cmdline != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n ukiconfig: ]]
+ [[ ukiconfig: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux-zen ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux-zen.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen.img --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux-zen
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux-zen.img
++ local mode=w opt=-g path=/boot/initramfs-linux-zen.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux-zen.img
++ path=/boot/initramfs-linux-zen.img
++ mesg+=' -- '\''/boot/initramfs-linux-zen.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux-zen.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux-zen.img ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux-zen.img
+ _optgenimg=/boot/initramfs-linux-zen.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux-zen != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux-zen
++ resolve_kernver /boot/vmlinuz-linux-zen
++ set -x
++ local kernel=/boot/vmlinuz-linux-zen arch=
++ [[ -z /boot/vmlinuz-linux-zen ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux-zen ]]
++ kver /boot/vmlinuz-linux-zen
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux-zen
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux-zen
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux-zen bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux-zen
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux-zen
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-zen'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ for p in "${PRESETS[@]}"
+ ((  _optremove  ))
+ msg 'Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''fallback'\'''
+ local 'mesg=Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''fallback'\'''
+ shift
+ printf '==> Building image from preset: /etc/mkinitcpio.d/linux-zen.preset: '\''fallback'\''\n'
+ preset_cmd=("${preset_mkopts[@]}")
+ preset_remove_cmd=()
+ preset_kver=fallback_kver
+ [[ -n /boot/vmlinuz-linux-zen ]]
+ preset_cmd+=(-k "${!preset_kver:-$ALL_kver}")
+ preset_config=fallback_config
+ [[ -n '' ]]
+ msg 'Using default configuration file: '\''%s'\''' /etc/mkinitcpio.conf
+ local 'mesg=Using default configuration file: '\''%s'\'''
+ shift
+ printf '==> Using default configuration file: '\''%s'\''\n' /etc/mkinitcpio.conf
+ preset_uki=fallback_uki
+ [[ ! -v fallback_uki ]]
+ [[ -v fallback_efi_image ]]
+ [[ -n '' ]]
+ preset_image=fallback_image
+ [[ -n /boot/initramfs-linux-zen-fallback.img ]]
+ preset_cmd+=(-g "${!preset_image}")
+ preset_remove_cmd+=("${!preset_image}")
+ local -n preset_options=fallback_options
+ [[ '' == *a* ]]
+ [[ -n -S autodetect ]]
+ mapfile -d ' ' -O 4 -t preset_cmd
++ printf %s '-S autodetect'
+ local -n preset_microcode=fallback_microcode
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  _optremove  ))
+ local preset_name=linux-zen.preset
+ preset_name=linux-zen-fallback
+ preset_cmd+=("${OPTREST[@]}")
+ msg2 '-k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect'
+ local 'mesg=-k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect'
+ shift
+ printf '  -> -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect\n'
+ MKINITCPIO_PROCESS_PRESET=linux-zen-fallback
+ /usr/bin/mkinitcpio -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect
+ declare -r version=39.2
+ shopt -s extglob
+ _f_functions=/usr/lib/initcpio/functions
+ _f_config=/etc/mkinitcpio.conf
+ _d_config=/etc/mkinitcpio.conf.d
+ _d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks
+ _d_install=/etc/initcpio/install:/usr/lib/initcpio/install
+ _d_post=/etc/initcpio/post:/usr/lib/initcpio/post
+ _d_flag_hooks=
+ _d_flag_install=
+ _d_flag_post=
+ _d_firmware=({/usr,}/lib/firmware/updates {/usr,}/lib/firmware)
+ _d_fwpath=()
+ _d_presets=/etc/mkinitcpio.d
+ _optmoduleroot=
+ _optgenimg=
+ _optcompress=
+ _opttargetdir=
+ _optosrelease=
+ _optukiconfig=
+ _optuki=
+ _optcmdline=
+ _optsplash=
+ _optkernelimage=
+ _optuefistub=
+ _optshowautomods=0
+ _optsavetree=0
+ _optshowmods=0
+ _optremove=0
+ _optnocmdline=0
+ _optnoukify=0
+ _optquiet=1
+ _optcolor=1
+ _optconfd=1
+ _optskiphooks=()
+ _optaddhooks=()
+ _hooks=()
+ _optpreset=()
+ _tmpfiles=()
+ _generated=()
+ declare -A _runhooks _addedmodules _modpaths _autodetect_cache
+ export PATH=/usr/bin
+ PATH=/usr/bin
+ unset GREP_OPTIONS CDPATH
+ . /usr/lib/initcpio/functions
++ shopt -s extglob
++ [[ /usr/bin/mkinitcpio == *\/\f\u\n\c\t\i\o\n\s ]]
+ trap cleanup EXIT
+ _opt_short=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ _opt_long=('add:' 'addhooks:' 'config:' 'generate:' 'hookdir': 'hookhelp:' 'help' 'kernel:' 'listhooks' 'automods' 'moduleroot:' 'nocolor' 'allpresets' 'preset:' 'remove' 'skiphooks:' 'save' 'generatedir:' 'builddir:' 'version' 'verbose' 'compress:' 'uki:' 'uefi:' 'microcode:' 'splash:' 'kernelimage:' 'uefistub:' 'cmdline:' 'osrelease:' 'no-cmdline' 'ukiconfig:' 'no-ukify')
+ parseopts A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: add: addhooks: config: generate: hookdir: hookhelp: help kernel: listhooks automods moduleroot: nocolor allpresets preset: remove skiphooks: save generatedir: builddir: version verbose compress: uki: uefi: microcode: splash: kernelimage: uefistub: cmdline: osrelease: no-cmdline ukiconfig: no-ukify -- -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect
+ local opt= optarg= i= shortopts=A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz:
+ longopts=()
+ unused_argv=()
+ local -a longopts unused_argv
+ shift
+ [[ -n add: ]]
+ [[ add: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n addhooks: ]]
+ [[ addhooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n config: ]]
+ [[ config: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generate: ]]
+ [[ generate: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookdir: ]]
+ [[ hookdir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n hookhelp: ]]
+ [[ hookhelp: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n help ]]
+ [[ help != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernel: ]]
+ [[ kernel: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n listhooks ]]
+ [[ listhooks != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n automods ]]
+ [[ automods != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n moduleroot: ]]
+ [[ moduleroot: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n nocolor ]]
+ [[ nocolor != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n allpresets ]]
+ [[ allpresets != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n preset: ]]
+ [[ preset: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n remove ]]
+ [[ remove != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n skiphooks: ]]
+ [[ skiphooks: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n save ]]
+ [[ save != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n generatedir: ]]
+ [[ generatedir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n builddir: ]]
+ [[ builddir: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n version ]]
+ [[ version != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n verbose ]]
+ [[ verbose != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n compress: ]]
+ [[ compress: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uki: ]]
+ [[ uki: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefi: ]]
+ [[ uefi: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n microcode: ]]
+ [[ microcode: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n splash: ]]
+ [[ splash: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n kernelimage: ]]
+ [[ kernelimage: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n uefistub: ]]
+ [[ uefistub: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n cmdline: ]]
+ [[ cmdline: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n osrelease: ]]
+ [[ osrelease: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-cmdline ]]
+ [[ no-cmdline != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n ukiconfig: ]]
+ [[ ukiconfig: != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n no-ukify ]]
+ [[ no-ukify != \-\- ]]
+ longopts+=("$1")
+ shift
+ [[ -n -- ]]
+ [[ -- != \-\- ]]
+ shift
+ ((  6  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=k
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *k* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\k\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/vmlinuz-linux-zen ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  4  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=g
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *g* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\g\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n /boot/initramfs-linux-zen-fallback.img ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  2  ))
+ case "$1" in
+ (( i = 1 ))
+ (( i < 2 ))
+ opt=S
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: != *S* ]]
+ OPTRET+=("-$opt")
+ [[ A:c:D:g:H:hk:nLMPp:Rr:S:sd:t:U:Vvz: == *\S\:* ]]
+ ((  i < 2 - 1  ))
+ ((  i == 2 - 1  ))
+ [[ -n autodetect ]]
+ OPTRET+=("$2")
+ shift
+ break
+ shift
+ ((  0  ))
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+ return 0
+ set -- -k /boot/vmlinuz-linux-zen -g /boot/initramfs-linux-zen-fallback.img -S autodetect --
+ unset _opt_short _opt_long OPTRET
+ :
+ case "$1" in
+ [[ '' == /* ]]
+ KERNELVERSION=/boot/vmlinuz-linux-zen
+ shift
+ shift
+ :
+ case "$1" in
++ check_path w -g /boot/initramfs-linux-zen-fallback.img
++ local mode=w opt=-g path=/boot/initramfs-linux-zen-fallback.img mesg
++ mesg='Invalid option -g'
+++ realpath -qs -- /boot/initramfs-linux-zen-fallback.img
++ path=/boot/initramfs-linux-zen-fallback.img
++ mesg+=' -- '\''/boot/initramfs-linux-zen-fallback.img'\'''
++ [[ w == *d* ]]
++ [[ -d /boot/initramfs-linux-zen-fallback.img ]]
++ [[ w == *w* ]]
++ [[ -w /boot/initramfs-linux-zen-fallback.img ]]
++ [[ ! -e /boot/initramfs-linux-zen-fallback.img ]]
++ [[ -d /boot/. ]]
++ [[ -w /boot/. ]]
++ [[ w == *r* ]]
++ echo /boot/initramfs-linux-zen-fallback.img
+ _optgenimg=/boot/initramfs-linux-zen-fallback.img
+ shift
+ shift
+ :
+ case "$1" in
+ shift
+ IFS=,
+ read -r -a skip
+ _optskiphooks+=("${skip[@]}")
+ unset skip
+ shift
+ :
+ case "$1" in
+ shift
+ break 2
+ OPTREST=("$@")
+ [[ -t 1 ]]
+ ((  _optremove && 0  ))
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -e /proc/self/mountinfo ]]
+ [[ -e /dev/fd ]]
+ ((  0  ))
+ KERNELIMAGE=
+ KERNELDESTINATION=
+ [[ /boot/vmlinuz-linux-zen != \n\o\n\e ]]
+ [[ / == \/ ]]
+ KERNELIMAGE=/boot/vmlinuz-linux-zen
++ resolve_kernver /boot/vmlinuz-linux-zen
++ set -x
++ local kernel=/boot/vmlinuz-linux-zen arch=
++ [[ -z /boot/vmlinuz-linux-zen ]]
++ [[ / != / ]]
++ [[ ! -e /boot/vmlinuz-linux-zen ]]
++ kver /boot/vmlinuz-linux-zen
++ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ local arch
+++ uname -m
++ arch=x86_64
++ [[ x86_64 == @(i?86|x86_64) ]]
+++ kver_x86 /boot/vmlinuz-linux-zen
+++ local kver
+++ local -i offset
++++ od -An -j0x20E -dN2 /boot/vmlinuz-linux-zen
+++ offset=' 17152'
+++ read -r kver _
++++ dd if=/boot/vmlinuz-linux-zen bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1
++ error 'invalid kernel specified: '\''%s'\''' /boot/vmlinuz-linux-zen
++ local 'mesg=invalid kernel specified: '\''%s'\'''
++ shift
++ printf '==> ERROR: invalid kernel specified: '\''%s'\''\n' /boot/vmlinuz-linux-zen
==> ERROR: invalid kernel specified: '/boot/vmlinuz-linux-zen'
++ return 1
+++ uname -m
++ arch=x86_64
++ [[ x86_64 != @(i?86|x86_64) ]]
++ return 1
+ KERNELVERSION=
+ exit 1
+ cleanup
+ local err=1
+ ((  0  ))
+ [[ -n '' ]]
+ exit 1
+ ((  1  ))
+ ret=1
+ exit 1
+ ((  4 > 255 ? r=1 : ++r  ))
+ return 3
+ exit
+ cleanup
+ local err=3
+ ((  0  ))
+ [[ -n '' ]]
+ exit 3

It outputted even more, but my terminal (kitty) cut the text off from the above (that's why I added the "..." at the beginning). And, you also asked for this, so here it is:

❯ file /boot/initramfs-linux-zen.img
/boot/initramfs-linux-zen.img: ASCII cpio archive (SVR4 with no CRC)

Offline

#6 2025-05-11 14:24:15

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

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

Sorry, I ddin't clean up my previous post

Around #115 you'll find the "resolve_kernver()" function, add "set -x" to its head and run mkinitcpio.

will suffice, the line before was just a general suggestion, then I figured to better also suggest where but kept the generic.

This should vastly reduce the log, in doubt you can "set +a" at the end of that function (but both calls inside the { })

Offline

#7 2025-05-11 14:30:32

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

++++ dd if=/boot/vmlinuz-linux-zen bs=1 count=127 skip=17664
+++ printf %s ''
++ kver=
++ [[ '' =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
++ return 1

So the dd is failing to get the version string from the kernel image. What do you get from `type -a dd`? How about `file /boot/vmlinuz-linux-zen`?

Online

#8 2025-05-11 15:51:57

stefanr
Member
Registered: 2025-05-10
Posts: 5

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

I just fixed the issue. The problem was that I added a line that aliased dd to something else in my ~/.zshrc. I didn't even realize that mkinitcpio used dd (tysm Scimmia for making me realize that).
So, even though I have no idea why mkinitcpio respects my zshrc, I commented out the line, and it works perfectly fine. Thank you both so much for helping.

Offline

#9 2025-05-11 15:53:17

stefanr
Member
Registered: 2025-05-10
Posts: 5

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

Also, how do I make this post show as solved/answered?

Offline

#10 2025-05-11 16:12:54

chrislg
Member
From: Greece
Registered: 2022-11-06
Posts: 30
Website

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

False thread sorry

Last edited by chrislg (2025-05-11 16:13:36)

Offline

#11 2025-05-11 16:30:58

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: [SOLVED] Mkinitcpio fails to run; "invalid kernel specified"

You edit the first post and change the title.

Online

Board footer

Powered by FluxBB