Commit graph

249 commits

Author SHA1 Message Date
David Zeuthen
4e9c89ab87 resolve merge conflicts of 86180eb to nyc-mr1-dev-plus-aosp
Change-Id: Ia4bfb2571bac509cebe22f70ff43e6696f832423
2016-10-04 18:53:34 -04:00
David Zeuthen
4014a9daa7 Make room for AVB hashtree and metadata.
While the system.img images currently built with AVB support verify
correctly, mounting the filesystem content fails. This is because
'avbtool add_hashtree_footer' used to claim some of the unused /
DONT_CARE space for stashing the verity tables and this resulting in the
mapped device ending up being smaller causing the mount failure.

Fix this by leaving enough room for AVB hashtree and metadata before
building the image. This is achieved by moving the AVB hashtree support
into build_image.py and using a just added '--calc_max_image_size'
option to 'avbtool add_hashtree_footer' to figure out how much space to
leave out.

This depends on https://android-review.googlesource.com/#/c/281821/

Bug: 31264226
Test: Mounting dm-verity set up from system.img now works.

Merged-In: I4c5de1004c1059f8c582e76b3b8517d427aa1a87

Change-Id: I945a5f1f6782791736cd319f216cfa6b448fb04d
2016-10-04 17:32:16 -04:00
Sami Tolvanen
3d207c8889 Merge "build_image: add padding to match partition size" am: ef5751c1ec am: 5875285ecf
am: e261a2dc20

Change-Id: Ib396abb9f6707c984b2888b8b5a265d8ebcf76be
2016-09-02 18:24:43 +00:00
Sami Tolvanen
433905f50e build_image: add padding to match partition size
For some partition sizes, we currently build an image that's 1-2
blocks smaller than the actual partition, which causes fs_mgr to
not find metadata. This change adds padding to FEC metadata that
correctly positions the metadata header at the end.

Bug: 28865197
Change-Id: Ie0e044715a9c5ae8ba395e7d2ff9fbd7cffc0b4c
2016-09-02 10:20:02 -07:00
Alex Light
a3e8e9c6f3 resolve merge conflicts of 3f7c348 to nyc-mr1-dev-plus-aosp
Bug: 29278988

Change-Id: Icffb9a280311c7d3c45f096243ddf18f7ebecd9d
2016-06-29 15:43:54 -07:00
Alex Light
4e358ab2c3 Add system_other partition, install odex files
For AB devices, support flashing two system partitions for factory use.
The normal system image on one partition, but without dex preopt. And a
system_other image that just contains the odex files. The dex files will
not be stripped out of the system image, in case the second system
partition is wiped.

Setting BOARD_USES_SYSTEM_OTHER_ODEX := true in the BoardConfig.mk
enables this behavior.

One can control which directories are placed in system_other by the
SYSTEM_OTHER_ODEX_FILTER configuration variable. Currently we default
to only copying only app and priv-app odexs.

Bug: 29278988
Change-Id: I7f4e87da919e7dc6a89fd8c668193cd4e98631bc
2016-06-24 11:07:15 -07:00
Elliott Hughes
2d208075c6 Merge \\\"Remove obsolete MTD support from the releasetools scripts.\\\" am: 63fc2b6766 am: ece6ff869c
am: f66d3e61f8

Change-Id: Ib754bc3e9b1c895d431e3b7be9e5435bb6b05fb5
2016-06-17 05:05:08 +00:00
Elliott Hughes
f66d3e61f8 Merge \\"Remove obsolete MTD support from the releasetools scripts.\\" am: 63fc2b6766
am: ece6ff869c

Change-Id: I4b5f5b6a622a2fbb996861e8832e1fc1d12e6bf4
2016-06-17 05:02:05 +00:00
Elliott Hughes
ece6ff869c Merge \"Remove obsolete MTD support from the releasetools scripts.\"
am: 63fc2b6766

