1 KERNEL_IMG
="openwrt-au1000-au1500-vmlinux.bin"
2 ROOTFS_IMG
="openwrt-au1000-au1500-root.fs"
4 platform_check_image
() {
5 [ "$#" -gt 1 ] && return 1
6 case "$(get_magic_word "$1")" in
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"
15 echo "Invalid image type"
20 platform_do_upgrade
() {
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"