Closed Bug 1066005 Opened 10 years ago Closed 9 years ago

[Hamachi][v1.4] "No space left on device" error when trying to flash Hamachi

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: AndreiH, Unassigned)

References

Details

I am using B2G-flash_tool to flash my device (https://github.com/Mozilla-TWQA/B2G-flash-tool)

When trying to flash the Hamachi device with the latest v1.4 build I get the error:

failed to copy '/tmp/shallowflashgaia.G0xgvGaBqWQd/gaia/profile/webapps/keyboard.gaiamobile.org/application.zip' to '/system/b2g/webapps/keyboard.gaiamobile.org/application.zip': No space left on device
### Failed: Pushing Gaia to device failed.
Shallow Flash failed.
Blocks: 1020536
This is a known problem and is due to the small amount of space the device has. Where you trying to flash an engineering build? User builds always work as they're smaller.
Yes, I was trying to build the engineering one. We kinda need the engineering build so we can run our automation tests on it, especially Marketplace tests as Bug 1011016 was resolved. this is now blocking bug 1020536
Just had the same issue upgrading to the latest non-engineering nightly: http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-b2g32_v2_0-flame-kk/b2g-32.0.en-US.android-arm.tar.gz
It apparently happens with user builds as well (since a couple of weeks now)...

Install system fs image: out/target/product/hamachi/system.img
out/target/product/hamachi/system.img+ total size is 218640576
error: out/target/product/hamachi/system.img+ too large (218640576 > [216268800 - 2162688])
I got this error:

"Target system fs image: out/target/product/hamachi/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/hamachi/system.img
out/target/product/hamachi/system.img+ total size is 298510080
error: out/target/product/hamachi/system.img+ too large (298510080 > [216268800 - 2162688])"

Any solution?
Same problem as described above, the resulting image is too large for being flashed on an Hamachi. Did you try an engineering build? If you did you might want to try a user or userdebug build, those should be smaller.
I did with this in my .userconfig file   :

export VARIANT=user
echo "VARIANT=${VARIANT}"

export PRODUCTION=1
echo "PRODUCTION=${PRODUCTION}"

And the problem is still there. Before I just used export PRODUCTION=1 but since I have the problem I added export VARIANT=user but AFAIK export VARIANT=user have implicit the PRODUCTION=1.

Any idea?
Unfortunately not, it seems like our build has become too large for this device as your generated image is almost 100M too large according to the error message. There's one thing that bugs me though: I just checked my build for the flame and the system.img file is only 224M and it's an engineering build vs the almost 300M of your build. This tells me that your build must contain something that's not in a regular build, could you try to unpack it and see what's inside? Also posting the contents of your .userconfig file will help checking if you've got something enabled that you shouldn't have. IIRC the Hamachi used yaffs images so you'll need this tool to unpack the image: https://github.com/ehlers/unyaffs

Once you've got it running a 'du | sort -n' of the top-level directory will shed some light of what's taking so much space.
I think it's the libxul.so itself that inflated (currently on device: 33Mb vs compiled with userconfig below: 45Mb), it fails on that file when you try a shallow flash too.

My userconfig:
# branding
export ENABLE_DEFAULT_BOOTANIMATION=true
export MOZILLA_OFFICIAL=1
export PRODUCTION=1
export GAIA_APP_TARGET=production
export GAIA_INSTALL_PARENT=/system/b2g
export VARIANT=user

# local settings for debian
export CC=gcc-4.6
export CXX=g++-4.6
export MAKE=/usr/bin/make-3.81
This is my .usercongif 

export VARIANT=user
export PRODUCTION=1
export MOZILLA_OFFICIAL=1
export B2G_SYSTEM_APPS=1
export B2G_UPDATER=1
export B2G_UPDATE_CHANNEL=default
export ENABLE_DEFAULT_BOOTANIMATION=true
export DEVICE_DEBUG=1
export NO_LOCK_SCREEN=1
export GAIA_MEMORY_PROFILE=low
export GAIA_DISTRIBUTION_DIR=distros/spark
export GAIA_KEYBOARD_LAYOUTS="$((find gaia/apps/keyboard/js/layouts/*.js|sed -e 's|gaia/apps/keyboard/js/layouts/||g' -e 's/\.js$//g') | tr -s '\r\n' ',' | sed -e 's/,$//g')"
echo "GAIA_KEYBOARD_LAYOUTS=${GAIA_KEYBOARD_LAYOUTS}"

The problem is that when the image is created, the script compare sizes and if don't match then delete the image, also I have the system directory, this is the output of the command.

penserbjorne@PAINKILLER:~/B2G/out/target/product/hamachi/system$ du | sort -n
8	./b2g/defaults/pref
12	./b2g/webapps/{2fabe6bc-b21b-4f4b-898d-751906298ca6}
12	./etc/dhcpcd/dhcpcd-hooks
12	./etc/ppp
20	./b2g/webapps/{679b3a20-9ae1-403c-8bf3-dc0cca1fa75d}
20	./etc/dhcpcd
20	./etc/permissions
20	./usr/idc
28	./b2g/webapps/operatorvariant.gaiamobile.org
28	./etc/bluetooth
40	./etc/wifi
44	./b2g/webapps/marketplace.firefox.com
48	./b2g/webapps/{538c1e58-6a2d-4c0a-9383-1e8c731461b1}
52	./lib/drm
64	./b2g/webapps/findmydevice.gaiamobile.org
68	./b2g/webapps/{16cc6c43-8449-4840-baec-53a94a1c50d0}
68	./b2g/webapps/{599372a7-3a9c-43fb-97ff-3691c7030d5e}
68	./fonts/hidden
76	./usr/keylayout
88	./usr/keychars
132	./b2g/webapps/network-alerts.gaiamobile.org
136	./lib/soundfx
188	./etc/firmware/ath6k/AR6003/hw2.1.1
192	./b2g/webapps/homescreen.gaiamobile.org
192	./etc/firmware/ath6k/AR6003
196	./etc/firmware/ath6k
212	./b2g/webapps/emergency-call.gaiamobile.org
216	./etc/firmware
220	./b2g/webapps/{f09f5a6b-cff6-463e-ad8b-0bbe769f3e2f}
220	./b2g/webapps/wappush.gaiamobile.org
228	./b2g/webapps/bookmark.gaiamobile.org
232	./b2g/webapps/fl.gaiamobile.org
260	./b2g/webapps/download.gaiamobile.org
272	./lib/bluez-plugin
300	./b2g/gmp-clearkey/0.1
304	./b2g/gmp-clearkey
332	./b2g/webapps/default_theme.gaiamobile.org
376	./b2g/webapps/video.gaiamobile.org
388	./b2g/webapps/{06e39ff4-a323-49ce-87fc-0db1c1bac0e3}
400	./b2g/defaults
404	./b2g/webapps/callscreen.gaiamobile.org
516	./b2g/webapps/camera.gaiamobile.org
516	./usr/share/zoneinfo
520	./usr/share
552	./lib/hw
560	./b2g/webapps/gallery.gaiamobile.org
568	./b2g/webapps/collection.gaiamobile.org
576	./b2g/webapps/verticalhome.gaiamobile.org
580	./b2g/webapps/bluetooth.gaiamobile.org
596	./b2g/dictionaries
604	./b2g/webapps/search.gaiamobile.org
752	./b2g/webapps/calendar.gaiamobile.org
844	./b2g/webapps/email.gaiamobile.org
916	./b2g/webapps/customizer-launcher.gaiamobile.org
996	./etc/security/cacerts
1004	./etc/security
1008	./b2g/webapps/customizer.gaiamobile.org
1024	./b2g/webapps/directory.gaiamobile.org
1024	./b2g/webapps/sharing.gaiamobile.org
1164	./b2g/webapps/studio.gaiamobile.org
1332	./b2g/webapps/costcontrol.gaiamobile.org
1364	./b2g/webapps/{7d123ec9-ca02-452e-b787-c7040876dc63}
1416	./b2g/webapps/music.gaiamobile.org
1528	./lib/egl
1548	./b2g/webapps/sms.gaiamobile.org
1700	./b2g/webapps/pdfjs.gaiamobile.org
1780	./etc
2248	./b2g/webapps/clock.gaiamobile.org
2356	./b2g/webapps/ftu.gaiamobile.org
2452	./b2g/webapps/communications.gaiamobile.org
2972	./b2g/webapps/ringtones.gaiamobile.org
3392	./b2g/webapps/wallpaper.gaiamobile.org
3420	./bin
3692	./b2g/models/dict
3908	./b2g/webapps/{350f6b76-7e73-4661-bbcf-853de2185e3b}
3948	./b2g/webapps/system.gaiamobile.org
4404	./b2g/webapps/settings.gaiamobile.org
4816	./media
6332	./tts/lang_pico
6336	./tts
6880	./lib/modules/ath6kl
6884	./lib/modules
6900	./usr/icu
7608	./usr
9728	./b2g/webapps/{59215fc3-72f8-412d-b7c9-5b5b82b050be}
18104	./b2g/models/en-US
21800	./b2g/models
31424	./fonts
39440	./lib
48012	./b2g/webapps/keyboard.gaiamobile.org
104492	./b2g/webapps
181620	./b2g
276476	.
Sorry for the large post, here is in pastebin , you can delete my last comment.

In the pastebin is my .userconfig and the output from 'du | sort -n' on the system folder.

https://pastebin.mozilla.org/8844021
Hey Guys!

I compiled today and all fine! I just erased ALL from my .userconfig , so the images are without any modification or added file. I'll be trying to use my .userconfig as always before, so If I find what was doing the problem I will post here.

Install: out/target/product/hamachi/system/sources.xml
Finding NOTICE files: out/target/product/hamachi/obj/NOTICE_FILES/hash-timestamp
Combining NOTICE files: out/target/product/hamachi/obj/NOTICE.html
Installed file list: out/target/product/hamachi/installed-files.txt
Target system fs image: out/target/product/hamachi/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/hamachi/system.img
out/target/product/hamachi/system.img+ total size is 182766144
Indeed it works again, hurray!
The system.img size is now 195Mb, smaller than the max 214Mb available. Shallow flashing didn't work, though, but that's probbly normal. In any case, the problem is solved...
The problem is a variable in the .userconfig , I compiled in the morning without any variable , later do it with the VARIANT=user, GAIA_MEMORY_PROFILE=low and GAIA_DISTRIBUTION_DIR=distros/spark and all was fine, but when I add other like MOZILLA_OFFICIAL=1, B2G_SYSTEM_APPS=1, B2G_UPDATER=1, B2G_UPDATE_CHANNEL=default, ENABLE_DEFAULT_BOOTANIMATION=true, DEVICE_DEBUG=1, NO_LOCK_SCREEN=1 and the image size increase a lot!!! :/
Here's a few tips:

- MOZILLA_OFFICIAL=1 will pull in all the official branding (images, etc...) that's going to add stuff

- B2G_SYSTEM_APPS is not something you should be setting yourself, it's set by the build system

- GAIA_DISTRIBUTION_DIR=distros/spark will pull in the spark customization, this will also add to the storage requirements

- I don't think that ENABLE_DEFAULT_BOOTANIMATION is used anymore but I could be wrong

- DEVICE_DEBUG=1 is going to enable debugging stuff and disable gaia optimizations, this is definitely going to make the image larger

BTW in the meantime I think we should close this as WORKSFORME as the problem appears only when adding tons of stuff to the default image. If you need any additional help send me an e-mail and I'll be glad to help you with your build.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Thanks Gabriele!

I'll send you an email :D

Cheers!
You need to log in before you can comment on or make changes to this bug.