forked from metal3-io/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare-ipxe.sh
More file actions
executable file
·28 lines (24 loc) · 1.04 KB
/
prepare-ipxe.sh
File metadata and controls
executable file
·28 lines (24 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/bash
set -euxo pipefail
# The minimal base image only has microdnf, install dnf first
# dnf-plugins-core provides config-manager
microdnf install -y dnf dnf-plugins-core
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf && \
echo "tsflags=nodocs" >> /etc/dnf/dnf.conf && \
echo "keepcache=1" >> /etc/dnf/dnf.conf && \
dnf install -y epel-release && \
dnf config-manager --set-disabled epel && \
dnf install -y git-core make perl xz-devel
# Install appropriate gcc binaries based on build architecture
if [[ "$TARGETARCH" == "amd64" ]]; then
# On x86_64, we need native gcc for x86 builds and cross-compiler for arm64
dnf install -y gcc && \
dnf install --enablerepo=epel -y gcc-aarch64-linux-gnu gcc-c++-aarch64-linux-gnu
elif [[ "$TARGETARCH" == "arm64" ]]; then
# On arm64, we need native gcc for arm64 builds and cross-compiler for x86_64
dnf install -y gcc && \
dnf install --enablerepo=epel -y gcc-x86_64-linux-gnu gcc-c++-x86_64-linux-gnu
else
echo "ERROR: Unsupported build architecture: $TARGETARCH"
exit 1
fi