Kernels incorrectly named, not showing up in GRUB menu

Hi, I’m running the unstable branch with two kernels installed, linux68 and linux66. Recently I noticed that only one of the two shows up in GRUB. When I run mkinitcpio -P, I notice that the files generated for both kernels have the same name:

==> Building image from preset: /etc/mkinitcpio.d/linux66.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz- -g /boot/initramfs-.img
...
==> Building image from preset: /etc/mkinitcpio.d/linux66.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz- -g /boot/initramfs--fallback.img -S autodetect
...
==> Building image from preset: /etc/mkinitcpio.d/linux68.preset: 'default'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz- -g /boot/initramfs-.img
...
==> Building image from preset: /etc/mkinitcpio.d/linux68.preset: 'fallback'
==> Using default configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz- -g /boot/initramfs--fallback.img -S autodetect

So basically the 6.6 ramdisk is being generated and then being written over by the 6.8 ramdisk. Usually these files have a version number attached to the end of their names, but for some reason now they don’t and they’re conflicting. I haven’t touched the preset files in /etc/mkinitcipio.d/. Any ideas about what might be causing this?

1 Like

Please post the output of…

ls /boot/

…as well as your /etc/mkinitcpio.conf.

Thanks for getting back so quickly! Here you go:

> ls /boot/
efi/   initramfs--fallback.img  intel-ucode.img      linux68-x86_64.kver  vmlinuz-
grub/  initramfs-.img           linux66-x86_64.kver  memtest86+/
> cat /etc/mkinitcpio.conf | sed '/^#/d'
MODULES=(crc32c-intel)
BINARIES=()
FILES=(/crypto_keyfile.bin)
HOOKS=(base udev autodetect kms modconf block keyboard keymap consolefont plymouth encrypt openswap resume filesystems)
1 Like

Your complete mkinitcpio.conf please, not just what you think is relevant.

Fair enough:

> cat /etc/mkinitcpio.conf
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(usbhid xhci_hcd)
MODULES=(crc32c-intel)

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=(/crypto_keyfile.bin)

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No RAID, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect modconf block filesystems fsck)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev modconf block filesystems fsck)
#
##   This setup assembles a mdadm array with an encrypted root file system.
##   Note: See 'mkinitcpio -H mdadm_udev' for more information on RAID devices.
#    HOOKS=(base udev modconf keyboard keymap consolefont block mdadm_udev encrypt filesystems fsck)
#
##   This setup loads an lvm2 volume group.
#    HOOKS=(base udev modconf block lvm2 filesystems fsck)
#
##   This will create a systemd based initramfs which loads an encrypted root filesystem.
#    HOOKS=(base systemd autodetect modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr and fsck hooks.
HOOKS=(base udev autodetect kms modconf block keyboard keymap consolefont plymouth encrypt openswap resume filesystems)

# COMPRESSION
# Use this to compress the initramfs image. By default, zstd compression
# is used for Linux ≥ 5.9 and gzip compression is used for Linux < 5.9.
# Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

# MODULES_DECOMPRESS
# Decompress loadable kernel modules and their firmware during initramfs
# creation. Switch (yes/no).
# Enable to allow further decreasing image size when using high compression
# (e.g. xz -9e or zstd --long --ultra -22) at the expense of increased RAM usage
# at early boot.
# Note that any compressed files will be placed in the uncompressed early CPIO
# to avoid double compression.
#MODULES_DECOMPRESS="no"

Maybe something is amiss in the preset files?

cat /etc/mkinitcpio.d/linux66.preset
cat /etc/mkinitcpio.d/linux68.preset

Here’s /etc/mkinitcpio.d/linux68.preset:

# mkinitcpio preset file for the '%PKGBASE%' package

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

PRESETS=('default' 'fallback')

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

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs--fallback.img"
#fallback_uki="/efi/EFI/Linux/manjaro--fallback.efi"
fallback_options="-S autodetect"

linux66.preset is similar, without version numbers in the .img and .efi file names. What do these files look like normally? If I understand correctly, these files are automatically generated by mkinitcpio, so even if I edit them, the next time I run mkinitcpio or the kernel gets upgraded by pacman, they’ll be overwritten.

Saw another user post about this the other day but I have no idea why it ended up like that.

Well, some idea, as it seems related to those ‘fix mkinitcpio’ scriptlets.

Oh yeah, it was a PM for some reason. Now it is not.

You could use maxi to show this ;

