diff --git a/scripts/latecommand.tar.gz b/scripts/latecommand.tar.gz index c6ec48c..d620940 100644 Binary files a/scripts/latecommand.tar.gz and b/scripts/latecommand.tar.gz differ diff --git a/scripts/latecommand/post.buster.sh b/scripts/latecommand/post.buster.sh index 5b8e1c0..b1d1765 100755 --- a/scripts/latecommand/post.buster.sh +++ b/scripts/latecommand/post.buster.sh @@ -94,6 +94,26 @@ aptitude -y purge '~c' ## }}} +# Grub {{{ + +## If EFI directory is present +EFI_PATH="/boot/efi" +if [ -d "${EFI_PATH}" ]; then + ## Install grub-efi + aptitude install -y grub-efi-amd64 + ## Get grub device (keep only some patterns, eg. /dev/sda, /dev/vda, /dev/nvme0n1,…) + GRUB_DEVICE=$(sed -n "s;^\(/dev/[a-z]\{3\}\|/dev/nvme[a-z0-9]\{3\}\)\(p[0-9]\|[0-9]\) ${EFI_PATH} .*;\1;p" /etc/mtab) + grub-install --target=x86_64-efi "${GRUB_DEVICE}" 2>/dev/null + if [ -d "${EFI_PATH}"/EFI ]; then + ## Copy efi entries to a boot directory + mkdir -p -- "${EFI_PATH}"/EFI/boot + find "${EFI_PATH}"/EFI/grub -type f -iname "grubx64.efi" -exec cp {} "${EFI_PATH}"/EFI/boot/bootx64.efi \; -quit 2>/dev/null + find "${EFI_PATH}"/EFI/debian -type f -iname "grubx64.efi" -exec cp {} "${EFI_PATH}"/EFI/boot/bootx64.efi \; -quit + fi +fi + +### }}} + ### Rsyslog {{{ # Install new Rsyslog configuration @@ -107,7 +127,6 @@ cp -- "${RSYSLOGD_INCLUDE_SRC}"* "${RSYSLOGD_INCLUDE_PATH}" systemctl restart rsyslog ### }}} - ### Logrotate {{{ # Install new Logrotate configuration