mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-24 21:37:14 +00:00
1b9a4f0cb4
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 62dbe361a1
)
88 lines
1.3 KiB
Bash
Executable File
88 lines
1.3 KiB
Bash
Executable File
#
|
|
# Copyright (C) 2010-2015 OpenWrt.org
|
|
#
|
|
|
|
. /lib/imx6.sh
|
|
|
|
RAMFS_COPY_BIN='blkid'
|
|
|
|
enable_image_metadata_check() {
|
|
case "$(board_name)" in
|
|
apalis*)
|
|
REQUIRE_IMAGE_METADATA=1
|
|
;;
|
|
esac
|
|
}
|
|
enable_image_metadata_check
|
|
|
|
apalis_copy_config() {
|
|
apalis_mount_boot
|
|
cp -af "$CONF_TAR" "/boot/$BACKUP_FILE"
|
|
sync
|
|
umount /boot
|
|
}
|
|
|
|
apalis_do_upgrade() {
|
|
local board_name=$(board_name)
|
|
board_name=${board_name/,/_}
|
|
|
|
apalis_mount_boot
|
|
get_image "$1" | tar Oxf - sysupgrade-${board_name}/kernel > /boot/uImage
|
|
get_image "$1" | tar Oxf - sysupgrade-${board_name}/root > $(rootpart_from_uuid)
|
|
sync
|
|
umount /boot
|
|
}
|
|
|
|
platform_check_image() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
apalis*)
|
|
return 0
|
|
;;
|
|
*gw5*)
|
|
nand_do_platform_check $board $1
|
|
return $?;
|
|
;;
|
|
esac
|
|
|
|
echo "Sysupgrade is not yet supported on $board."
|
|
return 1
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
apalis*)
|
|
apalis_do_upgrade "$1"
|
|
;;
|
|
*gw5*)
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_copy_config() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
apalis*)
|
|
apalis_copy_config
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_pre_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
apalis*)
|
|
[ "$UPGRADE_OPT_SAVE_CONFIG" -eq 0 ] && {
|
|
jffs2reset -y
|
|
umount /overlay
|
|
}
|
|
;;
|
|
esac
|
|
}
|