Change-Id: I26ed21479ab52d535bcc99b13e55a1476a02f76c
2016-06-17 04:59:26 +00:00
Elliott Hughes
305b088729 Remove obsolete MTD support from the releasetools scripts.
Bug: http://b/29250988
Change-Id: I653dc306485c6b35411840b53211d42eb6d19e34
2016-06-16 20:48:47 -07:00
Mohamad Ayyash
44dc2a973f resolve merge conflicts of 8ebbc4e to nyc-mr1-dev
am: 423862500b

Change-Id: I8f8dd48e52c1ab7cb3462725569cf7c1e0443d38
2016-06-16 20:22:30 +00:00
Mohamad Ayyash
423862500b resolve merge conflicts of 8ebbc4e to nyc-mr1-dev
Change-Id: I2349bb3fede317487227b16cb7c7b093a93a3876
2016-06-16 13:11:45 -07:00
Mohamad Ayyash
3336f9ae67 Merge \"squashfs: make disable-4k-align a parameter\" into nyc-dev
am: 8ebbc4e7e2

Change-Id: Ia5c59b7bfc7f2b25fa9b13c2ce52c1bd75ccecce
2016-06-16 16:39:39 +00:00
Mohamad Ayyash
1b6d3485fc squashfs: make disable-4k-align a parameter
BUG: 29388879
Change-Id: I121d2b76db5fb269e2f7152abb2e78098437a0d5
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-06-15 16:37:21 -07:00
Mohamad Ayyash
c3216ac077 Merge \\"Pass block_list param to mksquashfs\\" into nyc-dev am: 3bddf74752
am: 52cef0d4f0

Change-Id: I0fe16c6b9728acf7b46f412d705fa0aacd2b4655
2016-06-15 17:02:47 +00:00
Mohamad Ayyash
f80e55b821 Merge \"Pass block_list param to mksquashfs\" into nyc-dev
am: 3bddf74752

Change-Id: I713c6a60d10ef1e85475e462bb34c89751f74e7d
2016-06-15 16:58:36 +00:00
Mohamad Ayyash
52cef0d4f0 Merge \"Pass block_list param to mksquashfs\" into nyc-dev
am: 3bddf74752

Change-Id: I1679c255b297a36bc10b50ff9d6214c92d763489
2016-06-15 16:12:55 +00:00
Mohamad Ayyash
c3484f7f64 Pass block_list param to mksquashfs
Needed to generate image.map and to optimize the OTA size

BUG: 22322817
Change-Id: I7802f4dbb9116a94ea99a00b68c3a7ff180ef08a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-06-13 09:48:05 -07:00
Mohamad Ayyash
000d71dc1d Pass squashfs block size as a parameter
am: dfec815882

* commit 'dfec815882d2253c6c9130e3241a1906161f3824':
  Pass squashfs block size as a parameter

Change-Id: Ie767254ce653b6a0d21ca9922434ad350fd61a48
2016-05-24 21:08:17 +00:00
Mohamad Ayyash
dfec815882 Pass squashfs block size as a parameter
BUG: 28920352
Change-Id: Ifed02bd1565131814047991ec87fa61691bfe240
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-05-24 20:55:13 +00:00
Mohamad Ayyash
465acf8631 Use fs_config files for mksquashfs
BUG: 27467028
Change-Id: I7648030ad4b31d70a5d439e9552fd2cbfe288b74
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
BUG: 28704419
2016-05-12 18:44:48 -07:00
Mohamad Ayyash
230ef583b0 Merge "Use fs_config files for mksquashfs" into nyc-dev
am: b354a61

* commit 'b354a61f3ec3b4c6463aac2a80f23e5772b6b164':
  Use fs_config files for mksquashfs

Change-Id: I422bd6f5b8e7e587bec3caef1525497904268a96
2016-04-08 17:52:24 +00:00
Mohamad Ayyash
8837882fb9 Use fs_config files for mksquashfs
BUG: 27467028
Change-Id: I7648030ad4b31d70a5d439e9552fd2cbfe288b74
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-04-07 22:10:51 -07:00
Ying Wang
be667a1128 Merge "Correct usage message for build_image.py" am: d63ec28
am: 334a418

* commit '334a4185a5ca29086963a8d450fb7a9e972cbd77':
  Correct usage message for build_image.py

