Commit graph

394 commits

Author SHA1 Message Date
Geremy Condra
95ebe7a09b Use the specified verity key to sign boot and recovery OTA images.
This ensures that when the verity key is rotated to a release key
both the boot and recovery images will be correctly signed. It does
mean that they will both be signed with the same key for now, but
as that doesn't change the threat model separating them is just a
distant nice-to-have.

Bug: 15725238
Change-Id: I5b75e4346fe0655065643ab553431690cc1a8cb0
2014-08-20 20:17:01 +00:00
Geremy Condra
f19b365cc9 Add support for switching to verity release keys.
Bug: 15725238
Change-Id: I8f92210fd854b5a2567cf76aaecb5be02c3f9293
2014-08-20 00:05:23 +00:00
Benoit Fradin
a45a8682fa BuildBootImage: Add secondstage image support [DO NOT MERGE]
The AOSP bootimage format allows the use of a second stage image
however the BuildBootableImage function does not allows the "second"
optional argument. This patch adds the support of this argument.

Bug: 17035158

Change-Id: I8ed9d9e56449945c2d42fc908269921c394f68c0
Signed-off-by: Benoit Fradin <benoit.fradin@intel.com>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Patrick Tjin <pattjin@google.com>
2014-08-14 11:24:54 -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
Doug Zongker
f83400896d add 5 minute timeout on binary patch construction
When making bsdiff/imgdiff patches, give up after 5 minutes.  (On
certain large files it can take hours to build a patch, if it ever
even completes.)

Change-Id: I123c06f8194f85f6f4e640f7eb31c7746f76ba4d
2014-08-05 10:39:37 -07:00
Doug Zongker
56d91dd07f Merge "fall back to generating full OTA if incremental fails" into lmp-dev 2014-08-01 17:53:35 +00:00
Doug Zongker
62d4f18a30 fall back to generating full OTA if incremental fails
Block incremental OTA generation can currently fail on some
target-files pairs.  Fall back to generating a full OTA so that the
script succeeds rather than failing.

Change-Id: Ide70395d1f3759aa2076bd173836f6a5e5b397c0
2014-08-04 16:06:43 -07:00
Ying Wang
a961a09e59 Fix error: 'NoneType' object is not iterable
Change-Id: I5a54edbed0e5e5481a570b93c07d50f6ca3e18e0
2014-07-29 11:42:37 -07:00
Doug Zongker
3c84f56948 store images in target-files
Store sparse images in the target-files, and use those (when they're
available) for building block OTAs.

- New script add_img_to_target_files is added to make the images and
  add them to the IMAGES/ subdir in the target-files.  It gets run
  from the Makefile when building a target-files.

- img_from_target_files becomes mostly vestigial: it creates the
  img.zip by just copying the images out of the target-files.  (It
  still knows how to build images for use on older target-files.)

- ota_from_target_files uses images from the target-files in
  preference to rebuilding images from the source files.

- sign_apk_target_files builds images and includes them in its output
  target files (even if the input target-files didn't have them).

Bug: 16488065
Change-Id: I444e0d722d636978209467ffc01750a585c6db75
2014-07-31 11:06:30 -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
4d09dcb2c6 releasetools: only allow yaffs to have no userdata image size (fix build)
In the past, there was an exception for ext-base fs types to
deal with the lack of image size.
Back then it was only yaffs and ext*.
So now we explicitely only allow yaffs to have no userdata image size.

Change-Id: Ie354ee6222a58228dbcce2c6934971a0737422af
Signed-off-by: JP Abgrall <jpa@google.com>
2014-06-26 21:15:39 -07:00
Ying Wang
f5770d78da resolved conflicts for merge of 240e136e to master
Change-Id: Ic6e2cbe593914ddb613454581964c5d3d443b9d5
2014-06-19 10:32:35 -07:00
Ying Wang
240e136efd am 318c8e76: am 17c6426e: Merge "Document the worker_threads option."
* commit '318c8e76ee8f47fb9f077e419713cf4dbb454788':
  Document the worker_threads option.
2014-06-19 17:16:39 +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
c8b4e849f1 full support for OTA of vendor partitions
Make vendor partition a first-class member of the OTA system (for
target_files that contain a VENDOR/ subdirectory).

Build vendor images in a way that is compatible with block-based OTA.
Support updating the vendor partition in both full and incremental,
block and file OTAs.  In most cases this is handled by refactoring the
existing code to handle the system partition to handle either, and
then calling it twice.

Currently we don't support incremental OTAs from a target-files
without a VENDOR subdirectory to one with one, or vice versa.  To add
or remove a vendor partition a full OTA will need to be done.

Bug: 15544685
Change-Id: I9cb9a1267060bd9683a9bea19b43a26b5a43800d
2014-06-16 15:39:54 -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
Doug Zongker
1113e38195 test block patch more realistically
Read and write the same file when testing block patches, which can
turn up errors that don't show up otherwise.  (And will appear on the
device.)

