summarylogtreecommitdiffstats
path: root/shim-systemd-boot-update.sh
blob: 9d50537625c6327d685d63fc5ea93e3bcd229630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

ESP_DIR="$(bootctl -p)"
BOOT_LOADER_EFI="$ESP_DIR/EFI/systemd/systemd-bootx64.efi"
SHIM_TARGET_EFI="$ESP_DIR/EFI/BOOT/grubx64.efi"

if diff -q "$BOOT_LOADER_EFI" "$SHIM_TARGET_EFI"; then
    echo "info: no changes, nothing to do"
    exit 0
fi

if cp "$BOOT_LOADER_EFI" "$SHIM_TARGET_EFI"; then
    echo "info: bootloader installed as EFI shim target"
    exit 0
fi