New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted Firmware Images Aren't Replaced #645

Closed
gomker opened this Issue Dec 27, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@gomker

gomker commented Dec 27, 2016

This issue looks to be the same as Issue #63

"make" -f Makefile_orig unwrapped/D002.032.img
make[5]: Entering directory '/home/dlane/repo/md380tools/firmware'
../md380-fw --unwrap bin/D002.032.bin unwrapped/D002.032.img
DEBUG: reading "bin/D002.032.bin"
Traceback (most recent call last):
  File "../md380-fw", line 7, in <module>
	main()
  File "/home/dlane/repo/md380tools/md380_fw.py", line 185, in main
	md.unwrap(input)
  File "/home/dlane/repo/md380tools/md380_fw.py", line 114, in unwrap
	header = header.unpack(img[:256])
struct.error: unpack requires a string argument of length 256

Looking at my /firmware/bin I see that D002.032.bin is 0 bytes
I do see a D002.032.zip in the /firmware/dl folder

My environment is setup using this article as a guide

@travisgoodspeed

This comment has been minimized.

Owner

travisgoodspeed commented Dec 27, 2016

Please post a log of make distclean dist, built while your machine is online.

@gomker

This comment has been minimized.

gomker commented Dec 27, 2016

No errors on that output - I did not realize distclean was a build option, I was running make clean dist
Should have read the Make file a bit more.

Thanks

@gomker gomker closed this Dec 27, 2016

@travisgoodspeed travisgoodspeed changed the title from Make Error In Cygwin to Corrupted Firmware Images Aren't Replaced Dec 27, 2016

@travisgoodspeed

This comment has been minimized.

Owner

travisgoodspeed commented Dec 27, 2016

@gomker No worries, this is a real bug that we ought to fix. An explanation follows.

Explanation

What likely happened was a network error as @gomker was initially fetching the firmware image, giving him a zero-byte file. Users had reported this in the past, and for a while, 'make clean' would erase the temporary files. This was great for users who were online, but meant that 'make clean all' would fail when away from the Internet.

We can fix this by adding a 'make verify' stage to the firmware/ directory, or by committing the firmware directly to the repo.

Resolution

Close this issue when there is no longer danger of a corrupted firmware/ directory, but also that the Internet is only required for at most the initial build.

KG5IEN added a commit to KG5IEN/md380tools that referenced this issue May 9, 2017

Fix for issue travisgoodspeed#645
This is the minimal fix for this issue.  Before this fix, there were only two places where a corrupted file could show up:
1. From a curl download that fails without an error code
2. md380-fw generating a corrupted file

The other recipes in the firmware directory all check the size of the target and delete it and fail if there is a mismatch.  This minimal fix fills gap number 1 from above with a simple check for greater than zero bytes.

travisgoodspeed added a commit that referenced this issue May 9, 2017

Fix for issue #645
This is the minimal fix for this issue.  Before this fix, there were only two places where a corrupted file could show up:
1. From a curl download that fails without an error code
2. md380-fw generating a corrupted file

The other recipes in the firmware directory all check the size of the target and delete it and fail if there is a mismatch.  This minimal fix fills gap number 1 from above with a simple check for greater than zero bytes.
@KG5IEN

This comment has been minimized.

Contributor

KG5IEN commented May 23, 2017

This can be closed now, right? Or does more work remain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment