View Issue Details

IDProjectCategoryView StatusLast Update
0000081easycwmpBugpublic2015-10-05 14:39
Reporterfeckert Assigned Tomohamed.kallel  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Summary0000081: Firmware update failes
DescriptionHello,

During a firmware update over an acs the test to verify the size of free disk space in easycwmp.sh fails!

Reason:
The shell command in line 272 in easycwmp.sh fails if you get more lines as expected because of more /tmp directories.
--------------------------
root@OpenWrt:~# df
On my machine i get with the df command
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 58048 1852 56196 3% /
/dev/root 7680 7680 0 100% /rom
tmpfs 127456 13040 114416 10% /tmp
tmpfs 127456 268 127188 0% /tmp/root
tmpfs 512 0 512 0% /dev
/dev/mtdblock1 58048 1852 56196 3% /overlay
overlayfs:/overlay 58048 1852 56196 3% /
--------------------------
On my system i get two lines because of the wrong regex.
--------------------------
dl_size=`df |grep /tmp | awk '{print $4;}'`
114416
127188
--------------------------
I fixed it with this regex to get only the /tmp directory we interested in
--------------------------
dl_size=`df |grep "/tmp$" | awk '{print $4;}'`
114416

Please add this bugfix to your trunk. I have added the patch

Kind Regards

Flo
TagsNo tags attached.

Activities

feckert

2015-09-10 08:54

reporter  

system_easycwmp_patches_005-TDT-Bugfix-easycwmp-download-size-calculation.patch (594 bytes)   
Index: easycwmp-1.1.6/ext/openwrt/scripts/easycwmp.sh
===================================================================
--- easycwmp-1.1.6.orig/ext/openwrt/scripts/easycwmp.sh
+++ easycwmp-1.1.6/ext/openwrt/scripts/easycwmp.sh
@@ -259,7 +259,7 @@ handle_action() {
 	
 	if [ "$action" = "download" ]; then
 # TODO: check firmaware size with falsh to be improved  
-		dl_size=`df  |grep  /tmp | awk '{print $4;}'`
+		dl_size=`df  |grep  "/tmp$" | awk '{print $4;}'`
 		dl_size_byte=$((${dl_size}*1024))
 		if [ "$dl_size_byte" -lt "$__arg3" ]; then
 			let fault_code=9000+$E_DOWNLOAD_FAILURE

mohamed.kallel

2015-09-21 22:43

administrator   ~0000279

Thank you for the contribution and the patch.
I will fix that in the future versions of easycwmp

mohamed.kallel

2015-10-05 14:39

administrator   ~0000295

fixed in EasyCwmp-1.1.7

Issue History

Date Modified Username Field Change
2015-09-10 08:54 feckert New Issue
2015-09-10 08:54 feckert File Added: system_easycwmp_patches_005-TDT-Bugfix-easycwmp-download-size-calculation.patch
2015-09-21 22:43 mohamed.kallel Note Added: 0000279
2015-10-05 14:39 mohamed.kallel Note Added: 0000295
2015-10-05 14:39 mohamed.kallel Status new => resolved
2015-10-05 14:39 mohamed.kallel Resolution open => fixed
2015-10-05 14:39 mohamed.kallel Assigned To => mohamed.kallel