Commit graph

9695 commits

Author SHA1 Message Date
LuK1337
82d9f1507a
releasetools: Unconditionally store recovery.img in non-A/B OTA
Change-Id: Ib5c9f2f0fa90fd921d8f61b74364a20aaecb842e
2024-10-24 19:28:26 +02:00
Aaron Kling
6ee8d10147
releasetools: Fallback to calculated fp if partition fp is missing
This happens when the fingerprint property is blacklisted for the
purposes of unified device builds.

Change-Id: I9f8a5041248c3f73fce7a16da73cb8f68c06c8e2
2024-10-24 19:28:26 +02:00
David Ng
2131227516
build: Add support for device tree in boot.img
Add support for optional device tree image (dt.img)
to boot and recovery images.  Some devices use kernel device
tree and this adds the device tree image as a section within
the boot/recovery images.

Change-Id: I91431ef2f4b86485895678916e39a8572be878eb

Build: add DT image variable to Makefile

DT image variable is currently present in
generate_extra_images.mk.This file is moved to
build/tasks to support persist image generation
during parallel make. As build/tasks is called
at the end of Makefile, DT image variable is not
available for other images generation like boot and
recovery. Adding this variable in Makefile ensures
the variable is defined before usage

Change-Id: I21f675d8ce648dc1cf1f4f3aede33278300e08c9
CRs-fixed: 548299

Fix case where boot/recovery.img were being built with wrong params.

The boot and recovery images  now get built using the same params during ota package
generation as during a normal build.

Change-Id: I93d46e11a4245288f0e87c87a2e4bf45ac5aff69

Fix the extra dt.img compilation issue.

Add support for optional device tree image (dt.img)
for device that doesnt have TARGET_BOOTIMAGE_USE_EXT2

Change-Id: I6e07b3ca6d049a8ebdad7ea304b4f39e7c846151

releasetools: Store and use the dt image file through target files

Target files packages may be used for signing images separate from the
build process. Store the device tree image file in the target files
package so it can be used during the signing process.

Change-Id: Ie8507121fa9c4ba57ecffeab05bd859ae5f5b788
2024-10-24 19:28:26 +02:00
Luca Stefani
94b75b4429
Add build support for XZ ramdisks
Co-authored-by: Arne Coucheron <arco68@gmail.com>
Change-Id: I61530b6da06e0038970551aa4d12bce02007ae3c
2024-10-24 19:28:26 +02:00
Tom Powell
bc0ef30e0e
releasetools: support reading release keys out of some sort of command
key passphrases may live in some sort of secure storage, support running
an arbitrary command to retrieve them.

Change-Id: I49862cf60f1b73a2356e0c492e1038beef28a95f
(cherry picked from commit 9caf8603575aecf51761feaeac6db619be76cfd3)
2024-10-24 19:27:38 +02:00
Peter Cai
44112727ed
releasetools: do not remove dynamic partitions in system-only builds
* Before this commit, the generated `dynamic_partitions_op_list` in
  FullOTA packages always tries to remove all partitions and recreate
  them upon flashing. This makes it impossible to have a system-only
  "FullOTA" because vendor partition(s) are always removed.

* This commit detects if a build is vendor-less and disables every
  dynamic partition operation except `resize`, in order to keep the
  original content around after the flash. The change should not affect
  non-dynamic-partition or builds with vendor image included.

Change-Id: I0cded7f3b2958f35103d73d19b7fb5f292f6c17f
Signed-off-by: Jesse Chan <jc@lineageos.org>
2024-10-24 19:27:38 +02:00
Christian Oder
d76725c913
build_image: Allow disabling custom inode count calculation
This allows us to skip custom inode count calculation by setting
BOARD_*IMAGE_EXTFS_INODE_COUNT to -1, this will end up letting
mke2fs calculate appropriate inode count on its own.

While build_image only allocates exact number of needed inodes
plus 4% spare with .2% margin, mke2fs will allocate as many
inodes as it thinks is appropriate given the filesystem size.

Change-Id: If03d5edae8378be3b305346176067b01163f6f3d
2024-10-24 19:27:38 +02:00
Brint E. Kriebel
c161964bde
releasetools: Use the first entry of a mount point when reading fstab
There may be multiple entries in fstab for a mount point. Use the first
value found so the entries are prioritized in order.

Change-Id: Ibd2631413d3e00507d3a0ec84fb91755f1c7993c
Ticket: OPO-326
2024-10-24 19:27:38 +02:00
Matt Mower
8ba776d32f
Edify: Add abort message for bootloader asserts
* If a bootloader assert is not satisfied, print the
  versions that are supported by the package as well as the version
  on the device.