Change-Id: Ic9b8d93ec980d13163b135f619af589f41433d7f
2014-06-13 10:38:32 -07:00
Martin Blumenstingl
374e114d16 Document the worker_threads option.
Change-Id: I44775493bedc0c7224c2c4ef06330bdb1430a1b6
2014-06-11 23:03:44 +02:00
Doug Zongker
4b9596fe00 configure progress bar during block OTA script generation
Emit script commands to produce a more accurate progress bar (for full
block OTAs) and a working progress bar (for incremental block OTAs) --
ones that are driven by the progress callback from the thing actually
writing the system image.

Change-Id: Ifca10be68cfdaab7135d23515bd0ae5be2f98a16
2014-06-09 14:15:45 -07:00
Ying Wang
1343ec169c am b75fe469: am eafdd2cd: Fix emulator builds
* commit 'b75fe4696e847ef49aa9b11693243c00de497808':
  Fix emulator builds
2014-06-04 22:24:51 +00:00
Ying Wang
eafdd2cd87 Fix emulator builds
which don't have boot.img.

Change-Id: Id97a53c5356d435d9c70107ef047bed003769e22
2014-06-04 15:16:17 -07:00
Ying Wang
3a9cb0ca11 Merge "Allow to build the update.zip for emulator build." 2014-06-04 17:40:45 +00:00
Ying Wang
dc7ff05427 am bc080d51: am 2a386e0c: Allow to build the update.zip for emulator build.
* commit 'bc080d510f022da8055b89b85e02d91e74c3757d':
  Allow to build the update.zip for emulator build.
2014-06-04 17:26:00 +00:00
Ying Wang
2a386e0cfb Allow to build the update.zip for emulator build.
img_from_target_files.py just skips the boot.img and recovery.img since
there is no kernel or recovery.fstab for emulator.

Bug: 15383279
Change-Id: I4035193e6ab933194ff1417dfae4eab963fe5301
2014-06-04 17:04:14 +00:00
Michael Runge
4eb9e61c24 Merge "Add sprout support to signing tools" 2014-06-03 22:32:38 +00:00
Michael Runge
dc2661afe2 Add sprout support to signing tools
Bug: 15379701

Change-Id: Ied8329e1162250cc5509b65ef8bf0b5a9ddda3c3
2014-06-03 15:30:40 -07:00
Ying Wang
f8824aff68 Allow to build the update.zip for emulator build.
img_from_target_files.py just skipps the boot.img and recovery.img since
there is no kernel or recovery.fstab for emulator.

Bug: 15383279
Change-Id: I4035193e6ab933194ff1417dfae4eab963fe5301
2014-06-03 14:07:27 -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
15d5348e6c Reopen temporary system image to avoid stale data.
NamedTemporaryFile's aggressive caching behavior can cause an issue
where changes made by another process aren't visible even after the
fseek() below or a flush(). To avoid this, simply open the file
again and read from the fresh version.

This fixes an issue where verity metadata written by append2simg
doesn't become visible to img_from_target_files.

Change-Id: I291fb3a95d5b532218ac6205ecc9e9b4f3a36bd4
2014-05-13 20:23:54 -07:00
Geremy Condra
c10320eef3 Merge "Add verity support to make dist." 2014-05-12 17:00:58 +00: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
Michael Runge
4f12fceead Add missing quotation mark in assertion
Change-Id: I3e76997fe257bfccb7d61dcc1273e014cdb55a41
2014-05-09 14:14:42 -07:00
Doug Zongker
91a99c28e0 fix ota script to generate non-block commands correctly
If you had a target_files without a recovery patch and specified
--block (which should have no effect without a patch), it would have
omitted some necessary commands from the OTA script.

Change-Id: I96e79cd561ebf09cfe53792d1cc558cc71479869
2014-05-09 13:16:50 -07:00
Doug Zongker
af845256f1 assert recovery finger/thumbprints, not system
Block OTAs don't have the system partition mounted and so can't use
file_getprop on the system partition.  Make assertions look at the
recovery system finger/thumbprints, which should be the same as the
ones on the system partition (even for sprout devices).

Change-Id: Ie5d329d13beab4b428e37f75da9b9e1b8ceb35bc
2014-05-09 08:29:05 -07:00
Ed Heyl
3e92fd0fba Fix build: Revert "Add verity support to make dist."
This reverts commit 5dee206d8e.

Change-Id: I6f4f536c127d3e5dcb6594efb193231cd8dece7e
2014-05-09 05:53:54 +00:00
Geremy Condra
5dee206d8e Add verity support to make dist.
Without this, system images will be built that do not contain the
necessary bits for verification.

Change-Id: Icaa636085dbfd386424c90dfbe404c5960df0fe4
2014-05-06 18:06:18 -07:00
Michael Runge
0a2ce08f66 Merge "Support block OTA + OEM partition" 2014-05-05 19:57:56 +00:00
Michael Runge
c6e3afd26d Support block OTA + OEM partition
Change-Id: I9e662098569a43b05279908e6833e9552a7abe3a
2014-05-05 12:22:12 -07:00
Colin Cross
e8eef02cca Merge "verity: switch to C++ version of build_verity_tree" 2014-05-02 23:52:16 +00:00
Michael Runge
6e836116f7 Add support for verifying OEM properties.
A separate OEM file must be specified to provide the expected
values for these properties.  The list of properties comes from
the "oem_fingerprint_properties" list in misc_info.txt

