src/supermin: changes to how appliance is setup
Update the symlinks for `ip{,6}tables` in the supermin init. The
commands for iptables are provided through `update-alternatives`.
@@ -22,8 +22,14 @@ if [ -L "${workdir}"/src/config ]; then
mkdir -p "$(readlink "${workdir}"/src/config)"
mount -t 9p -o rw,trans=virtio,version=9p2000.L source "${workdir}"/src/config
fi
-mkdir -p "${workdir}"/cache "${workdir}/cache/container-work"
+mkdir -p "${workdir}"/cache /host/container-work
mount /dev/sdb1 "${workdir}"/cache
+# /usr/sbin/ip{,6}tables is installed as a symlink to /etc/alternatives/ip{,6}tables but
+# the /etc/alternatives symlink to /usr/sbin/ip{,6}tables-legacy is missing. This recreates
+# the missing link. Hehe.
+update-alternatives --install /etc/alternatives/iptables iptables /usr/sbin/iptables-legacy 1
+update-alternatives --install /etc/alternatives/ip6tables ip6tables /usr/sbin/ip6tables-legacy 1
+
# https://github.com/koalaman/shellcheck/wiki/SC2164
cd "${workdir}" || exit
