Skip to content

Instantly share code, notes, and snippets.

@a2nt
Last active May 2, 2022 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2nt/a4878e5fa85859f80b0cd1dfb561cc75 to your computer and use it in GitHub Desktop.
Save a2nt/a4878e5fa85859f80b0cd1dfb561cc75 to your computer and use it in GitHub Desktop.
EASY Debian Linux UEFI setup
#!/bin/sh
############## EASY Debian Linux UEFI setup ##############
#
# Moves latest kernel dracut EFI to Linux.efi
# To ease BIOS setup
#
# NOTE: By default EFI partition is mounted at /boot/efi
#
### INSTALL
# 1) Place GIST at /etc/kernel/postinst.d/zz-update-efi
# 2) chmod +x /etc/kernel/postinst.d/zz-update-efi
# 3) apt install dracut
# 4) Create /etc/dracut.conf.d/10-debian.conf
#
# hostonly=yes
#
# uefi=yes
# uefi_stub=/usr/lib/systemd/boot/efi/linuxx64.efi.stub
#
# 5) Setup your BIOS to boot /EFI/Linux/Linux.efi
###########################################################
LAST_KERNEL=$(ls /boot/efi/EFI/Linux | sort -V | tail -n 1)
if [ "$LAST_KERNEL" != "Linux.efi" ]; then
echo "Found last kernel EFI ... "$LAST_KERNEL
echo "mv "$LAST_KERNEL" to Linux.efi"
mv /boot/efi/EFI/Linux/$LAST_KERNEL /boot/efi/EFI/Linux/Linux.efi
else
echo "Current kernel is linked already"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment