I had a couple of booting issues, solved, but I report them in case it's useful
1) Starting, I think, from the update of Apr. 14, I noticed that during bootup, the "Starting random-seed [busy]" step waits until the enter key is pressed.
2) More seriously, in today's update (4/15), which included linux-5.17.3.artix1-1-x86_64, mkinitcpio reported "invalid kernel specified" and resulted in /boot without any initramfs file. I tried "pacman -U /var/cache/pacman/pkg/linux-5.17.1.artix1-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/linux-headers-5.17.1.artix1-1-x86_64.pkg.tar.zst" but that gave the same errors. Luckily I had a backup of /boot and of /lib/modules/5.17.1-artix1-1
Thanks for artix.
inxi attached
I just updated a QEMU dinit guest without any issues. Make sure your /etc/mkinitcpio.conf and files in /etc/mkinitcpio.d are correct and you aren't using any strange packages from AUR or Arch repositories (and your /etc/pacman.conf is set correctly (https://wiki.artixlinux.org/Main/Repositories)).
Apr. 21 update to 5.17.4 produced the same errors, so I'm still using kernel 5.17.1-artix1-1.
Thanks for the suggestions. mkinitcpio files do not differ from the backup. I haven't installed anything from AUR for a couple of months. pacman.conf is as recommended in the wiki: system, world, galaxy, extra, community and multilib in that order.
Without entirely understanding, I have tried some suggestions given in another forum post (https://forum.artixlinux.org/index.php?PHPSESSID=anqvirajfgslbe297ohtg0uqmt&topic=2939.0). artiong appears to have had the same problem.
Pluto:[root]:/boot# pacman -S linux linux-headers util-linux mkinitcpio
...
==> 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'
error: command failed to execute correctly
After this, /boot/vmlinuz-linux is identical to /usr/lib/modules/5.17.4-artix1-1/vmlinuz but no initrd is produced.
Same error messages
Pluto:[root]:/boot# mkinitcpio -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> ERROR: invalid kernel specified: `/boot/vmlinuz-linux'.
I don't understand those well; I don't see any path to the kernel in any of them. In any case, I haven't changed them.
Pluto:[root]:/boot# /usr/bin/bash --norc
Pluto:[root]:/boot# source /usr/lib/initcpio/functions
bash: /usr/lib/initcpio/functions: line 682: syntax error near unexpected token `('
bash: /usr/lib/initcpio/functions: line 682: ` RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD})'
Pluto:[root]:/boot# set -x
Pluto:[root]:/boot# kver /boot/vmlinuz-linux
+ kver /boot/vmlinuz-linux
+ local kver 're=^[[:digit:]]+(\.[[:digit:]]+)+'
++ uname -m
+ local arch=x86_64
+ [[ x86_64 == @(i?86|x86_64) ]]
++ kver_x86 /boot/vmlinuz-linux
+++ hexdump -s 526 -n 2 -e '"%0d"' /boot/vmlinuz-linux
++ local kver offset=14304
++ [[ 14304 = +([0-9]) ]]
++ read kver _
+++ dd if=/boot/vmlinuz-linux bs=1 count=127 skip=14816
++ printf %s 5.17.4-artix1-1
+ kver=5.17.4-artix1-1
+ [[ 5.17.4-artix1-1 =~ ^[[:digit:]]+(\.[[:digit:]]+)+ ]]
+ printf %s 5.17.4-artix1-1
So I think that's good, but
Pluto:[root]:/boot# read kver _ < <(dd if=/boot/vmlinuz-linux bs=1 count=127 skip=$(( 14464 + 0x200 )) 2>/dev/null)
Pluto:[root]:/boot# echo $kver
44�VGAVESABIOS�:�.r,�:�/�1�:
Thanks in advance for any ideas.
The function
kver computes the variable
offset to be 14304, but you have supplied 14464 in the
read kver... command. When 14304 is supplied instead:
# read kver _ < <(dd if=/boot/vmlinuz-linux bs=1 count=127 skip=$(( 14304 + 0x200 )) 2>/dev/null)
+ read kver _
++ dd if=/boot/vmlinuz-linux bs=1 count=127 skip=14816
# echo $kver
+ echo 5.17.4-artix1-1
5.17.4-artix1-1
Can you download the attached file to some location (for example,
$HOME), and then run:
$ su
# cp /usr/bin/mkinitcpio{,.copy}
# patch /usr/bin/mkinitcpio mkinitcpio.txt
then try
mkinitcpio -p linux >mkinitcpio.log 2>&1
and supply mkinitcpio.log? Afterwards you can revert this patch by simply doing (as root):
mv /usr/bin/mkinitcpio{.copy,}
Update: About the syntax error in /usr/lib/initcpio/functions, I have created an issue at upstream (https://github.com/archlinux/mkinitcpio/issues/102).
Thanks, stradjer. mkinitcpio.log is attached.
In case it's relevant:
Pluto:[root]:/home/spot# read kver _ < <(dd if=/boot/vmlinuz-linux bs=1 count=127 skip=$(( 14304 + 0x200 )) 2>/dev/null)
Pluto:[root]:/home/spot# echo $kver
Output
The file /usr/lib/initcpio/functions seems to rely on Bash-specific extended patterns, controlled through a shell option
extglob. Can you try issuing:
shopt -s extglob
mkinitcpio -p linux
and see if that generates an error?
I have created a PR (https://github.com/archlinux/mkinitcpio/pull/103) for mkinitcpio which expands the pattern so
extglob is not needed.
Update: On closer inspection, mkinitcpio script itself is executing
shopt -s extglob, so I am not sure what could cause this. Are you using any nonstandard shell or a setting? In this thread (https://bbs.archlinux.org/viewtopic.php?id=252418) it was suggested (https://bbs.archlinux.org/viewtopic.php?pid=1884992#p1884992) to check the location of hexdump and integrity of
util-linux:
type hexdump
pacman -Qo `which hexdump`
pacman -Qikk util-linux
I would also add:
ls -l /bin/sh
LC_ALL=C pacman -Qi bash | grep Version
Pluto:[root]:/home/spot# shopt -s extglob
Pluto:[root]:/home/spot# mkinitcpio -p linux
==> 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'
/boot/vmlinuz-linux = /usr/lib/modules/5.17.4-artix1-1/vmlinuz, but no new initramfs is made.
Can you supply the output of those other commands in my updated previous post?
Edit: Also
pacman -Qikk bash
pacman -Qikk coreutils # for dd
Thanks for persisting on this. I don't think I'm using any nonstandard shell or setting, not on purpose anyway ::)
Here is the output you requested.
Pluto:[root]:/boot# type hexdump
hexdump is /usr/bin/hexdump
Pluto:[root]:/boot# pacman -Qo `which hexdump`
/usr/bin/hexdump is owned by util-linux 2.38-1
Pluto:[root]:/boot# pacman -Qikk util-linux
Name : util-linux
Version : 2.38-1
Description : Miscellaneous system utilities for Linux
Architecture : x86_64
URL : https://github.com/karelzak/util-linux
Licenses : GPL2
Groups : None
Provides : rfkill hardlink
Depends On : pam shadow coreutils libudev libudev.so=1-64 libcap-ng
libxcrypt libcrypt.so=2-64 util-linux-libs
libmagic.so=1-64 libncursesw.so=6-64
Optional Deps : python: python bindings to libmount [installed]
words: default dictionary for look
Required By : base f2fs-tools fakeroot jfsutils mkinitcpio ntfs-3g
reiserfsprogs udev zeromq
Optional For : None
Conflicts With : rfkill hardlink
Replaces : rfkill hardlink
Installed Size : 14.32 MiB
Packager : Artix Build Bot <[email protected]>
Build Date : Mon 28 Mar 2022 09:25:27 AM PDT
Install Date : Thu 21 Apr 2022 05:33:44 PM PDT
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Pluto:[root]:/boot# LC_ALL=C pacman -Qi bash | grep Version
Version : 5.1.016-1
Pluto:[root]:/boot# pacman -Qikk bash
Name : bash
Version : 5.1.016-1
Description : The GNU Bourne Again shell
Architecture : x86_64
URL : https://www.gnu.org/software/bash/bash.html
Licenses : GPL
Groups : None
Provides : sh
Depends On : readline libreadline.so=8-64 glibc ncurses
Optional Deps : bash-completion: for tab completion
Required By : acpid autoconf automake base bison bzip2
ca-certificates-utils cronie db dhclient dhcpcd dialog
diffutils e2fsprogs ecl fakeroot fftw findutils flex
foomatic-db-engine freetype2 gawk gdbm gettext gmp gpm
grub gzip icu ijs iptables js78 keyutils libgpg-error
libksba libnet libpaper libpcap libpng libreoffice-still
libteam libtool lsb-release lvm2 m4 man-db mkinitcpio
mtools nano neofetch npth nspr nss openresolv
os-prober p7zip pacman pcre pcre2 pkgconf pps-tools
rkhunter rpcbind runit-rc sane smartmontools texinfo
unzip vte-common which wireless-regdb xapian-core
xdg-user-dirs xdg-utils xfsprogs xz
Optional For : mdadm ncurses
Conflicts With : None
Replaces : None
Installed Size : 8.20 MiB
Packager : Artix Build Bot <[email protected]>
Build Date : Sat 08 Jan 2022 01:06:22 PM PST
Install Date : Mon 10 Jan 2022 07:04:04 PM PST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
backup file: bash: /etc/bash/bashrc (Modification time mismatch)
backup file: bash: /etc/bash/bashrc (Size mismatch)
backup file: bash: /etc/bash/bashrc (MD5 checksum mismatch)
backup file: bash: /etc/bash/bashrc (SHA256 checksum mismatch)
backup file: bash: /etc/skel/.bashrc (Modification time mismatch)
backup file: bash: /etc/skel/.bashrc (Size mismatch)
backup file: bash: /etc/skel/.bashrc (MD5 checksum mismatch)
backup file: bash: /etc/skel/.bashrc (SHA256 checksum mismatch)
bash: 253 total files, 0 altered files
Pluto:[root]:/boot# pacman -Qikk coreutils
Name : coreutils
Version : 9.1-1
Description : The basic file, shell and text manipulation utilities of the
GNU operating system
Architecture : x86_64
URL : https://www.gnu.org/software/coreutils/
Licenses : GPL3
Groups : None
Provides : None
Depends On : glibc acl attr gmp libcap openssl
Optional Deps : None
Required By : base ca-certificates-utils inxi linux mkinitcpio p11-kit
util-linux
Optional For : usbutils
Conflicts With : None
Replaces : None
Installed Size : 16.20 MiB
Packager : Artix Build Bot <[email protected]>
Build Date : Sun 17 Apr 2022 01:48:46 PM PDT
Install Date : Tue 19 Apr 2022 02:45:14 PM PDT
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
coreutils: 431 total files, 0 altered files
Before the last line here,
pacman -Qikk util-linux should have output at least two more lines. On my system:
util-linux: 500 total files, 0 altered files
Can you provide
/etc/bash/bashrc,
$HOME/.bashrc,
/root/.bashrc?
Sorry, I didn't cut it all. After "Validated By: Signature" there is a blank line, then "util-linux: 500 total files, 0 altered files"
I don't know if it's relevant (it has worked for a year like this): my SSD is encrypted and init is runit.
I have no /root/.bashrc. Here is /etc/bash/bashrc
#
# /etc/bash/bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
[[ $DISPLAY ]] && shopt -s checkwinsize
##PS1='[\u@\h \W]\$ '
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
screen*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
;;
esac
for sh in /etc/bash/bashrc.d/*.bashrc ; do
[[ -r ${sh} ]] && source "${sh}"
done
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
~/.bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
HISTCONTROL=ignoreboth
alias ls='ls --color=auto'
alias lsblk='lsblk -o name,fstype,size,fsuse%,mountpoint,uuid'
# PS1='[\u@\h \W]\$ '
alias find='sudo find'
alias ffmpeg='ffmpeg -hide_banner'
. /home/spot/Scripts/text-color
PATH=$PATH:/home/spot/.local/bin
export PATH
Can you try to execute mkinitcpio, this time with
su --login --shell=/bin/bash
mkinitcpio -p linux
and see if there is any difference?
Update: If that still doesn't work, please try the patch attached to this post. As before, save it to
$HOME, then:
su
cp /usr/lib/initcpio/functions{,.copy}
patch /usr/lib/initcpio/functions functions.txt
mkinitcpio -p linux
then please supply the contents of the file /var/log/mkinitcpio-dd.log. You can revert the file by issuing (as root):
mv /usr/lib/initcpio/functions{.copy,}
rm -v /var/log/mkinitcpio-dd.log
@stradjer I found the problem: a script I wrote to confirm before executing dd, which was unfortunately in the path. I'm very grateful for your help and sorry to have wasted your time on a problem I caused. :(
No problem, I'm just curious since this is not the first case of this issue. The first report only differed in the output from dd - there the first word was "You", and here "Output". I assume your script was called "dd" in
$HOME/.local/bin or
/usr/local/bin?
If anything, this shows why user scripts, shell functions or aliases should have different names than the standard utilities.
Yes
Lesson learned.
Thanks again