| 1 |
#!/bin/sh |
| 2 |
. /usr/share/debconf/confmodule |
| 3 |
|
| 4 |
log() { |
| 5 |
logger -t grub-installer "$@" |
| 6 |
} |
| 7 |
|
| 8 |
ARCH="$(archdetect)" |
| 9 |
|
| 10 |
case $ARCH in |
| 11 |
i386/mac|amd64/mac) |
| 12 |
# Note: depends on partman-efi to load the efivars module! |
| 13 |
if [ -d /sys/firmware/efi ]; then |
| 14 |
log "GRUB not yet usable on Intel-based Macs booted using EFI" |
| 15 |
exit 1 |
| 16 |
fi |
| 17 |
;; |
| 18 |
mipsel/loongson-2f) |
| 19 |
;; |
| 20 |
mipsel/*) |
| 21 |
log "GRUB not yet usable on MIPS systems other than Yeeloong" |
| 22 |
exit 1 |
| 23 |
;; |
| 24 |
arm64/efi|armhf/efi) |
| 25 |
;; |
| 26 |
arm64/*) |
| 27 |
log "GRUB is only usable on EFI arm64 systems, not $ARCH" |
| 28 |
exit 1 |
| 29 |
;; |
| 30 |
armhf/*) |
| 31 |
log "GRUB is only usable on EFI armhf systems, not $ARCH" |
| 32 |
exit 1 |
| 33 |
;; |
| 34 |
riscv64/efi) |
| 35 |
;; |
| 36 |
riscv64/*) |
| 37 |
log "GRUB is only usable on EFI riscv64 systems, not $ARCH" |
| 38 |
exit 1 |
| 39 |
;; |
| 40 |
esac |
| 41 |
|
| 42 |
db_get grub-installer/skip |
| 43 |
if [ "$RET" = true ]; then |
| 44 |
exit 1 |
| 45 |
fi |
| 46 |
|
| 47 |
exit 0 |