Commit graph

2753 commits

Author SHA1 Message Date
Ying Wang
8f180b904f Merge "Create userdata.img with real data when SANITIZE_TARGET=address." 2015-06-25 21:29:52 +00:00
Ying Wang
2a04839aec Create userdata.img with real data when SANITIZE_TARGET=address.
Bug: 21785137
Change-Id: Ie0c36988759fe07419ad29bab5a71cdd0d992d2a
2015-06-25 14:29:04 -07:00
Mohamad Ayyash
042e851999 Merge "build_image.py: Make sparse squashfs images" 2015-06-24 22:01:00 +00:00
Mohamad Ayyash
2cd51cc711 build_image.py: Make sparse squashfs images
Change-Id: Iea0399868a9406f9929d8176d61d5698a2043697
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-24 11:08:00 -07:00
Tao Bao
109555753f Fix the error in sparse_img.py
Bug: 22046423
Change-Id: I0796e14df2b523570f0c485d146273f5e5aa5494
(cherry picked from commit 2b4ff174ff)
2015-06-23 17:44:48 -07:00
Dan Albert
944fc40eda Stop disallowing sanitizers.
Change-Id: I641cb3fe998184f8926324e3365a7a99d87263df
2015-06-16 22:20:19 -07:00
Ying Wang
4540a85dd4 Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
   PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
   Each makefile configures an image.
   For image configuration makefile foo/bar/xyz.mk, the built image
   file name
   will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
  - CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
    etc.
  - CUSTOM_IMAGE_PARTITION_SIZE
  - CUSTOM_IMAGE_FILE_SYSTEM_TYPE
  - CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
    accepted by BuildImage() in tools/releasetools/build_image.py.
  - CUSTOM_IMAGE_MODULES, a list of module names you want to include
    in the image; Not only the module itself will be installed to proper
    path in the image, you can also piggyback additional files/directories
    with the module's LOCAL_PICKUP_FILES.
  - CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
    the image. <dest> is relativ to the root of the image.

To build all those images, run "make custom_images".

Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
(cherry picked from commit 5fcf1094f9)
2015-06-03 09:56:29 -07:00
Tao Bao
e7b103751c Fix the wrong error message
apply_patch_space() checks the free space on /cache, not /system.

Change-Id: I70996d5cd5a81fe4871ee738bddb1437e8df6fb9
2015-06-03 09:25:10 -07:00
Tao Bao
68658c0f4f Add post-install verification for BBOTAs
Similar to the assertations in file-based OTA, we perform verification
for block-based OTAs (BBOTAs) after updating a partition, for both of
the incremental and full OTAs. It increases the update time (~20s on
Nexus 6), but will capture unnoticed errors right away.

Bug: 21500869
Change-Id: I89ac8fe623b855721b7affd07cf9426a23433ab0
2015-06-01 15:00:30 -07:00
Clay Murphy
b7bb040c75 Merge "Docs: Update link to new Community page location" 2015-06-01 19:04:56 +00:00
Oreste Salerno
420e341a36 Do not add 'adb' to persist.sys.usb.config if already there
The 'adb' configuration might have already been added by a
device-specific Makefile, so add it only if it's not already there.

Change-Id: I6f96645f44c96f6f827cc8c842a8b769f92be13a
2015-05-29 07:46:40 +00:00
Clay Murphy
7607786843 Docs: Update link to new Community page location
Bug: 21277510

Change-Id: I527e4efe264cbcf61bce997bed9086f1cb060c83
2015-05-27 18:37:02 -07:00
Brian Carlstrom
663127d0ca Use zipalign -p to page align .so files
Bug: 21400810
Change-Id: Ie3adf26dd3a51acfdb0faa23dc8ca1b206fb3727
(cherry picked from commit 903186f938)
2015-05-26 15:16:36 -07:00
Tao Bao
9773465409 Fix the permission setting in common.ZipWriteStr()
When passing a ZipInfo instance to common.ZipWriteStr(), the
external_attr attribute should not be overwritten unless specified.
We didn't have the issue previously because we were calling
ZipFile.writestr() directly until [1] merged.

[1] commit 2ed665a033.