maxi
Currently running: 6.7.12-1-MANJARO (linux67)
 linux515       vmlinuz-5.15-x86_64 initramfs-5.15-x86_64.img=39M  fallback=247M
 linux61        vmlinuz-6.1-x86_64  initramfs-6.1-x86_64.img =41M  fallback=274M
 linux67  <EOL> vmlinuz-6.7-x86_64  initramfs-6.7-x86_64.img =104M fallback=372M
 linux68        vmlinuz-6.8-x86_64  initramfs-6.8-x86_64.img =105M fallback=379M
Modules in: /lib/modules
 modules515 5.15.154-1-MANJARO=273M <missing>=
 modules61  6.1.85-1-MANJARO  =322M <missing>=
 modules67  6.7.12-1-MANJARO  =291M <missing>=
 modules68  6.8.8-2-MANJARO   =295M <missing>=

On my system the filenames are OK (sorry i am on stable :frowning: )
:footprints:

I use gcspt for this kind of thing. Very old little script.

gcspt script
#!/usr/bin/env bash
#
# gcspt
#
# grub+ configuration search presentation tool
#
# <3 cscs <3
#

gcspt=$(find /boot -type f -name '*.cfg' 2>/dev/null | sort);
gscpt=$(find /etc/grub.d -type f ! -name 'README' 2>/dev/null | sort);
initz=$(find /boot -type f -name 'initramfs*' 2>/dev/null | sort); 
imgz=$(find /boot -type f -name 'vmlinuz*' 2>/dev/null | sort); 
modz=$(find /lib/modules -maxdepth 1 -type d 2>/dev/null | sort);
mkinitz=$(find /etc -type f -name 'mkinitcpio*' 2>/dev/null | sort); 
mkinitzd=$(find /etc/mkinitcpio.d -type f 2>/dev/null | sort);
dracutz=$(find /etc -type f -name 'dracut*' 2>/dev/null | sort); 
dracutzd=$(find /etc/dracut.conf.d -type f 2>/dev/null | sort);

_gcspt_format () {
    while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t
}

#printf '\n...Bite-Sized Boot-Info...\n';

printf "\nCurrently Running Kernel:\n$(uname -s -r)\n";

printf '\nGrub Configuration Files:\n';

echo "$gcspt" | _gcspt_format;
echo "$gscpt" | _gcspt_format;

printf '\nInstalled Kernels:\n';

echo "$imgz" | _gcspt_format;

printf '\nInitramfs Images:\n'; 

echo "$initz" | _gcspt_format;

if which mkinitcpio >/dev/null 2>&1; then

printf '\nmkinitcpio:\n';

echo "$mkinitz" | _gcspt_format;
echo "$mkinitzd" | _gcspt_format;
fi

if which dracut >/dev/null 2>&1; then

printf '\ndracut:\n';

echo "$dracutz" | _gcspt_format;
echo "$dracutzd" | _gcspt_format;

fi

printf '\nModule Directories:\n'; 

for i in $modz; do du --time --time-style=+'%F %R' -sh $i; done | awk '{print $2,$3,$4,$1}' | column -t; 

printf '\nHibernation:\n';

grep -o 'resume=' /etc/default/grub || printf 'No "resume=" option found in /etc/default/grub\n';

printf '\nSettings of /etc/default/grub:\n';

awk 'NF && !/^ *#/ { print; }' /etc/default/grub;

printf "\n"
exit
$ gcspt 

Currently Running Kernel:
Linux 6.8.9-AMD-znver3

Grub Configuration Files:
2024-05-09  20:51  /boot/grub/grub.cfg
2024-03-17  10:22  /etc/grub.d/00_header
2024-03-17  10:22  /etc/grub.d/10_linux
2024-03-17  10:22  /etc/grub.d/20_linux_xen
2024-03-17  10:22  /etc/grub.d/25_bli
2024-03-17  10:22  /etc/grub.d/30_os-prober
2024-04-29  00:55  /etc/grub.d/30_recovery-custom
2024-03-17  16:36  /etc/grub.d/30_uefi-firmware
2024-05-03  01:47  /etc/grub.d/35_fwupd
2024-03-17  10:22  /etc/grub.d/40_custom
2024-03-17  10:22  /etc/grub.d/41_custom
2024-03-11  03:27  /etc/grub.d/60_memtest86+-efi
2023-09-25  22:13  /etc/grub.d/91_reboot
2023-09-25  22:13  /etc/grub.d/92_poweroff