Change-Id: I958d49281c51bd4e60d596a727bb94cfc4a21909
2024-10-24 19:27:38 +02:00
Andrew Dodd
f0509ac9bd
ota: Disable downgrade check
We want users to be able to downgrade their packages.

Change-Id: I6bcbd4ee2a02640fe0855b0f1f197a02e914c927
2024-10-24 19:27:23 +02:00
M1cha
82633d9de8
releasetools: ota_from_target_files: add FullOTA_PostValidate
Change-Id: I152412049f90fd546d4516cc064238c3192be553
2024-10-24 19:26:30 +02:00
TheScarastic
21f38c6d8e
Don't make recovery patch for devices with prebuilt vendor
Change-Id: I05c0155e6331bfeccd4ad545e003fa3fa3498044
2024-10-24 19:26:02 +02:00
dianlujitao
dfcb38a988
Move recovery-from-boot.p from /system to /vendor
The file was missed when moving recovery resources, but the assertion
path was changed, as a result non-Treble devices failed to build.

Fixes: Ia4045bd67ffb3d899efa8d20dab4c4299b87ee5f
Change-Id: Ib7822a9bd5b1a2ab7e762e9fb35dbb22291a3a76
2024-10-24 19:25:58 +02:00
Steve Kondik
0da100cff3
Allow override of device asserts, including multi-device support.
Set in board file with TARGET_OTA_ASSERT_DEVICE.
(cherry-picked from commit 0f452f21fc9323b9d1fe746161761cf40aaa5030)

Change-Id: I3d06bdc0e3e26bde0c0e646accd050364f9713b9

ota_from_target_files: Remove device dependent arguments

These device-specific arguments are defined at build time and are
necessary to generate the zip correctly. Don't use command line
arguments to specify them, but write all the needed information
in misc_info.txt when the target-files zip is generated.
ota_from_target_files will then read misc_info.txt and set
everything automatically.

Change-Id: Ibdbca575b76eb07b53fccfcea52a351c7e333f91
Signed-off-by: André Pinela <sheffzor@gmail.com>
2024-10-24 19:25:44 +02:00
Ted Bauer
e75c1a4ca8 Merge "Read from new storage in Rust R/W flags" into main 2024-06-14 19:40:38 +00:00
Treehugger Robot
b8b81612a3 Merge "zipalign: succesful -> successful" into main am: e7a2e5994f am: e7c4ab6fbb
Original change: https://android-review.googlesource.com/c/platform/build/+/3126573

Change-Id: Ibe9fb26bb1d4308be57539f883ac74403a995c8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-14 18:42:26 +00:00
Treehugger Robot
e7c4ab6fbb Merge "zipalign: succesful -> successful" into main am: e7a2e5994f
Original change: https://android-review.googlesource.com/c/platform/build/+/3126573

Change-Id: Ieb4255b044523c36b945ac8b92f2c51797a3fce4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-14 18:32:52 +00:00
Ted Bauer
e8e66b8aa8 Read from new storage in Rust R/W flags
Bug: 346991641
Test: m
Change-Id: I23b7f7e8a1b43bbd5f49012c95a130d91098f92a
Ignore-AOSP-First: internal storage migration, this code will be deleted
2024-06-14 17:20:27 +00:00
Steven Moreland
cffced3727 zipalign: succesful -> successful
Bugs: me
Change-Id: I6cc866b3d8765ed6ef553f2de80bba995bdbc095
Test: n/a
2024-06-11 17:07:44 +00:00
Mårten Kongstad
c87770e242 Merge changes from topic "check-flagged-apis-list-subcommand" into main am: ac9a2abad8 am: 21d8395879
Original change: https://android-review.googlesource.com/c/platform/build/+/3121994

Change-Id: I5a73f3e79f9ef92caf7dc291ced4db0cb6b8ddfa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 13:06:22 +00:00
Mårten Kongstad
21d8395879 Merge changes from topic "check-flagged-apis-list-subcommand" into main am: ac9a2abad8
Original change: https://android-review.googlesource.com/c/platform/build/+/3121994

Change-Id: I42b6876b78e9369280b2737b82c5d04233faff77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 12:51:22 +00:00
Mårten Kongstad
1692a36da7 check-flagged-apis: add list subcommand
Add a new subcommand to list all flagged APIs and corresponding flags.
This provides an overview of what flagged APIs exist in the Android
tree.

Bug: 345207706
Test: build/tools/check-flagged-apis/check-flagged-apis.sh list
Test: atest check-flagged-apis-test
Flag: EXEMPT host side tool
Change-Id: Icc224f3787480353baabbd3946f36f003f35db59
2024-06-11 13:11:28 +02:00
Mårten Kongstad
576e818880 check-flagged-apis: extract argument names into constants
Extract the command line argument names (and help texts) into constants.
This will allow future subcommands to re-use the same names and keep
things consistent.