Bug: b/13367676

Change-Id: I1a3eaf108492132cf6f595a5d1c9f7e0c3cb3142
2014-05-01 17:37:57 -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
Ying Wang
c73e461537 Fix variable name.
Change-Id: Ie7439f71cf7fd2eeacd45a5d6625e610dad8bfbe
(cherry picked from commit 1a1dfcb5fcb6eda11d8dbf5df02f0083853dd5c1)
2014-04-15 22:31:54 +00:00
Ying Wang
114b46f15d Accomodate to the import syntax in build.prop.
Bug: 14024566
Change-Id: I71692244fabcd4d12f65849ffa027295b3a2a79a
(cherry picked from commit 092fea0d3e644573d7f0dbfe6692f42431f83c5c)
2014-04-15 20:28:53 +00:00
Doug Zongker
2a99239920 Merge "test block system image patch at build time" 2014-03-06 16:39:20 +00:00
Doug Zongker
922206ec2a move data wipe to end of OTA package
Now that OTA packages can be downloaded to /data, if they include a
data wipe we should do that last.

Change-Id: I75102fb2ff85d0f0110d55dfca06ec5f38104850
2014-03-04 13:16:24 -08:00
Doug Zongker
32b527d6cb test block system image patch at build time
After building a patch for the system image (for incremental block
OTAs), apply it to a local copy of the file and test that it succeeds.
This is an imperfect test as it's using the local client's
syspatch_host, which may differ from the syspatch library actually
used in the target build, but it's somewhat better than nothing.

Change-Id: Ic0001b0145881e2ebd4b5b36ce9b5bcebd76deb4
2014-03-04 10:03:02 -08: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
25568486e5 add option to specify updater binary, for development
Change-Id: I5f239afff70c87fb16ddc4b8abefa7bbcda6040d
2014-03-03 10:21:27 -08:00
Doug Zongker
26e6619c37 add --block flag to ota_from_target_files
Add the --block flag to this script to control whether block-based OTA
packages are generated (defaults to off).  Make the full OTA package
produced by "make otapackage" continue to produce a block-based OTA.

Also fix a problem where block incremental OTAs didn't ever succeed,
and the --no_signing option never worked.

Change-Id: I610d0b4abed4b8b65fbe8ce0abaeec6cf52e14a1
2014-02-20 13:30:44 -08:00
Geremy Condra
d75d7128ce Merge "Add support for block incremental OTAs" 2014-02-20 21:10:39 +00:00
Geremy Condra
36bd365625 Add support for block incremental OTAs
Change-Id: Ie72015e34ed8d7595a5c74c8df41cba73275afab
2014-02-20 12:54:17 -08:00
Doug Zongker
4abfeaa358 Merge "rebuild recovery patch in sign_target_files_apks" 2014-02-20 16:33:36 +00:00
Doug Zongker
cf6d5a9074 bump releasetools python requirement to 2.7
These scripts already use some post-2.4 features, so let's make it
official: Python 2.7 is needed to run them.

Change-Id: I256e9ed99b0b62abe4e22a7b1f811acb7419e88e
2014-02-18 10:57:07 -08:00
Doug Zongker
412c02fffb rebuild recovery patch in sign_target_files_apks
The target_files zip should now contain the recovery-from-boot patch
and the script to install it.  This means that sign_target_files_apks,
which generates a signed target_files from an unsigned target_files,
now needs to recompute the patch and script (taking into account the
key replacement, property changes, etc., that it does) so its output
contains the correct patch.

Change-Id: I18afd73864ba5c480b7ec11de19d1f5e7763a8c0
2014-02-13 10:58:24 -08:00
Ying Wang
64a55babf2 Fix typo.
Change-Id: I01a1762fe449e02ff80a5ea7a3ee1c529e5da902
2014-02-05 12:15:06 -08:00
Ying Wang
d89ffa8623 Fix emulator builds
which don't have boot.img.

Change-Id: Id97a53c5356d435d9c70107ef047bed003769e22
2014-02-05 11:29:34 -08:00
Doug Zongker
01ce19c95f make full OTAs block based
Instead of writing individual files and fixing up their metadata, make
full OTAs contain a system image and simply write it to the block
device.

This is only done for target-files that already contain the recovery
flashing information, older target-files still get a file-based full
OTA.

Bug: 12893978
Change-Id: If7586083c8f275e24fec49d260af5b5aff4a0a88
2014-02-04 14:04:42 -08:00
Doug Zongker
c9253822ea add recovery update code to system images
Currently, the "img" zip files generated by the build system lack the
script and data needed to rewrite the recovery partition, while the
"ota" zip files do (when installed).

In order to move towards block-based OTAs, we want the result of
flashing an image and the result of installing the corresponding OTA
package to be identical.

Generate the recovery-from-boot patch and install script as part of
the process of building the target-files.  This requires breaking the
code to generate that out of ota_from_target_files into its own tool
that we can run from the Makefile.  (ota_from_target_files can still
do this, so it continues to work with older target-files.)

