# Shared, fail-closed mode selection. Every normal disk hook must source this.
installation_mode() {
    args=" $(cat /proc/cmdline) "
    case "$args" in *" newworld.debug=1 "*) echo debug; return ;; esac
    case "$args" in *" newworld.autoinstall=1 "*) echo install ;; *) echo stopped ;; esac
}
ensure_normal_install() {
    case "$(installation_mode)" in
        install) return ;;
        debug) exec /usr/lib/newworld-installer/debug-mode ;;
        *) mkdir -p /run/newworld-install; echo 'Automatic installation was not selected. No disk changes will be made.' >/run/newworld-install/error
           logger -t newworld 'SAFE STOP: installation was not authorized'
           while :; do sleep 60; done ;;
    esac
}
