Skip to content

Commit 7c49fde

Browse files
committed
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>
1 parent a452925 commit 7c49fde

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

initrd/bin/cbfs-init

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set -e -o pipefail
66
# This extraction and measurement cannot be suppressed by quiet mode, since
77
# config.user is not yet loaded at this point.
88
# To suppress this output, set CONFIG_QUIET_MODE=y needs be be set in /etc/config
9-
# which is defined at buiid time under board configuration file to be part of initrd.cpio
10-
# This script is called from initrd/init
9+
# which is defined at build time under board configuration file to be part of initrd.cpio
10+
# This script is called from initrd/init so really early in the boot process to put files in place in initramfs
1111

1212
TRACE_FUNC
1313

initrd/init

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,21 @@ fi
109109
if [ "$CONFIG_QUIET_MODE" = "y" ]; then
110110
# check origin of quiet mode setting =y: if it is under /etc/config.user then early cbfs-init outputs are not suppressible
111111
# if it is under /etc/config then early cbfs-init outputs are suppressible
112-
if ! grep -q 'CONFIG_QUIET_MODE="y"' /etc/config.user 2>/dev/null; then
112+
if grep -q 'CONFIG_QUIET_MODE="y"' /etc/config 2>/dev/null; then
113113
echo "Quiet mode enabled: refer to '/tmp/debug.log' for boot measurements traces" >/dev/tty0
114114
else
115115
echo "Runtime Quiet mode: refer to '/tmp/debug.log' for additional boot measurements traces past this point" >/dev/tty0
116116
echo "To suppress earlier boot measurements traces, enable CONFIG_QUIET_MODE=y in your board configuration at build time." >/dev/tty0
117117
fi
118+
# If CONFIG_QUIET_MODE enabled in board config but disabled from Config->Configuration Settings
119+
# warn that early boot measurements output was suppressed prior of this point
120+
elif [ "$CONFIG_QUIET_MODE" = "n" ]; then
121+
# if CONFIG_QUIET_MODE=n in /etc/config.user but CONFIG_QUIET_MODE=y in /etc/config then early cbfs-init outputs are suppressed
122+
# both needs to be checked to determine if early boot measurements traces were suppressed
123+
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
124+
echo "Early boot measurements traces were suppressed per CONFIG_QUIET_MODE=y in your board configuration at build time (/etc/config)" >/dev/tty0
125+
echo "Runtime Quiet mode disabled: refer to '/tmp/debug.log' for cbfs-init related traces prior of this point" >/dev/tty0
126+
fi
118127
fi
119128

120129
TRACE_FUNC

0 commit comments

Comments
 (0)