Commit graph

68596 commits

Author SHA1 Message Date
Akilesh Kailash
d967d01f56 libsnapshot: Retrieve COW version from update engine manifest
update_metadata.proto will have the COW version. Retrieve
that from the manifest and compare it with the COW library.
If the versioning doesn't match, disable VABC.

The primary use case of this is during downgrade tests
in pre-submit. Whenever we have a COW format changes,
we may have to disable VABC for that specific transition
build. At a high level, the flow of version check will be:

1: Create a initial COW version of 1 in manifest (update_metadata.proto)
2: The latest COW version of libsnapshot is 2
3: libsnapshot will return VABC disabled
4: Check-in the CL and changes to manifest
5: Once the CL is baked in and the build is green, bump up the COW version to 2 in the manifest
6: Next set of tests, since both versions match, libsnapshot will enable VABC
7: Downgrade should be done to the build which was checked in at (5)

Bug: 183863613
Test: Apply OTA and verify if VABC is disabled if the versions don't
match
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Id55f33a90bb31b417e72f4fbe370daf05a68f05a
2021-04-30 06:46:24 +00:00
Akilesh Kailash
771b17f509 libsnapshot:snapuserd: Add 2MB scratch space in COW file
Add 2MB scratch space in the COW file. This is a preparation
patch for read-ahead patch. This just add the buffer
space right after the header. Bump up the version number
in the header in order to distiguish between older and newer
COW formats.

No operation is done on this buffer with this patch-set.

Scratch space option is disabled by default.

Bug: 183863613
Test: 1: Create Full OTA with the new COW format.
2: Incremental OTA with older COW format.
3: vts_libsnapshot_test

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I42a535a48ec22adb893dfe6f86a4f51650e1f88a
2021-04-30 06:45:57 +00:00
Akilesh Kailash
31e0426489 libsnapshot:snapuserd: mmap + msync header after merge
mmap the CowHeader and use msync to flush only the
first 4k page after merge is complete.

This cuts down ~30 seconds of merge completion time
on a 55M incremental OTA with 235k copy operations.

Although, this isn't a significant gain but this patch
creates a scaffolding for the next set of read-ahead patches.

Bug: 183863613
Test: Incremental and Full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I15bfec91ea1d5bdf4390670bcf406e1015b79299
2021-04-30 06:31:12 +00:00
Akilesh Kailash
acc1c5d189 libsnapshot: Add Version field which will be used by update-engine
manifest

Bug: 183863613
Test: Build
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If4b6a60669a55eb2ea1167fb2cc49ce04c054748
2021-04-30 06:31:01 +00:00
David Anderson
4a3ab034c6 Merge "ueventd: Allow pattern matching to find external firmware handler" 2021-04-16 20:35:58 +00:00
Suchang Woo
22fdd0ae13 ueventd: Allow pattern matching to find external firmware handler
Only the exact same devpath uevent can launch external handler specified
in ueventd.rc. So, you should specify all possible devpaths, even
firmware with different filenames on the same device. Pattern mactching
can be used to simplify this.

Test: atest CtsInitTestCases
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: If3b7a2cabb8055bf4b768d928f0fc0012da3c177
2021-04-16 13:35:10 -07:00
Treehugger Robot
78e26beb02 Merge "add missing spaces" 2021-04-16 18:39:59 +00:00
Elliott Hughes
acec0918e5 Merge "Remove move dead code." 2021-04-16 16:38:28 +00:00
Paul Crowley
61abbef4e4 Merge changes from topic "revert-1665499-revert-1660531-max-boot-level-crypto-KFMCEDKSIV-WPIHELCRFI"
* changes:
  Revert^2 "Set earlyBootEnded before apex starts"
  Revert^2 "Expose AID_KEYSTORE"
2021-04-16 15:51:27 +00:00
jiahao
bfcee2891c add missing spaces
The parameters "--debug-cache" and path are close to each other, eg:

01-09 17:14:52.058   648   648 I vold    : [libfs_mgr]Running
/system/bin/fsck.f2fs -a -c 10000 --debug-cache/dev/block/dm-10

