Skip to content
Permalink
Browse files

boards/x86: scripts: extend build_grub.sh for 64-bit UEFI

This extends the build_grub.sh script so that it can build 64-bit
Grub UEFI application, and thus enabling us to boot on systems
with 64-bit BIOS.

Also updated the script to checkout the tag grub-2.02 since
v2.02 has been out.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
  • Loading branch information...
dcpleung authored and nashif committed Jul 17, 2018
1 parent cf71938 commit 2bda5cf1a7315e051e32d90c33e51369880ee7eb
Showing with 14 additions and 6 deletions.
  1. +12 −4 boards/x86/common/scripts/build_grub.sh
  2. +2 −2 boards/x86/galileo/doc/galileo.rst
@@ -6,9 +6,16 @@
set -e

JOBS=5
HEAD="bac5d1a64ab4191058a8fd4c05f6b3b339e249e7"
HEAD="grub-2.02"
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

if [ "x$1" == "x" ]; then
echo "Usage: $0 [i386|x86_64]"
exit 1
fi

TARGET_ARCH=$1

prepare() {
if [[ ! -d ./src ]]; then
git clone http://git.savannah.gnu.org/r/grub.git src
@@ -24,11 +31,12 @@ build() {
pushd src

./autogen.sh
./configure --with-platform=efi --target=i386
./configure --with-platform=efi --target=${TARGET_ARCH}

make -j${JOBS}

./grub-mkimage -p /EFI/BOOT -d ./grub-core/ -O i386-efi -o grub.efi \
./grub-mkimage -p /EFI/BOOT -d ./grub-core/ -O ${TARGET_ARCH}-efi \
-o grub_${TARGET_ARCH}.efi \
boot efifwsetup efi_gop efinet efi_uga lsefimmap lsefi lsefisystab \
exfat fat multiboot2 multiboot terminal part_msdos part_gpt normal \
all_video aout configfile echo file fixvideo fshelp gfxterm gfxmenu \
@@ -40,7 +48,7 @@ build() {

setup() {
mkdir -p bin
cp src/grub.efi bin/
cp src/grub_${TARGET_ARCH}.efi bin/
}

cleanup() {
@@ -218,10 +218,10 @@ copy of GRUB, follow these steps to test on supported boards using a custom GRUB
.. code-block:: console

$ cd $ZEPHYR_BASE
$ ./boards/x86/common/scripts/build_grub.sh
$ ./boards/x86/common/scripts/build_grub.sh i386

#. Find the binary at
:file:`$ZEPHYR_BASE/boards/x86/common/scripts/grub/bin/grub.efi`.
:file:`$ZEPHYR_BASE/boards/x86/common/scripts/grub/bin/grub_i386.efi`.



0 comments on commit 2bda5cf

Please sign in to comment.
You can’t perform that action at this time.