2 # Copyright (C) 2010-2011 OpenWrt.org
5 # use default "image" for PART_NAME
6 # use default for platform_do_upgrade()
8 platform_check_image
() {
9 [ "${ARGC}" -gt 1 ] && { echo 'Too many arguments. Only flash file expected.'; return 1; }
11 local hardware
=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
12 local magic
="$(get_magic_word "$1")"
13 local magic_long
="$(get_magic_long "$1")"
16 # hardware with a direct uImage partition
17 # image header format as described in U-Boot's include/image.h
18 # see http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=include/image.h
20 [ "${magic_long}" != '27051956' ] && {
21 echo "Invalid image type ${magic_long}."
26 # Netgear WNR854T (has uImage as file inside a JFFS2 partition)
28 [ "${magic}" != '8519' ] && {
29 echo "Invalid image type ${magic}."
36 echo "Sysupgrade is not yet supported on ${hardware}."