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.
35 local mtdnum
="$( find_mtd_index $CI_UBIPART )"
36 [ ! "$mtdnum" ] && return 1
37 ubiattach
-m "$mtdnum" || true
38 local ubidev
="$( nand_find_ubi $CI_UBIPART )"
39 local ubi_rootfs
=$
(nand_find_volume
$ubidev ubi_rootfs
)
40 local ubi_rootfs_data
=$
(nand_find_volume
$ubidev ubi_rootfs_data
)
42 [ -n "$ubi_rootfs" ] ||
[ -n "$ubi_rootfs_data" ] ||
return 0
45 ubi_rootfs partition is still present.
47 You need to delete the stock partition first:
48 # ubirmvol /dev/ubi0 -N ubi_rootfs
49 Please also delete ubi_rootfs_data, if exist:
50 # ubirmvol /dev/ubi0 -N ubi_rootfs_data
52 Once this is done. Retry.
63 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
64 board_dir
=${board_dir%/}
66 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
74 local board_dir
=$
(tar tf
$tar_file |
grep -m 1 '^sysupgrade-.*/$')
75 board_dir
=${board_dir%/}
77 tar Oxf
$tar_file ${board_dir}/kernel | mtd
write - kernel
79 if [ -n "$UPGRADE_BACKUP" ]; then
80 tar Oxf
$tar_file ${board_dir}/root | mtd
-j "$UPGRADE_BACKUP" write - rootfs
82 tar Oxf
$tar_file ${board_dir}/root | mtd
write - rootfs
86 platform_do_upgrade_mikrotik_nand
() {
87 local fw_mtd
=$
(find_mtd_part kernel
)
88 fw_mtd
="${fw_mtd/block/}"
89 [ -n "$fw_mtd" ] ||
return
91 local board_dir
=$
(tar tf
"$1" |
grep -m 1 '^sysupgrade-.*/$')
92 board_dir
=${board_dir%/}
93 [ -n "$board_dir" ] ||
return
95 local kernel_len
=$
(tar xf
"$1" ${board_dir}/kernel
-O |
wc -c)
96 [ -n "$kernel_len" ] ||
return
98 tar xf
"$1" ${board_dir}/kernel
-O | ubiformat
"$fw_mtd" -y -S $kernel_len -f -
104 platform_do_upgrade
() {
105 case "$(board_name)" in
111 avm
,fritzrepeater-1200 |\
112 avm
,fritzrepeater-3000 |\
113 buffalo
,wtr-m2133hp |\
114 cilab
,meshpoint-one |\
121 mobipromo
,cm520-79f |\
132 CI_DATAPART
="rootfs_data"
135 alfa-network
,ap120c-ac
)
136 part
="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
137 if [ "$part" = "rootfs1" ]; then
138 fw_setenv active
2 ||
exit 1
141 fw_setenv active
1 ||
exit 1
157 askey_do_upgrade
"$1"
164 export_partdevice CI_ROOTDEV
0
174 platform_do_upgrade_linksys
"$1"
178 CI_KERNPART
="part.safe"
183 mikrotik
,hap-ac3-lte6-kit|\
185 mikrotik
,sxtsq-5-ac|\
187 mikrotik
,wap-ac-lte|\
189 [ "$(rootfs_type)" = "tmpfs" ] && mtd erase firmware
190 default_do_upgrade
"$1"
193 platform_do_upgrade_mikrotik_nand
"$1"
199 platform_do_upgrade_netgear_orbi_upgrade
"$1"
203 plasmacloud
,pa1200 |\
206 platform_do_upgrade_dualboot_datachk
"$1"
208 sony
,ncp-hg100-cellular
)
209 sony_emmc_do_upgrade
"$1"
222 zyxel_do_upgrade
"$1"
225 default_do_upgrade
"$1"
230 platform_copy_config
() {
231 case "$(board_name)" in