Change-Id: Iee000ee9974b4cb7329fab87dc81fdba2affe93d
2016-04-07 22:24:15 +00:00
Maria Bornski
885dbb5111 Correct usage message for build_image.py
target_out_dir is now a required argument. Include this in the usage message.

Change-Id: If77d94ec5350b2c737d1dd1df28a51167b173058
2016-04-06 17:26:31 -07:00
Mohamad Ayyash
f876555893 Hook incremental ext4 image generation into build
Allows passing the *.base_fs or *.map files for system and vendor in
INTERNAL_SYSTEM_BASE_FS_PATH and INTERNAL_VENDOR_BASE_FS_PATH variables
respectively.

Internal Design Doc: go/incremental-ext4
BUG: 26839493
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>

Change-Id: Ie57ef6dbfa6084268b6535fe0a673a3b4aaa6e2f
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-03-03 12:07:21 -08:00
Sami Tolvanen
405e71dcd3 Fix metadata location when file system doesn't span the partition
Pad the sparse image with a zero fill chunk to correctly position
verity and FEC metadata at the end of the partition.

Bug: 27073791
Change-Id: I9f70d579a42e5007d50e9c02a98a608d2815f0ed
(cherry picked from commit 6a8781a251)
2016-02-10 10:53:47 -08:00
Sami Tolvanen
6a8781a251 Fix metadata location when file system doesn't span the partition
Pad the sparse image with a zero fill chunk to correctly position
verity and FEC metadata at the end of the partition.

Bug: 27073791
Change-Id: I9f70d579a42e5007d50e9c02a98a608d2815f0ed
2016-02-10 09:37:59 -08:00
Patrick Tjin
e11aa50bb2 Add compressor options for squashfs vendor images
Change-Id: I4f9f5d62e24654cb37d436cb73dd5893aed30fa8
2016-02-09 15:41:07 -08:00
Sami Tolvanen
4a0600406e build_image: don't call append2simg for FEC
append2simg can be slow, so generate error correction data before verity
data is appended, and append all metadata to the image at the same time.

Needs matching changes from
  I09349368925e5e2f2a7961a712a1e933eb0b9ec8

Bug: 26251929
Change-Id: Iea8cee0aee353b4d029d9581e8fbd68ec7b7dd4b
2015-12-18 15:50:25 +00:00
Sami Tolvanen
ff914f5dd0 build_image: remove an unnecessary call to append2simg
append2simg on a large image is fairly slow, so append verity metadata to
the hash tree to avoid two calls.

Bug: 26251929
Change-Id: I5ec84dcd6e8500e990af13b1f9cef5e809b41605
2015-12-18 13:28:25 +00:00
Todd Poynor
b2a555e6fc Make squashfs sparse image generation optional
Allow non-sparse squashfs image generation, a la ext filesystems.

Bug: 26218766
Change-Id: Ifd596af16411e0cf69a2e7e05d725fd9442dc79c
2015-12-15 20:11:12 -08:00
Sami Tolvanen
f99b53143d Error correction: Append codes to verified partitions
Append error-correcting codes to verified partitions provided that
PRODUCT_SUPPORTS_VERITY_FEC is true.

This moves verity metadata to be after the hash tree, and requires
matching changes from
  Ide48f581bbba77aed6132f77b309db71630d81ed

Bug: 21893453
Change-Id: I6945cbab99e214566a1f9d3702333f2dbbc35816
2015-10-14 18:06:20 +01:00
Tao Bao
ce9635ec7a am 2124d7e1: Merge "Only use a fixed timestamp when packaging."
* commit '2124d7e1e2dec91ce4ab15c6a215d61f7693a8d6':
  Only use a fixed timestamp when packaging.
2015-09-30 23:50:49 +00:00
Tao Bao
822f5840c0 Only use a fixed timestamp when packaging.
[1] changed to use a fixed timestamp for all the generated images
(either the one under $ANDROID_PRODUCT_OUT/ or the one added into the
target_files zip). It makes 'adb sync' after 'fastboot flashall' to
resync all the files. This CL changes to use a fixed timestamp only when
packaging into the target_files zip.

[1]: commit 052ae3542b

