From c5441bb9f538ca45468db21c1c62f45680349a3d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 9 Jun 2024 16:06:07 +0100 Subject: re-add ability to use cbfs grub.cfg as default i removed this before, when making grub multi-tree, because the design i used in an earlier version of the patch actually added the grub.elf generation to grub source itself, but then i decided to hack around the grub build system from lbmk/cbmk instead re-add this functionality, so that users can easily insert their own custom grub.cfg into cbfs without needing to re-build their image. Signed-off-by: Leah Rowe --- config/data/grub/memdisk.cfg | 10 ++++++++++ script/trees | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 config/data/grub/memdisk.cfg diff --git a/config/data/grub/memdisk.cfg b/config/data/grub/memdisk.cfg new file mode 100644 index 00000000..543e421d --- /dev/null +++ b/config/data/grub/memdisk.cfg @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2023 Leah Rowe + +set prefix=(memdisk)/boot/grub + +if [ -f (cbfsdisk)/grub.cfg ]; then + source (cbfsdisk)/grub.cfg +else + source (memdisk)/boot/grub/grub_default.cfg +fi diff --git a/script/trees b/script/trees index 68d4f94b..4d9a5d08 100755 --- a/script/trees +++ b/script/trees @@ -286,7 +286,9 @@ mkpayload_grub() -O i386-coreboot -o "${cdir}/grub.elf" -d "${cdir}/grub-core/" \ --fonts= --themes= --locales= --modules="$grub_modules" \ --install-modules="$grub_install_modules" \ - "/boot/grub/grub.cfg=${cdir}/.config" || $err "$tree: !mkgrub" + "/boot/grub/grub_default.cfg=${cdir}/.config" \ + "/boot/grub/grub.cfg=$grubdata/memdisk.cfg" || \ + $err "$tree: cannot build grub.elf" } copy_elf() -- cgit v1.2.1