Update today: initramfs was not build correctly

Today, I installed the update.
Initramfs was build for the two kernels.
Initramfs fallback for kernel 5.15 was not build correctly.
An error occured.

How to corecct this ?

Which error?

Can you rerun the generation? sudo mkinitcpio -P

The first time the message error occured building initramfs was displayed.

During mkinitcpio -P the error specified kernel does not exist: /boot/vmlinuz-6.0-x86_64 was displayed.

But the kernel 6.0 is not installed anymore.

there are probably some leftovers here from the uninstalled kernel(s):

ls /etc/mkinitcpio.d/*.preset
sudo ls /boot/initramfs-*
sudo ls /boot/vmlinuz-*
sudo ls /usr/lib/modules/*

so remove them, and rerun the mkinit again

I removed /etc/mkinitcpio.de/linux60.preset.
Then mkinitcpio -P.

All works now.
Thanks !

@brahma @Keruskerfuerst

I happened to be looking at an old one-liner thats related to this.
I polished it up a bit … here it is for you

gcspt
#!/usr/bin/env bash
gcspt=$(find /boot/ -type f -name grub.cfg);
initz=$(find /boot/ -type f -name 'initramfs*' | sort); 
imgz=$(find /boot/ -type f -name 'vmlinuz*' | sort); 
modz=$(find /lib/modules/ -maxdepth 1 -type d | sort);
mkinitz=$(find /etc/ -type f -name 'mkinitcpio*' 2>/dev/null | sort); 
mkinitzd=$(find /etc/mkinitcpio.d -type f | sort); 
printf '\n...Bite-Sized Boot-Info...\n'; 
printf "\nCurrently Running Kernel:\n$(hostnamectl | tail -n6 | head -n1 | awk '{ print $NF }')\n"; 
printf '\nGrub Configuration File:\n';
echo $gcspt | while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t;
printf '\nInstalled Kernels:\n';
echo "$imgz" | while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t; 
printf '\nInitramfs Images:\n'; 
echo "$initz" | while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t;
printf '\nmkinitcpio:\n';
echo "$mkinitz" | while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t;
echo "$mkinitzd" | while read in; do ls -l --time-style=+'%F %R' "$in" | cut --complement -d ' ' -f1,2,3,4,5; done | column -t;
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\n'
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.