Skip to content
Snippets Groups Projects
Verified Commit 02a683ce authored by Piotr Kubik's avatar Piotr Kubik Committed by Andreas Gnau
Browse files

airoha: Add platform dependent list of components for upgrade

iopsys_sysupgrade() supports now a list of components to be processed
by upgrade functions, passed as a parameter to iopsys_sysupgrade().

For more details, check relevant commits adding support for FIT image
'configurations' in openwrt_core repo.
parent 02f75bb5
No related branches found
No related tags found
1 merge request!1264Use configurations with compatibility strings in sysupgrade
platform_check_image() {
iopsys_check_image "$1" "$(board_name)" || return 1
iopsys_check_image "$1" "$(board_name)" || return
}
platform_do_upgrade() {
......@@ -9,7 +9,26 @@ platform_do_upgrade() {
return 1
fi
local boot_dev=""
iopsys_do_upgrade "$image" "$(board_name)" "$(platform_list_image_components "$image")" || return
}
# Tell the bootloader to boot from flash "bank" $1 next time.
# $1: bank identifier (1 or 2)
platform_set_bootbank() {
iopsys_set_bootbank "$1"
}
platform_get_bootbank() {
iopsys_get_bootbank
}
platform_copy_config() {
log sysupgrade "Copy config files"
iopsys_copy_config
}
__get_bootloader_device() {
local boot_dev="u-boot"
case "$(get_root_device_type)" in
emmc)
# search for device-mapper devices with specified name
......@@ -30,20 +49,21 @@ platform_do_upgrade() {
;;
esac
iopsys_do_upgrade "$1" "$(board_name)" "${boot_dev}" || return
}
# Tell the bootloader to boot from flash "bank" $1 next time.
# $1: bank identifier (1 or 2)
platform_set_bootbank() {
iopsys_set_bootbank "$1"
echo "$boot_dev"
}
platform_get_bootbank() {
iopsys_get_bootbank
}
platform_list_image_components() {
local image=$1
local boot_dev
platform_copy_config() {
log sysupgrade "Copy config files"
iopsys_copy_config
boot_dev="$(__get_bootloader_device)"
# <type> /configuration/<name> <required> <target device>
echo "pre_upgrade upgrade_bundle optional"
echo "image boot required boot\${next_bank_id}"
echo "image rootfs required rootfs\${next_bank_id}"
if bootloader_upgrade_enabled 2>/dev/null "$image" "bootloader" "$boot_dev" ; then
echo "bootloader bootloader optional $boot_dev"
fi
echo "u_boot_env u-boot-env required"
echo "post_upgrade upgrade_bundle optional"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment