snap: Build and package rust version of virtiofsd
Update the snap config file to build the rust version of `virtiofsd` for
x86_64, but build QEMU's C version for other platforms.
Fixes:
@@ -317,6 +317,41 @@ parts:
# Hack: move qemu to /
"snap/kata-containers/current/": "./"
+ virtiofsd:
+ plugin: nil
+ after: [godeps]
+ override-build: |
+ # Currently, only one platform uses the new rust virtiofsd. The
+ # others make use of QEMU's C implementation.
+ #
+ # See "tools/packaging/scripts/configure-hypervisor.sh".
+ if [ "$(uname -m)" = 'x86_64' ]
+ then
+ echo "INFO: Building rust version of virtiofsd"
+ else
+ echo "INFO: Building QEMU's C version of virtiofsd"
+ # Handled by the 'qemu' part, so nothing more to do here.
+ exit 0
+ fi
+
+ # put everything in stage
+ cd ${SNAPCRAFT_STAGE}
+
+ export PATH="$PATH:${SNAPCRAFT_STAGE}/bin"
+ export GOPATH=${SNAPCRAFT_STAGE}/gopath
+
+ kata_dir=${GOPATH}/src/github.com/${SNAPCRAFT_PROJECT_NAME}/${SNAPCRAFT_PROJECT_NAME}
+ cd "${kata_dir}"
+ # Download the rust implementation of virtiofsd
+ tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh
+ sudo install \
+ --owner='root' \
+ --group='root' \
+ --mode=0755 \
+ -D \
+ --target-directory="${SNAPCRAFT_PART_INSTALL}/usr/libexec/" \
+ virtiofsd/virtiofsd
+
cloud-hypervisor:
plugin: nil
after: [godeps]