Bug: 12893978
Change-Id: I80e62268840780b81216e548be89b47baf81b4ac
2014-02-04 13:50:35 -08:00
Ying Wang
eb18125f2f am 0064dceb: am a8d15474: am 04cff708: resolved conflicts for merge of 7382ec7d to klp-dev-plus-aosp
* commit '0064dceb198788e237bbc10931c54b9a35275976':
  ota_from_target_files: Add an option to not sign OTA packages
2014-01-28 00:13:04 +00:00
Ying Wang
04cff70804 resolved conflicts for merge of 7382ec7d to klp-dev-plus-aosp
Change-Id: Ic414d3ec8b52b1045125e1b76deae8a4a59a5e52
2014-01-27 15:56:45 -08:00
Doug Zongker
eb0a78afc0 prefer releasetools.py from target_files zip
If the target_files zip for the target build contains a
META/releasetools.py (which it has since Nov 2013), prefer that over
using a releasetools.py from the local client.

Explicitly specifying the device-specific extensions path via
command-line options takes priority over both of the above mechanisms.

Change-Id: Ia068b0e2e06ede7da89ebe4315cdec592eb8995e
2014-01-27 10:03:23 -08:00
Takeshi Kanemoto
e153b34643 ota_from_target_files: Add an option to not sign OTA packages
Sometimes it is useful to be able to tell ota_from_target_files
to not sign the output zip file. For instance, the private
release key may not be available when ota_from_target_files
is executed; similarly the release tools may not be available
or executable where the private key is stored.

This change adds an option, '--no_signing', to simply output the
unsigned OTA zip file, instead of spuriously signing it with the
test key even though the zip file would need to be re-signed later
with a different key.

Change-Id: I1f3c4dc8ffa35ce85478f848b147aff3d40fe283
2014-01-27 15:01:04 +09:00
Michael Runge
52ad1d7043 am 1a4520a5: am d961b7d0: am 5636d07a: am a80542db: am 4038aa8f: Enabled incrementals to patch + rename moved files
* commit '1a4520a5680a05a360986b260d15e170ed899da5':
  Enabled incrementals to patch + rename moved files
2013-12-26 23:50:25 +00:00
Michael Runge
5636d07a29 am a80542db: am 4038aa8f: Enabled incrementals to patch + rename moved files
* commit 'a80542dbf4f193c59525b8749871bcdf4ae4283a':
  Enabled incrementals to patch + rename moved files
2013-12-26 15:33:27 -08:00
Michael Runge
4038aa8fff Enabled incrementals to patch + rename moved files
Change-Id: I551fc5291847e3ace15361c203d86f566c26da97
2013-12-16 11:29:51 -08:00
Ying Wang
c4b1577d6e resolved conflicts for merge of 1b53b6a7 to master
Change-Id: Id08fb8de4f136596fd39b651446ec96fc952427a
2013-12-11 15:27:46 -08:00
Ying Wang
d532077a8f am d270230f: Merge "sign_target_files_apks: rewrite build.prop correctly in eng builds"
* commit 'd270230fa49311901d8797a9e77865c37857d028':
  sign_target_files_apks: rewrite build.prop correctly in eng builds
2013-12-11 15:15:10 -08:00
Andrew Boie
73d5abbd3f sign_target_files_apks: rewrite build.prop correctly in eng builds
In eng builds, ro.display.id has many space separated items and was
resulting in an error when trying to rewrite it as 'value' gets
turned into a list and never converted back to a string.

Change-Id: I6c8633ed2eb52c56a4097992a32d53d80df4f844
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2013-12-11 13:23:15 -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
Doug Zongker
b00398a07e am a6fadb61: am 57c9ffef: am 9b23f2cd: add option to generate two-step recovery files
* commit 'a6fadb61cae38089bc534f3cb995b98689f796cb':
  add option to generate two-step recovery files
2013-12-03 17:06:04 +00:00
Doug Zongker
a6fadb61ca am 57c9ffef: am 9b23f2cd: add option to generate two-step recovery files
* commit '57c9ffef30a6f34e126d8e89a08d208b05cc4901':
  add option to generate two-step recovery files
2013-12-03 08:58:11 -08:00
Doug Zongker
9b23f2cd78 add option to generate two-step recovery files
When run with the -2 option, ota_from_target_files will generate a
package (full or incremental) that does some extra reboots in order to
install the new recovery first, so that the rest of the installation
is done with the new recovery.  This can be useful if (say) the
package installation needs some features from the newer kernel.

For incremental packages, the verification phase is still done with
the old recovery.

This is only supported on devices where the misc partition is EMMC
(not MTD).

Two-step packages are slower to install and possibly confusing to
users (they will see their device reboot four times instead of twice),
so only use this option if necessary.

Change-Id: I3267d905e5e8eb1a1eb61bf48255b8b24ffc4ad1
2013-11-27 11:27:55 -08:00
Dave Langemak
cb067ad2f6 am c3644114: am 8ea83e90: am 96f56b6f: Merge "Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."" into klp-dev
* commit 'c3644114805150eef2f5035085878e5f860c7436':
  Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."
2013-11-21 22:59:47 -08:00
Dave Langemak
c364411480 am 8ea83e90: am 96f56b6f: Merge "Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."" into klp-dev
* commit '8ea83e902d931591af37e747763e768e7a6990be':
  Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."
