3

On the Internet I've only found this:

/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh $(uname -r) /boot/vmlinuz-$(uname -r)

but it doesn't work in Fedora 36 and soon to be released version 37, because this file is missing, in fact the entire /etc/kernel/postinst.d/ directory is empty.

I've also found

dnf reinstall kernel-core

but it only works for an up-to-date kernel. I'm running the kernel which is no longer available in repositories. Also, this is not a good option per se since it will result in reinstalling literally many hundreds of files for no reason.

grep -r rescue /etc finds nothing.

# grep -r rescue /usr/bin
grep: /usr/bin/tdbdump: binary file matches
grep: /usr/bin/ctags: binary file matches
grep: /usr/bin/systemctl: binary file matches
grep: /usr/bin/systemd-analyze: binary file matches
grep: /usr/bin/efisecdb: binary file matches
grep: /usr/bin/dpkg: binary file matches
grep: /usr/bin/grub2-mkrescue: binary file matches

/usr/share contains a ton of matches but I've no idea how to work with that.

kernel-core and kernel-modules packages have RPM scripts that do something but there's nothing specific to "rescue". It looks like it's all done as a single operation but I don't want to regenerate the initrd.

seramo
  • 21
  • 3
Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64

1 Answers1

4

Rescue kernels use a general-purpose initramfs, so you have to regenerate it. (Compare the sizes of your initramfses to see the impact of this.)

To create a new rescue kernel using the currently-running kernel, on Fedora 36, run

sudo rm /boot/*rescue*
sudo /usr/lib/kernel/install.d/51-dracut-rescue.install add "$(uname -r)" /boot "/boot/vmlinuz-$(uname -r)"
Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64
Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • The command `sudo rm /boot/*rescue*` maybe needs to be `sudo rm /boot/*rescue* /boot/loader/entries/*-rescue.conf`, but it seems `/boot/loader/entries/*-rescue.cfg` will get overwritten anyways. – Doncho Gunchev Jul 07 '23 at 07:45