Bug: 24377993
Bug: 24536411
Change-Id: I209318966109fd4902468dfe96caf777464f9fe1
2015-09-30 16:01:14 -07:00
Tao Bao
9a5afa5242 am 5e23069b: Merge "build_image.py: Use a fixed timestamp in the generated image."
* commit '5e23069bceebfbf17f67c709bad495d707b194dc':
  build_image.py: Use a fixed timestamp in the generated image.
2015-09-28 21:16:34 +00:00
Tao Bao
052ae3542b build_image.py: Use a fixed timestamp in the generated image.
Bug: 24377993
Change-Id: I9b1433c8c877dc2a391615bb016b8970426e9f70
2015-09-28 13:44:13 -07:00
Simon Wilson
37700c9ad1 Merge "Add compressor options for squashfs system images" 2015-07-29 21:35:57 +00:00
Tao Bao
1358123688 am a04e6b89: am dd68e68f: Merge "Override properties that point to out/ directory."
* commit 'a04e6b89ec262f4dd38c9d80ee05ce313bab9347':
  Override properties that point to out/ directory.
2015-07-21 18:25:36 +00:00
Tao Bao
84e7568b1f Override properties that point to out/ directory.
A few properties are stored as links to the files in the out/
directory, which are no longer available when (re)packing from
target_files zip. Redirect those properties to the actual files in
the unzipped directory when repacking.

Change-Id: I18e930cbea224ab9c6db8d4e721b1c266a671db6
2015-07-19 08:48:09 -07:00
Thierry Strudel
74a81e6633 fix device specific fs_config on build server
fs_config function from libcutils, in order to properly set the xattr FS
used to define device specific uid, gid, permissions and capabilities,
now needs TARGET_OUT make variable to be passed explicitly to all tools
using it:
  fs_config
  fs_get_stats used by mktarball.sh
  make_ext4fs used by mkuserimg.sh
  mksquashfs used by mksquashfsimage.sh

Bug: 21989305
Bug: 22048934
Change-Id: I6caf9cf870882fce2ead93027767092c29b75ded
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-10 10:55:54 -07:00
Simon Wilson
011ea06db7 Add compressor options for squashfs system images
Change-Id: I2a75f8754273f6e00b96ba6aca6741c4388f5da8
(cherry picked from commit f86e7eeabc)
2015-07-07 11:41:20 -07:00
Tao Bao
4e66343b2b Retry adjusting the size computation for reserved blocks.
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

It amends the last attemp in [1]. Now it computes the used blocks from the
make_ext4fs output, instead of altering its argument.

[1]: commit efbb5d2e69.

Bug: 21522719
Bug: 22023465
Bug: 22174684
Change-Id: Iaae6507f6de68a5892f2e3035d330039287b4492
(cherry picked from commit c7a6f1e4f8)
2015-06-30 12:17:28 -07:00
Tao Bao
c7a6f1e4f8 Retry adjusting the size computation for reserved blocks.
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

It amends the last attemp in [1]. Now it computes the used blocks from the
make_ext4fs output, instead of altering its argument.

[1]: commit efbb5d2e69.

Bug: 21522719
Bug: 22023465
Bug: 22174684
Change-Id: I9783a51abe6581ff5c75db81e78ac606d0f32c4c
2015-06-29 20:45:53 -07:00
Tao Bao
2384d01c1c Revert "Adjust the size computation for reserved blocks"
We should not change the parameter to mkfs_ext4. Bug filed at
b/22174684. Will come up with a new CL.

This reverts commit efbb5d2e69.

