init: warn user that if CONFIG_QUIET_MODE was enabled in board config at build time but disabled through Configuration Settings applied override, early measurement output got suppressed

Also tell user that those early suppressed messages can be seen under /tmp/debug.txt

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2024-12-20 14:51:19 -05:00
parent 07218df9cb
commit e1a263ce3b
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461
2 changed files with 12 additions and 3 deletions

View File

@ -6,8 +6,8 @@ set -e -o pipefail
# This extraction and measurement cannot be suppressed by quiet mode, since
# config.user is not yet loaded at this point.
# To suppress this output, set CONFIG_QUIET_MODE=y needs be be set in /etc/config
# which is defined at buiid time under board configuration file to be part of initrd.cpio
# This script is called from initrd/init
# which is defined at build time under board configuration file to be part of initrd.cpio
# This script is called from initrd/init so really early in the boot process to put files in place in initramfs
TRACE_FUNC

View File

@ -109,12 +109,21 @@ fi
if [ "$CONFIG_QUIET_MODE" = "y" ]; then
# check origin of quiet mode setting =y: if it is under /etc/config.user then early cbfs-init outputs are not suppressible
# if it is under /etc/config then early cbfs-init outputs are suppressible
if ! grep -q 'CONFIG_QUIET_MODE="y"' /etc/config.user 2>/dev/null; then
if grep -q 'CONFIG_QUIET_MODE="y"' /etc/config 2>/dev/null; then
echo "Quiet mode enabled: refer to '/tmp/debug.log' for boot measurements traces" >/dev/tty0
else
echo "Runtime Quiet mode: refer to '/tmp/debug.log' for additional boot measurements traces past this point" >/dev/tty0
echo "To suppress earlier boot measurements traces, enable CONFIG_QUIET_MODE=y in your board configuration at build time." >/dev/tty0
fi
# If CONFIG_QUIET_MODE enabled in board config but disabled from Config->Configuration Settings
# warn that early boot measurements output was suppressed prior of this point
elif [ "$CONFIG_QUIET_MODE" = "n" ]; then
# if CONFIG_QUIET_MODE=n in /etc/config.user but CONFIG_QUIET_MODE=y in /etc/config then early cbfs-init outputs are suppressed
# both needs to be checked to determine if early boot measurements traces were suppressed
if grep -q 'CONFIG_QUIET_MODE="y"' /etc/config 2>/dev/null && grep -q 'CONFIG_QUIET_MODE="n"' /etc/config.user 2>/dev/null; then
echo "Early boot measurements traces were suppressed per CONFIG_QUIET_MODE=y in your board configuration at build time (/etc/config)" >/dev/tty0
echo "Runtime Quiet mode disabled: refer to '/tmp/debug.log' for cbfs-init related traces prior of this point" >/dev/tty0
fi
fi
TRACE_FUNC