Skip to content

Commit

Permalink
fix: update GRUB build to build EFI & BIOS platforms
Browse files Browse the repository at this point in the history
This fixes grub-install on EFI machines.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira authored and talos-bot committed Aug 27, 2020
1 parent 5d10015 commit 5c09cc5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
format: v1alpha2

vars:
TOOLS_IMAGE: docker.io/autonomy/tools:v0.2.0-9-g546446a
TOOLS_IMAGE: docker.io/autonomy/tools:v0.2.0-10-g1aba785
48 changes: 41 additions & 7 deletions grub/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,55 @@ steps:
destination: grub.tar.xz
sha256: e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
sha512: 9c15c42d0cf5d61446b752194e3b628bb04be0fe6ea0240ab62b3d753784712744846e1f7c3651d8e0968d22012e6d713c38c44936d4004ded3ca4d4007babbb
env: # disable any optimizations, as this breaks GRUB build
CFLAGS: ""
CXXFLAGS: ""
LDFLAGS: ""
prepare:
- |
tar -xJf grub.tar.xz --strip-components=1
./configure --prefix=/usr \
--sbindir=/sbin \
--sysconfdir=/etc \
--disable-efiemu \
--disable-werror
/toolchain/bin/bash ./autogen.sh
build:
- |
make -j $(nproc)
case "${ARCH}" in
x86_64)
flavors="efi bios"
;;
*)
flavors="efi"
;;
esac
for flavor in $flavors; do
mkdir "build-${flavor}"
cd "build-${flavor}"
case "${flavor}" in
bios)
flags="--with-platform=pc" ;;
efi)
flags="--with-platform=efi --disable-efiemu" ;;
esac
../configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
${flags} \
--disable-nls \
--disable-werror
make -j $(nproc)
make install-strip DESTDIR=/rootfs
cd ..
done
install:
- |
make install DESTDIR=/rootfs
rm -f /rootfs/usr/lib/charset.alias
mkdir -p /rootfs/usr/share/locale
mkdir -p /rootfs/usr/share/bash-completion/completions
mv -v /rootfs/etc/bash_completion.d/grub /rootfs/usr/share/bash-completion/completions
finalize:
Expand Down

0 comments on commit 5c09cc5

Please sign in to comment.