# SPDX-FileCopyrightText: 2017 Stefano Babic <sbabic@denx.de>
#
# SPDX-License-Identifier: GPL-2.0-only

menu "Bootloader Interfaces"

config BOOTLOADER_NONE
	bool "Environment in RAM"
	default y
	help
	  This simulates the interface to a bootloader.
	  Bootloader environment is just maintained in RAM
	  and lost when SWUpdate exits.

config BOOTLOADER_EBG
	bool "EFI Boot Guard"
	help
	  Support for EFI Boot Guard
	  https://github.com/siemens/efibootguard

config UBOOT
	bool "U-Boot"
	help
	  Support for U-Boot
	  https://www.denx.de/wiki/U-Boot

config UBOOT_FWENV
	string "U-Boot Environment Configuration file"
	depends on UBOOT
	default "/etc/fw_env.config"
	help
	  This is the file described in U-Boot documentation
	  in the tools directory. It tells where the U-Boot
	  environment is saved.

config UBOOT_DEFAULTENV
	string "U-Boot Initial Environment file"
	depends on UBOOT
	default "/etc/u-boot-initial-env"
	help
	  This is the file with the initial environment delivered
	  with the bootloader. It is used by SWUpdate if no environment
	  is found on the storage.

config BOOTLOADER_GRUB
	bool "GRUB"
	help
	  Support for GRUB
	  https://www.gnu.org/software/grub/

config GRUBENV_PATH
	string "GRUB Environment block file path"
	depends on BOOTLOADER_GRUB
	default "/boot/efi/EFI/BOOT/grub/grubenv"
	help
	  Provide path to GRUB environment block file

endmenu

choice
	prompt "Default Bootloader Interface"
	help
	  Default bootloader interface to use if not explicitly
	  overridden via configuration or command-line option
	  at run-time.

config BOOTLOADER_DEFAULT_EBG
	bool "EBG"
	depends on BOOTLOADER_EBG
	help
	  Use EFI Boot Guard as default bootloader interface.
	  
	  Note: Make sure the environment modification shared
	  library https://github.com/siemens/efibootguard (including
	  dependencies) is installed on the target system.

config BOOTLOADER_DEFAULT_UBOOT
	bool "U-Boot"
	depends on UBOOT
	help
	  Use U-Boot as default bootloader interface.
	  
	  Note: Make sure the environment modification shared
	  library https://github.com/sbabic/libubootenv (including
	  dependencies) is installed on the target system.

config BOOTLOADER_DEFAULT_GRUB
	bool "GRUB"
	depends on BOOTLOADER_GRUB
	help
	  Use GRUB as default bootloader interface.

config BOOTLOADER_DEFAULT_NONE
	bool "Environment in RAM"
	depends on BOOTLOADER_NONE
	help
	  Use Environment in RAM as default bootloader interface.

endchoice

choice
	prompt "Update Status Storage"
	help
	  Place to persistently store the update
	  status for, e.g., communicating it to SWUpdate after
	  a reboot.

config UPDATE_STATE_CHOICE_NONE
	bool "None"
	help
	  Do not store update status.

config UPDATE_STATE_CHOICE_BOOTLOADER
	bool "Bootloader"
	depends on BOOTLOADER_EBG || UBOOT || BOOTLOADER_NONE || BOOTLOADER_GRUB
	help
	  Store update status in Bootloader's environment.
	  Specify Bootloader environment variable name to store update status in.

endchoice

config UPDATE_STATE_BOOTLOADER
	string "Store Update Status in Bootloader Environment variable"
	default "ustate"
	depends on UPDATE_STATE_CHOICE_BOOTLOADER
	help
	  Store update information in Bootloader's environment.

