Move local.yaml setup to setup.sh, document software requirements

This commit is contained in:
Zach Dykstra 2020-09-11 10:18:34 -05:00
parent 29e38f0dc7
commit d84356606e
3 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,13 @@
# Requirements
The testing environment setup and runtime depends on the following tools:
* kpartx
* qemu
* yq-go
* ZFS
* kvm kernel module
# Creating a ZFSBootMenu Test Pool for QEMU # Creating a ZFSBootMenu Test Pool for QEMU
First, run (as root) `./setup.sh` to: First, run (as root) `./setup.sh` to:

View File

@ -1,14 +1,5 @@
#!/bin/bash #!/bin/bash
# Setup a local config file
if [ ! -f local.yaml ]; then
cp ../etc/zfsbootmenu/config.yaml local.yaml
yq-go w -i local.yaml Components.ImageDir "$( pwd )"
yq-go w -i local.yaml Components.Versions false
yq-go w -i local.yaml Global.ManageImages true
yq-go d -i local.yaml Global.BootMountPoint
fi
# Support x86_64 and ppc64(le) # Support x86_64 and ppc64(le)
case "$(uname -m)" in case "$(uname -m)" in
ppc64*) ppc64*)

View File

@ -48,7 +48,7 @@ xbps-install -y -S -M -r "${MNT}" --repository="${URL}" \
base-minimal dracut ncurses-base kbd iproute2 base-minimal dracut ncurses-base kbd iproute2
cp /etc/hostid "${MNT}/etc/" cp /etc/hostid "${MNT}/etc/"
cp /etc/resolv.conf "${MNT}/etc/" cp /etc/resolv.conf "${MNT}/etc/"
cp /etc/rc.conf "${MNT}/etc/" cp /etc/rc.conf "${MNT}/etc/"
mount -t proc proc "${MNT}/proc" mount -t proc proc "${MNT}/proc"
@ -65,3 +65,12 @@ zpool export ztest
losetup -d "${LOOP}" losetup -d "${LOOP}"
chown "$( stat -c %U . ):$( stat -c %G . )" zfsbootmenu-pool.img chown "$( stat -c %U . ):$( stat -c %G . )" zfsbootmenu-pool.img
# Setup a local config file
if [ ! -f local.yaml ]; then
cp ../etc/zfsbootmenu/config.yaml local.yaml
yq-go w -i local.yaml Components.ImageDir "$( pwd )"
yq-go w -i local.yaml Components.Versions false
yq-go w -i local.yaml Global.ManageImages true
yq-go d -i local.yaml Global.BootMountPoint
fi