Skip to content

Commit

Permalink
grub_install.sh: Remove redundant BOARD_GRUB logic
Browse files Browse the repository at this point in the history
We always use the board's GRUB now.

Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed Nov 12, 2024
1 parent 579fc81 commit 42b0b00
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions build_library/grub_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,12 @@ switch_to_strict_mode
# Our GRUB lives under flatcar/grub so new pygrub versions cannot find grub.cfg
GRUB_DIR="flatcar/grub/${FLAGS_target}"

# GRUB install location inside the SDK
GRUB_SRC="/usr/lib/grub/${FLAGS_target}"

# Modules required to boot a standard CoreOS configuration
CORE_MODULES=( normal search test fat part_gpt search_fs_uuid gzio search_part_label terminal gptprio configfile memdisk tar echo read btrfs )

# Name of the core image, depends on target
CORE_NAME=

# Whether the SDK's grub or the board root's grub is used. Once amd64 is
# fixed up the board root's grub will always be used.
BOARD_GRUB=1

SBAT_ARG=()

case "${FLAGS_target}" in
Expand All @@ -70,21 +63,19 @@ case "${FLAGS_target}" in
arm64-efi)
CORE_MODULES+=( serial linux efi_gop efinet pgp http tftp tpm )
CORE_NAME="core.efi"
BOARD_GRUB=1
SBAT_ARG=( --sbat "${BOARD_ROOT}/usr/share/grub/sbat.csv" )
;;
*)
die_notrace "Unknown GRUB target ${FLAGS_target}"
;;
esac

if [[ $BOARD_GRUB -eq 1 ]]; then
info "Updating GRUB in ${BOARD_ROOT}"
emerge-${BOARD} \
--nodeps --select --verbose --update --getbinpkg --usepkgonly --newuse \
sys-boot/grub
GRUB_SRC="${BOARD_ROOT}/usr/lib/grub/${FLAGS_target}"
fi
info "Updating GRUB in ${BOARD_ROOT}"
emerge-${BOARD} \
--nodeps --select --verbose --update --getbinpkg --usepkgonly --newuse \
sys-boot/grub

GRUB_SRC="${BOARD_ROOT}/usr/lib/grub/${FLAGS_target}"
[[ -d "${GRUB_SRC}" ]] || die "GRUB not installed at ${GRUB_SRC}"

# In order for grub-setup-bios to properly detect the layout of the disk
Expand Down

0 comments on commit 42b0b00

Please sign in to comment.