Use installed Tech Talk.
[libguestfs-talks.git] / 2019-fosdem / run
1 #!/bin/bash -
2 # Run the talk.
3
4 set -e
5
6 # Avoid GNOME keyring stupidity
7 export GNOME_KEYRING_CONTROL=
8 export GNOME_KEYRING_PID=
9
10 # No proxy.
11 #unset http_proxy
12 #unset https_proxy
13 #unset ftp_proxy
14
15 # Check the files are precreated.
16 if [ ! -f 1000-loop-mounting.d/fedora-29.img ]; then
17     pushd 1000-loop-mounting.d
18     virt-builder fedora-29
19     popd
20 fi
21
22 if [ ! -f 2000-xz-compressed.d/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz ]; then
23     pushd 2000-xz-compressed.d
24     wget https://download.fedoraproject.org/pub/fedora/linux/releases/29/Cloud/x86_64/images/Fedora-Cloud-Base-29-1.2.x86_64.raw.xz
25     popd
26 fi
27
28 if [ ! -f 2200-partitioning.d/boot.img ]; then
29     guestfish --ro -a 1000-loop-mounting.d/fedora-29.img -i <<EOF
30 download /dev/sda2 2200-partitioning.d/boot.img
31 download /dev/sda3 2200-partitioning.d/swap.img
32 # Save to hidden file.
33 download /dev/sda4 2200-partitioning.d/.root.img
34 EOF
35 fi
36
37 # Restore original root.img before each run.
38 if ! cmp -s 2200-partitioning.d/{.root.img,root.img}; then
39     cp 2200-partitioning.d/{.root.img,root.img}
40 fi
41
42 # Create mountpoint.
43 mkdir -p /tmp/mnt
44
45 # Check nbd module is loaded.
46 sudo modprobe nbd
47
48 # Remove any old mounts, nbdkit processes etc.
49 ./restore
50
51 # Run techtalk.
52 techtalk-pse
53 #~/d/techtalk-pse/techtalk-pse
54
55 ./restore