1 platform_do_upgrade
() {
2 local board
=$
(board_name
)
5 #Keep the persisten random mac address (if it exists)
7 mount
-o rw
,noatime
/dev
/mmcblk0p1
/tmp
/recovery
8 [ -f "/tmp/recovery/mac_addr" ] && \
9 mv -f /tmp
/recovery
/mac_addr
/tmp
/
12 #1310720 is the offset in bytes from the start of eMMC and to
13 #the location of the kernel (2560 512 byte sectors)
14 get_image
"$1" |
dd of
=/dev
/mmcblk0 bs
=1310720 seek
=1 conv
=fsync
16 mount
-o rw
,noatime
/dev
/mmcblk0p1
/tmp
/recovery
17 [ -f "/tmp/mac_addr" ] && mv -f /tmp
/mac_addr
/tmp
/recovery
22 default_do_upgrade
"$1"
29 platform_check_image
() {
30 local board
=$
(board_name
)
31 local magic
="$(get_magic_long "$1")"
33 [ "$#" -gt 1 ] && return 1
38 [ "$magic" != "27051956" ] && {
39 echo "Invalid image type."
46 echo "Sysupgrade is not supported on your board yet."
54 platform_copy_config_emmc
() {
56 mount
-o rw
,noatime
/dev
/mmcblk0p1
/recovery
57 cp -af "$CONF_TAR" /recovery
/
62 platform_copy_config
() {
63 case "$(board_name)" in
65 platform_copy_config_emmc