+usage() {
+ cat >&2 <<EOF
+pb-console [OPTIONS] -- [ARGS]
+OPTIONS
+ -d, --detach
+ Start in a detached (background) state.
+
+ -g, --getty[=PATH]
+ Start a getty (specified by PATH, otherwise $getty),
+ passing additional ARGS to the getty process
+
+ -s, --shell=PATH
+ Use PATH as the exit-to-shell shell
+
+ -u, --ui=PATH
+ Use PATH as the petitboot UI
+
+ -h, --help
+ Print a help message.
+EOF
+ exit 1
+}
+
+opts=$(getopt --options 'hdg::s:u:' \
+ --long 'help,detach,getty::,shell:,ui:' \
+ -- "$@")
+[ $? = 0 ] || exit 1
+
+eval set -- "$opts"
+
+while :