aboutsummaryrefslogtreecommitdiffstats
path: root/build/bin
diff options
context:
space:
mode:
Diffstat (limited to 'build/bin')
-rwxr-xr-xbuild/bin/entrypoint27
-rwxr-xr-xbuild/bin/user_setup13
2 files changed, 40 insertions, 0 deletions
diff --git a/build/bin/entrypoint b/build/bin/entrypoint
new file mode 100755
index 0000000..af0d88a
--- /dev/null
+++ b/build/bin/entrypoint
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+
+
+cmd=${1:-""}
+
+case ${cmd} in
+ "cni")
+ CNI_BIN_DIR="/host/opt/cni/bin"
+ OVN4NFV_CONF_DIR="/host/etc/openvswitch"
+ OVN4NFV_BIN_FILE="/usr/local/bin/ovn4nfvk8s-cni"
+ OVN4NFV_CONF_FILE="/tmp/ovn4nfv-conf/ovn4nfv_k8s.conf"
+ cp -f $OVN4NFV_BIN_FILE $CNI_BIN_DIR
+ cp -f $OVN4NFV_CONF_FILE $OVN4NFV_CONF_DIR
+ # Sleep forever.
+ sleep infinity
+ ;;
+
+ "operator")
+ shift
+ exec ${OPERATOR} $@
+ ;;
+
+ *)
+ echo "invalid command ${cmd}"
+
+esac
+
diff --git a/build/bin/user_setup b/build/bin/user_setup
new file mode 100755
index 0000000..1e36064
--- /dev/null
+++ b/build/bin/user_setup
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -x
+
+# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
+mkdir -p ${HOME}
+chown ${USER_UID}:0 ${HOME}
+chmod ug+rwx ${HOME}
+
+# runtime user will need to be able to self-insert in /etc/passwd
+chmod g+rw /etc/passwd
+
+# no need for this script to remain in the image after running
+rm $0