Add a space between them to separate.

Signed-off-by: jiahao <jiahao@xiaomi.com>
Change-Id: Ie2929b541d5907a521c7b97aaed31fdca381fc1a
2021-04-16 17:07:50 +08:00
Treehugger Robot
3f4ea91c7c Merge "Move debugfs mount/unmount to init-debug.rc" 2021-04-16 01:54:54 +00:00
Treehugger Robot
f1cb594c05 Merge "Install platform-bootclasspath generated config in /system/etc." 2021-04-16 01:51:33 +00:00
Artur Satayev
a2631ebc13 Install platform-bootclasspath generated config in /system/etc.
platform-bootclasspath module generates classpaths.proto config with
the information for derive_classpath to read and parse at runtime.

See go/updatable-bootclasspath.

Bug: 180105615
Test: m && launch_cvd; presubmit / DeviceBootTest
Change-Id: I0f4b1cfce9468fd6e3377a1d7233245e30f1ea51
2021-04-15 22:32:31 +00:00
Elliott Hughes
4b7b4d6d7b Remove move dead code.
Test: treehugger
Change-Id: I6a23b19d078400dfe90329a49ae1abbcb24ef2bf
2021-04-15 15:18:54 -07:00
Paul Crowley
7583da1bcd Revert^2 "Set earlyBootEnded before apex starts"
Revert submission revert-1660531-max-boot-level-crypto-KFMCEDKSIV

Reason for revert: topic:vold-use-keystore2 has landed fixing the bug

Reverted changes:
Ibf63734a: Revert "Set earlyBootEnded before apex starts"
Id02f63a7: Revert "Expose AID_KEYSTORE"
Ibcedeff4: Revert "Cryptographic security for MAX_BOOT_LEVEL"

Restored changes:
Ia3b968afc:Set earlyBootEnded before apex starts
Ia69891291:Expose AID_KEYSTORE
I12530cd13:Cryptographic security for MAX_BOOT_LEVEL

Reverted-SHA1: 82cfe66794

Original commit message:
earlyBootEnded signals to keystore2 to read the database for the first
time, and start the MAX_BOOT_LEVEL system. It must therefore run
after /data is mounted and /data/misc/keystore is created, but before
apexd or odsign starts.

Bug: 176450483
Test: atest com.android.tests.odsign.OnDeviceSigningHostTest#verifyArtUpgradeSignsFiles
Change-Id: Ib9c2b4bbdddecdf73924125f9bdc75c82e1dd257
2021-04-15 12:55:28 -07:00
Treehugger Robot
5e89a35ae3 Merge "Do not populate ro.kernel. properties in init" 2021-04-15 18:19:45 +00:00
Tri Vo
afe3212a19 Merge "Trusty: Move tipc fuzzer connection to end of iteration" 2021-04-15 16:41:30 +00:00
Orion Hodson
abe3b42eb4 Merge "Create directory for caching odrefresh metrics" 2021-04-15 08:51:01 +00:00
Jooyung Han
0bfa7c92f1 Merge "Make prebuilt_etc for public.libraries.android.txt" 2021-04-15 08:49:25 +00:00
Roman Kiryanov
f4adb894cc Do not populate ro.kernel. properties in init
`ro.kernel.` is deprecated, emulator migrated to
`ro.boot.`.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I074f9a63dc4e3edcc01930b2e8481efd1d85eb55
2021-04-14 20:45:55 -07:00
Daniel Rosenberg
4872b73b9e Merge changes Ie93d09b3,I56f0218f,I3c9a3855
* changes:
  libsnapshot: Check cluster size on appends
  libsnapshot: Zero out leftover ops in CowWriter
  libsnapshot: Fix premature truncation in CowWriter.
2021-04-15 01:49:13 +00:00
Stephen Crane
e54e8d4ebf Trusty: Move tipc fuzzer connection to end of iteration
We detect a TA crash by not being able to reconnect to its channel. We
were previously connecting to the TA at the beginning of each fuzz
iteration, but this results in only detecting a crash on the following
iteration. By moving this connection to the end of the fuzz iteration,
we can detect a crash corresponding to the correct fuzz iteration and
libFuzzer will produce the correct crashing input.

Test: /data/fuzz/arm64/trusty_keymaster_fuzzer/trusty_keymaster_fuzzer
Bug: 185407818
Change-Id: I6808c72611fcabab5b314218f8b588dd7d944188
2021-04-15 01:02:50 +00:00
Jooyung Han
489cea14d8 Make prebuilt_etc for public.libraries.android.txt
so that this can be packaged in a filesystem(e.g microdroid)

Bug: 181093750
Test: MicrodroidTestCase
Change-Id: Ib86789de4632a32eee31fee0607d5ade8ae6b33f
2021-04-15 09:45:48 +09:00
Elliott Hughes
450f66bd8f Merge "Remove String8::toUpper()." 2021-04-14 17:36:36 +00:00
Bill Yi
664f9cd068 Merge "Merge RQ2A.210405.006 to aosp-master - DO NOT MERGE" 2021-04-14 04:59:51 +00:00
Bill Yi
19ee982d26 Merge RQ2A.210405.006 to aosp-master - DO NOT MERGE
Merged-In: I1093e922d7251b9a30bc5b450f1ed924892f5cac
Merged-In: I54b465b57f0c6b2cbc5f2aa4fb03756cbbc507a0
Change-Id: I9f00c4b6250f4a7d3d9998781c20787c26ae0feb
2021-04-13 19:29:22 -07:00
David Anderson
7723c72cab Merge "Unable to mount filesystem in fastbootd mode on the user build." 2021-04-13 23:45:01 +00:00
Hridya Valsaraju
3f384a25fa Move debugfs mount/unmount to init-debug.rc
Debugfs cannot be mounted in userbuilds since Android R. Since init only
mounts/unmounts debugfs during boot for debug builds, move it to
init-debug.rc.

Bug: 184381659
Test: build/boot
Change-Id: Ib51e82b99ec1eb95a2647c91855f6d4d1585040a
2021-04-13 14:45:50 -07:00
Steven Moreland
4efe03b492 Merge "libutils: group deprecated RefBase functions" 2021-04-13 16:47:28 +00:00
Andrew Walbran
d8d9736573 Merge "Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm" 2021-04-13 09:18:44 +00:00
Yo Chiang
3841fdfa3c Merge "Load *_compat_cil_file from system_ext as well" 2021-04-13 05:48:04 +00:00
Daniel Rosenberg
35ff136a25 libsnapshot: Check cluster size on appends
When appending, if the cluster should end after the given label, ensure
that it does.

Bug: 183985866
Test: cow_api_test#ResumeEndCluster
Change-Id: Ie93d09b3431755d0b9b92761619d55df7f9f6151
2021-04-12 21:52:06 -07:00
Daniel Rosenberg
861e69a4c2 libsnapshot: Zero out leftover ops in CowWriter
When opening in append mode, we could write less than what was present
before. This could result in data blocks referencing beyond the end of
the file, or partially written ops. Zeroing these out will prevent
invalid leftovers from potentially causing confusion.

Bug: 183985866
Test: cow_api_test
Change-Id: I56f0218f3ea5b83c0614d1b86e81a4ca885f5c5e
2021-04-12 21:52:06 -07:00
David Anderson
db25e8e32d libsnapshot: Fix premature truncation in CowWriter.
When opening in append mode, we ftruncate() the COW. This has three side
effects:
 (1) If the COW is never modified, or Finalized(), the state of the COW
     will have changed. Ideally it should only change on an explicit
     write operation.
 (2) Data after the current cluster will be accidentally thrown away.
 (3) The ending "cluster" op will be thrown away if the current cluster
     was incomplete, and thus the last valid label could be invalidated.