Change-Id: I15f7a9a07a65a936ba186d2ce672ec4832ed3e17
2015-06-29 12:55:38 -07:00
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
07a7590f08 Merge "build_image.py: Make sparse squashfs images" into mnc-dev 2015-06-24 23:15:56 +00:00
Simon Wilson
6d5ddc32ab resolved conflicts for merge of ecfc97f7 to mnc-dev
Change-Id: Ic7661c4176dc87cb2796f9cbb61bdd64f89cdc01
2015-06-24 16:06:34 -07:00
Simon Wilson
ecfc97f772 resolved conflicts for merge of f86e7eea to lmp-mr1-ub-dev
Change-Id: I746021aa57edd5f6fae6e57cec0908951a659664
2015-06-24 15:42:27 -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
Mohamad Ayyash
fa6c8a9b79 build_image.py: Make sparse squashfs images
Change-Id: Iea0399868a9406f9929d8176d61d5698a2043697
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-24 10:44:52 -07:00
Tao Bao
efbb5d2e69 Adjust the size computation for reserved blocks
Due to the change in https://lwn.net/Articles/546473/, kernel reserves a
few extra blocks (lesser of 2% and 4096 blocks) on ext4 FS which leads to
OTA update failures. Adjust the size computation if the device has
BOARD_HAS_EXT4_RESERVED_BLOCKS := true.

Bug: 21522719
Bug: 22023465
Change-Id: I49f16adbf2dedc5279fbb8622bf99ef71dcc494f
2015-06-23 14:53:28 -07:00
Simon Wilson
f86e7eeabc Add compressor options for squashfs system images
Change-Id: I2a75f8754273f6e00b96ba6aca6741c4388f5da8
2015-06-22 15:42:52 -07:00
Mohamad Ayyash
cade49ddee Allow flashing a squashfs system image
Change-Id: Ic51d11274784a8d2e9d57d5f0b821ebc89680e5a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-06-16 13:11:21 -07:00
Baligh Uddin
601ddeae06 Allow custom boot_signer and verity_signer.
Bug: 21701163
Change-Id: I85e75fd3a166a9f6a7859ebf81dee73322dc2798
2015-06-09 15:48:14 -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
f3282b4a7f 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: I499574cee51ec4804bc10cbefe0b17940afed918
(cherry picked from commit 2ed665a033)
2015-05-08 15:53:27 -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
e71b55606e am 347195da: am 6ddc3600: Merge "build_image.py: Verity support for flashing non partition spanning fs"
* commit '347195da2ea801db95cf201fa7516bf392dc005a':
  build_image.py: Verity support for flashing non partition spanning fs
2015-04-02 18:37:05 +00: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
eecf00db59 resolved conflicts for merge of 4c32aa3d to lmp-mr1-dev-plus-aosp
Change-Id: I32a06c88416e68ce628f642e0d025d1df5e227d7
2015-03-27 14:37:14 -07:00
Dan Albert
99e22a57d0 Merge "Make releasetools pylint clean." 2015-03-27 18:40:02 +00:00
Ying Wang
52ea2066a1 am abc748c1: am 6ff1b035: Merge "Support to build image of root file system with /system and ramdisk combined."
* commit 'abc748c11cbba71a99f306d318c74b5336b28730':
  Support to build image of root file system with /system and ramdisk combined.
2015-03-26 17:57:22 +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
Ying Wang
d4ca3b38d9 am 4cbc4b39: am ae61f50a: Support to configure and build multiple custom images.
* commit '4cbc4b392da57c34626af38a4ea0fe4dc115af57':
  Support to configure and build multiple custom images.
2015-03-14 00:31:44 +00:00
Ying Wang
ae61f50a68 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-03-14 00:06:54 +00:00
Mohamad Ayyash
9b19382f0e resolved conflicts for merge of fc759204 to stage-aosp-master
Change-Id: Icf58e881286a66cb3ca4cb122fa8c11ec217fbab
2015-03-04 15:43:45 -08:00
Mohamad Ayyash
b97746ef09 Allow flashing a squashfs system image
Change-Id: Ic51d11274784a8d2e9d57d5f0b821ebc89680e5a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2015-03-03 18:54:50 -08:00
David Turner
7a864af1b7 am aa112716: Merge "build_image: Set file system labels on disk images"
* commit 'aa112716067167d58d1db37aaf8adc49b83b59a1':
  build_image: Set file system labels on disk images
2015-01-07 20:28:17 +00:00
Christoffer Dall
8ed01f3816 build_image: Set file system labels on disk images
When building images set the mount point (data,cache,system) as the
filesystem label on the generated image.  This is required for the
Android Emulator.

IMPORTANT: This depends on the following patch to system/extras/:

    https://android-review.googlesource.com/#/c/120047/