Bug: 345207706
Test: atest check-flagged-apis-test
Flag: EXEMPT host side tool
Change-Id: I430f36c99f28aab8511a357f572086ee238d653b
2024-06-10 16:26:17 +02:00
Mårten Kongstad
d5ce20fc07 check-flagged-apis: add support for subcommands
The tool currently only supports a single subcommand, the "check"
command. Follow-up CLs will add new subcommands.

Bug: 345207706
Test: build/tools/check-flagged-apis/check-flagged-apis.sh
Flag: EXEMPT host side tool
Change-Id: I1aaaf313db8a10a7427aab378aac8d946d5a8a3d
2024-06-10 16:26:16 +02:00
Treehugger Robot
895768cced Merge "aconfig: update java read api for performance" into main am: 910ad04d2f am: edbd06d8a4
Original change: https://android-review.googlesource.com/c/platform/build/+/3112419

Change-Id: I0d26fec2dc3e854baed38c26ff49bdddbbcd4f5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:34:36 +00:00
Joe Onorato
1e56e96609 Merge "Add new simplified lunch function (lunch2)" into main am: fc19715ebf am: 070808646e
Original change: https://android-review.googlesource.com/c/platform/build/+/3101473

Change-Id: I589461579736e186abf852f7e55f8d20bad46f90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:34:18 +00:00
Treehugger Robot
edbd06d8a4 Merge "aconfig: update java read api for performance" into main am: 910ad04d2f
Original change: https://android-review.googlesource.com/c/platform/build/+/3112419

Change-Id: I44714409822a6a37244b417e28c9993b37ad3a98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:33:50 +00:00
Treehugger Robot
910ad04d2f Merge "aconfig: update java read api for performance" into main 2024-06-04 23:29:18 +00:00
Joe Onorato
070808646e Merge "Add new simplified lunch function (lunch2)" into main am: fc19715ebf
Original change: https://android-review.googlesource.com/c/platform/build/+/3101473

Change-Id: I1f41c20816e37c542468fc32da3bde4d2f380d38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:26:13 +00:00
Joe Onorato
590ae9f785 Add new simplified lunch function (lunch2)
Includes tests for envsetup.sh

After we've tried this for a bit and are happy, this will be swapped out
to become the new standard lunch and all of the menus and stuff will be
removed.

Test: build/make/tools/envsetup/run_envsetup_tests
Change-Id: Idebeeb1153406238b6c32f3f564c7bc1e7ced7e6
2024-06-04 16:04:49 -07:00
Treehugger Robot
9861b785c1 Merge "Reland "check_elf_file: check prebuilts are aligned"" into main am: 69e8c9be5f am: 9830e817d6
Original change: https://android-review.googlesource.com/c/platform/build/+/3110301

Change-Id: I482fad100593b127dd8fb9e35bdabcfc4cfcd123
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 22:11:33 +00:00
Treehugger Robot
9830e817d6 Merge "Reland "check_elf_file: check prebuilts are aligned"" into main am: 69e8c9be5f
Original change: https://android-review.googlesource.com/c/platform/build/+/3110301

Change-Id: I53a7274547eb1731191a5ea4690d4627926f9e13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 21:47:36 +00:00
Steven Moreland
52c2371ae8 Reland "check_elf_file: check prebuilts are aligned"
This reverts commit 411fb17537.

Reason for revert: reland after other targets are fixed b/342466032

Bug: 342466032
Test: build, w/ and w/o checking enabled

Change-Id: I830166faffec781cf6cc4fea47140a60b0a12466
2024-06-04 17:26:12 +00:00
Dennis Shen
a8e28dfe87 aconfig: update java read api for performance
With this update, cold flag read (first flag in a namespace) is now 6x
faster compared to device config.

Bug: b/321077378
Test: atest -c
Change-Id: I52ffd897fdd487b2a44d07be50f2975f0ef5b9b3
2024-06-04 17:24:53 +00:00
Priyanka Advani
2737f1d829 Merge "Revert "check_elf_file: check prebuilts are aligned"" into main am: 8d5b8c1f98 am: 9b6857d6f8
Original change: https://android-review.googlesource.com/c/platform/build/+/3110411

Change-Id: Id4663969203b19071f009a27c4b7250d50ae2f63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:45:32 +00:00
Priyanka Advani
9b6857d6f8 Merge "Revert "check_elf_file: check prebuilts are aligned"" into main am: 8d5b8c1f98
Original change: https://android-review.googlesource.com/c/platform/build/+/3110411

