2018-04-30 12:42:39 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2019-03-04 05:05:27 +00:00
|
|
|
# Copyright 2015-2019 Traverse Technologies
|
2018-04-30 12:42:39 +00:00
|
|
|
#
|
2019-07-17 06:02:05 +00:00
|
|
|
|
|
|
|
RAMFS_COPY_BIN="/usr/sbin/fw_printenv /usr/sbin/fw_setenv /usr/sbin/ubinfo /bin/echo"
|
|
|
|
RAMFS_COPY_DATA="/etc/fw_env.config /var/lock/fw_printenv.lock"
|
|
|
|
|
2020-02-25 19:07:41 +00:00
|
|
|
REQUIRE_IMAGE_METADATA=1
|
|
|
|
|
2018-04-30 12:42:39 +00:00
|
|
|
platform_do_upgrade_traverse_nandubi() {
|
|
|
|
bootsys=$(fw_printenv bootsys | awk -F= '{{print $2}}')
|
|
|
|
newbootsys=2
|
|
|
|
if [ "$bootsys" -eq "2" ]; then
|
|
|
|
newbootsys=1
|
|
|
|
fi
|
|
|
|
|
2019-03-04 05:05:27 +00:00
|
|
|
# If nand_do_upgrade succeeds, we don't have an opportunity to add any actions of
|
|
|
|
# our own, so do it here and set back on failure
|
|
|
|
echo "Setting bootsys to #${newbootsys}"
|
2018-04-30 12:42:39 +00:00
|
|
|
fw_setenv bootsys $newbootsys
|
2019-03-04 05:05:27 +00:00
|
|
|
CI_UBIPART="nandubi"
|
|
|
|
CI_KERNPART="kernel${newbootsys}"
|
|
|
|
CI_ROOTPART="rootfs${newbootsys}"
|
2019-07-14 17:03:19 +00:00
|
|
|
nand_do_upgrade "$1" || (echo "Upgrade failed, setting bootsys ${bootsys}" && fw_setenv bootsys $bootsys)
|
2019-03-04 05:05:27 +00:00
|
|
|
|
2018-04-30 12:42:39 +00:00
|
|
|
}
|
|
|
|
platform_check_image() {
|
|
|
|
local board=$(board_name)
|
|
|
|
|
|
|
|
case "$board" in
|
|
|
|
traverse,ls1043v | \
|
2019-03-04 05:05:27 +00:00
|
|
|
traverse,ls1043s)
|
|
|
|
nand_do_platform_check "traverse-ls1043" $1
|
|
|
|
return $?
|
2018-04-30 12:42:39 +00:00
|
|
|
;;
|
2020-02-25 19:07:40 +00:00
|
|
|
fsl,ls1012a-frdm)
|
|
|
|
return 0
|
|
|
|
;;
|
2018-04-30 12:42:39 +00:00
|
|
|
*)
|
|
|
|
echo "Sysupgrade is not currently supported on $board"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
|
|
local board=$(board_name)
|
|
|
|
|
2019-07-17 06:02:05 +00:00
|
|
|
# Force the creation of fw_printenv.lock
|
|
|
|
mkdir -p /var/lock
|
|
|
|
touch /var/lock/fw_printenv.lock
|
|
|
|
|
2018-04-30 12:42:39 +00:00
|
|
|
case "$board" in
|
|
|
|
traverse,ls1043v | \
|
2019-03-04 05:05:27 +00:00
|
|
|
traverse,ls1043s)
|
2019-07-14 17:03:19 +00:00
|
|
|
platform_do_upgrade_traverse_nandubi "$1"
|
2018-04-30 12:42:39 +00:00
|
|
|
;;
|
2020-02-25 19:07:40 +00:00
|
|
|
fsl,ls1012a-frdm)
|
|
|
|
PART_NAME=firmware
|
|
|
|
default_do_upgrade "$1"
|
|
|
|
;;
|
2018-04-30 12:42:39 +00:00
|
|
|
*)
|
|
|
|
echo "Sysupgrade is not currently supported on $board"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|