andreasgal / B2G

Boot to Gecko aims to create a complete, standalone operating system for the open web.
https://wiki.mozilla.org/B2G
908 stars 158 forks source link

Image download fails with a EOF error #240

Open arky opened 12 years ago

arky commented 12 years ago

443 KB/s (23320 bytes in 0.051s) Pulling "ODEAnim.zip" 2901 KB/s (4305404 bytes in 1.449s) Downloading CyanogenMod image update-cm-7.1.0-GalaxyS2-signed.zip ... Image update-cm-7.1.0-GalaxyS2-signed.zip exists, skip downloading [update-cm-7.1.0-GalaxyS2-signed.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of update-cm-7.1.0-GalaxyS2-signed.zip or update-cm-7.1.0-GalaxyS2-signed.zip.zip, and cannot find update-cm-7.1.0-GalaxyS2-signed.zip.ZIP, period. Copying "libaudiopolicy.so" cp: cannot stat `cm_root/system/lib/libaudiopolicy.so': No such file or directory OK

arky commented 12 years ago

Workaround: Remove the previously downloaded file from B2G directory:

find . -name update-cm-7.1.0-GalaxyS2-signed.zip -ok mv {} \tmp \;

shianyow commented 12 years ago

I tried but cannot reproduce this issue. It looks like the previously downloaded zip file was corrupted. Does this always happen?

shianyow commented 12 years ago

You can uncomment this line to remove the image after extracting. https://github.com/cgjones/android_device_samsung_galaxys2/blob/gingerbread/extract-cm.sh#L95

arky commented 12 years ago

@shianyow

You can reproduce the problem by interrupting the wget download process. This can help either due to network failures or lost bits.

shianyow commented 12 years ago

OK, it will be fixed by https://github.com/cgjones/android_device_samsung_galaxys2/pull/25

arky commented 12 years ago

@shianyow @cgjones

The following part of code can re-factored by simplying using 'wget -c' . This enables us to continue partial downloaded files and also check if the images was already downloaded.

echo Downloading CyanogenMod image $CM_IMAGE ... if [ -f $CM_IMAGE ]; then echo Image $CM_IMAGE exists, skip downloading else wget $CM_DOWNLOAD_SITE/$CM_IMAGE fi

arky commented 12 years ago

https://github.com/arky/android_device_samsung_galaxys2/commit/bf3efe460388545e6de64b6ed3cfd47687e48fc6

shianyow commented 12 years ago

It looks great with 'wget -c'. Would you send a pull request?