Skip to content

Commit

Permalink
Use new cross-build capabilities of mkimage-iso-efi
Browse files Browse the repository at this point in the history
mkimage-iso-efi recently gained the capability to build for another architecture
other than the one it is running on. This takes advantage of it.

Signed-off-by: Avi Deitcher <[email protected]>
  • Loading branch information
deitch committed Mar 11, 2025
1 parent cac6b86 commit 24bf45b
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions tools/makeiso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,10 @@

[ -n "$DEBUG" ] && set -x

if [ -z "$DOCKER_ARCH_TAG" ] ; then
case $(uname -m) in
x86_64) ARCH=amd64
;;
aarch64) ARCH=arm64
;;
*) echo "Unsupported architecture $(uname -m). Exiting" && exit 1
;;
esac
else
ARCH="${DOCKER_ARCH_TAG}"
fi

EVE="$(cd "$(dirname "$0")" && pwd)/../"
PATH="$EVE/build-tools/bin:$PATH"
INSTALLER_TAR="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
MKIMAGE_TAG="$(linuxkit pkg show-tag "$EVE/pkg/mkimage-iso-efi")-${ARCH}"
MKIMAGE_TAG="$(linuxkit pkg show-tag "$EVE/pkg/mkimage-iso-efi")"
ISO="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")"

if [ ! -f "$INSTALLER_TAR" ] || [ $# -lt 2 ]; then
Expand All @@ -28,4 +15,4 @@ fi

: > "$ISO"
# shellcheck disable=SC2086
cat $INSTALLER_TAR | docker run -i --platform "linux/${ARCH}" --rm -e DEBUG="$DEBUG" -e VOLUME_LABEL=EVEISO -v "$ISO:/output.iso" "$MKIMAGE_TAG" $3
cat $INSTALLER_TAR | docker run -i --rm -e DEBUG="$DEBUG" -e VOLUME_LABEL=EVEISO -v "$ISO:/output.iso" "$MKIMAGE_TAG" $3

0 comments on commit 24bf45b

Please sign in to comment.