Skip to content
Snippets Groups Projects
Commit 2599814d authored by Bartlomiej Grzeskowiak's avatar Bartlomiej Grzeskowiak
Browse files

iopsys-econet: Fix config handling after sysupgrade


Config files must be handled correctly over sysupgrade.
Config files are copied over to new overlay bank by default.
-n argument should erase overlay.

Signed-off-by: default avatarBartlomiej Grzeskowiak <bartlomiej.grzeskowiak@iopsys.eu>
parent 0f36efd0
No related branches found
No related tags found
No related merge requests found
platform_check_image() {
if [[ "ubifs" != "$(fw_printenv -n rootfstype)" ]]; then
#squashfs sysupgrade MUST be executed at early stage. Before including unsupported /lib/upgrade/iopsys.sh.
log sysupgrade "- Squshfs detected -"
iopsys_process_upgrade_bundle "$1" pre_upgrade || return
fi
return 0
}
......@@ -20,9 +15,11 @@ iopsys_do_upgrade_econet() {
log sysupgrade "Starting upgrade to bank id $next_bank_id..."
iopsys_process_upgrade_bundle "$image" pre_upgrade || return
if [[ "ubifs" == "$(fw_printenv -n rootfstype)" ]]; then
iopsys_write_fit_image_component "$image" boot required mtd "boot${next_bank_id}" || return
iopsys_write_fit_image_component "$image" rootfs required ubi "rootfs${next_bank_id}" || return
iopsys_write_fit_image_component "$image" bootloader optional mtd bootloader || return
fi
iopsys_clean_other_overlay || return
......@@ -34,10 +31,14 @@ iopsys_do_upgrade_econet() {
# Tell the bootloader to boot from flash "bank" $1 next time.
# $1: bank identifier (1 or 2)
platform_set_bootbank() {
fw_setenv active_image "$1"
fw_setenv active_image "$1"
}
platform_get_bootbank() {
fw_printenv -n active_image
fw_printenv -n active_image
}
platform_copy_config() {
log sysupgrade "Copy config files"
iopsys_copy_config
}
#!/bin/sh
. /lib/functions.sh
. /lib/upgrade/iopsys.sh
invocation=$1
image=$2
......@@ -84,7 +85,6 @@ do_squashfs_update() {
nandwrite -p /dev/$next_bank_rootfs_mtd /tmp/squashfs.bin
rm /tmp/squashfs.bin
do_post_upgrade $image
log "- Install overlay partition if not present -"
if [[ "1" != "$(fw_printenv -n overlay_installed)" ]]; then
flash_erase /dev/$ubicontainer_mtd 0 0
......@@ -94,9 +94,6 @@ do_squashfs_update() {
ubimkvol /dev/ubi0 -n 7 -N overlay2 -s 10MiB
fw_setenv overlay_installed "1"
fi
log "- Set boot bank $next_bank_id and reboot-"
fw_setenv active_image $next_bank_id
do_exit_reboot
}
case $invocation in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment