Skip to content

Commit da240c7

Browse files
committed
init: make sure config.user is overriden only with new values so that going DEBUG/undoing can work reproducibly
Signed-off-by: Thierry Laurion <[email protected]>
1 parent 2f3754d commit da240c7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

initrd/init

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,14 @@ fi
140140
#
141141
# Values in user config have higher priority during combining thus effectively
142142
# changing the value for the rest of the scripts which source /tmp/config.
143-
echo "export CONFIG_TPM=\"$CONFIG_TPM\"" >> /etc/config.user
144-
echo "export CONFIG_TPM2_TOOLS=\"$CONFIG_TPM2_TOOLS\"" >> /etc/config.user
143+
144+
#Only set CONFIG_TPM and CONFIG_TPM2_TOOLS if they are not already set in /etc/config.user
145+
if ! grep -q 'CONFIG_TPM=' /etc/config.user; then
146+
echo "export CONFIG_TPM=\"$CONFIG_TPM\"" >> /etc/config.user
147+
fi
148+
if ! grep -q 'CONFIG_TPM2_TOOLS=' /etc/config.user; then
149+
echo "export CONFIG_TPM2_TOOLS=\"$CONFIG_TPM2_TOOLS\"" >> /etc/config.user
150+
fi
145151

146152
# CONFIG_BASIC was previously CONFIG_PUREBOOT_BASIC in the PureBoot distribution.
147153
# Substitute it in config.user if present for backward compatibility.

0 commit comments

Comments
 (0)