which has already been submitted to AOSP and merged into the
internal tree.

Change-Id: Iaeb45462570c26d37980f1cc5d8a1b929e476c89
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2015-01-05 17:49:37 +01:00
Ying Wang
f3b86357e2 Support journal size board config variables.
A device can set up BOARD_SYSTEMIMAGE_JOURNAL_SIZE (number of journal blocks)
in its BoardConfig.mk.
To disable journaling, set "BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0".

BOARD_VENDORIMAGE_JOURNAL_SIZE and BOARD_OEMIMAGE_JOURNAL_SIZE work in
similar way.

Bug: 18430740
Change-Id: I0594814fe19ffc54dff41ec2464e2e3a802b9419
2014-11-18 18:19:43 -08:00
Paul Lawrence
a37b2bb236 Fix the build
Bug: 15984840
Bug: 18120110
Change-Id: I0224d5a31e03b711953d9496ecb00b6d88b8ef4c
2014-11-14 02:04:33 +00:00
Doug Zongker
fc44a515d4 new block OTA system tools
Replace the xdelta/xz-based block OTA generation with a new system
based on the existing bsdiff/imgdiff tools.

Bug: 16984795
Change-Id: Ia9732516ffdfc12be86260b2cc4b1dd2d210e886
2014-08-26 13:10:25 -07:00
Doug Zongker
f21cb5a219 save file block allocations in target_files
make_ext4fs can now output a file listing the blocks used for each
file in the image.  Request this file and save it in the target_files;
it will be used for future improvements to block OTAs.

Bug: 16984795
Change-Id: Id1e60465e3b5a9d126a7934b4d089cf34d8fec44
2014-08-12 17:09:38 -07:00
Daniel Rosenberg
f4eabc3961 Added support for building verified vendor partition
Change-Id: I762724800ccab3a365e6d2efdf86cd9c394818eb
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-07-14 22:55:22 +00:00
JP Abgrall
5bfed5a320 core+tools: support specifying F2FS as the fstype for userdata
- Support TARGET_USERIMAGES_USE_F2FS.
- Support BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE.
- Support "userdata_fs_type" in the prop dict.
- Update build_image to recognize f2fs and call the correct command.

Change-Id: If31cc8bd235f93a4c7814fab36e6e2d13d3037ad
Signed-off-by: JP Abgrall <jpa@google.com>
2014-06-17 13:32:14 -07:00
Doug Zongker
8282282122 use fs_config and file_contexts from target_files
When building images, we want to use the file_contexts and fs_config
data contained in the target_files zip, rather than whatever happens
to be in the current client.

Change-Id: I13df2405898039f5a9b4bb4837147e76b31b068a
2014-06-16 09:24:41 -07:00
Geremy Condra
e8e982afd3 Fix salt for verity tree generation.
Prior to this change salts were randomly generated, causing OTAs
to fail when they tried to check whether the system they were
installing on was binary identical to the source from which they
were generated.

Bug: 15018770
Change-Id: I86fffe2264a0c263aaf47112fb82fa71240e3403
2014-05-16 19:14:30 -07:00
Geremy Condra
5b5f4958d8 Add verity support to make dist.
Without this, system images will be built that do not contain the
necessary bits for verification.

Change-Id: I87c15282b26377d7a2a1540e3d0e30b0299622e3
2014-05-10 18:31:07 -07:00
Colin Cross
477cf2b029 verity: switch to C++ version of build_verity_tree
The C++ version avoids the need to unsparse the image to generate
the verity image, and is much faster for images with large regions
of don't care (treated as zeroes).

Change-Id: I8396b08a5fdb93f27d8c71c9c1ac23cb75cf1f7f
2014-04-28 17:19:13 -07:00
Ying Wang
b8888432f0 Set up rules to build oem.img
To build oem.img:
- You must define BOARD_OEMIMAGE_PARTITION_SIZE in your BoardConfig.mk
- The file system type will be the same as system.img and userdata.img.
- To install a module to oem.img, use "LOCAL_OEM_MODULE := true"
- run "make -j48 showcommands oem_image dist". By default it's not
  built.

