Commit 9eb1d295 authored by Martin Roukala's avatar Martin Roukala
Browse files

initscript: improve the reliability of the script by setting -eux

The 'e' flag will abort on any uncaught error
The 'u' flag will abort on un-initialized variables
The 'x' flag will print every command that is executed
parent e5df6046
#!/bin/busybox sh
set -eux
MODULES_PATH=/usr_mods
CONTAINER_MOUNTPOINT=/container
CONTAINER_ROOTFS="$CONTAINER_MOUNTPOINT/rootfs"
......@@ -146,6 +148,9 @@ function start_container {
podman run --privileged --network=host --runtime /bin/crun-no-pivot $@
}
# Do not print all the early commands
set +x
# Initial setup
setup_busybox
#setup_mounts # To be continued to so we could boot without any go commands
......@@ -155,6 +160,9 @@ ARG_MODULES=""
ARG_CONTAINER=""
parse_cmdline
# Now that the early boot is over, let's log every command executed
set -x
setup_container_runtime
# Start the container
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment