2 REQUIRE_IMAGE_METADATA
=1
4 RAMFS_COPY_BIN
='fw_printenv fw_setenv'
5 RAMFS_COPY_DATA
='/etc/fw_env.config /var/lock/fw_printenv.lock'
7 platform_check_image
() {
8 case "$(board_name)" in
11 local ubidev
=$
(nand_find_ubi
$CI_UBIPART)
12 local asus_root
=$
(nand_find_volume
$ubidev jffs2
)
14 [ -n "$asus_root" ] ||
return 0
17 jffs2 partition is still present.
18 There's probably no space left
19 to install the filesystem.
21 You need to delete the jffs2 partition first:
22 # ubirmvol /dev/ubi0 --name=jffs2
24 Once this is done. Retry.
30 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
31 [ ! "$mtdnum" ] && return 1
32 ubiattach
-m "$mtdnum" || true
33 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
34 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
35 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
37 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
40 ubi_rootfs partition is still present.
42 You need to delete the stock partition first:
43 # ubirmvol /dev/ubi0 -N ubi_rootfs
44 Please also delete ubi_rootfs_data, if exist:
45 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
47 Once this is done. Retry.
58 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
59 board_dir
=${board_dir%/}
61 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
69 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
70 board_dir
=${board_dir%/}
72 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
74 if [ -n "$UPGRADE_BACKUP" ]; then
75 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
77 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
81 platform_do_upgrade_mikrotik_nand
() {
82 local fw_mtd
=$
(find_mtd_part kernel
)
83 fw_mtd
="${fw_mtd/block/}"
84 [ -n "$fw_mtd" ] ||
return
86 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
87 board_dir
=${board_dir%/}
88 [ -n "$board_dir" ] ||
return
90 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
91 [ -n "$kernel_len" ] ||
return
93 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
99 platform_do_upgrade
() {
100 case "$(board_name)" in
106 avm
,fritzrepeater-1200 |\
107 avm
,fritzrepeater-3000 |\
108 buffalo
,wtr-m2133hp |\
109 cilab
,meshpoint-one |\
115 mobipromo
,cm520-79f |\
125 CI_DATAPART
="rootfs_data"
128 alfa-network
,ap120c-ac
)
129 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
130 if [ "$part" = "rootfs1" ]; then
131 fw_setenv active
2 ||
exit 1
134 fw_setenv active
1 ||
exit 1
150 askey_do_upgrade
"$1"
157 export_partdevice CI_ROOTDEV
0
166 platform_do_upgrade_linksys
"$1"
170 CI_KERNPART
="part.safe"
176 mikrotik
,sxtsq-5-ac|\
178 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
179 default_do_upgrade
"$1"
182 platform_do_upgrade_mikrotik_nand
"$1"
188 platform_do_upgrade_netgear_orbi_upgrade
"$1"
192 plasmacloud
,pa1200 |\
195 platform_do_upgrade_dualboot_datachk
"$1"
197 sony
,ncp-hg100-cellular
)
198 sony_emmc_do_upgrade
"$1"
206 zyxel_do_upgrade
"$1"
209 default_do_upgrade
"$1"
214 platform_copy_config
() {
215 case "$(board_name)" in