2

Whenever Yum updates the kernel, there's a new set of (vmlinuz* initramfs*) files in /boot and the Grub config is updated to directly point to those new files.

Where is the setting that will force Yum to always create/update symlinks to the new files after such an update?

vmlinuz-3.12.6-300.fc20.x86_64 # HAVE
vmlinuz -> /boot/vmlinuz-3.12.6-300.fc20.x86_64 # WANT
initramfs-3.12.6-300.fc20.x86_64.img # HAVE
initramfs -> /boot/initramfs-3.12.6-300.fc20.x86_64.img # WANT

Reasoning:

  • A computer with two operating systems installed might have one master Grub with one entry for each system. The Fedora entry would point to symlinks because I'm not manually changing the config file whenever Fedora installs a new kernel.
  • In two cases, the Fedora 20 installer failed to install Grub (and crashed). So when this happens, I install a dedicated Grub (not mounted in the Fedora installation) and have the same issue.
1

You could put a script in /etc/kernel/postinst.d/ like the following:

#!/bin/bash

KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"

ln -sf $KERNEL_IMAGE /boot/vmlinuz
ln -sf /boot/initramfs-$KERNEL_VERSION.img /boot/initramfs.img

You might also want to put a script in /etc/kernel/prerm.d/ that handles removing a kernel, which would be more complex. The script would need to work out whether the kernel being removed is symlinked to and work out which kernel to update the symlink to.

The scripts in these directories are called by the new-kernel-pkg command, which gets called by kernel-install in the post transaction script of a kernel RPM.

  • Works like a charm. However, the 2 links have to be changed manually when starting an upgrade with fedup, right before reboot (they have to point to the -fedup images). But after the upgrade and after every kernel update, the symlinks are updated properly. Nice. – basic6 May 4 '14 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.