openwrt/target/linux/imx6/base-files/lib/upgrade/platform.sh
Petr Štetiar 0711b515f6 imx6: apalis: add missing jffs2reset to ramfs during sysupgrade
jffs2reset is used to cleanup the rootfs_data overlay, but it's
currently missing in the ramfs during sysupgrade leading to the
following error:

 Switching to ramdisk...
 Performing system upgrade...
 /lib/upgrade/do_stage2: line 27: jffs2reset: not found

Fixes: 2f1a11d008 ("imx6: apalis: fix config survival after sysupgrade -n")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2019-07-17 12:16:29 +02:00

85 lines
1.2 KiB
Bash
Executable File

#
# Copyright (C) 2010-2015 OpenWrt.org
#
. /lib/imx6.sh
RAMFS_COPY_BIN='blkid jffs2reset'
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/
sync
umount /boot
}
apalis_do_upgrade() {
apalis_mount_boot
get_image "$1" | tar Oxf - sysupgrade-apalis/kernel > /boot/uImage
get_image "$1" | tar Oxf - sysupgrade-apalis/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*)
[ "$SAVE_CONFIG" -eq 0 ] && {
jffs2reset -y
umount /overlay
}
;;
esac
}