Change entrypoint.sh to account for device changes
KVM device is provided by plugin framework.
TUN device is not present due to running non-privileged.
@@ -8,15 +8,23 @@ _term() {
trap _term SIGTERM SIGINT SIGQUIT
-# HACK
-# Try to create /dev/kvm if not present
-if [ ! -e /dev/kvm ]; then
- mknod /dev/kvm c 10 $(grep '\<kvm\>' /proc/misc | cut -f 1 -d' ')
-fi
-
+# FIXME: The plugin framework doesn't appear to (currently) have a means
+# to specify device ownership. This needs to be re-visited if that changes
chown :qemu /dev/kvm
chmod 660 /dev/kvm
+# HACK
+# /dev/net and associated devices are not present in
+# non privileged containers
+#
+# FIXME: this should probably be incorporated into the plugin framework,
+# but that might be part of a bigger architectural change.
+#
+if [ ! -e /dev/net/tun ]; then
+ mkdir -p /dev/net
+ mknod /dev/net/tun c 10 $(grep '\<tun\>' /proc/misc | cut -f 1 -d' ')
+fi
+
# Cockpit/OCP hack to all shoing the vm terminal
mv /usr/bin/sh /usr/bin/sh.orig
mv /sh.sh /usr/bin/sh