Change-Id: I25ab04d528185a17f3f82b089b1292a97a9d65fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:37:38 +00:00
Priyanka Advani
8d5b8c1f98 Merge "Revert "check_elf_file: check prebuilts are aligned"" into main 2024-05-31 22:27:08 +00:00
Steven Moreland
f47dbd2922 Merge "check_elf_file: check prebuilts are aligned" into main am: 26bb2346de am: b716e006ed
Original change: https://android-review.googlesource.com/c/platform/build/+/3101471

Change-Id: I81ab2ae179b0cfc48c0dbd5351b73c53e76dc00e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:19:47 +00:00
Priyanka Advani
411fb17537 Revert "check_elf_file: check prebuilts are aligned"
This reverts commit 432bd660dc.

Reason for revert: Droidmonitor created revert due to breakage in b/344033120

Change-Id: I40f3e1becf3e7d944fdc868bd4000d7602db1d15
2024-05-31 22:14:22 +00:00
Steven Moreland
b716e006ed Merge "check_elf_file: check prebuilts are aligned" into main am: 26bb2346de
Original change: https://android-review.googlesource.com/c/platform/build/+/3101471

Change-Id: I29118e75b78ccfbfcc1b69640d0f2078804e21d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:11:13 +00:00
Steven Moreland
26bb2346de Merge "check_elf_file: check prebuilts are aligned" into main 2024-05-31 22:02:55 +00:00
Dennis Shen
6ef1489b44 Merge "aconfig: create first implementation of aconfig storage java read api" into main am: ca6602821b am: 845de05ab4
Original change: https://android-review.googlesource.com/c/platform/build/+/3106837

Change-Id: I2f1c01b7a62c06eb8047cdee9dfbdcbc98301a51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-30 22:44:19 +00:00
Dennis Shen
845de05ab4 Merge "aconfig: create first implementation of aconfig storage java read api" into main am: ca6602821b
Original change: https://android-review.googlesource.com/c/platform/build/+/3106837

Change-Id: I9c8280841afb2153c7e716ceea4947026744129a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-30 22:36:10 +00:00
Steven Moreland
432bd660dc check_elf_file: check prebuilts are aligned
WARNING: two things still need to be done
1. this should probably only be enabled when PAGE_SIZE
   is undefined, but I'm curious what other targets
   break now.
2. we may need a per-prebuilt way to disable this,
   like some of the other settings here.

For prebuilts added onto a device, we can check the
page alignment matches the one declared in the build
configuration.

Bug: 342466032
Test: manually, by changing the script to require 64 KB
  alignment, I was able to see its errors on new targets.
Change-Id: Ic118245e64d67204bf5fa740a3e1afb7325b34f5
2024-05-30 17:31:08 +00:00
Dennis Shen
e5dd91bca7 aconfig: create first implementation of aconfig storage java read api
1, See AconfigStorageReadAPI.java to see java APIs to map storage files
and read flag values. It is using fast native annotation, in theory it
should be faster than regular JNI without much of the overhead.

2, The java api calls into Rust wrapper in srcs/lib.rs, note that
MappedByteBuffer is not copied during JNI. In the rust side
implementation we get the underlying raw pointer and buffer size and
reconstruct a rust slice. However, at current implmentation, the string
input such as package name and flag name are most likely copied. They
are converted from JStirng to JavaStr first without copy, then the
into() call to convert it to Rust string. We could potentially optimize
it to without copy.

3, Add an android_test target to lock down the API behaviors.

Bug: b/321077378
Test: atest -c
Change-Id: I8915fe70e8eb341be563c70f85e19e644e8aa6be
2024-05-30 00:32:42 +00:00
Xin Li
2389748ddb Merge "Merge Android 24Q2 Release (ab/11526283) to aosp-main-future" into aosp-main-future 2024-05-24 21:16:16 +00:00
Treehugger Robot
3cab784a60 Merge "Add fs_config support for vendor_boot" into main am: 58ab571b38 am: c2cfb31c74
Original change: https://android-review.googlesource.com/c/platform/build/+/2653760

Change-Id: I0222b52c10d66b2949df7d1261540c777ea0b787
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-24 20:26:08 +00:00
Treehugger Robot
b42161d959 Merge "Disable zucchini for all OTAs" into main am: 078c1c95c9 am: 38cd6585f6
Original change: https://android-review.googlesource.com/c/platform/build/+/3101466

Change-Id: I6298558649ea33cb1d478f6b3c00825678645fdc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-24 19:46:21 +00:00
Treehugger Robot
f2baf8949a Merge "Update go.mod and go.work for go 1.22" into main am: 6d67f4b600 am: 699c8802f2
Original change: https://android-review.googlesource.com/c/platform/build/+/3101492

Change-Id: Ieca99343668e2974a677c989d1f7ab5abd1ee1ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-24 19:45:59 +00:00
Treehugger Robot
58ab571b38 Merge "Add fs_config support for vendor_boot" into main 2024-05-24 19:31:07 +00:00