mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-13 08:08:51 +01:00
add swupdate to rootfs too
Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
parent
d7b0cdedca
commit
0f408f3b63
@ -152,13 +152,13 @@ create_swap
|
|||||||
notif "5/8 Enable swap"
|
notif "5/8 Enable swap"
|
||||||
enable_swap
|
enable_swap
|
||||||
|
|
||||||
notif "6/8 Create share partition"
|
notif "6/8 Create USB partition"
|
||||||
create_backing_store_partition
|
create_backing_store_partition
|
||||||
|
|
||||||
notif "7/8 Reload partition table"
|
notif "7/8 Reload partition table"
|
||||||
reload_partition_table
|
reload_partition_table
|
||||||
|
|
||||||
notif "8/8 Format share partition"
|
notif "8/8 Format USB partition"
|
||||||
format_backing_store_partition
|
format_backing_store_partition
|
||||||
|
|
||||||
notif "First boot setup finished!"
|
notif "First boot setup finished!"
|
||||||
|
|||||||
@ -50,12 +50,20 @@ mount_share () {
|
|||||||
# Create the directory structure if required
|
# Create the directory structure if required
|
||||||
(cd /mnt; mkdir -p "Atari lynx" "Game Boy" "Game Boy Color" "Game Boy Advance" "Game Gear" "Neo Geo Pocket" "NES" "PS1" "Sega Genesis" "Sega Master System" "SNES" "WonderSwan" "PCE-TurboGrafx")
|
(cd /mnt; mkdir -p "Atari lynx" "Game Boy" "Game Boy Color" "Game Boy Advance" "Game Gear" "Neo Geo Pocket" "NES" "PS1" "Sega Genesis" "Sega Master System" "SNES" "WonderSwan" "PCE-TurboGrafx")
|
||||||
|
|
||||||
# Check if there is an update file
|
# Check if there is a firmware update file
|
||||||
if [ -f /mnt/FunKey-*.swu ]; then
|
if [ -f /mnt/FunKey-*.fwu ]; then
|
||||||
warn "found an update file, going into recovery mode"
|
warn "found a firmware update file, going into recovery mode"
|
||||||
notif "^^^^^^^^ UPDATING...^^^^^^^^"
|
notif "^^^^^^^^ UPDATING...^^^^^^^^"
|
||||||
recovery_mode
|
recovery_mode
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if there is a software update file
|
||||||
|
for file in $(ls /mnt/FunKey-*.swu); do
|
||||||
|
swupdate -i "${file}"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
125
FunKey/board/funkey/swupdate.config
Normal file
125
FunKey/board/funkey/swupdate.config
Normal file
@ -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
|
||||||
|
#
|
||||||
@ -9,7 +9,7 @@ root_mount=/tmp/rootfs
|
|||||||
|
|
||||||
do_preinst()
|
do_preinst()
|
||||||
{
|
{
|
||||||
notif "1/5 Extract update"
|
notif "1/5 Extract firmware update..."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ do_postinst()
|
|||||||
notif "Cannot unmount root filesystem"
|
notif "Cannot unmount root filesystem"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
for file in $(ls /mnt/FunKey-rootfs-*.swu); do
|
for file in $(ls /mnt/FunKey-rootfs-*.fwu); do
|
||||||
notif "5/5 Erase update file"
|
notif "5/5 Erase update file"
|
||||||
rm -f "${file}"
|
rm -f "${file}"
|
||||||
done
|
done
|
||||||
|
|||||||
@ -63,12 +63,20 @@ BR2_PACKAGE_PARTED=y
|
|||||||
BR2_PACKAGE_SYSSTAT=y
|
BR2_PACKAGE_SYSSTAT=y
|
||||||
BR2_PACKAGE_UBOOT_TOOLS=y
|
BR2_PACKAGE_UBOOT_TOOLS=y
|
||||||
BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=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_LIBQRENCODE=y
|
BR2_PACKAGE_LIBQRENCODE=y
|
||||||
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
BR2_PACKAGE_LIBQRENCODE_TOOLS=y
|
||||||
BR2_PACKAGE_LIBNL=y
|
BR2_PACKAGE_LIBNL=y
|
||||||
|
BR2_PACKAGE_LIBRSYNC=y
|
||||||
BR2_PACKAGE_DHCPCD=y
|
BR2_PACKAGE_DHCPCD=y
|
||||||
BR2_PACKAGE_DROPBEAR=y
|
BR2_PACKAGE_DROPBEAR=y
|
||||||
BR2_PACKAGE_PROCPS_NG=y
|
BR2_PACKAGE_PROCPS_NG=y
|
||||||
|
BR2_PACKAGE_SWUPDATE=y
|
||||||
|
BR2_PACKAGE_SWUPDATE_CONFIG="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/swupdate.config"
|
||||||
|
# BR2_PACKAGE_SWUPDATE_INSTALL_WEBSITE is not set
|
||||||
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
|
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
|
||||||
BR2_PACKAGE_NANO=y
|
BR2_PACKAGE_NANO=y
|
||||||
BR2_TARGET_ROOTFS_EXT2=y
|
BR2_TARGET_ROOTFS_EXT2=y
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -94,7 +94,7 @@ update: fun
|
|||||||
@cd tmp && \
|
@cd tmp && \
|
||||||
echo sw-description rootfs.ext2.gz update_partition | \
|
echo sw-description rootfs.ext2.gz update_partition | \
|
||||||
tr " " "\n" | \
|
tr " " "\n" | \
|
||||||
cpio -o -H crc --quiet > ../images/FunKey-rootfs-$(shell cat FunKey/board/funkey/rootfs-overlay/etc/sw-versions | cut -f 2).swu
|
cpio -o -H crc --quiet > ../images/FunKey-rootfs-$(shell cat FunKey/board/funkey/rootfs-overlay/etc/sw-versions | cut -f 2).fwu
|
||||||
@rm -rf tmp
|
@rm -rf tmp
|
||||||
|
|
||||||
defconfig:
|
defconfig:
|
||||||
|
|||||||
@ -9,8 +9,8 @@ case "$1" in
|
|||||||
keys=$(devmem 0x01c20500 16)
|
keys=$(devmem 0x01c20500 16)
|
||||||
if [ "${keys}" != "0xF83F" ]; then
|
if [ "${keys}" != "0xF83F" ]; then
|
||||||
|
|
||||||
# Automatic update requested
|
# Automatic firmware update requested
|
||||||
updates=$(ls /mnt/FunKey-*.swu)
|
updates=$(ls /mnt/FunKey-*.fwu)
|
||||||
if [ "x${updates}" = "x" ]; then
|
if [ "x${updates}" = "x" ]; then
|
||||||
menu &
|
menu &
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@ -96,7 +96,7 @@ menu_run () {
|
|||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif "${message}...^Cannot unmount USB!"
|
notif "${message}...^Cannot unmount USB!"
|
||||||
else
|
else
|
||||||
for file in $(ls /mnt/FunKey-*.swu); do
|
for file in $(ls /mnt/FunKey-*.fwu); do
|
||||||
swupdate -i "${file}"
|
swupdate -i "${file}"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
notif "${message}...^Cannot update!"
|
notif "${message}...^Cannot update!"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user