Kernels incorrectly named, not showing up in GRUB menu

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'
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
# 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)

# 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

# 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.

# 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)

# 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.

# Additional options for the compressor

# 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.

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


PRESETS=('default' 'fallback')

#default_options="--splash /usr/share/systemd/bootctl/splash-manjaro.bmp"

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 ;

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: )

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;

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

printf '\ndracut:\n';

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


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"
$ 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

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

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

Settings of /etc/default/grub:
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"

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
 PRESETS=('default' 'fallback')
 #default_options="--splash /usr/share/systemd/bootctl/splash-manjaro.bmp"
 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.

@scarwire well the logic changed. 39-6 should fix it. Try to delete all preset files including pacsave ones.

If younstill see issues I provide a script with more verbose output

@philm, thanks for the recent patch. However, it seems there is still a function oversight in the patch, causing the package to remain non-functional.

Specifically, the install_kernel function invokes install_preset, which requires three arguments. Unfortunately, only two arguments are currently being provided, an issue not addressed in the patch.