From cac2cd65b190f7eb2b678886052621405d30e9de Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 17 Dec 2009 21:29:33 +0100 Subject: check image size --- target/ag241/Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'target') diff --git a/target/ag241/Makefile b/target/ag241/Makefile index abfaf7bef..e1c5b47a5 100644 --- a/target/ag241/Makefile +++ b/target/ag241/Makefile @@ -31,14 +31,17 @@ kernel-install: tools-compile ifeq ($(FS),squashfs) imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS) - ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS) - @echo - @echo The image file is $(ROOTFSSQUASHFS) - @echo 'You can flash the image via tftp:' - @echo 'tftp 192.168.1.1' - @echo 'tftp> binary' - @echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin" - @echo 'Login as user root with password linux123 via ssh or console' + @if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 4063233 ];then \ + echo 'Image is too big!'; \ + else \ + ${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS); \ + echo The image file is $(ROOTFSSQUASHFS); \ + echo 'You can flash the image via tftp:'; \ + echo 'tftp 192.168.1.1'; \ + echo 'tftp> binary'; \ + echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"; \ + echo 'Login as user root with password linux123 via ssh or console'; \ + fi endif ifeq ($(FS),nfsroot) -- cgit v1.2.3