OpenWrt – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | KERNEL_IMG="openwrt-au1000-au1500-vmlinux.bin" |
2 | ROOTFS_IMG="openwrt-au1000-au1500-root.fs" |
||
3 | |||
4 | platform_check_image() { |
||
5 | [ "$#" -gt 1 ] && return 1 |
||
6 | case "$(get_magic_word "$1")" in |
||
7 | 6f70) |
||
8 | ( get_image "$1" | tar -tf - $KERNEL_IMG >/dev/null && \ |
||
9 | get_image "$1" | tar -tf - $ROOTFS_IMG >/dev/null) || { |
||
10 | echo "Invalid image contents" |
||
11 | return 1 |
||
12 | } |
||
13 | return 0;; |
||
14 | *) |
||
15 | echo "Invalid image type" |
||
16 | return 1;; |
||
17 | esac |
||
18 | } |
||
19 | |||
20 | platform_do_upgrade() { |
||
21 | sync |
||
22 | local conf="" |
||
23 | [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && conf="-j $CONF_TAR" |
||
24 | get_image "$1" | tar -Oxvf - $KERNEL_IMG | mtd write - "kernel" |
||
25 | get_image "$1" | tar -Oxvf - $ROOTFS_IMG | mtd $conf write - "rootfs" |
||
26 | } |