mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
osbuilder: install musl for aarch64
So that it can do musl static build. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
b24f2cb969
commit
c624fa7469
23
ci/install_musl.sh
Executable file
23
ci/install_musl.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020 Ant Group
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
install_aarch64_musl() {
|
||||
local arch=$(uname -m)
|
||||
if [ "${arch}" == "aarch64" ]; then
|
||||
local musl_tar="${arch}-linux-musl-native.tgz"
|
||||
local musl_dir="${arch}-linux-musl-native"
|
||||
pushd /tmp
|
||||
curl -sLO https://musl.cc/${musl_tar}
|
||||
tar -zxf ${musl_tar}
|
||||
mkdir -p /usr/local/musl/
|
||||
cp -r ${musl_dir}/* /usr/local/musl/
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
install_aarch64_musl
|
@ -539,9 +539,11 @@ EOT
|
||||
AGENT_DEST="${AGENT_DIR}/${AGENT_BIN}"
|
||||
|
||||
if [ -z "${AGENT_SOURCE_BIN}" ] ; then
|
||||
# rust agent needs x86_64-unknown-linux-musl
|
||||
rustup show | grep x86_64-unknown-linux-musl > /dev/null || bash ${script_dir}/../../../ci/install_rust.sh
|
||||
bash ${script_dir}/../../../ci/install_musl.sh
|
||||
# rust agent needs ${arch}-unknown-linux-musl
|
||||
rustup show | grep linux-musl > /dev/null || bash ${script_dir}/../../../ci/install_rust.sh
|
||||
test -r "${HOME}/.cargo/env" && source "${HOME}/.cargo/env"
|
||||
[ "$ARCH" == "aarch64" ] && OLD_PATH=$PATH && export PATH=$PATH:/usr/local/musl/bin
|
||||
|
||||
agent_pkg="${RUST_AGENT_PKG}"
|
||||
agent_dir="${script_dir}/../../../src/agent/"
|
||||
@ -554,6 +556,7 @@ EOT
|
||||
make clean
|
||||
make LIBC=${LIBC} INIT=${AGENT_INIT}
|
||||
make install DESTDIR="${ROOTFS_DIR}" LIBC=${LIBC} INIT=${AGENT_INIT} SECCOMP=${SECCOMP}
|
||||
[ "$ARCH" == "aarch64" ] && export PATH=$OLD_PATH && rm -rf /usr/local/musl
|
||||
popd
|
||||
else
|
||||
cp ${AGENT_SOURCE_BIN} ${AGENT_DEST}
|
||||
|
Loading…
Reference in New Issue
Block a user