Bug: http://b/21309935
Change-Id: I374ccd40c174ff9259844f38bdbf187dfe82552d
2015-05-20 12:18:55 -07:00
Jeff Vander Stoep
7033819eeb Merge "Remove unused #include <selinux/android.h>" 2015-05-14 15:27:51 +00:00
Jeff Vander Stoep
80ae3084d0 Remove unused #include <selinux/android.h>
Change-Id: Iebc59784c7318edb1c1f686e040ed581259bdd5a
2015-05-13 14:24:04 -07:00
Tao Bao
2f7ae925a3 Merge "Add support for clobbered blocks" 2015-05-13 19:03:08 +00:00
Tao Bao
ff7778166b Add support for clobbered blocks
In ext4 filesystems, some blocks might be changed even being mounted
R/O, such as the superblock (block 0). We need to exclude such blocks
from integrity verification. Plus such blocks should always be
written to the target by copying instead of patching.

Bug: http://b/20939131
Change-Id: I991169ec307dfb231b2fe8908a0668595ecb2060
2015-05-13 11:19:39 -07:00
Baligh Uddin
852a5b531c Add bootsigner path as an option
Change-Id: I3d804b7937aafea8274b06edab097a6dca8f04cd
(cherry picked from commit e204868f1f)
2015-05-13 10:07:47 -07:00
Tao Bao
2ed665a033 Wrap zipfile.write(), writestr() and close()
In order to work around the zip 2GiB limit, we need to wrap the related
functions in zipfile. Calls to those functions should always be replaced
with calls to the wrappers instead.

Bug: 18015246
Change-Id: Ice494371ca6654e88ded2ae0eb680f51082effcb
2015-05-08 13:51:12 -07:00
Mohamad Ayyash
a990534e73 common.py: Add support for squashfs
Change-Id: Ia40f8c6307d0213d43207aee91c4c8a5b5ad6f1e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-05-01 15:39:43 -07:00
Jeff Brown
9dc5808702 Add float support to binary event log.
Bug: 20664753
Change-Id: Iab232b1f172094919839d57f15644dfb2eaa1425
2015-04-28 18:21:09 -07:00
Sami Tolvanen
e09d096ed6 Check partition hash before resorting to block_image_verify
It's not necessary to call block_image_verify for the most common
case where we attempt an update for the first time and the target
partition has expected contents. It is sufficient to confirm that
the target partition is intact.

Computing a hash is much faster than simulating the update, which
means this change should make the update speed for v3 much closer
to v2 for the common case. If the update was interrupted, this is
going to make resuming somewhat slower, of course. Hopefully this
should be rather rare.

Bug: 20309033
Change-Id: I04792f3681bf2cd5d9a4e1c41eb883c7f26c6f58
2015-04-24 10:56:59 +00:00
Tao Bao
43078aa37a Add support for full radio option
Occasionally we need to include full radio image in incremental OTAs.
Adding --full_radio option to support that.

It needs matching changes in the releasetools.py in the target_files
zip, which comes from device/<vendor>/<device>/releasetools.py.

Bug: 19994922
Change-Id: Id1fb3a9cdb7e67dd9dbadd8fb6cd5fccd358820e
2015-04-21 16:54:52 -07:00
Sami Tolvanen
29f529f33e Calculate max_stashed_blocks correctly for block OTA v3
The updater automatically stashes overlapping source blocks to
make it possible to resume if the command performing the update
is interrupted. However, blockimgdiff.py does not take this into
account and therefore, max_stashed_blocks indicates only the
number of explicitly stashed blocks. Change blockimgdiff.py to
correctly calculate the maximum used stash space, including any
automatically stashed blocks.

Bug: 20309033
Change-Id: Ibf5cb1abc38c54e60a6ad3ce4cbce43556b08ac2
2015-04-17 16:28:08 +01:00
Glenn Kasten
1004eccb16 Merge "Fix bookmark title" 2015-04-16 23:12:50 +00:00
Glenn Kasten
1efbc8996e Fix bookmark title
Bug: 20299601
Change-Id: Ie57daf7b378cf370e34ff282d97fd36f2d74031a
2015-04-16 11:56:22 -07:00
Mark Salyzyn
6024069f37 build: fs_config_generate must open file in binary mode
Bug: 19908228
Change-Id: I2361b8af90b3729deb438e6a7a7179de12680b65
2015-04-16 08:43:33 -07:00
Mark Salyzyn
06b91b9bcf fs_config: Add fs_config_generate
fs_config_generate_$(TARGET_DEVICE) is built based off the content
of $(TARGET_ANDROID_FILESYSTEM_CONFIG_H). We also add the rules
fs_config_dirs and fs_config_file to utilize this command
for target contents:

