The issue has been addressed on releasetools script side, by specifying
UUID and AVB salt to get reproducible images [1].
[1] https://android-review.googlesource.com/c/platform/build/+/1135332
Fixes: 134525174
Test: `m dist` with a non-A/B target.
`validate_target_files out/dist/target_files.zip` passes.
Change-Id: Ida6750291706036c9b0c192d8abcde6d65155287
In commit I30137c3caef91805d9143d404e5e4d06c0fccc30, we added
a boot-debug.img to allow adb root when using an user build GSI image.
However, to run automated tests, it requires additional properties,
which are not needed for GSI compliance:
ro.audio.silent=1
ro.test_harness=1
This CL adds an additional boot-test-harness.img for automated tests,
and keeps the original boot-debug.img for GSI compliance.
Note: boot-test-harness.img won't be built by default, it needs
explicit `make bootimage_test_harness`.
Bug: 140036184
Test: `m bootimage_test_harness`, flashes boot-test-harness.img and checks
adb root works and test harness props are set.
Test: `m bootimage_test_harness dist -j32`, checks both
boot-test-harness.img and ramdisk-test-harness.img are under ./out/dist/.
Test: `system/tools/mkbootimg/unpack_bootimg.py --boot_img $OUT/boot-test-harness.img --out ramdisk-test-harness`,
checks the extracted out/ramdisk is as expected
Test: Run `gunzip -c ramdisk | cpio -idm` for the ramdisk extracted from
$OUT/boot-test-harness.img and $OUT/boot-debug.img, respectively.
Then compare the root dirs of both, e.g.,
`diff -rq --no-dereference ./ramdisk-test-harness ./ramdisk-debug`
Test: `m ramdisk_test_harness-nodeps` and `m bootimage_test_harness-nodeps`
Change-Id: Iadea0b5c933c3b7fa10dcf3d9e85596916b3333d
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.
The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.
* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)
This change includes the platform build system and release tools changes to
move the recovery resources from system to vendor (or /system/vendor). The
release tools need to know where to generate the recovery patch, and they
discover this from misc_info.txt variable board_uses_vendorimage, which the
platform build system generates.
We remove applypatch from PRODUCT_PACKAGES, but it is added back as a required
module in target/product/base_vendor.mk.
Several release tools rely on the misc_info.txt board_uses_vendorimage variable
to know how to generate and detect the recovery patch.
This change partially removes the --rebuild_recovery flag from the
merge_target_files.py script. The flag will be fully removed in a follow-on
change.
Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
They are designed to be used as a pair -- we should create separate
flags when there's a need.
Fixes: 130433003
Test: TreeHugger
Test: Define only one of them. `m dist` fails.
Change-Id: Ied57bd67fbed59b160c407dbb4c0d624581c58f7
Modifications made to make/core to handle new C Flags build variables which
store which module uses which flag.
C Flags build variables generated by Soong.
Bug: 140442588
Test: Executed m dist and presubmit
Change-Id: I4c730b9dba27672c6a9f75cf35beaf6311174af0
System Ext partition is not mounted in recovery mode. Install
system_ext_file_contexts and system_ext_property_contexts into
rootdir for recovery. This is similar to how we deal with system,
product, vendor, odm *_contexts files.
Bug: 137712473
Test: m bootimage for pixel 2, system_ext_file_contexts and
system-ext_property_contexts appear in $OUT/recovery/root/
Change-Id: I94b965d775e727fbbe26c8b715bbce3ca6179fa7
Allows us to use dist-for-goals and produce the fuzz target packages as
part of a normal dist.
Bug: 141026328
Test: m dist fuzz
Change-Id: Idffa879eb11266bfce18e0f9164e7ef80769cbc2
The vendor_boot partition is generated by mkbootimg and contains all the
device-specific information that used to reside in the boot partition.
Bug: 137297791
Change-Id: I5b005097b73f59857c3a2f92d693b3e67ee8424e
... so that it can be used during OTA package generation.
Bug: 141720569
Test: apply virtual A/B OTA
Change-Id: I3a1df1afb7676eed6d22be49270354119bfb5a75
mke2fs.conf is now packaged into the Python executable mkuserimg_mke2fs
and no longer needs to be packaged directly into otatools.zip.
Change-Id: I06216ccd60f834747f9302e30397a7f0bae53726
We're now adding a core CSI system.img that is common across different
targets. So GSI-specific things should be moved to /system_ext.
Also renaming various generic*/system.prop to generic*/system_ext.prop.
This is to put the customization into /system_ext/build.prop instead of
/system/build.prop.
Bug: 137711197
Test: boot a GSI on crosshatch, and checks the value of those properties
Change-Id: Id344124280d5f4a6c10d390a9e8a4a50cc7f28fb
Proguard dictionaries are useful for platform builds as well as
unbundled builds, produce them for both.
Bug: 140585949
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/${TARGET_PRODUCT}-proguard-dict-eng.ccross.zip
Change-Id: I63b826be35cfbfc9661b5be7de5bea285bd3d3fc
Test: Build the following targets and check the built image archive.
bonito-userdebug (contains flashable images);
cf_x86_phone-userdebug (contains super.img);
aosp_arm64-eng (contains VerifiedBootParams.textproto)
Test: m -j otatools-package; Check that zip2zip is included; Use
bin/img_from_target_files to generate image archive.
Change-Id: I9f28765bd702849f0df309faebd6aa3072920536
Instead of relying on META/{system,vendor}_{manifest,matrix}.xml
and blindly copy compatibility.zip from target files package to
OTA package, do a static check on the input target files package
before generating the OTA package.
META/{system,vendor}_{manifest,matrix} does not contain ODM manifest
fragments, which is incorrect.
Also, the on-device check of compatibility.zip uses a old libvintf
binary on the device, which may not understand the incoming VINTF
metadata. This change removes the on-device check. Hence, it removes
the requirement of forwards compatibility of libvintf.
This behavior can be skipped with --skip-compatibility-check.
Test: build OTA package
Bug: 139300422
Bug: 131425279
Change-Id: I7fb93be9eb73f578fc05a182c6c9d1f073db2800
Instead of checking META/{system,vendor}_{manifest,matrix}.xml (which
is error-prone because ODM SKU-specific manifests are not checked),
this script read the target files package, remaps its directory
structure so that checkvintf understands it, and check VINTF
compatibility.
Also, put it in otatools.zip.
Test: run it on an extracted target files package
Bug: 131425279
Change-Id: I06036f9a8d7242d4bc11524028be40e780c508e8
Include the misc_info.txt in "dist_files" so we can recreate a new
mixed super image (system and vendor images from different builds)
later in the test pipeline.
The misc_info.txt for products with BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE
set to true is removed from their update packages (essentially, reverts
aosp/976069) since the super_misc_info.txt created here can be used.
Bug: 139404128
Test: $ lunch aosp_x86-userdebug
$ m dist
$ diff $OUT_DIR/dist/super_misc_info.txt $OUT/misc_info.txt
Change-Id: Iad1ff981124a19933b0b575bc99941e0fc3813a7
We once attempted to use them (by importing from releasetools scripts)
to parse payload. Due to the dependency on google.protobuf, we have
switched to delta_generator instead (commit 750385e4).
Bug: 65261072
Test: `m -j otatools-package`; and check the related scripts are not
included.
Change-Id: Iaa8bcb0e2792e48512e1b8db29869db875ba8dc9
In line with the existing PRODUCT_BUILD_*_IMAGE variables, add a flag to
control whether vbmeta is generated.
Bug: 139328573
Test: manual
Change-Id: Id71026f9b0de9019e82e8ef594e718a4b0f3628f
These two tools are only used within build system, so not adding them
to otatools.zip.
Bug: 63866463
Test: TreeHugger
Test: Build a non-A/B target that calls make_recovery_patch.
Change-Id: Iaeddc98a2c4a27c6b49d91047500029e460db9e3
If you want the `dist` behavior, but only want to build the
updatepackage (you only need to be able to flash the device).
Test: m dist updatepackage
Change-Id: I921f9d96ab3f7df180601dac3fff2ff24185792d
Bug: 63866463
Test: TreeHugger
Test: m -j otapackage
Test: `m -j otatools-package`. Check bin/ota_from_target_files is
available. Build an OTA package with standalone otatools.
Change-Id: I533dee1c6997d233601e7f4eae637ff5743ed637
CL985267 was merged with one comment left unresolved. This CL resolves
that comment.
Test: Built with a pre-built vendor image and ensured additional
licenses were placed in NOTICE.xml
Test: Built with a vendor image and ensured additional licenses were
placed into NOTICE_VENDOR.xml
Change-Id: I927f09b4b501c38447702ee2fd8fdbdd5934ad20
Previously, misc_info.txt is included only when super.img is included
in the update package. This CL adds it to the update package so
Goldfish-based products for emulator can use it to create a new super.img
later in TF pipeline so mixed-image tests can be performed.
A typical example for such mixed-image tests is GSI (aosp_x86) on
sdk_gphone_x86 or older aosp_x86 vendor images.
Bug: 138545354
Test: $ lunch aosp_x86-userdebug; m - j
$ unzip -l $OUT/aosp*.zip | grep misc
526 2019-07-22 14:50 misc_info.txt
Change-Id: I111716f499b031c03f2896299b7436a7611841b8
Apex payload dev keys are stored as .pem files.
Apex payload also utilizes .avbpubkey as public keys.
Change-Id: I65ced74be02008b666d7bb608f0d0a3ef3769c9c
BUG: 138623265
If building with a vendor image, ensure that the licenses from
extra partitions are included in the vendor NOTICE file (possibly in
addition to having them in the system NOTICE file) since they could come
from disperate source trees. This change does not affect existing NOTICE
files outside of the system partition. (e.g. product and system_ext).
Bug: 134679603
Test: Built a vendor image enabled target and ensured the notices were in the
proper file
Change-Id: Ib17c7d7f84805734de09e686a4835b9b680b4192
When /boot partition is AVB chained, boot patch level will be
included into the AVB metadata appended to boot.img. We should
also do the same for boot-debug.img to pass keymaster v4 VTS
tests, whichs checks per-partition security patch levels are
indicated in AVB properties.
Bug: 136980825
Test: avbtool info_image --image $OUT/boot-debug.img, checks
com.android.build.boot.security_patch is there
Change-Id: I2ea1ebfa6abbbbc95639817c208a90642fc3d068
aapt does not support parsing some referencing attributes.
Switch to latest tool, aapt2, which works better.
Test: aapt2 dump badging test.apk and returned 0.
Test: Run check_target_files_signatures.py with a target_files.zip.
Test: Run sign_target_files_apks.py with a target_files.zip.
Change-Id: Ib3a4740506f29ebab6930767f2aa8a0b5c4ba053
The intended check was to ensure system image won't be built as a
chained partition when using dynamic partitions. Because such an image
can't be verified by bootloader.
As it evolves, GSI system image has been built against the intended
check. Because GSI system image will be verified by first stage init in
userspace.
Bug: 80195851
Test: TreeHugger
Change-Id: I45b079799e5d7443e82d73d43e2b63c613f33165
Logic to create a seperate ODM NOTICE file for modules located at
TARGET_OUT_ODM.
Bug: 137542307
Test: Built an image with both a seperate ODM image and one where it is
built into vendor.img and ensured that a NOTICE.xml.gz was located at
/odm/etc and contained any license generated by ODM modules.
Change-Id: I9e6f46b1b94c5b6584c2a5810713fcf49f637d02
Tools/files added in this CL are necessary for mixing GSI with vendor
images from other product and for the GSI to run on the emulator.
Bug: 136786169
Test: $ lunch aosp_x86-userdebug
$ m -j updatepackage otatools-package emu_extra_imgs
$ cd $TMP_DIR
$ unzip $OUT/emu-extra-linux-system-images-eng.ycchen.zip
$ cd x86
$ unzip -n $OUT/aosp_x86-img-eng.ycchen.zip
$ unzip $OUT/otatools bin/mk_combined_img bin/sgdisk
$ unzip $OUT/otatools lib64/libc++.so lib64/libext2_uuid-host.so
$ cut -d/ -f5 system-qemu-config.txt > composit.txt
$ SGDISK=bin/sgdisk bin/mk_combined_img -i composit.txt -o system.img
$ cd ..
# Download sdk-repo-linux-emulator-*.zip from AB
$ unzip -l sdk-repo-linux-emulator-*.zip
$ ANDROID_PRODUCT_OUT=x86 ANDROID_BUILD_TOP=x86 emulator/emulator
Change-Id: Ibf88652eb4fb3244553062bbfb8bceac9a5cda47
The modules.softdep file is used to communicate soft dependencies
between modules and is supported by libmodprobe.
Bug: 130585369
Change-Id: I790ea872fde7fb0cb58e07277a32aa4688adcac6
To accommodate a future vendor ramdisk, recognize
BOARD_VENDOR_RAMDISK_KERNEL_MODULES and
BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD as a way to specify kernel
modules to be stored on the vendor ramdisk, and the optional override list of
kernel modules to be loaded by first stage init.
For now this will affect the modules loaded on the generic ramdisk,
but will provide a way for vendors to add support now and hopefully not
have to modify it later when the vendor ramdisk is created.
BOARD_RAMDISK_KERNEL_MODULES is renamed to
BOARD_GENERIC_RAMDISK_KERNEL_MODULES, which is not expected to be
modified by vendors.
Bug: 137297791
Change-Id: I05944e004ab5235172da3a15b8d1c6f4c4c021ce
When we build the system image separately from the vendor image, we need the
/vendor/odm link (if any) to be created in the vendor build, not the system
build. This change moves the create-vendor-odm-symlink function outside the
BUILDING_SYSTEM_IMAGE gaurd, and inside the BUILDING_VENDOR_IMAGE gaurd.
Bug: 136516335
Test: Build vendor image, verify that /vendor/odm -> /odm
Change-Id: I6edf5d6d1fa0b2f632f67113f69a49b43f719941
This CL changes the condition for building super_empty.img from
PRODUCT_BUILD_SUPER_PARTITION to PRODUCT_USE_DYNAMIC_PARTITIONS, as a
follow-up to the change in [1].
With the CL in [1], it skips building super.img and super_empty.img both
when turning off PRODUCT_BUILD_SUPER_PARTITION. However, the latter
should be mandatory whenever dynamic partitions is enabled. Because
fastboot relies on this file to properly flash dynamic partitions. Plus,
the cost for building super_empty.img is much lower than the one for
super.img.
As part of the change, it'll write group info into target_files when
building with PRODUCT_BUILD_SUPER_PARTITION == false. It's the work for
target_files merging script to determine the values to be picked up. The
current logic in merge_target_files.py always uses the one from vendor
target_files. This CL adds a testcase to ensure the behavior.
[1] https://android-review.googlesource.com/c/platform/build/+/928756
Bug: 135752763
Test: `m dist` with a target that sets PRODUCT_BUILD_SUPER_PARTITION to
false. Check the built artifacts contain super_empty.img. Verify
that the build can be flashed properly.
Change-Id: I277f087eab45663a6c3b33333d16e9e576c1c25c
Build support exists to copy a set of kernel modules to the recovery,
vendor, and odm images. Extend similar support for copying kernel
modules to the ramdisk via BOARD_RAMDISK_KERNEL_MODULES. If
BOARD_USES_RECOVERY_AS_BOOT, then BOARD_RAMDISK_KERNEL_MODULES is
added to the set of modules to be copied to recovery.
Libmodprobe now supports reading a list of kernel modules to be loaded.
Enable the creation of modules.load and modules.load.recovery files.
These files contain the contents of
BOARD_[RAMDISK|VENDOR|ODM|RECOVERY]_KERNEL_MODULES_LOAD, or if those
variables are not set, the contents of
BOARD_[RAMDISK|VENDOR|ODM|RECOVERY]_KERNEL_MODULES (indicating all
modules should be loaded by default). This allows for
optional customization of the set of modules to be loaded by
libmodprobe and the order they are loaded in.
Bug: 130585369
Change-Id: I9340787d31d71aebc8552344675d9696c189a8a1
Therefore, we can access the tool in tradefed test. And partners can also
run simulation without a git repo.
Bug: 131911365
Test: build otatools-package
Change-Id: Ibfeeab360517e129f47f18372bfa236b437bce9b
- `--block` has been a no-op since Oreo [1] -- ota_from_target_files
will always build block-based OTAs or A/B OTAs.
- MKBOOTIMG is no longer needed when calling ota_from_target_files, at
least for the callsite in Makefile. Because target_files.zip has been
including boot/recovery images since Lollipop [2].
This CL also switches to long options to improve readability.
[1] commit 457cbf6a8a
[2] commit 3c84f56948
Test: TreeHugger
Change-Id: I801bd0525d2529156bbf783698661d90ba24017a
lpunpack is needed to repackage super.img for mixed-image virtual devices.
For Cuttlefish, it's included in host package. We need to include it in
otatools.zip so Goldfish or other devices can use it to mix their super images.
Necessary SOs are the same as lpmake and have been included in otatools.zip.
Bug: 134461288
Test: $ lunch aosp_x86-userdebug
$ m otatools-package
$ unzip -l $OUT/ota* | grep lpunpack
467824 2008-01-01 00:00 bin/lpunpack
Change-Id: Ie2092f18afb88721b29b1738847a0b781dbcd431
The dependency on MAKE_EXT4FS (mke2fs) has been covered by the rule for
MKEXTUSERIMG (mkuserimg_mke2fs):
https://android.googlesource.com/platform/system/extras/+/refs/heads/master/ext4_utils/Android.bp
The dependency on mksquashfs and img2simg comes from mksquashfsimage.sh,
which has been moved into mksquashfsimage's building rule.
This CL also fixes the ordering of INTERNAL_USERIMAGES_BINARY_PATHS,
which should come after adding all the binaries to
INTERNAL_USERIMAGES_DEPS.
Test: TreeHugger
Change-Id: I8b30bf87860d9711e88eecca4b76db72f5cd8241
`PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH` will
produce a space separated string due to `foreach`, if
$(INTERNAL_USERIMAGES_BINARY_PATHS) has more than one string. We didn't
hit the issue in the past because $(INTERNAL_USERIMAGES_BINARY_PATHS)
had contained only one path in practice.
Test: TreeHugger
Change-Id: I74ef4356668af63d871a81f6bfd4c9324aa1d956
BOARD_PREBUILT_BOOTIMAGE is set.
Based on current Makefile INSTALLED_BOOTIMAGE_TARGET always kept as
empty if TARGET_NO_KERNEL is true, so build fails with empty out path.
This change is to set up INSTALLED_BOOTIMAGE_TARGET with
$(PRODUCT_OUT)/boot.img in case of TARGET_NO_KERNEL is true and
BOARD_PREBUILT_BOOTIMAGE is defined.
Bug: 135648566
Test: m -j passed
Change-Id: I9658f215c2e2cc5d87040d5085521ef44722c4ef
BOARD_SUPER_PARTITION_ERROR_LIMIT can be set by OEMs to cause a
build failure when the sum of sizes of logical partitions exceeds the same.
It is set to BOARD_SUPER_PARTITION_SIZE by default.
Bug: 133329143
Test: mmm -j32
Change-Id: Ief85c9ab3e3b9d071cd22b70e13b5c64bb784b9c
* changes:
Fix dependency on BOARD_AVB_SYSTEM_KEY_PATH
Fix some java library dependencies
Depend on NDK libraries
Call clean-path in more places
Add missing dependecy on SOONG_ZIP
Add dependencies on the toolchain (clang, etc)
These were found when trying to run remotely on RBE with only the
sources depended upon available for each rule.
Bug: 130111713
Test: treehugger
Change-Id: Id763f8fc7dfbe60445f98604db3422147165f537
BOARD_SUPER_PARTITION_WARN_LIMIT can be set by OEMs to print
a warning when the sum of sizes of logical partitions exceed the same.
It is set to 95% of BOARD_SUPER_PARTITION_SIZE by default.
Bug: 133329143
Test: mmm -j32
Change-Id: I7d3bedd970a92be60991898e436f63d914359301