aboutsummaryrefslogtreecommitdiff
path: root/src/install-kernel
blob: 64c9ee5ea390a3cf336194844702b5bd0784d094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# System local command to install the kernel into the system boot loader.
#

# The /boot/vmlinuz-huge softlink points to the last installed kernel.
KERNEL_VERSION="$(realpath /boot/vmlinuz | sed 's/.*\/.*-\(.*\)/\1/')"
if [ "$1" ]; then
  KERNEL_VERSION="$(echo "$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