Skip to content
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

system image is out of space #13

Closed
jcppkkk opened this issue Jan 15, 2016 · 6 comments
Closed

system image is out of space #13

jcppkkk opened this issue Jan 15, 2016 · 6 comments

Comments

@jcppkkk
Copy link

jcppkkk commented Jan 15, 2016

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
@acr92
Copy link
Contributor

acr92 commented Jan 15, 2016

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 :)

@jcppkkk
Copy link
Author

jcppkkk commented Jan 16, 2016

@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

@limxtop1989
Copy link

@jcppkkk What do you mean by " change gapps package type to mini"? How did you do exactly?

@jcppkkk
Copy link
Author

jcppkkk commented Mar 17, 2017

@limxtop1989 it's in README.md 😞

  1. 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

@Farsid009
Copy link

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?

@pksiwan11
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants