Root/target/linux/au1000/base-files/lib/upgrade/platform.sh

1KERNEL_IMG="openwrt-au1000-au1500-vmlinux.bin"
2ROOTFS_IMG="openwrt-au1000-au1500-jffs2-128k.fs"
3
4platform_check_image() {
5    [ "$ARGC" -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
20platform_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}
27
28disable_watchdog() {
29        killall watchdog
30        ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
31                echo 'Could not disable watchdog'
32                return 1
33        }
34}
35
36append sysupgrade_pre_upgrade disable_watchdog
37

Archive Download this file



interactive