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.
36 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
37 [ ! "$mtdnum" ] && return 1
38 ubiattach
-m "$mtdnum" || true
39 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
40 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
41 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
43 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
46 ubi_rootfs partition is still present.
48 You need to delete the stock partition first:
49 # ubirmvol /dev/ubi0 -N ubi_rootfs
50 Please also delete ubi_rootfs_data, if exist:
51 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
53 Once this is done. Retry.
64 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
65 board_dir
=${board_dir%/}
67 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
75 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
76 board_dir
=${board_dir%/}
78 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
80 if [ -n "$UPGRADE_BACKUP" ]; then
81 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
83 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
87 platform_do_upgrade_mikrotik_nand
() {
88 local fw_mtd
=$
(find_mtd_part kernel
)
89 fw_mtd
="${fw_mtd/block/}"
90 [ -n "$fw_mtd" ] ||
return
92 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
93 board_dir
=${board_dir%/}
94 [ -n "$board_dir" ] ||
return
96 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
97 [ -n "$kernel_len" ] ||
return
99 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
105 platform_do_upgrade
() {
106 case "$(board_name)" in
112 avm
,fritzrepeater-1200 |\
113 avm
,fritzrepeater-3000 |\
114 buffalo
,wtr-m2133hp |\
115 cilab
,meshpoint-one |\
122 mobipromo
,cm520-79f |\
134 CI_DATAPART
="rootfs_data"
137 alfa-network
,ap120c-ac
)
138 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
139 if [ "$part" = "rootfs1" ]; then
140 fw_setenv active
2 ||
exit 1
143 fw_setenv active
1 ||
exit 1
159 askey_do_upgrade
"$1"
166 export_partdevice CI_ROOTDEV
0
176 platform_do_upgrade_linksys
"$1"
179 platform_do_upgrade_linksys_emmc
"$1"
183 CI_KERNPART
="part.safe"
188 mikrotik
,hap-ac3-lte6-kit|\
190 mikrotik
,sxtsq-5-ac|\
192 mikrotik
,wap-ac-lte|\
194 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
195 default_do_upgrade
"$1"
198 platform_do_upgrade_mikrotik_nand
"$1"
206 platform_do_upgrade_netgear_orbi_upgrade
"$1"
210 plasmacloud
,pa1200 |\
213 platform_do_upgrade_dualboot_datachk
"$1"
215 sony
,ncp-hg100-cellular
)
216 sony_emmc_do_upgrade
"$1"
231 zyxel_do_upgrade
"$1"
234 default_do_upgrade
"$1"
239 platform_copy_config
() {
240 case "$(board_name)" in