add create-libguestfs-module.sh

This commit is contained in:
Max Erenberg 2022-06-25 12:51:49 -04:00
parent d7cc9610f3
commit 1f2428f804
4 changed files with 18 additions and 6 deletions

View File

@ -17,6 +17,7 @@ guestfish:
deps:
scripts/download-deps.sh
scripts/create-libguestfs-module.sh
guestfish-deps:
scripts/download-guestfish-deps.sh

View File

@ -5,7 +5,8 @@ cloudbuild downloads, modifies and uploads VM templates for the CSC cloud
## Installing dependencies
If you have root access, run
```sh
apt install golang-guestfs-dev
sudo apt install golang-guestfs-dev
scripts/create-libguestfs-module.sh
```
Otherwise, run
@ -20,7 +21,7 @@ for guestfs.
If you have root access, run
```sh
apt install libguestfs-tools
sudo apt install libguestfs-tools
```
Otherwise, run

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -ex
DEPS_DIR=
if ! [ -d /usr/share/gocode/src/libguestfs.org/guestfs ]; then
DEPS_DIR=guestfs/deps
fi
mkdir -p guestfs
cp $DEPS_DIR/usr/share/gocode/src/libguestfs.org/guestfs/guestfs.go guestfs/
cp $DEPS_DIR/usr/include/guestfs.h guestfs/
cd guestfs
rm -f go.mod
go mod init guestfs

View File

@ -62,7 +62,3 @@ for dep in "${dependencies[@]}"; do
done
set -x
rm -f *.deb
cp deps/usr/share/gocode/src/libguestfs.org/guestfs/guestfs.go .
cp deps/usr/include/guestfs.h .
go mod init guestfs