summarylogtreecommitdiffstats
path: root/grub-install
blob: 56c7e4f07b847d2e4cb9e9ed7cf05ad40e9a9e6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# Install grub files into /boot
/usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --modules="tpm" --disable-shim-lock
# Create BOOTX64 file if not present. if already present check if it is grub. If it is grub then update. If not dont do any thing to it.
if [[ -f /boot/EFI/BOOT/BOOTX64.EFI ]]; then
  if strings /boot/EFI/BOOT/BOOTX64.EFI | grep -qi grub; then
    /usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --removable
  fi
else
    /usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --modules="tpm" --disable-shim-lock --removable
fi
# create config
/usr/bin/grub-mkconfig -o /boot/grub/grub.cfg
# secureboot signing
[[ -f /usr/bin/sbctl ]] && /usr/bin/sbctl sign-all -g