Explorar o código

check image size

Waldemar Brodkorb %!s(int64=15) %!d(string=hai) anos
pai
achega
cac2cd65b1
Modificáronse 1 ficheiros con 11 adicións e 8 borrados
  1. 11 8
      target/ag241/Makefile

+ 11 - 8
target/ag241/Makefile

@@ -31,14 +31,17 @@ kernel-install: tools-compile
 
 
 ifeq ($(FS),squashfs)
 ifeq ($(FS),squashfs)
 imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS)
 imageinstall: $(BIN_DIR)/$(ROOTFSSQUASHFS)
-	${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS)
+	@if [ $$(stat --format=%s ${BUILD_DIR}/${ROOTFSSQUASHFS}) -gt 4063233 ];then \
-	@echo
+		echo 'Image is too big!'; \
-	@echo The image file is $(ROOTFSSQUASHFS)
+	else \
-	@echo 'You can flash the image via tftp:'
+		${CP} ${BUILD_DIR}/${ROOTFSSQUASHFS} $(BIN_DIR)/$(ROOTFSSQUASHFS); \
-	@echo 'tftp 192.168.1.1'
+		echo The image file is $(ROOTFSSQUASHFS); \
-	@echo 'tftp> binary'
+		echo 'You can flash the image via tftp:'; \
-	@echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"
+		echo 'tftp 192.168.1.1'; \
-	@echo 'Login as user root with password linux123 via ssh or console'
+		echo 'tftp> binary'; \
+		echo "tftp> put $(ROOTFSSQUASHFS) upgrade_code.bin"; \
+		echo 'Login as user root with password linux123 via ssh or console'; \
+	fi
 endif
 endif
 
 
 ifeq ($(FS),nfsroot)
 ifeq ($(FS),nfsroot)