Originally Posted by
Cavsfan
Also Fedora does not generate a generic symlink for initrd and vmlinuz like every other Linux OS does just after a new kernel is installed.
So, I created a script to run when a new kernel is installed. I'm running it manually now but, I am very close to getting it right.
Originally Posted by
Dennis N
Symbolic link needed in Fedora? The chain loading in the quoted text would always boot the latest kernel without any symbolic link in Fedora since the newest kernel is always placed first in the Fedora grub menu. That's the advantage of doing it this way, and makes it maintenance free.
I got the script perfected a while ago, forgot to post it here. Adding this script to /etc/kernel/postinst.d/ also boots into the last installed kernel every time.
Code:
#!/bin/bash
#
# We're passed the kernel version being installed
KERNEL_VERSION="$1"
ln -s -f "initramfs-"$1".img" /boot/initrd.img
ln -s -f "vmlinuz-"$1 /boot/vmlinuz
echo " SUCCESS: symlink initrd.img created for "initramfs-"$1".img"" >&2
echo " SUCCESS: symlink vmlinuz created for "vmlinuz-"$1" >&2
exit 0
I just called it symlink-kernel in my home directory.
You install the script with this command:
Code:
sudo install symlink-kernel /etc/kernel/postinst.d/symlink-kernel
This is my Fedora grub menuentry in Xubuntu 18.04. I've got all of my systems customized because if grub is updated on another system, grub moves to that system.
Arch Linux, Fedora 29, openSUSE TW and Xubuntu 18.04 LTS all have a working 06_custom file
Code:
menuentry 'Fedora 29 (Workstation)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-advanced-1216e907-e6c7-4791-841d-a2d2d7a4dcfc' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd2,gpt8'
search --no-floppy --fs-uuid --set=root 1216e907-e6c7-4791-841d-a2d2d7a4dcfc
linux /boot/vmlinuz root=UUID=1216e907-e6c7-4791-841d-a2d2d7a4dcfc ro resume=UUID=bbc771f8-ba61-4e50-aeca-d2754b112aee rhgb quiet nouveau.modeset=0 LANG=en_US.UTF-8
initrd /boot/initrd.img
}
Code:
[cavsfan@fedora ~]$ sudo blkid | grep -e "Fedora" -e "swap"
/dev/sdc4: UUID="bbc771f8-ba61-4e50-aeca-d2754b112aee" TYPE="swap" PARTLABEL="swap" PARTUUID="c39d976b-91cd-4d59-a270-91398b764d3f"
/dev/sdc8: LABEL="Fedora" UUID="1216e907-e6c7-4791-841d-a2d2d7a4dcfc" TYPE="ext4" PARTLABEL="Fedora" PARTUUID="887a3d2f-73ed-4894-b566-3e37294757e7"
I'm sure some of that is extraneous but, it works and I don't mind.
There are many ways to skin a cat and I have the UUID method working to my satisfaction.
If you did install the script, you would see something like this in the terminal output when a new kernel is installed:
Code:
Running scriptlet: kernel-core-4.20.6-200.fc29.x86_64 169/169
SUCCESS: symlink initrd.img created for initramfs-4.20.6-200.fc29.x86_64.img
SUCCESS: symlink vmlinuz created for vmlinuz-4.20.6-200.fc29.x86_64
Bookmarks