Skip to content

Commit

Permalink
download virtiofsd-rs binary instead of building
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Sep 24, 2024
1 parent 2d7123e commit 073e33a
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
CHV_VERSION="v39.0"
CHV_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/${CHV_VERSION}/cloud-hypervisor"
RUSTUP_URL="https://sh.rustup.rs"
VIRTIOFSD_REPO="https://gitlab.com/muhamad.azmy/virtiofsd.git"
VIRTIOFSD_REPO="https://gitlab.com/muhamad.azmy/virtiofsd/-/jobs/6547244336/artifacts/download?file_type=archive"
RFS_VERSION="v1.1.1"
RFS_URL="https://github.com/threefoldtech/rfs/releases/download/${RFS_VERSION}/rfs"

Expand All @@ -14,24 +14,17 @@ install_chv() {
chmod +x /usr/local/bin/cloud-hypervisor
}

install_rust() {
echo "Installing rust ..."
curl --proto '=https' --tlsv1.2 -sSf ${RUSTUP_URL} | sh -s -- -y
. "$HOME/.cargo/env"
}

install_virtiofsd() {
echo "Installing virtiofsd ..."
[ ! -d 'virtiofsd' ] && git clone ${VIRTIOFSD_REPO}
pushd virtiofsd

# specially needed for virtiofsd bin
apt -y update
apt -y install libseccomp-dev libcap-ng-dev

cargo build --release
mv ./target/release/virtiofsd /usr/local/bin/virtiofsd
popd
curl -L -k -o "/tmp/virtiofsd-rs.zip" ${VIRTIOFSD_REPO}
unzip -p /tmp/virtiofsd-rs.zip > /bin/virtiofsd-rs
chmod +x /bin/virtiofsd-rs
}

install_rfs() {
Expand All @@ -58,10 +51,6 @@ main() {

# install virtiofsd
if ! command -v virtiofsd &>/dev/null; then
# install rustup and cargo
if ! command -v cargo &>/dev/null; then
install_rust
fi

install_virtiofsd
fi
Expand Down

0 comments on commit 073e33a

Please sign in to comment.