aboutsummaryrefslogtreecommitdiff
#!/bin/sh
#
# System local command to install the kernel into the system boot loader.
#

# The /boot/vmlinuz softlink points to the last installed kernel.
KERNEL_VERSION="$(realpath /boot/vmlinuz | sed 's/.*\/.*-\(.*\)/\1/')"
if [ "$1" ]; then
  KERNEL_VERSION="$(realpath "$1" | sed 's/.*\/.*-\(.*\)/\1/')"
fi

if [ -z "$KERNEL_VERSION" ]; then
  >&2 echo "The kernel version could not be detected from the filename."
  exit 1
fi

echo "Installing kernel version $KERNEL_VERSION into the efi..."
cp -H /boot/vmlinuz /efi/EFI/Slackware/vmlinuz
if [ -f /etc/mkinitrd.conf ]; then
  echo "Installing initialized ram disk into the efi..."
  mkinitrd -F -k "$KERNEL_VERSION" >/dev/null 
fi