Skip to content

Commit 995a693

Browse files
committed
config-gui.sh: permit io386 platform locking to be dynamically disabled at runtime
ash_functions: make sure /tmp/config is sourced before going to recovery shell TODO: revisit https://source.puri.sm/firmware/pureboot/-/blob/Release-27/initrd/bin/config-gui.sh#L33 to have proper config store later on
1 parent 39bb6ea commit 995a693

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

initrd/bin/config-gui.sh

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ TRACE "Under /bin/config-gui.sh"
1010
param=$1
1111

1212
while true; do
13+
dynamic_config_options=(
14+
'b' ' Change the /boot device'
15+
's' ' Save the current configuration to the running BIOS' \
16+
'r' ' Clear GPG key(s) and reset all user settings' \
17+
)
18+
if [ "$CONFIG_FINALIZE_PLATFORM_LOCKING_PRESKYLAKE" = "y" ];then
19+
dynamic_config_options+=(
20+
't' ' Deactivate Platform Locking to permit OS write access to firmware'
21+
)
22+
fi
23+
dynamic_config_options+=(
24+
'x' ' Return to Main Menu'
25+
)
26+
1327
if [ ! -z "$param" ]; then
1428
# use first char from parameter
1529
menu_choice=${param::1}
@@ -18,16 +32,19 @@ while true; do
1832
unset menu_choice
1933
whiptail $BG_COLOR_MAIN_MENU --title "Config Management Menu" \
2034
--menu "This menu lets you change settings for the current BIOS session.\n\nAll changes will revert after a reboot,\n\nunless you also save them to the running BIOS." 0 80 10 \
21-
'b' ' Change the /boot device' \
22-
's' ' Save the current configuration to the running BIOS' \
23-
'r' ' Clear GPG key(s) and reset all user settings' \
24-
'x' ' Return to Main Menu' \
35+
"${dynamic_config_options[@]}" \
2536
2>/tmp/whiptail || recovery "GUI menu failed"
2637

2738
menu_choice=$(cat /tmp/whiptail)
2839
fi
2940

3041
case "$menu_choice" in
42+
"t" )
43+
unset CONFIG_FINALIZE_PLATFORM_LOCKING_PRESKYLAKE
44+
replace_config /etc/config.user "CONFIG_FINALIZE_PLATFORM_LOCKING_PRESKYLAKE" "n"
45+
combine_configs
46+
. /tmp/config
47+
;;
3148
"x" )
3249
exit 0
3350
;;

initrd/etc/ash_functions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ recovery() {
5757

5858
# ensure /tmp/config exists for recovery scripts that depend on it
5959
touch /tmp/config
60+
. /tmp/config
6061

6162
if [ "$CONFIG_TPM" = "y" ]; then
6263
tpmr extend -ix 4 -ic recovery

0 commit comments

Comments
 (0)