261c468813a7d7107500d139c6cd16cd8608d314
[openwrt/staging/dedeckeh.git] / target / linux / ipq40xx / base-files / lib / upgrade / platform.sh
1 PART_NAME=firmware
2 REQUIRE_IMAGE_METADATA=1
3
4 RAMFS_COPY_BIN='fw_printenv fw_setenv'
5 RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
6
7 platform_check_image() {
8 case "$(board_name)" in
9 asus,rt-ac58u)
10 CI_UBIPART="UBI_DEV"
11 local ubidev=$(nand_find_ubi $CI_UBIPART)
12 local asus_root=$(nand_find_volume $ubidev jffs2)
13
14 [ -n "$asus_root" ] || return 0
15
16 cat << EOF
17 jffs2 partition is still present.
18 There's probably no space left
19 to install the filesystem.
20
21 You need to delete the jffs2 partition first:
22 # ubirmvol /dev/ubi0 --name=jffs2
23
24 Once this is done. Retry.
25 EOF
26 return 1
27 ;;
28 esac
29 return 0;
30 }
31
32 platform_do_upgrade() {
33 case "$(board_name)" in
34 asus,rt-ac58u)
35 CI_UBIPART="UBI_DEV"
36 CI_KERNPART="linux"
37 nand_do_upgrade "$1"
38 ;;
39 openmesh,a42)
40 PART_NAME="inactive"
41 platform_do_upgrade_openmesh "$ARGV"
42 ;;
43 *)
44 default_do_upgrade "$ARGV"
45 ;;
46 esac
47 }
48
49 platform_nand_pre_upgrade() {
50 case "$(board_name)" in
51 asus,rt-ac58u)
52 CI_UBIPART="UBI_DEV"
53 CI_KERNPART="linux"
54 ;;
55 esac
56 }
57
58 blink_led() {
59 . /etc/diag.sh; set_state upgrade
60 }
61
62 append sysupgrade_pre_upgrade blink_led