# SPDX-FileCopyrightText: 2016 Christian Storm <christian.storm@tngtech.com>
#
# SPDX-License-Identifier: GPL-2.0-only

menuconfig SURICATTA
	bool "Suricatta"
	depends on HAVE_LIBCURL
	select CHANNEL_CURL
	help
	  Suricatta is a daemon mode of SWUpdate.

	  Suricatta regularly polls a remote server for updates,
	  downloads, and installs them. Thereafter, it reboots the
	  system and reports the update status to the server, based
	  on an update state variable currently stored in bootloader’s
	  environment ensuring persistent storage across reboots. Some
	  U-Boot script logics or U-Boot’s bootcount feature may be
	  utilized to alter this update state variable, e.g., by
	  setting it to reflect failure in case booting the newly
	  flashed root file system has failed and a switchback had to
	  be performed.

if SURICATTA

menu "Features"

config SURICATTA_SSL
	bool "SSL support"
	default n
	select CHANNEL_CURL_SSL
	help
	  Enable SSL and checksum verification support in suricatta.

endmenu

menu "Server"

config SURICATTA_HAWKBIT
	bool "hawkBit support"
	default y
	help
	  Support for hawkBit server.
	  https://projects.eclipse.org/projects/iot.hawkbit

config SURICATTA_LUA
	bool "Suricatta Lua module"
	depends on HAVE_LUA
	select CHANNEL_CURL
	select LUA
	help
	  Support for Suricatta modules in Lua.

	  The JSON support for Suricatta Lua modules
	  provides JSON as Lua Tables to the Lua realm and
	  enables channel result parsing to JSON per default.
	  To enable, select 'libjson' in 'Parser Features'.

config SURICATTA_WFX
	bool "wfx support"
	depends on SURICATTA_LUA
	select EMBEDDED_SURICATTA_LUA
	help
	  Support for wfx server.
	  https://www.github.com/siemens/wfx

config EMBEDDED_SURICATTA_LUA
	bool "Embed Suricatta Lua module in SWUpdate binary"
	depends on SURICATTA_LUA
	help
	  Embed the Suricatta Lua module source code file into
	  the SWUpdate binary.

	  If enabled, a swupdate_suricatta.lua will *not*
	  be loaded from disk at SWUpdate startup.

	  Note: Exactly one Lua source code file is embedded
	  into the binary, i.e., possible dependencies either
	  have to be deployed on the target system or put into
	  the one embedded Lua source code file.

config EMBEDDED_SURICATTA_LUA_SOURCE
	string "Suricatta Lua module file"
	depends on EMBEDDED_SURICATTA_LUA
	default "swupdate_suricatta.lua" if !SURICATTA_WFX
	default "suricatta/server_wfx.lua" if SURICATTA_WFX
	help
	  Path to the Suricatta Lua module source code file to
	  be embedded into the SWUpdate binary.

config SURICATTA_GENERAL
	bool "General HTTP support"
	help
	  Support for Simple HTTP coded server
	  The server uses HTTP return codes to detect if an update
	  is available. See documentation for more details.

endmenu

comment "Suricatta Lua module support needs Lua"
	depends on !HAVE_LUA

comment "Suricatta daemon support needs libcurl"
	depends on !HAVE_LIBCURL

endif
