heads/boards/librem_mini_v2/initrd/bin/board-init.sh
Jonathon Hall e9a5b27e6c
librem_mini,librem_mini_v2: Don't use three values for auto poweron
PureBoot doesn't have any other three-valued settings and this doesn't
present very well in the config UI.

Instead make this a two-valued setting; drop the mode that forces the
EC setting to "stay off" at every boot because this is the default.

When disabling automatic power-on, disable the EC BRAM setting too.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
2023-06-21 13:26:49 -04:00

17 lines
566 B
Bash
Executable File

#!/bin/bash
set -o pipefail
. /tmp/config
# If CONFIG_AUTOMATIC_POWERON is set, always set the EC BRAM setting during
# boot. It persists as long as the RTC battery is set, but set it during every
# boot for robustness in case the battery is temporarily removed, or the user
# toggles in config-gui and then does not flash, etc.
if [ "$CONFIG_AUTOMATIC_POWERON" = "y" ]; then
set_ec_poweron.sh y
fi
# Don't disable the setting in the EC BRAM though if CONFIG_AUTOMATIC_POWERON
# is not enabled. The default is disabled anyway, and the OS could configure
# it.