This is a collection of scripts to build a image for EIAS, using virt-builder.
Under debian:
apt install libguestfs-tools
Components of the image can be added/removed by altering the build-image
script.
Create a file twpreload/twadmins
, with colon-seperated usernames and passwords, e.g:
cat <<EOF > twpreload/twadmins
user1:pwd1
user2:pwd2
EOF
Create a twpreload/twhosts
file with a white list of hosts to connect to, separated by carrage return.
The phonehome service will ssh to a given host, configured in twpreload/phonehome/config
, for example:
Host phonehome
User phonehome
HostName phonehome.server.net
An SSH key will be added to the image, and it's public half available at twpreload/phonehome/id_rsa.pub
.
As well as separate partitions, kiwix content files can be baked into the image.
Download .zim files from here and add it to the
twpreload/kiwix/
directory. .zim files can also be added into a twextra
or twdata
partitions, in a kiwix
directory.
You need to get a tarball of tutorweb content, and place it at twpreload/tutorweb.tar.bz2
.
On first start you also need to run sync_all to populate the database, e.g:
sudo -ututorweb /srv/tutorweb.buildout/bin/sync_all
Run ./build-image
. A eias.amd64.img
will be created which can be flashed onto a bootable device.
Run sudo ./qemu-setup
to create network bridge device, then run ./qemu
to boot an image in a virtual machine. Run ./qemu-host
to start a LiveCD
connected to the server.
You can SSH to the VM with ssh -p10022 tutor@localhost
.
As well as the main filesystem, the image will also mount any partitions found with the following label:
twextra
: Read-only partition for e.g. kiwix contenttwdata
: Read-write partition where tutor-web results are stored.
After writing the image to a disk, you can use unpartitioned space by creating an extra partition and using one of the labels above when formatting, e.g:
mkfs.ext4 -L twdata /dev/sdc2