fs_config_generate_$(TARGET_DEVICE) -D -o system/etc/fs_config_dir
fs_config_generate_$(TARGET_DEVICE) -F -o system/etc/fs_config_file

In order to use this feature, one must have the fs_config_dirs and
fs_config_files in the $(PRODUCT_PACKAGES) list defined in the
device make files in $(TARGET_DEVICE_DIR). And either an
android_filesystem_config.h file in that directory, or define a
path in TARGET_ANDROID_FILESYSTEM_CONFIG_H to point to one.

Bug: 19908228
Change-Id: Iee1543d99169f874e0915ae07962a7750ecb6342
2015-04-15 14:17:12 -07:00
Mark Salyzyn
073a9ebbbf fs_config: use libcutils and libselinux shared libraries
- move to libcutils.so and libselinux.so as shared now that
  they are in DISTTOOL.
- liblog dependency is part of libcutils, and need not be
  called out explicitly now. liblog is in DISTTOOL.
- libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: Iaa60ad624b42d83653840ac3c77bfa03ad8674aa
2015-04-15 14:17:07 -07:00
Tao Bao
6c55a8adc8 Dump fingerprints into recovery log
No more guessing. We should have the info for OTA issues diagnosis.

Change-Id: I0ce919434444ab16a38cc7af818e64785509b0fb
2015-04-09 17:36:05 -07:00
Mark Salyzyn
27ac7a9c1a fs_get_stats: add logging
libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: I75d472ed142e32959cec78bf7babbf39d2b66cd2
2015-04-07 09:19:27 -07:00
Mark Salyzyn
5f478fe3c5 fs_config: add logging
libcutils fs_config has the right to add Android logging

Bug: 19908228
Change-Id: I6d68107156962a6fec357ab99d23960c6852b026
2015-04-07 09:18:30 -07:00
Mark Salyzyn
1c5f19eabe fs_config: move fs_config to libcutils
Bug: 19908228
Change-Id: I4103ac395d0a28fd13173cc703e980aafe6c02e1
2015-04-02 13:56:00 -07:00
Mark Salyzyn
8efa6d3f0d fs_get_stats: move fs_config to libcutils
Bug: 19908228
Change-Id: I668bf8e11b09ccc9c298382e54208f531844b0c5
2015-04-02 13:55:44 -07:00
Mohamad Ayyash
6ddc360065 Merge "build_image.py: Verity support for flashing non partition spanning fs" 2015-04-02 18:18:21 +00:00
Tao Bao
d95e9fd267 Add support to sign bootable images with vboot_signer
Add vboot properties to the dictionary file, which will be packed into
the target_files zip. Add support in packaging and OTA scripts to
sign the generated bootable images (boot.img and recovery.img) when
vboot is enabled.

Change-Id: I08758ced03d173219415bca762bbdb66c464a9f5
(cherry picked from commit 5d5a3bd9e8d8b14b71d1b2105417a2958d13d3d2)
2015-04-01 09:23:08 -07:00
Mohamad Ayyash
dd063528ed build_image.py: Verity support for flashing non partition spanning fs
Change-Id: Ic5f7b256ed9a31e99ebaebdf8a8a19ba9adcced3
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-04-01 00:50:39 +00:00
Dan Albert
ebb19aa01a Fix up a few callers of GetTypeAndDevice.
Change-Id: I8f2d8d28b60715f917e9aceb8f851ad652034aa7
2015-03-27 19:11:53 -07:00
Dan Albert
99e22a57d0 Merge "Make releasetools pylint clean." 2015-03-27 18:40:02 +00:00
Ying Wang
a2292c94d1 Support to build image of root file system with /system and ramdisk combined.
Added support to build system.img that combines contents of /system and
the ramdisk, and can be mounted at the root of the file system.
To enable this feature, define BoardConfig.mk variable:
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

