Skip to content

Commit

Permalink
Integrate k3s-root for RISC-V, use patched runc for RISC-V, move buil…
Browse files Browse the repository at this point in the history
…d script in scripts folder

Signed-off-by: Antony Chazapis <[email protected]>
  • Loading branch information
chazapis committed Jun 16, 2023
1 parent a8d44c2 commit 5efec36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ if [ ${ARCH} = riscv64 ]; then
# These are needed as we are cross-compiling
export CC=riscv64-linux-gnu-gcc
export PKG_CONFIG_PATH=/usr/lib/riscv64-linux-gnu/pkgconfig/
export CGO_ENABLED=1
fi

rm -f \
Expand Down
9 changes: 5 additions & 4 deletions cross-compile-riscv.sh → scripts/cross-compile-riscv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# To run mount a clean checkout of the code inside the container and run the script:
#
# docker run --rm --mount type=bind,source=${PWD},target=/k3s ubuntu:22.04 /bin/bash -c /k3s/cross-compile-riscv.sh
# docker run --rm --mount type=bind,source=${PWD},target=/k3s ubuntu:22.04 /bin/bash -c /k3s/scripts/cross-compile-riscv.sh

dpkg --add-architecture riscv64
apt-get update
Expand All @@ -15,9 +15,10 @@ if [ ${HOST_ARCH} = aarch64 ]; then
HOST_ARCH=arm64
fi

wget -P /tmp "https://dl.google.com/go/go1.20.5.linux-${HOST_ARCH}.tar.gz"
(cd /; tar -C /usr/local -xzf "/tmp/go1.20.5.linux-${HOST_ARCH}.tar.gz")
rm -rf /tmp/go1.20.5.linux-${HOST_ARCH}.tar.gz
GOLANG_VERSION=1.20.4
wget -P /tmp "https://dl.google.com/go/go${GOLANG_VERSION}.linux-${HOST_ARCH}.tar.gz"
(cd /; tar -C /usr/local -xzf "/tmp/go${GOLANG_VERSION}.linux-${HOST_ARCH}.tar.gz")
rm -rf /tmp/go${GOLANG_VERSION}.linux-${HOST_ARCH}.tar.gz
mkdir -p /go/src /go/bin

export GOPATH=/go
Expand Down
8 changes: 4 additions & 4 deletions scripts/download
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ rm -rf ${CONTAINERD_DIR}
mkdir -p ${CHARTS_DIR}
mkdir -p ${DATA_DIR}

curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf -

if [ ${ARCH} = riscv64 ]; then
curl --compressed -sfL https://github.com/CARV-ICS-FORTH/k3s-root/releases/download/20230614/k3s-root-riscv64.tar | tar xf -
git clone --single-branch --branch=release-1.1-riscv64 --depth=1 https://github.com/CARV-ICS-FORTH/runc ${RUNC_DIR}
else
curl --compressed -sfL https://github.com/k3s-io/k3s-root/releases/download/${VERSION_ROOT}/k3s-root-${ARCH}.tar | tar xf -
git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}
fi

git clone --single-branch --branch=${VERSION_RUNC} --depth=1 https://github.com/opencontainers/runc ${RUNC_DIR}

git clone --single-branch --branch=${VERSION_CONTAINERD} --depth=1 https://github.com/k3s-io/containerd ${CONTAINERD_DIR}

for CHART_FILE in $(grep -rlF HelmChart manifests/ | xargs yq eval --no-doc .spec.chart | xargs -n1 basename); do
Expand Down
2 changes: 1 addition & 1 deletion scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if [ -z "$VERSION_KUBE_ROUTER" ]; then
VERSION_KUBE_ROUTER="v0.0.0"
fi

VERSION_ROOT="v0.12.2"
VERSION_ROOT="v0.13.0"

if [[ -n "$GIT_TAG" ]]; then
if [[ ! "$GIT_TAG" =~ ^"$VERSION_K8S"[+-] ]]; then
Expand Down

0 comments on commit 5efec36

Please sign in to comment.