#!/bin/sh

# NeTTrom can only boot images up to 4 MB.  In fact, slightly less.
# Ralph Siemsen says:
# > Best that I can make out, 4MB is the buffer size, of which 0x200 bytes
# > are used for kernel commandline args and the "param struct".  So
# > theoretically you can do 4096*1024 - 0x200 bytes.

size=$(wc -c $1 | cut -d " " -f 1)
if [ $size -gt 4193792 ]; then
	echo "Image is too large ($size bytes)"
	exit 1
else
	echo "Image size is okay ($size bytes)"
	exit 0
fi