Bug: 13367676
Change-Id: I1a26d4d0c61b72ecffe60279667b1b3de050780d
2014-04-28 09:43:51 -07:00
Doug Zongker
5fad2039bb handle don't care regions in the system image
The system partitions has regions that we shouldn't write and can't
depend on the contents of.  Adds a new script to generate a map of
these regions (using the sparse image as input), and include the map
in the package zip so it can be used when writing or patching the
system partition.

Also fixes a bug where the wrong SELinux file contexts are used when
generating incrementals.

Change-Id: Iaca5b967a3b7d1df843c7c21becc19b3f1633dad
2014-03-03 10:57:23 -08:00
Doug Zongker
1ad7adeaa7 some builds don't have a build.prop?
Change-Id: I31ab106a1934ff4bb7076c184f4d7581336e16da
2013-12-06 11:53:27 -08:00
Doug Zongker
df12406ad8 Merge "fix timestamps in images to the build date" 2013-12-06 19:27:58 +00:00
Geremy Condra
6e8f53c276 Fix unsparse image reuse bug.
This would cause an existing sparse image to be reused by a
subsequent build, leading to verity failures.

Change-Id: I2082df3dfba014515c9267e02189fe9987a56830
2013-12-05 17:09:18 -08:00
Doug Zongker
850b80780d fix timestamps in images to the build date
Pass the -T option to mkuserimg.sh to set all timestamps in the system
image (and any other ext4 image we build) to the value of
ro.build.date.utc for the build.  This makes images produced from a
given target_files bit-identical.

Change-Id: Ibba5fa7a610f476209ef61708729cfd79dece0b6
2013-12-05 15:54:55 -08:00
Geremy Condra
1f50400241 Fix a misnamed variable to fix the build.
Change-Id: Ia69d48ace0a6c10c5e6ea06714e52b8c937e213f
2013-11-17 18:10:55 -08:00
Geremy Condra
fd6f7513f8 Add support for verity builds to the build system.
Change-Id: I3ef908d8d52ec88de453b161bbc3f198517a72f1
2013-11-17 16:09:34 -08:00
Ying Wang
a0febe5e6d Support to build vendor.img
Bug: 8341435
Change-Id: I2db7970936984d38aed35054e3f695d298f4e512
2013-03-25 09:53:16 -07:00
Ying Wang
6a42a25429 Run e2fsck only when building images with the target files.
With this change, e2fsck is run only when you build the update.zip file,
which is built when "dist" is among the make command.

Bug: 7591683
Change-Id: I446b71d5aa9295aff3af622f115175f769746615
2013-02-27 13:54:02 -08:00
Ying Wang
69e9b4d6d1 Run e2fsck on built sparse images.
Bug: 7591683
Change-Id: Id1cba79f7840aab1f0327cb741eda655b45d1b46
2012-11-27 09:57:17 -08:00
Kenny Root
f32dc71e49 resolved conflicts for merge of a86fcc29 to master
Change-Id: I3868c19bfd309b5b43b5642152a120931fe37315
2012-04-09 14:59:04 -07:00
Ying Wang
9f8e8db188 Build cache.img on demand
Bug: 5153694
To build cache.img, set BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE (required,
ext4 only for now), BOARD_CACHEIMAGE_PARTITION_SIZE (optional) in
BoardConfig.mk.

Change-Id: I1d8b91646aa1dba88285e008ad3335768bcbddd2
2011-11-10 14:30:34 -08:00
Ying Wang
c0debb9b5e Revert "Build cache.img."
This reverts commit 531bdb546a.
2011-11-02 11:19:28 -07:00
Ying Wang
531bdb546a Build cache.img.
Change-Id: I3dbe7afa4934fa718ba20605eebd2e3ce2ae82ab
2011-11-01 10:44:19 -07:00
Ying Wang
bd93d425ae Unify the user image building code
Bug: 5398808

Before this change we have duplicate code in the Makefile and the
python-based releasetool. That's a real headache to maintain.

Change-Id: I8ddf04a79c6886540e89d990f723d8f77c9dd883
2011-10-31 17:11:35 -07:00