Skip to content

Commit

Permalink
fix: build zbin utility for both amd64 and arm64
Browse files Browse the repository at this point in the history
Utility `zbin` is used to compress `undionly.kpxe` image for x86, but if
the Sidero is running on `arm64`, we still need utility `zbin` for
arm64. Regular build depends on x86, so just extract build as a single
invocation of `gcc`.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed May 4, 2021
1 parent bb39b97 commit b0d9cd2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ipxe/pkg.yaml
Expand Up @@ -21,6 +21,7 @@ steps:
{{ if eq .ARCH "aarch64" }}
ARCH= make -j $(nproc) bin-arm64-efi/ipxe.efi EMBED=/pkg/files/ipxe.script
gcc ./util/zbin.c -llzma -o util/zbin
{{ else }}
ARCH= make -j $(nproc) bin/undionly.kpxe bin-x86_64-efi/ipxe.efi EMBED=/pkg/files/ipxe.script
ARCH= make bin/undionly.kpxe.bin bin/undionly.kpxe.zinfo EMBED=/pkg/files/ipxe.script
Expand All @@ -29,14 +30,15 @@ steps:
- |
cd src/
mkdir -p /rootfs/{usr/libexec,usr/libexec/zbin}
mkdir -p /rootfs/{usr/libexec,usr/libexec/kpxe}
{{ if eq .ARCH "aarch64" }}
cp -p bin-arm64-efi/ipxe.efi /rootfs/usr/libexec
{{ else }}
cp -p bin/undionly.kpxe bin-x86_64-efi/ipxe.efi /rootfs/usr/libexec
cp -p bin/undionly.kpxe.bin bin/undionly.kpxe.zinfo util/zbin /rootfs/usr/libexec/zbin
cp -p bin/undionly.kpxe.bin bin/undionly.kpxe.zinfo /rootfs/usr/libexec/kpxe
{{ end }}
cp -p util/zbin /rootfs/usr/libexec
finalize:
- from: /rootfs
to: /
Expand Down

0 comments on commit b0d9cd2

Please sign in to comment.