Skip to content

Commit 3b22ae6

Browse files
authored
Merge pull request #1772 from tlaurion/fix_config_user_reproducibility_for_undoing
init: make sure config.user is overriden only with new values so that going DEBUG/undoing can work reproducibly
2 parents 38dd863 + f068673 commit 3b22ae6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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)