From 127ae5e216c1c9c164db2b658eff7398ec7d9197 Mon Sep 17 00:00:00 2001 From: lanzeliu Date: Sun, 6 Oct 2024 13:40:33 -0700 Subject: [PATCH 1/2] Add '-a' option to build-mic-container.sh for arch selection. --- .../container/build-mic-container.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/toolkit/tools/imagecustomizer/container/build-mic-container.sh b/toolkit/tools/imagecustomizer/container/build-mic-container.sh index 52155a00e52..78a43e3c236 100755 --- a/toolkit/tools/imagecustomizer/container/build-mic-container.sh +++ b/toolkit/tools/imagecustomizer/container/build-mic-container.sh @@ -14,18 +14,30 @@ function showUsage() { echo "usage:" echo echo "build-mic-container.sh \\" - echo " -t " + echo " -t \\" + echo " [-a ]" + echo + echo " Architecture can be 'amd64' or 'arm64'. Default is 'amd64'." echo } -while getopts ":r:n:t:" OPTIONS; do +while getopts ":a:t:" OPTIONS; do case "${OPTIONS}" in t ) containerTag=$OPTARG ;; + a ) ARCH=$OPTARG ;; + \? ) echo "Invalid option: -$OPTARG" >&2; showUsage; exit 1 ;; + : ) echo "Option -$OPTARG requires an argument." >&2; showUsage; exit 1 ;; esac done if [[ -z $containerTag ]]; then - echo "missing required argument '-t containerTag'" + echo "missing required argument '-t '" + showUsage + exit 1 +fi + +if [[ "$ARCH" != "amd64" && "$ARCH" != "arm64" ]]; then + echo "Invalid architecture: $ARCH" showUsage exit 1 fi From dc00075c9d83294407347ff722b147946aa6b75f Mon Sep 17 00:00:00 2001 From: lanzeliu Date: Wed, 20 Nov 2024 14:28:12 -0800 Subject: [PATCH 2/2] Remove legacy grub-pc packages. --- .../tools/imagecustomizer/container/Dockerfile.mic-container | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/tools/imagecustomizer/container/Dockerfile.mic-container b/toolkit/tools/imagecustomizer/container/Dockerfile.mic-container index 6be89969c1e..4c76b0abefa 100644 --- a/toolkit/tools/imagecustomizer/container/Dockerfile.mic-container +++ b/toolkit/tools/imagecustomizer/container/Dockerfile.mic-container @@ -2,6 +2,6 @@ FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 RUN tdnf update -y && \ tdnf install -y qemu-img rpm coreutils util-linux systemd openssl \ sed createrepo_c squashfs-tools cdrkit parted e2fsprogs dosfstools \ - xfsprogs zstd veritysetup grub2 grub2-pc + xfsprogs zstd veritysetup grub2 COPY . /