1 REQUIRE_IMAGE_METADATA
=1
3 platform_do_upgrade
() {
4 local board
=$
(board_name
)
5 local file_type
=$
(identify
$1)
9 local rootdev
="$(cmdline_get_var root)"
10 rootdev
="${rootdev##*/}"
11 rootdev
="${rootdev%p[0-9]*}"
15 CI_KERNPART
="production"
25 local magic
="$(get_magic_long "$1")"
27 # use "mtd write" if the magic is "DHP2 (0x44485032)"
28 # or "DHP3 (0x44485033)"
29 if [ "$magic" = "44485032" -o "$magic" = "44485033" ]; then
30 buffalo_upgrade_ubinized
"$1"
32 CI_KERNPART
="firmware"
36 elecom
,wrc-x3200gst3|\
37 mediatek
,mt7622-rfb1-ubi|\
39 xiaomi
,redmi-router-ax6s
)
47 if grep -q mtdparts
=slave
/proc
/cmdline
; then
52 default_do_upgrade
"$1"
55 default_do_upgrade
"$1"
62 platform_check_image
() {
63 local board
=$
(board_name
)
64 local magic
="$(get_magic_long "$1")"
66 [ "$#" -gt 1 ] && return 1
70 buffalo_check_image
"$board" "$magic" "$1" ||
return 1
72 elecom
,wrc-x3200gst3|\
73 mediatek
,mt7622-rfb1-ubi|\
75 xiaomi
,redmi-router-ax6s
)
76 nand_do_platform_check
"$board" "$1"
79 [ "$magic" != "d00dfeed" ] && {
80 echo "Invalid image type."
90 platform_copy_config
() {
91 case "$(board_name)" in
94 export_partdevice rootdev
0
95 if echo $rootdev |
grep -q mmc
; then