system image is out of space
Closed this issue · 6 comments
At the end of make aosp+gapps for nexus 7 device, i got a error about system folder is too large to fit in the allocated size of system image. Can i change the image size safely? how can i find the max image size i can change to, or should i adjust nexus 7's partition table definition?
make_ext4fs -s -T -1 -S out_6.0/aosp/target/product/deb/root/file_contexts -L system -l 880803840 -J -a system out_6.0/aosp/target/product/deb/obj/PACKAGING/systemimage_intermediates/system.img out_6.0/aosp/target/product/deb/system out_6.0/aosp/target/product/deb/system
error: ext4_allocate_best_fit_partial: failed to allocate 1807 blocks, out of space?
Creating filesystem with parameters:
Size: 880803840
Block size: 4096
Blocks per group: 32768
Inodes per group: 7680
Inode size: 256
Journal blocks: 0
Label: system
Blocks: 215040
Block groups: 7
Reserved block group size: 55
error: failed to build out_6.0/aosp/target/product/deb/obj/PACKAGING/systemimage_intermediates/system.img from out_6.0/aosp/target/product/deb/system
Out of space? the tree size of out_6.0/aosp/target/product/deb/system is (MB):
1136 out_6.0/aosp/target/product/deb/system
The max is 840 MB.
build/core/Makefile:1018: recipe for target 'out_6.0/aosp/target/product/deb/obj/PACKAGING/systemimage_intermediates/system.img' failed
make: *** [out_6.0/aosp/target/product/deb/obj/PACKAGING/systemimage_intermediates/system.img] Error 1
The size of system dir
# du -h out_6.0/aosp/target/product/deb/system --max-depth=1
660M out_6.0/aosp/target/product/deb/system/app
5.0M out_6.0/aosp/target/product/deb/system/etc
69M out_6.0/aosp/target/product/deb/system/usr
11M out_6.0/aosp/target/product/deb/system/bin
84M out_6.0/aosp/target/product/deb/system/lib
166M out_6.0/aosp/target/product/deb/system/priv-app
3.7M out_6.0/aosp/target/product/deb/system/xbin
6.8M out_6.0/aosp/target/product/deb/system/tts
35M out_6.0/aosp/target/product/deb/system/fonts
57M out_6.0/aosp/target/product/deb/system/vendor
33M out_6.0/aosp/target/product/deb/system/framework
11M out_6.0/aosp/target/product/deb/system/media
1.2G out_6.0/aosp/target/product/deb/system
The property is based on BOARD_SYSTEMIMAGE_PARTITION_SIZE
in device/manufacturer/product/BoardConfig.mk
, for example:
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1006632960
If the resulting system.img is larger then this, then the Android build system will fail. You should use a smaller gapps package.
You could increase the BOARD_SYSTEMIMAGE_PARTITION_SIZE
but then you need access to the bootloader, to change the partition table. I.e. it's not recommended :)
@Blystad thanks! I change gapps package type to mini and succeed in the building. The system size is just enough to be put in the system.img 👍
out_6.0/aosp/target/product/deb/system.img maxsize=899137536 blocksize=135168 total=848358916 reserve=9191424
@jcppkkk What do you mean by " change gapps package type to mini"? How did you do exactly?
@limxtop1989 it's in README.md 😞
- Set the desired OpenGapps variant
In your device/manufacturer/product/device.mk file, in the beginning, add:
GAPPS_VARIANT := <variant>
where is one of the package types in lowercase. E.g:
GAPPS_VARIANT := stock
where GAPPS_VARIANT can be any of: Super Stock Full Mini Micro Nano Pico
Hello there,
I am struggling to flash the system.img for the same issue. My device ASUS Zenfone Selfie is bootlooped and that's why am unable to start the OS as well. Can you describe the procedure from the scratch for my situation please?
Hello @Blystad , @jcppkkk , @limxtop1989,
I am building AOSP from source code. The tag number is android-7.1.1_r55 for "Nexus 6" device. I am using ubuntu 16.04 with 8GB RAM. I got to know to build on 8GB system the heap size needs to be increased else build will fail [link].
But I am encountering the error mentioned below during the make
process. I also tried editing the device/manufacturer/product/device.mk for various variant values for each build at start of device.mk file. I tried for: mini, micro, nano.
GAPPS_VARIANT := <variant>
as suggested by @jcppkkk , but no success.
Please help.
Error message:
Running: mkuserimg.sh -s out/target/product/shamu/system out/target/product/shamu/obj/PACKAGING/systemimage_intermediates/system.img ext4 system
2113941504 -D out/target/product/shamu/system -L system
out/target/product/shamu/root/file_contexts.bin
make_ext4fs -s -T -1 -S out/target/product/shamu/root/file_contexts.bin -L system -l 2113941504 -a
system out/target/product/shamu/obj/PACKAGING/systemimage_intermediates/system.img
out/target/product/shamu/system out/target/product/shamu/system
Creating filesystem with parameters:
Size: 2113941504
Block size: 4096
Blocks per group: 32768
Inodes per group: 8064
Inode size: 256
Journal blocks: 8064
Label: system
Blocks: 516099
Block groups: 16
Reserved block group size: 127
Created filesystem with 2297/129024 inodes and 233379/516099 blocks
build_verity_tree -A aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7
out/target/product/shamu/obj/PACKAGING/systemimage_intermediates/system.img
/tmp/tmpBfVxfj_verity_images/verity.img
system/extras/verity/build_verity_metadata.py 2113941504
/tmp/tmpBfVxfj_verity_images/verity_metadata.img
48885d8c29bbe630130b5592bed7df084cc4810173d67130bc61933ebe302caa
aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7
/dev/block/platform/msm_sdcc.1/by-name/system verity_signer
build/target/product/security/verity.pk8
cat /tmp/tmpBfVxfj_verity_images/verity_metadata.img >> /tmp/tmpBfVxfj_verity_images/verity.img
fec -e out/target/product/shamu/obj/PACKAGING/systemimage_intermediates/system.img
/tmp/tmpBfVxfj_verity_images/verity.img /tmp/tmpBfVxfj_verity_images/verity_fec.img
Could not build FEC data! Error: terminating with uncaught exception of type std::bad_alloc:
std::bad_alloc
Aborted (core dumped)
Out of space? the tree size of out/target/product/shamu/system is (MB):
846 out/target/product/shamu/system
The max is 2048 MB.
[ 83% 30414/36517] Checking build with Jack:
out/target/common/obj/APPS/CtsCameraTestCases_intermediates/jack.check.timestamp
[ 83% 30414/36517] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/apache-
harmony-tests_intermediates/classes.jack
[ 83% 30414/36517] Compiling SDK Stubs with Jack:
out/target/common/obj/JAVA_LIBRARIES/android_test_stubs_current_intermediates/classes.jack
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
�[0;31m#### make failed to build some targets (02:56:43 (hh:mm:ss)) ####�[00m