2013-11-21 17:16:26 -08:00
Dave Langemak
96f56b6fcb Merge "Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."" into klp-dev 2013-11-22 01:08:53 +00:00
Michael Runge
90c60d3b92 Revert "Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add."
This reverts commit 37335b4238.

Change-Id: I61cc125d3b08eaa300a7774b6607dbb43f0e7148
2013-11-22 00:52:51 +00: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
Baligh Uddin
40d2cfc01e am 38f1aed0: am dcc645eb: am dd00a967: Merge "Revert the revert. (its time to sign MR1)" into klp-dev
* commit '38f1aed01d7bfeba6368d321f1233fa2b7903cb5':
  Revert the revert. (its time to sign MR1)
2013-11-12 19:28:54 -08:00
Baligh Uddin
38f1aed01d am dcc645eb: am dd00a967: Merge "Revert the revert. (its time to sign MR1)" into klp-dev
* commit 'dcc645ebb1a87982d2a067b8584ff167ae2c5287':
  Revert the revert. (its time to sign MR1)
2013-11-12 16:46:48 -08:00
Baligh Uddin
dd00a9677b Merge "Revert the revert. (its time to sign MR1)" into klp-dev 2013-11-13 00:38:47 +00:00
Baligh Uddin
beb6afdee2 Revert the revert. (its time to sign MR1)
Revert "Waiting till post MR0 - this impacts signing tools for MR0."

This reverts commit a7b5c4a7dc.

Bug: 11334314
Change-Id: I89f8996161e4258b80bf2d0bc7817f0e8e32df13
2013-11-13 00:23:10 +00:00
Michael Runge
c5d3cb362c am 3b44339d: am 37335b42: Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add.
* commit '3b44339d6a443fde57db4ae84a7e46823da6d162':
  Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add.
2013-11-07 16:13:15 -08:00
Michael Runge
3b44339d6a am 37335b42: Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add.
* commit '37335b42385970d957d48056145a3d4c4dbc6087':
  Enable incremental builder to find files that moved, and try to process them via patch + rename, instead of delete + add.
2013-11-07 15:00:42 -08:00
Michael Runge
37335b4238 Enable incremental builder to find files that moved, and
try to process them via patch + rename, instead of
delete + add.

b/11437930

Change-Id: Ie70632a2fa0a13d4bb259f61c620bb01812494e5
2013-11-07 11:36:03 -08:00
Baligh Uddin
aa4a34ec1f am 31469e36: am a7b5c4a7: Waiting till post MR0 - this impacts signing tools for MR0.
* commit '31469e36e078e044e883aeb103888af3411e9691':
  Waiting till post MR0 - this impacts signing tools for MR0.
2013-10-23 18:32:47 -07:00
Baligh Uddin
31469e36e0 am a7b5c4a7: Waiting till post MR0 - this impacts signing tools for MR0.
* commit 'a7b5c4a7dc77a0896d6314828b9ce85f82d103e8':
  Waiting till post MR0 - this impacts signing tools for MR0.
2013-10-23 18:30:01 -07:00
Baligh Uddin
a7b5c4a7dc Waiting till post MR0 - this impacts signing tools for MR0.
Revert "Modify release tools to replace certs in MMAC files."

This reverts commit a6e0466ab5.

Change-Id: Ib7819185bad119013f307ce4301d5f02190e14ed
2013-10-23 16:53:43 +00:00
Robert Craig
a6e0466ab5 Modify release tools to replace certs in MMAC files.
Added support to perform a string replace of specified
dev keys with release keys when using the release tool
scripts.

Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>

(cherry picked from commit 817c574d75)

Change-Id: I51be8d62945436d3f374f51867295c5b792d4b53
Bug: 11334314
2013-10-22 13:54:46 -07:00
Ying Wang
717ee5ab0e am 13871a8f: resolved conflicts for merge of 65d5e788 to klp-dev-plus-aosp
* commit '13871a8f500b0f9a5e167be3487c1e8d1f92f327':
  Fix parsing string parameters in BOARD_MKBOOTIMG_ARGS
2013-09-13 17:56:51 -07:00
Ying Wang
13871a8f50 resolved conflicts for merge of 65d5e788 to klp-dev-plus-aosp
Change-Id: Iad8793c5e53b239425e9bba1b6a925265ff8d130
2013-09-13 17:50:29 -07:00
Nick Kralevich
69fecd43c1 am 46f00b61: am b5d4c0df: Merge "Update OTA to understand SELinux labels and capabilities" into klp-dev
* commit '46f00b6167f4c23dd4874abe9377bac85e965b2f':
  Update OTA to understand SELinux labels and capabilities
2013-09-10 13:17:18 -07:00
Nick Kralevich
46f00b6167 am b5d4c0df: Merge "Update OTA to understand SELinux labels and capabilities" into klp-dev
* commit 'b5d4c0df503966f2a050af64dfa15c84f2e12c15':
  Update OTA to understand SELinux labels and capabilities
2013-09-10 13:14:54 -07:00
Nick Kralevich
0eb17d9447 Update OTA to understand SELinux labels and capabilities
Update the OTA generation script to understand SELinux file
labels and file capabilities.

