From 5b4eebd7d53463d3060a32145e921afd29b1ba6e Mon Sep 17 00:00:00 2001 From: Michel Stempin Date: Fri, 23 Oct 2020 08:46:33 +0200 Subject: [PATCH] add swupdate Signed-off-by: Michel Stempin --- .../funkey/rootfs-overlay/etc/hwrevision | 1 + .../funkey/rootfs-overlay/etc/sw-versions | 1 + FunKey/board/funkey/sw-description | 14 ++ Makefile | 12 ++ .../funkey/rootfs-overlay/etc/hwrevision | 1 + .../funkey/rootfs-overlay/etc/sw-versions | 1 + Recovery/board/funkey/swupdate.config | 125 ++++++++++++++++++ Recovery/configs/recovery_defconfig | 8 ++ 8 files changed, 163 insertions(+) create mode 100644 FunKey/board/funkey/rootfs-overlay/etc/hwrevision create mode 100644 FunKey/board/funkey/rootfs-overlay/etc/sw-versions create mode 100644 FunKey/board/funkey/sw-description create mode 100644 Recovery/board/funkey/rootfs-overlay/etc/hwrevision create mode 100644 Recovery/board/funkey/rootfs-overlay/etc/sw-versions create mode 100644 Recovery/board/funkey/swupdate.config diff --git a/FunKey/board/funkey/rootfs-overlay/etc/hwrevision b/FunKey/board/funkey/rootfs-overlay/etc/hwrevision new file mode 100644 index 0000000..8fcabb5 --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/etc/hwrevision @@ -0,0 +1 @@ +FunKey_S Rev.A diff --git a/FunKey/board/funkey/rootfs-overlay/etc/sw-versions b/FunKey/board/funkey/rootfs-overlay/etc/sw-versions new file mode 100644 index 0000000..a2f5d7d --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/etc/sw-versions @@ -0,0 +1 @@ +rootfs 0.6 diff --git a/FunKey/board/funkey/sw-description b/FunKey/board/funkey/sw-description new file mode 100644 index 0000000..8f72206 --- /dev/null +++ b/FunKey/board/funkey/sw-description @@ -0,0 +1,14 @@ +software = +{ + version = "0.6"; + + hardware-compatibility = [ "#RE:^Rev\.[A-E]$" ]; + + images: ( + { + filename = "rootfs.ext2.tar.gz"; + device = "/dev/mmcblk0p2"; + compression = "zlib"; + } + ); +} diff --git a/Makefile b/Makefile index 4eb502f..365ec0f 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,18 @@ image: @./Recovery/output/host/bin/genimage --loglevel 0 --inputpath . @rm -rf root tmp +update: fun + @$(call MESSAGE,"Creating update file") + @rm -rf tmp + @mkdir -p tmp + @cp FunKey/board/funkey/sw-description tmp/ + @tar -C FunKey/output/images -zcf tmp/rootfs.ext2.tar.gz rootfs.ext2 + @cd tmp && \ + echo sw-description rootfs.ext2.tar.gz | \ + tr " " "\n" | \ + cpio -o -H crc --quiet > ../images/FunKey-$(shell cat FunKey/board/funkey/rootfs-overlay/etc/sw-versions | cut -f 2).swu + @rm -rf tmp + defconfig: @$(call MESSAGE,"Updating default configs") @$(call MESSAGE,"Updating default configs in Recovery") diff --git a/Recovery/board/funkey/rootfs-overlay/etc/hwrevision b/Recovery/board/funkey/rootfs-overlay/etc/hwrevision new file mode 100644 index 0000000..8fcabb5 --- /dev/null +++ b/Recovery/board/funkey/rootfs-overlay/etc/hwrevision @@ -0,0 +1 @@ +FunKey_S Rev.A diff --git a/Recovery/board/funkey/rootfs-overlay/etc/sw-versions b/Recovery/board/funkey/rootfs-overlay/etc/sw-versions new file mode 100644 index 0000000..a2f5d7d --- /dev/null +++ b/Recovery/board/funkey/rootfs-overlay/etc/sw-versions @@ -0,0 +1 @@ +rootfs 0.6 diff --git a/Recovery/board/funkey/swupdate.config b/Recovery/board/funkey/swupdate.config new file mode 100644 index 0000000..1ee73c6 --- /dev/null +++ b/Recovery/board/funkey/swupdate.config @@ -0,0 +1,125 @@ +# +# Automatically generated file; DO NOT EDIT. +# Swupdate Configuration +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Swupdate Settings +# + +# +# General Configuration +# +# CONFIG_CURL is not set +# CONFIG_CURL_SSL is not set +# CONFIG_SYSTEMD is not set +CONFIG_SCRIPTS=y +CONFIG_HW_COMPATIBILITY=y +CONFIG_HW_COMPATIBILITY_FILE="/etc/hwrevision" +CONFIG_SW_VERSIONS_FILE="/etc/sw-versions" + +# +# Socket Paths +# +CONFIG_SOCKET_CTRL_PATH="/tmp/sockinstctrl" +CONFIG_SOCKET_PROGRESS_PATH="/tmp/swupdateprog" +CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY="/tmp/" + +# +# MTD support needs libmtd +# + +# +# Lua support needs a Lua interpreter +# +# CONFIG_FEATURE_SYSLOG is not set + +# +# Build Options +# +CONFIG_CROSS_COMPILE="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_WERROR is not set +# CONFIG_NOCLEANUP is not set + +# +# EFI Boot Guard needs libebgenv and libz +# +CONFIG_UBOOT=y +# CONFIG_BOOTLOADER_NONE is not set +# CONFIG_BOOTLOADER_GRUB is not set +CONFIG_UBOOT_FWENV="/etc/fw_env.config" +# CONFIG_UBOOT_NEWAPI is not set +CONFIG_SSL_IMPL_NONE=y + +# +# Image downloading support needs libcurl +# + +# +# Hash checking needs an SSL implementation +# + +# +# Image signature verification needs an SSL implementation +# + +# +# Image encryption needs an SSL implementation +# +# CONFIG_SURICATTA is not set +# CONFIG_WEBSERVER is not set +CONFIG_GUNZIP=y + +# +# Parser Features +# +CONFIG_LIBCONFIG=y +CONFIG_PARSERROOT="" + +# +# JSON config parser support needs json-c +# +# CONFIG_SETSWDESCRIPTION is not set + +# +# Image Handlers +# + +# +# ubivol support needs libubi +# +CONFIG_RAW=y +CONFIG_RDIFFHANDLER=y +CONFIG_SHELLSCRIPTHANDLER=y +CONFIG_ARCHIVE=y + +# +# remote handler needs zeromq +# + +# +# swuforward handler needs json-c and curl +# + +# +# SWU forwarder requires libcurl +# + +# +# swuforward handler needs json-c and curl +# +CONFIG_BOOTLOADERHANDLER=y + +# +# Microcontroller handler depends on libgpiod +# diff --git a/Recovery/configs/recovery_defconfig b/Recovery/configs/recovery_defconfig index d1573ae..5421ed2 100644 --- a/Recovery/configs/recovery_defconfig +++ b/Recovery/configs/recovery_defconfig @@ -40,10 +40,18 @@ BR2_PACKAGE_PARTED=y BR2_PACKAGE_SYSSTAT=y BR2_PACKAGE_UBOOT_TOOLS=y BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y +BR2_PACKAGE_LIBARCHIVE=y +BR2_PACKAGE_LIBARCHIVE_BSDTAR=y +BR2_PACKAGE_LIBARCHIVE_BSDCPIO=y +BR2_PACKAGE_LIBARCHIVE_BSDCAT=y BR2_PACKAGE_LIBNL=y +BR2_PACKAGE_LIBRSYNC=y BR2_PACKAGE_DHCPCD=y BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_PROCPS_NG=y +BR2_PACKAGE_SWUPDATE=y +BR2_PACKAGE_SWUPDATE_CONFIG="$(BR2_EXTERNAL_RECOVERY_PATH)/board/funkey/swupdate.config" +# BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE is not set BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_NANO=y BR2_TARGET_ROOTFS_EXT2=y