Skip to content

Commit b8dbb35

Browse files
authored
Merge pull request kata-containers#5631 from GabyCT/topic/fixvirtiofsdscript
tools: Fix indentation of build static virtiofsd script
2 parents dff7859 + 8be0817 commit b8dbb35

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh

+54-54
Original file line numberDiff line numberDiff line change
@@ -27,70 +27,70 @@ virtiofsd_zip="${virtiofsd_zip:-}"
2727
[ -d "virtiofsd" ] && rm -r virtiofsd
2828

2929
pull_virtiofsd_released_binary() {
30-
if [ "${ARCH}" != "x86_64" ]; then
31-
info "Only x86_64 binaries are distributed as part of the virtiofsd releases" && return 1
32-
fi
33-
info "Download virtiofsd version: ${virtiofsd_version}"
34-
35-
mkdir -p virtiofsd
36-
37-
pushd virtiofsd
38-
curl --fail -L ${virtiofsd_zip} -o virtiofsd.zip || return 1
39-
unzip virtiofsd.zip
40-
mv -f target/x86_64-unknown-linux-musl/release/virtiofsd virtiofsd
41-
chmod +x virtiofsd
42-
rm -rf target
43-
rm virtiofsd.zip
44-
popd
30+
if [ "${ARCH}" != "x86_64" ]; then
31+
info "Only x86_64 binaries are distributed as part of the virtiofsd releases" && return 1
32+
fi
33+
info "Download virtiofsd version: ${virtiofsd_version}"
34+
35+
mkdir -p virtiofsd
36+
37+
pushd virtiofsd
38+
curl --fail -L ${virtiofsd_zip} -o virtiofsd.zip || return 1
39+
unzip virtiofsd.zip
40+
mv -f target/x86_64-unknown-linux-musl/release/virtiofsd virtiofsd
41+
chmod +x virtiofsd
42+
rm -rf target
43+
rm virtiofsd.zip
44+
popd
4545
}
4646

4747
init_env() {
48-
source "$HOME/.cargo/env"
49-
50-
extra_rust_flags=" -C link-self-contained=yes"
51-
case ${ARCH} in
52-
"aarch64")
53-
LIBC="musl"
54-
ARCH_LIBC=""
55-
;;
56-
"ppc64le")
57-
LIBC="gnu"
58-
ARCH="powerpc64le"
59-
ARCH_LIBC=${ARCH}-linux-${LIBC}
60-
;;
61-
"s390x")
62-
LIBC="gnu"
63-
ARCH_LIBC=${ARCH}-linux-${LIBC}
64-
extra_rust_flags=""
65-
;;
66-
"x86_64")
67-
LIBC="musl"
68-
ARCH_LIBC=""
69-
;;
70-
esac
48+
source "$HOME/.cargo/env"
49+
50+
extra_rust_flags=" -C link-self-contained=yes"
51+
case ${ARCH} in
52+
"aarch64")
53+
LIBC="musl"
54+
ARCH_LIBC=""
55+
;;
56+
"ppc64le")
57+
LIBC="gnu"
58+
ARCH="powerpc64le"
59+
ARCH_LIBC=${ARCH}-linux-${LIBC}
60+
;;
61+
"s390x")
62+
LIBC="gnu"
63+
ARCH_LIBC=${ARCH}-linux-${LIBC}
64+
extra_rust_flags=""
65+
;;
66+
"x86_64")
67+
LIBC="musl"
68+
ARCH_LIBC=""
69+
;;
70+
esac
7171

7272
}
73-
73+
7474
build_virtiofsd_from_source() {
75-
echo "build viriofsd from source"
76-
init_env
75+
echo "build viriofsd from source"
76+
init_env
77+
78+
git clone --depth 1 --branch ${virtiofsd_version} ${virtiofsd_repo} virtiofsd
79+
pushd virtiofsd
7780

78-
git clone --depth 1 --branch ${virtiofsd_version} ${virtiofsd_repo} virtiofsd
79-
pushd virtiofsd
81+
export RUSTFLAGS='-C target-feature=+crt-static'${extra_rust_flags}
82+
export LIBSECCOMP_LINK_TYPE=static
83+
export LIBSECCOMP_LIB_PATH=/usr/lib/${ARCH_LIBC}
84+
export LIBCAPNG_LINK_TYPE=static
85+
export LIBCAPNG_LIB_PATH=/usr/lib/${ARCH_LIBC}
8086

81-
export RUSTFLAGS='-C target-feature=+crt-static'${extra_rust_flags}
82-
export LIBSECCOMP_LINK_TYPE=static
83-
export LIBSECCOMP_LIB_PATH=/usr/lib/${ARCH_LIBC}
84-
export LIBCAPNG_LINK_TYPE=static
85-
export LIBCAPNG_LIB_PATH=/usr/lib/${ARCH_LIBC}
86-
87-
cargo build --release --target ${ARCH}-unknown-linux-${LIBC}
87+
cargo build --release --target ${ARCH}-unknown-linux-${LIBC}
8888

89-
binary=$(find ./ -name virtiofsd)
90-
mv -f ${binary} .
91-
chmod +x virtiofsd
89+
binary=$(find ./ -name virtiofsd)
90+
mv -f ${binary} .
91+
chmod +x virtiofsd
9292

93-
popd
93+
popd
9494
}
9595

9696
pull_virtiofsd_released_binary || build_virtiofsd_from_source

0 commit comments

Comments
 (0)