Make fs_config aware of SELinux labels and file capabilities, and
optionally output those elements whenever we output the
UID / GID / file perms. The information is emitted as a key=value pair
to allow for future extensibility.

Pass the SELinux file label and capabilities to the newly created
set_metadata() and set_metadata_recursive() calls. When the OTA
script fixes up filesystem permissions, it will also fix up the SELinux
labels and file capabilities.

If no SELinux label and capabilities are available for the file, use
the old set_perm and set_perm_recursive calls.

Bug: 8985290
Bug: 10183961
Bug: 10186213
Change-Id: I4fcfb2c234dbfb965cee9e62f060092a4274d22d
2013-09-10 12:30:43 -07:00
Jianxun Zhang
098494981d Fix parsing string parameters in BOARD_MKBOOTIMG_ARGS
The existing logic in common.py breaks string arguments incorrectly:
e.g. --para1 val1 --para2 "val2 is a string" will be output as:

'--para', 'val1, '--para2', 'val2' 'is' 'a' 'string'

This will cause mkbootimg command fails due to the invalid arguments
generated from the wrong parsing.

The patch fixes this issue to get:

'--para', 'val1, '--para2', 'val2 is a string'

Change-Id: Ia34ec357550f11ae9d6adc719d86a0c6a9099fbc
Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
2013-08-27 15:31:13 -07:00
Ying Wang
430a46c024 am a3ee330a: am fa67740a: am 25977365: Merge "mkbootimg: Support custom mkbootimg implementation"
* commit 'a3ee330ac52e188c9545c022552572e0e9541577':
  mkbootimg: Support custom mkbootimg implementation
2013-08-19 14:31:17 -07:00
Ying Wang
a3ee330ac5 am fa67740a: am 25977365: Merge "mkbootimg: Support custom mkbootimg implementation"
* commit 'fa67740ae41fc068d9a9b5fbf5a7a06c36dbbdb1':
  mkbootimg: Support custom mkbootimg implementation
2013-08-19 14:29:32 -07:00
Bjorn Andersson
612e2cd0e8 mkbootimg: Support custom mkbootimg implementation
Support using custom mkbootimg to allow boards to specify custom
boot image formats. Also export this as the environment variable
MKBOOTIMG to the *_from_target_files releasetools scripts.

Change-Id: I2084273b1175de097fb7da5c4f2264ea8014d74f
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
2013-08-09 16:29:02 -07:00
Doug Zongker
bbd6073430 fix sign_target_files_apks on non-user builds
Not that these should ever be signed, but still, it shouldn't crash.

Change-Id: I2b837e2c77f6e81743f93c96f361fc187b4fb82b
2013-08-09 13:20:36 -07:00
Ying Wang
412bc2329f am 0a7e26e2: am a3f69c93: Merge "Modify release tools to replace certs in MMAC files."
* commit '0a7e26e29dfb5efbb008ced7509931e5e5eb4d71':
  Modify release tools to replace certs in MMAC files.
2013-08-09 12:47:17 -07:00
Robert Craig
817c574d75 Modify release tools to replace certs in MMAC files.
Added support to perform a string replace of specified
dev keys with release keys when using the release tool
scripts.