Bug: 183985866
Test: cow_api_test
Change-Id: I3c9a38553b7492a3d6e71d177d75ddb1b6490dfe
2021-04-12 21:52:06 -07:00
Steven Moreland
8c8d361981 libutils: group deprecated RefBase functions
Make it easier to see reference to usage documentation, as requested in
review.

Bug: 184190315
Test: libutils_test
Change-Id: If9056e35b1c7a779dd78f2b986ad10d02f25eaf3
2021-04-12 23:56:07 +00:00
David Anderson
9a95ed928f Merge "fastboot: Add a few missing fastboot commands from help" 2021-04-12 21:17:42 +00:00
David Anderson
055f802086 Merge "libsnapshot: Add diagnostics for DM_DEV_REMOVE failures." 2021-04-12 21:04:08 +00:00
Elliott Hughes
9434f59c17 Remove String8::toUpper().
Actually, it looks like it's only toLower() that's used, so let's remove
toUpper() separately, since it's so easy.

Test: treehugger
Change-Id: I8fae9fa513b2a34d5bd6b3f64e9305a1ee3c1ec4
2021-04-12 13:38:31 -07:00
Elliott Hughes
561209ee66 Merge "Remove the weird range variants of String8::toLower() and String8::toUpper()." 2021-04-12 18:51:22 +00:00
Luca Stefani
173667b7e7 fastboot: Add a few missing fastboot commands from help
Test: m, fastboot help
Change-Id: I8c40ad25123470ea214b9d93d7305945973a2b0b
2021-04-12 19:16:52 +02:00
Hridya Valsaraju
2a8b028c04 Merge "Use property ro.product.enforce_debugfs_restrictions to enable debugfs restrictions" 2021-04-12 17:11:23 +00:00
Martin Stjernholm
8146f21745 Merge "libdexfile_external is replaced by libdexfile (reland 2)." 2021-04-12 16:36:05 +00:00
Andrew Walbran
e76a7ef09c Give virtmanager user access to /dev/kvm and /dev/vhost-vsock for crosvm
Bug: 183583115
Test: Ran a VM manually with vm tool
Change-Id: Idf691c3ec3551c4cdadaecff96eddc2027dc8c79
2021-04-12 15:25:35 +00:00
Li Li
50d8f9d299 Merge "task_profiles.json: use cgroup v2 uid/pid freezer" 2021-04-10 07:40:19 +00:00
Rick Yiu
32c68d4e33 Merge "libprocessgroup: Change LogFailures to string" 2021-04-10 02:38:51 +00:00
Li Li
2470e479cf task_profiles.json: use cgroup v2 uid/pid freezer
Bug: 184800106
Bug: 184893012
Test: Verify the app status in frozen and unfrozen states.

Change-Id: Ic27529d71839076a0ac816383b52ec28c5d17be5
2021-04-10 02:27:43 +00:00
Elliott Hughes
a858395f91 Remove the weird range variants of String8::toLower() and String8::toUpper().
I want to remove these bad ASCII-only APIs completely, but it might be
easier to remove the range variants first.

Test: treehugger
Change-Id: I4c11f959a7bd8e670708cc03281ea72e9c461ff7
2021-04-09 13:06:20 -07:00
Martin Stjernholm
33a4e5539b libdexfile_external is replaced by libdexfile (reland 2).
This relands https://r.android.com/1644045 after requisite fix in
https://r.android.com/1671709.

Test: atest CtsSimpleperfTestCases
Bug: 143978909
Change-Id: I89650a8059b56d2b35a5592ef555c91faa49a2cf
2021-04-09 19:11:13 +01:00
Ulyana Trafimovich
60b9b4a467 Merge "Revert "libdexfile_external is replaced by libdexfile (reland)."" 2021-04-09 15:24:58 +00:00
Orion Hodson
44bedf6a58 Create directory for caching odrefresh metrics
Metrics are written to /data/misc/odrefresh by odrefresh during early
boot, then the zygote passes them to statsd and delete the metrics
files.

Bug: 169925964
Test: manual
Change-Id: Ia39098109d59600ae8d7b197f46e9a6de18ca57c
2021-04-09 15:42:31 +01:00