Ideally we would just change TARGET_OUT (the path of the staging system
directory) to under TARGET_ROOT_OUT. But at this point many places in
the build system assume TARGET_OUT is independent of TARGET_ROOT_OUT and
we can't make it easily configurable.
Instead this implementation takes the least intrusive approach:
We don't change TARGET_OUT or TARGET_ROOT_OUT. We just assemble a
temporary staging directory that contains contents of both TARGET_OUT
and TARGET_ROOT_OUT, in build_image.BuildImage() of
tools/releasetools/build_image.py.
When build_image.py is directly called from the makefile, we pass in the
parameters from the global dictionary; when build_image.BuildImage() is
called from add_img_to_target_files.py, we need to override values to
point to files extracted from the target_files zip file.
We need to combine the fs_config files of both /system and ramdisk,
when fs_config is enabled.

Also this change refactored build_image.BuildImage() by moving the extra
parameters to the image property dictionary.

(cherry-picked from commit 0eabd4f2c5)

Bug:19868522
Change-Id: Iafc467a0e3427b0d6ad3b575abcc98ddcc9ea0f1
2015-03-26 10:35:00 -07:00
Dan Albert
8b72aefb5a Make releasetools pylint clean.
This caught a few bugs/syntax errors (a few character classes were not
escaped properly in regex patterns, some indentation was illegal,
etc).

Change-Id: I50637607524e68c4fb9cad7167f58a46b8d26b2c
2015-03-24 11:05:16 -07:00
Dan Albert
5d60719e42 Merge "Run ZipFile.testzip() during zipfile tests." 2015-03-24 00:07:02 +00:00
Dan Albert
d6d1beb88c Run ZipFile.testzip() during zipfile tests.
This still doesn't catch the issue that [1] fixes, but it's probably a
good idea anyway.

[1]: https://android-review.googlesource.com/#/c/143469/

Change-Id: Iaa607ec7450d605b26114bd81ea41a14c6613c0e
2015-03-23 16:54:39 -07:00
Tao Bao
eaf885b1d0 Fix the computation of basefilename
Change-Id: I156b182414ef5b33611955cbc019e208c771013a
2015-03-23 16:05:26 -07:00
Greg Hackmann
6701db8145 Allow system images larger than 2GiB, pt. 2
We need to patch zipfile during close() too, because it refers to the
ZIP64 file size threshold when writing out the central directory

Bug: 18015246
Bug: 19888174

Change-Id: I1b49d653d0831fcc2106808f86c929d7a2b22ff3
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-23 14:35:50 -07:00
Tao Bao
3910ebf468 Fix the syntax error in the edify script generator
file_getprop() always expects two arguments.

Bug: 19881931
Change-Id: Icf5577ad34188991c03f68c1217642d3adc4201c
2015-03-22 14:20:48 -07:00
Tao Bao
b8c8717191 Make the generated OTAs repeatable
The generated OTAs are supposed to be repeatable. The use of dict in
blockimgdiff.py breaks the assumption for block-based OTAs. Fixed by
using OrderedDict instead.

Change-Id: I945bdc879912ba174ca330c152b1f8fc7ed211ac
2015-03-19 19:42:12 -07:00
Dan Albert
8e0178d41b Allow system images larger than 2GiB.
Python 2.7's zipfile implementation wrongly thinks that zip64 is
required for files larger than 2GiB. We can work around this by
adjusting their limit. Note that `zipfile.writestr()` will not work
for strings larger than 2GiB. The Python interpreter sometimes rejects
strings that large (though it isn't clear to me exactly what
circumstances cause this). `zipfile.write()` must be used directly to
work around this.

This mess can be avoided if we port to python3.

The bug (b/19364241) in original commit has been fixed.

Bug: 18015246
Bug: 19364241
Bug: 19839468

(cherry picked from commit cd082d4bfe)

Change-Id: I7b5cc310e0a9ba894533b53cb998afd5ce96d8c6
2015-03-19 13:59:01 -07:00
Tao Bao
dd2a5892e5 Restrict the verification in block-based incremental OTAs
BlockImageDiff has three versions. Only the incremental OTAs generated
with the latest version (3) can be re-applied to the system that's
already on the target build. Otherwise, operations like move will make
unconditional changes and damage the system. During the verification
phase, abort the OTA update if BlockImageDiff is less than 3 and it
doesn't match the checksum of the source build.

Change-Id: Ic630346eab2a993a84d0aeaacd7167ef62cc24f6
(cherry picked from commit daebaa6ed3)
2015-03-13 17:57:15 -07:00