Change-Id: Id0e945b0d62720c41f5ca9764a00de4bcdecaab4
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-08-09 07:20:52 -04:00
Doug Zongker
a8608a7f7c distinguish signed and unsigned user builds in UI
Add "dev-keys" or "test-keys" to the value of ro.build.display.id for
user builds.  (This is the property that is displayed under "Build
number" in the Settings UI.)  Modify the signing script to remove the
keys tag from this value when signing.

Change-Id: I3d9d92056f8567d7f84b1be047619be7c6e4c419
2013-07-23 11:51:04 -07:00
T.R. Fullhart
37e1052c99 Add support for using custom signapk.jar.
Details:
* New --signapk_path, --extra_signapk_args, --java_path.
* New --public_key_suffix, --private_key_suffix so you can change the filenames.
* Fixes raising exceptions on error.

Change-Id: I0b7014b6d779d52ae896f95dfecb1bcccf536cf4
(cherry picked from commit a28acc6972)
2013-06-05 22:17:59 +00:00
T.R. Fullhart
e9a1f47e65 Merge "Add support for using custom signapk.jar." 2013-06-05 17:50:40 +00:00
T.R. Fullhart
a28acc6972 Add support for using custom signapk.jar.
Details:
* New --signapk_path, --extra_signapk_args, --java_path.
* New --public_key_suffix, --private_key_suffix so you can change the filenames.
* Fixes raising exceptions on error.

Change-Id: I0b7014b6d779d52ae896f95dfecb1bcccf536cf4
2013-06-05 09:57:55 -07:00
Doug Zongker
0d92f1f13a improve OTA failure messages
Replace OTA script constructs of the form:

   assert(foo);

with

   foo || abort("sensible message");

so that the log and the on-screen display is somewhat more accessible
to non-experts.  (assert() displays the source code of the false
expression 'foo'.)

Change-Id: Ic99448e4466561d305b167cd4d5c1f0f2dbadcce
2013-06-03 12:07:12 -07:00
Kenny Root
e2e9f613b5 Fix signing process for SELinux file_contexts
When not building locally and just using a target-files.zip from some
other build, it still tries to access the file_contexts from the out/
directory. This change instead looks at the unzipped target-files.zip
hierarchy to grab that information.

Bug: 9191141
Change-Id: I6ea12e82d6c6376fcada412314c5eefc97ff4853
2013-05-29 14:38:48 -07:00
Ying Wang
a0febe5e6d Support to build vendor.img
Bug: 8341435
Change-Id: I2db7970936984d38aed35054e3f695d298f4e512
2013-03-25 09:53:16 -07:00
Ying Wang
d7321d31ac Skip userdata.img only if partition size is not give for extfs.
We still build yaffs2 images which don't need partition size.

Change-Id: I9c7f45069f25868666a257cee044faecf1a8781a
2013-03-15 10:32:29 -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
Ken Sumrall
3b07cf1277 Add unified fstab support to release tools
Update the release tools to be able to handle the new unified fstab.

Change-Id: Id9d1810c89aba415e83ae2fc586520f148ec73ef
2013-02-21 16:26:46 -08:00
Ying Wang
a7c8f72b40 Use the correct size key
At this point, userdata_size has been converted to partition_size in
build_image.ImagePropFromGlobalDict().

Change-Id: Ida6be1905ca3109c2660274a16359a9f3fbcd94d
2012-11-27 11:29:11 -08:00
Ying Wang
69e9b4d6d1 Run e2fsck on built sparse images.
Bug: 7591683
Change-Id: Id1cba79f7840aab1f0327cb741eda655b45d1b46
2012-11-27 09:57:17 -08:00
Ying Wang
4e3f44f356 Skip userdata.img if no size is provided when building images from target files
Change-Id: Iab5c510fcc7608c4b109781e6595ab8964f4c543
2012-11-19 10:38:44 -08:00
Doug Zongker
b32161a2a5 change recovery partition construction to use resource .dat
When /system/etc/recovery-resource.dat is available, use it to
construct the recovery-from-boot patch.

Change-Id: I1575f7d284711323186ca6823842eb2a866fd890
2012-08-21 10:33:44 -07:00
Doug Zongker
1eb74dd9a0 load SYSTEM/build.prop into the info_dict
Change-Id: Ic747106ba11773ffc9c2eebc163cfd22b1d7a4d5
2012-08-16 16:19:00 -07:00
Doug Zongker
24cd280328 allow diff program to be selected explicitly
Change-Id: I1d8df9cc3ed35cc5983bc50fc13975db32072dbe
2012-08-14 16:36:15 -07:00
Doug Zongker
d513160b76 add extra args to mkbootimg
Arrange to take $(BOARD_MKBOOTIMG_ARGS) and pass it to all invocations
of mkbootimg from within make, and to store it in the target_files so
it can be used by future invocations of img_from_target_files and
ota_from_target_files.

Bug: 6918260
Change-Id: I7130ac52e96bd51d4d8b80ca036635e1626f01f1
2012-08-02 15:03:41 -07:00
Doug Zongker
fffe1d5e9c use the file uid/gid/mode saved in the target_files
When building a bootable image with mkbootfs, use the set of file
metadata that's stored in the target_files zip (when available),
rather than whatever is built into the mkbootfs binary at the time the
image is built.

Bug: 6435132
Change-Id: If6c59149bdbcc9a67e5ab9161398f355bd1f511d
2012-05-03 16:15:29 -07:00
Kenny Root
f32dc71e49 resolved conflicts for merge of a86fcc29 to master
Change-Id: I3868c19bfd309b5b43b5642152a120931fe37315
2012-04-09 14:59:04 -07:00
Stephen Smalley
56882bf9b4 Support the setting of file security contexts in OTA and update packages.
Pass the file_contexts configuration to the releasetools scripts
so that the security contexts of files can be properly set for OTA
and update packages.

Requires Ica5fb73d6f2ffb981b74d1896538988dbc4d9b24

Change-Id: I5a63fd61a7e74d386d0803946d06bcf2fa8a857e
2012-04-06 15:35:41 -04:00
Doug Zongker
1807e700a5 don't generate retouch commands in OTA scripts
Doing ASLR at OTA time is now obsolete; we can stop emitting this code
in OTA scripts.

Change-Id: I2bcf8ef0697ea5590120f89dcd302f273daf531e
2012-02-28 12:21:08 -08:00
Andrew Boie
0f9aec837f releasetools: Fix image size checking
A block of code that should be evaluated for all
image types was instead only being run for yaffs
partitions.

Change-Id: I83ccbd7fa3c1bc02b9bba0832701ecc258e40a7d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2012-02-21 12:45:23 -08:00
Doug Zongker
e5ff5907be add device-specific hooks at start of OTA phases
Change-Id: I47534e6d40e7918ee8cb9e87d76d9030b9273708
2012-01-17 10:55:37 -08:00
Doug Zongker
bd2dadc21a check entire recovery partition on startup
Checksum the entire recovery partition at boot time to see if we need
to rewrite it, rather than just the first 2kb.

Bug: 5668350
Change-Id: I777754f92e8da630ae3c09bb0d4c41884ff62f39
2011-12-02 13:55:57 -08:00
Doug Zongker
0276d18873 check entire recovery partition on startup
Checksum the entire recovery partition at boot time to see if we need
to rewrite it, rather than just the first 2kb.

Bug: 5668350
Change-Id: I777754f92e8da630ae3c09bb0d4c41884ff62f39
2011-12-02 10:46:59 -08:00
Doug Zongker
402839d17a am 29ea81eb: am 4a84a13e: am a5f534df: use frozensets to represent APK cert sets
* commit '29ea81eb977699a2b026f08d13f213a7d216cb7e':
  use frozensets to represent APK cert sets
2011-11-11 20:36:58 -08:00
Doug Zongker
a5f534df07 use frozensets to represent APK cert sets
Change-Id: Ic92c83be0c3f6a76bf1bd21f0216cd1b87586959
2011-11-11 09:51:37 -08: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
Doug Zongker
4906f456a4 am 53bef54c: am 4b87f575: am 278c9781: to be upgraded, APKs must have exactly the same set of certs
* commit '53bef54cfff0cb9c6a67494b3e385a9617f75d03':
  to be upgraded, APKs must have exactly the same set of certs
2011-11-10 16:14:42 +00:00
Doug Zongker
278c9781ec to be upgraded, APKs must have exactly the same set of certs
Change-Id: I0d528d3d55e5ee553e57e63ed1f998172c6306f8
2011-11-09 10:32:23 -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
Jeff Davidson
033fbe28c2 Support signing target_files without a recovery.fstab.
Change-Id: I7d6f511c69d589bf035ac3eb7eeee4b0e0505faa
2011-10-26 18:16:13 -07:00
Doug Zongker
b11e2d78ec add missing parameter to ReplaceOtaKeys
Change-Id: Ib596235a8e3b3588d363fea82b92b69895ee5408
2011-10-05 11:23:06 -07:00
Doug Zongker
831840e51b change OTA tools to handle variable dev keys
The signing and OTA-building tools now understand the
default_sys_dev_certificate value which may be present in the
META/misc_info.txt file of the target-files packages.

Change-Id: I64f09ec0b77a5184b6ddb74019255518776ee773
2011-10-04 16:02:01 -07:00
Doug Zongker
b40a58e4b3 allow APKs to be signed with multiple certs
The Package Manager handles this now.  To share a UID, all packages
must be signed with exactly the same set of certs.

Change-Id: I2fd08923f55f02ae2f1d503266ab124be2472921
2011-09-29 13:22:57 -07:00
Doug Zongker
e92f15a858 patch the /system/build.prop file last
Works around a problem observed on a retail device: incremental update
from build 1 to build 2 partially completed, leaving a mix of files
from the two builds.  (Why it booted into the regular system instead
of recovery to restart update installation is still a mystery.)
build.prop was one of the files updated, so the device reported itself
as having build 2.  The device hobbled along for months in this state,
until build 3 was released and the 2-to-3 incremental package
repeatedly failed (because some of the files it was trying to patch
were build 1).

This change makes updating build.prop the very last thing does by an
incremental update script, so if installation is aborted and the
regular system starts (and works at all), it will continue reporting
itself as build 1 and be sent the 1-to-2 OTA package again.

Change-Id: I1edc1dcef2bd2495b6fd96517c2f4c574b994f27
2011-08-26 13:46:40 -07:00
Ying Wang
bed0a19583 am 6d38bdfc: resolved conflicts for merge of a74a4811 to honeycomb-plus-aosp
* commit '6d38bdfc7b9ff699370b4a40dcbdddce0ea713b8':
  sha module is deprecated
2011-08-11 16:59:48 -07:00
Ying Wang
6d38bdfc7b resolved conflicts for merge of a74a4811 to honeycomb-plus-aosp
Change-Id: I8400ac2bead6aa1a9902d44bf65906084ad353ad
2011-08-11 16:55:00 -07:00
david
cad0bb9f62 sha module is deprecated
This patch removes the deprecated warnings from the python
scripts.

Change-Id: I052a0aab3fb28dd1d78de1307edafda6b6c35e5f
2011-08-10 17:48:04 -07:00
Doug Zongker
02da210a5c pass blobs to write_raw_image() instead of using temp file
Change-Id: I73b71541596612552d52a8f7b1ccdd74451ac6fc
2011-04-12 15:50:17 -07:00
Ying Wang
eb68729bf3 am 080ed92e: Merge "Close inherited PIPE before doing work" into gingerbread
* commit '080ed92e77fc7c24ca3bac1a1dc06057390bfdb8':
  Close inherited PIPE before doing work
2011-03-15 18:21:20 -07:00
Ying Wang
080ed92e77 Merge "Close inherited PIPE before doing work" into gingerbread 2011-03-15 17:49:05 -07:00
Ying Wang
70d6ec5f9b resolved conflicts for merge of 0a1f3236 to honeycomb-plus-aosp
Change-Id: I6596f4a65a99eed98bdca2d8a6840bc378297b6d
2011-03-07 11:07:12 -08:00