log: Allow runtime selection of 'debug' log level
[petitboot] / utils / pb-sysinfo
index bd2f0fedc601a8a95d75431266359ba54f6c4d77..001535a46fac14934e7fc5be2a4ccf86317de9f8 100755 (executable)
@@ -7,4 +7,10 @@ case "$1" in
 '--id')
        tr -d '\0' < /proc/device-tree/system-id
        ;;
+'--debug-enabled')
+       exec >/dev/null 2>&1
+       nvram --print-config=petitboot,debug? | grep -q true && exit 0
+       grep -Fq petitboot.debug /proc/cmdline && exit 0
+       exit 1
+       ;;
 esac