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.
33 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
34 [ ! "$mtdnum" ] && return 1
35 ubiattach
-m "$mtdnum" || true
36 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
37 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
38 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
40 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
43 ubi_rootfs partition is still present.
45 You need to delete the stock partition first:
46 # ubirmvol /dev/ubi0 -N ubi_rootfs
47 Please also delete ubi_rootfs_data, if exist:
48 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
50 Once this is done. Retry.
61 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
62 board_dir
=${board_dir%/}
64 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
72 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
73 board_dir
=${board_dir%/}
75 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
77 if [ -n "$UPGRADE_BACKUP" ]; then
78 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
80 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
84 platform_do_upgrade_mikrotik_nand
() {
85 local fw_mtd
=$
(find_mtd_part kernel
)
86 fw_mtd
="${fw_mtd/block/}"
87 [ -n "$fw_mtd" ] ||
return
89 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
90 board_dir
=${board_dir%/}
91 [ -n "$board_dir" ] ||
return
93 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
94 [ -n "$kernel_len" ] ||
return
96 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
102 platform_do_upgrade
() {
103 case "$(board_name)" in
109 avm
,fritzrepeater-1200 |\
110 avm
,fritzrepeater-3000 |\
111 buffalo
,wtr-m2133hp |\
112 cilab
,meshpoint-one |\
119 mobipromo
,cm520-79f |\
130 CI_DATAPART
="rootfs_data"
133 alfa-network
,ap120c-ac
)
134 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
135 if [ "$part" = "rootfs1" ]; then
136 fw_setenv active
2 ||
exit 1
139 fw_setenv active
1 ||
exit 1
155 askey_do_upgrade
"$1"
162 export_partdevice CI_ROOTDEV
0
172 platform_do_upgrade_linksys
"$1"
176 CI_KERNPART
="part.safe"
181 mikrotik
,hap-ac3-lte6-kit|\
183 mikrotik
,sxtsq-5-ac|\
185 mikrotik
,wap-ac-lte|\
187 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
188 default_do_upgrade
"$1"
191 platform_do_upgrade_mikrotik_nand
"$1"
197 platform_do_upgrade_netgear_orbi_upgrade
"$1"
201 plasmacloud
,pa1200 |\
204 platform_do_upgrade_dualboot_datachk
"$1"
206 sony
,ncp-hg100-cellular
)
207 sony_emmc_do_upgrade
"$1"
219 zyxel_do_upgrade
"$1"
222 default_do_upgrade
"$1"
227 platform_copy_config
() {
228 case "$(board_name)" in