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.
31 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
32 [ ! "$mtdnum" ] && return 1
33 ubiattach
-m "$mtdnum" || true
34 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
35 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
36 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
38 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
41 ubi_rootfs partition is still present.
43 You need to delete the stock partition first:
44 # ubirmvol /dev/ubi0 -N ubi_rootfs
45 Please also delete ubi_rootfs_data, if exist:
46 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
48 Once this is done. Retry.
59 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
60 board_dir
=${board_dir%/}
62 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
70 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
71 board_dir
=${board_dir%/}
73 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
75 if [ -n "$UPGRADE_BACKUP" ]; then
76 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
78 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
82 platform_do_upgrade_mikrotik_nand
() {
83 local fw_mtd
=$
(find_mtd_part kernel
)
84 fw_mtd
="${fw_mtd/block/}"
85 [ -n "$fw_mtd" ] ||
return
87 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
88 board_dir
=${board_dir%/}
89 [ -n "$board_dir" ] ||
return
91 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
92 [ -n "$kernel_len" ] ||
return
94 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
100 platform_do_upgrade
() {
101 case "$(board_name)" in
107 avm
,fritzrepeater-1200 |\
108 avm
,fritzrepeater-3000 |\
109 buffalo
,wtr-m2133hp |\
110 cilab
,meshpoint-one |\
117 mobipromo
,cm520-79f |\
127 CI_DATAPART
="rootfs_data"
130 alfa-network
,ap120c-ac
)
131 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
132 if [ "$part" = "rootfs1" ]; then
133 fw_setenv active
2 ||
exit 1
136 fw_setenv active
1 ||
exit 1
152 askey_do_upgrade
"$1"
159 export_partdevice CI_ROOTDEV
0
168 platform_do_upgrade_linksys
"$1"
172 CI_KERNPART
="part.safe"
177 mikrotik
,hap-ac3-lte6-kit|\
179 mikrotik
,sxtsq-5-ac|\
181 mikrotik
,wap-ac-lte|\
183 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
184 default_do_upgrade
"$1"
187 platform_do_upgrade_mikrotik_nand
"$1"
193 platform_do_upgrade_netgear_orbi_upgrade
"$1"
197 plasmacloud
,pa1200 |\
200 platform_do_upgrade_dualboot_datachk
"$1"
202 sony
,ncp-hg100-cellular
)
203 sony_emmc_do_upgrade
"$1"
212 zyxel_do_upgrade
"$1"
215 default_do_upgrade
"$1"
220 platform_copy_config
() {
221 case "$(board_name)" in