Installed Kernels:
2024-05-08  12:54  /boot/vmlinuz-6.6-x86_64
2024-05-04  17:46  /boot/vmlinuz-linux-amd-znver3

Initramfs Images:
2024-05-09  20:51  /boot/initramfs-6.6-x86_64.img
2024-05-09  20:51  /boot/initramfs-linux-amd-znver3.img

mkinitcpio:
2024-05-05  14:44  /etc/mkinitcpio.conf
2024-03-04  13:32  /etc/mkinitcpio.d/linux66.preset
2024-01-15  13:54  /etc/mkinitcpio.d/linux-amd-znver3.preset

Module Directories:
2024-05-08  12:54  /lib/modules                   994M
2024-05-08  12:54  /lib/modules/6.6.30-2-MANJARO  300M
2024-05-04  17:46  /lib/modules/6.8.9-AMD-znver3  232M

Hibernation:
No "resume=" option found in /etc/default/grub

Settings of /etc/default/grub:
GRUB_DEFAULT=saved
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=3 systemd.show_status=auto udev.log_priority=3 rd.udev.log_level=3"
GRUB_CMDLINE_LINUX="rw amd_pstate=active nmi_watchdog=0 nowatchdog zswap.enabled=0 snd_rn_pci_acp3x.dmic_acpi_check=1 spec_rstack_overflow=off "
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
GRUB_TIMEOUT_STYLE=hidden
GRUB_TERMINAL_INPUT=console
GRUB_GFXMODE=2240x1400x32,1024x768x32,auto
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_DISABLE_RECOVERY=true
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"
GRUB_THEME="/usr/share/grub/themes/manjaro-cscs/theme.txt"
GRUB_SAVEDEFAULT=true
GRUB_DISABLE_OS_PROBER=false
GRUB_ROOT_FS_RO=false

Its very dumb and prints a lot.

I can’t explain what’s causing your issue as I cannot reproduce it on more than one PC.

--- linux68-preset.yours	2024-05-10 13:03:12.367380179 -0600
+++ linux68-preset.mine	2024-05-10 13:03:55.850081011 -0600
@@ -1,16 +1,17 @@
 # mkinitcpio preset file for the '%PKGBASE%' package
 
 #ALL_config="/etc/mkinitcpio.conf"
-ALL_kver="/boot/vmlinuz-"
+ALL_kver="/boot/vmlinuz-6.8-x86_64"
 
 PRESETS=('default' 'fallback')
 
 #default_config="/etc/mkinitcpio.conf"
-default_image="/boot/initramfs-.img"
-#default_uki="/efi/EFI/Linux/manjaro-.efi"
+default_image="/boot/initramfs-6.8-x86_64.img"
+#default_uki="/efi/EFI/Linux/manjaro-6.8-x86_64.efi"
 #default_options="--splash /usr/share/systemd/bootctl/splash-manjaro.bmp"
 
 #fallback_config="/etc/mkinitcpio.conf"
-fallback_image="/boot/initramfs--fallback.img"
-#fallback_uki="/efi/EFI/Linux/manjaro--fallback.efi"
+fallback_image="/boot/initramfs-6.8-x86_64-fallback.img"
+#fallback_uki="/efi/EFI/Linux/manjaro-6.8-x86_64-fallback.efi"
 fallback_options="-S autodetect"
+

Has to be one of Manjaro’s mkinitcpio commits. Can’t find it at this moment though. :man_shrugging:

I actually edited my reply to remove the obvious statement you ended up quoting. :stuck_out_tongue_closed_eyes:

How do you come to that conclusion? You did notice I can’t reproduce it using the same Manjaro branch, right? I also have no issues on Arch (which apparently you’re using).

The other user seemed to think so as well, but so far hasnt given details.

Well, exactly because of:

It’s Manjaro who’s adding kernel version to {initramfs,vmlinuz}-$kernelbaseorwhatever, so it makes logical sense that in some cases var is empty.

I think you missed something…

Yes, we have patches since our kernel names are different. If there is something Phil & I missed that needs to be changed, let us know.

Arguing logic isn’t going to solve anything. :wink:

1 Like

Exact the issue I have too.

1 Like

@scarwire @pheiduck Please test mkinitcpio 39-6.

1 Like

@Yochanan I Reported here (issue fixed on my side):

@Yochanan, I’ve replied over on the other thread.