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.
32 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
33 [ ! "$mtdnum" ] && return 1
34 ubiattach
-m "$mtdnum" || true
35 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
36 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
37 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
39 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
42 ubi_rootfs partition is still present.
44 You need to delete the stock partition first:
45 # ubirmvol /dev/ubi0 -N ubi_rootfs
46 Please also delete ubi_rootfs_data, if exist:
47 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
49 Once this is done. Retry.
60 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
61 board_dir
=${board_dir%/}
63 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
71 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
72 board_dir
=${board_dir%/}
74 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
76 if [ -n "$UPGRADE_BACKUP" ]; then
77 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
79 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
83 platform_do_upgrade_mikrotik_nand
() {
84 local fw_mtd
=$
(find_mtd_part kernel
)
85 fw_mtd
="${fw_mtd/block/}"
86 [ -n "$fw_mtd" ] ||
return
88 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
89 board_dir
=${board_dir%/}
90 [ -n "$board_dir" ] ||
return
92 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
93 [ -n "$kernel_len" ] ||
return
95 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
101 platform_do_upgrade
() {
102 case "$(board_name)" in
108 avm
,fritzrepeater-1200 |\
109 avm
,fritzrepeater-3000 |\
110 buffalo
,wtr-m2133hp |\
111 cilab
,meshpoint-one |\
118 mobipromo
,cm520-79f |\
128 CI_DATAPART
="rootfs_data"
131 alfa-network
,ap120c-ac
)
132 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
133 if [ "$part" = "rootfs1" ]; then
134 fw_setenv active
2 ||
exit 1
137 fw_setenv active
1 ||
exit 1
153 askey_do_upgrade
"$1"
160 export_partdevice CI_ROOTDEV
0
169 platform_do_upgrade_linksys
"$1"
173 CI_KERNPART
="part.safe"
178 mikrotik
,hap-ac3-lte6-kit|\
180 mikrotik
,sxtsq-5-ac|\
182 mikrotik
,wap-ac-lte|\
184 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
185 default_do_upgrade
"$1"
188 platform_do_upgrade_mikrotik_nand
"$1"
194 platform_do_upgrade_netgear_orbi_upgrade
"$1"
198 plasmacloud
,pa1200 |\
201 platform_do_upgrade_dualboot_datachk
"$1"
203 sony
,ncp-hg100-cellular
)
204 sony_emmc_do_upgrade
"$1"
214 zyxel_do_upgrade
"$1"
217 default_do_upgrade
"$1"
222 platform_copy_config
() {
223 case "$(board_name)" in