Commit graph

81940 commits

Author SHA1 Message Date
Yi-Yo Chiang
18cea8df37 Merge "remount: Replace ServiceManager::getService with checkService" into main am: 4131a3afd1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2690886

Change-Id: I0edade2adc78401e6f5291d1a2a579ac102d2087
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-04 04:22:27 +00:00
Yi-Yo Chiang
4131a3afd1 Merge "remount: Replace ServiceManager::getService with checkService" into main 2023-08-04 03:31:33 +00:00
David Anderson
c7b9ece0c4 Merge "libsnapshot: Fix missing return keyword in error path." into main am: c8ce6347db
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2691212

Change-Id: I223ac6defc12d300f9cee99cdb6c46831487343f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-03 19:52:25 +00:00
Treehugger Robot
ecc86c1f93 Merge "Remove references to the pdk product variable" into main am: 0950447d18
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2692949

Change-Id: Ib1681df19e0c2829066cdc69ba81ed46c9a9470b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-03 19:49:15 +00:00
David Anderson
c8ce6347db Merge "libsnapshot: Fix missing return keyword in error path." into main 2023-08-03 18:57:37 +00:00
Treehugger Robot
0950447d18 Merge "Remove references to the pdk product variable" into main 2023-08-03 18:56:33 +00:00
Cole Faust
355ae4154e Remove references to the pdk product variable
pdk is deprecated and has no effect as of aosp/1319667.

Test: Presubmits
Change-Id: I78d7afaaa71b93e575dcd5c20716ffb295b9f522
2023-08-03 10:54:59 -07:00
David Anderson
fbc5f59737 libsnapshot: Fix missing return keyword in error path.
Bug: 288273605
Test: vts_libsnapshot_test
Change-Id: I0bee5ee1ebfb61f17d2a495440048d02e2c347b1
2023-08-03 09:45:20 -07:00
Yi-Yo Chiang
67e3e637a4 Merge "init: Unify kernel bootconfig parser with libfs_mgr" into main am: f2368d0744
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2682016

Change-Id: I9f4d70d3202c35d1ec8686efb6658dfe250fd60f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-03 08:44:05 +00:00
Yi-Yo Chiang
f2368d0744 Merge "init: Unify kernel bootconfig parser with libfs_mgr" into main 2023-08-03 07:54:14 +00:00
Yi-Yo Chiang
59442132d1 remount: Replace ServiceManager::getService with checkService
Address this build log message:
```
[ 18% 2/11] //system/core/fs_mgr:remount clang++ fs_mgr_remount.cpp
system/core/fs_mgr/fs_mgr_remount.cpp:133:31: warning: 'getService' is deprecated: this polls for 5s, prefer waitForService or checkService [-Wdeprecated-declarations]
        if (auto binder = sm->getService(android::String16("vold"))) {
                              ^
```

Bug: 293695109
Test: adb-remount-test
Change-Id: I3b5c7d338e9307dee58edeb0f6a00ba9a73d46f6
2023-08-02 18:01:19 +00:00
Mitchell Wills
cf244ae185 Merge "Add logs in SuperLayoutBuilder::Open when the metadata isn't supported" into main am: b7cfba1ca2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2665257

Change-Id: Ifa7f47c7e5f464f05cc6429f801fa6176c6f7fcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 17:34:38 +00:00
Mitchell Wills
b7cfba1ca2 Merge "Add logs in SuperLayoutBuilder::Open when the metadata isn't supported" into main 2023-08-02 16:30:04 +00:00
Yi-Yo Chiang
5d6e684874 Merge "init: Unify duplicated get_android_dt_dir with libfs_mgr" into main am: 0b30e34a04
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2675395

Change-Id: Ie92ec1006c0af058e809867aded4a7303ee0a67b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 10:38:20 +00:00
Yi-Yo Chiang
79ad1e2e9b init: Unify kernel bootconfig parser with libfs_mgr
Right now there are two bootconfig parsers that gets linked into `init`.
One is from libinit itself and the other is from libfs_mgr.

The one in libinit removes all space characters between list elements,
so `key = "val1", "val2"` gets unquoted and squeezed into:
  `key=val1,val2`
The one in libfs_mgr doesn't remove spaces, it only unquotes:
  `key=val1, val2`

The libinit behavior is due to existing systems (such as sysprop)
expect the config value to be in the same format as kernel cmdline.
(aosp/1757971)
THe libfs_mgr behavior is due to the `androidboot.boot_device[s]`
format explicitly allows quoted comma appear in its list value, thus
relies on space, not comma, as the list value delimeter.

This commit merges the two parsers into libfs_mgr. Since all usages in
libfs_mgr besides `boot_device[s]` do not care about how list value are
delimited, and most usages in init expects the bootconfig value format
to be the same format as cmdline. We just special case the
`boot_device` scenario.

Also harden the test cases to cover all the different config value
format and expected result.

Note:
The format of kernel bootconfig is described here
https://docs.kernel.org/admin-guide/bootconfig.html

Bug: 293695109
Test: CtsFsMgrTestCases
Change-Id: I42b9bf626e8de38a60e8e09fac0693126b7efd91
2023-08-02 09:57:37 +00:00
Yi-Yo Chiang
0b30e34a04 Merge "init: Unify duplicated get_android_dt_dir with libfs_mgr" into main 2023-08-02 09:56:36 +00:00
David Anderson
633e1f51d6 Merge "libsnapshot: Introduce a dynamically linked version of libsnapshot." into main am: c99cd86610
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2670618

Change-Id: I2ab1a051bb12d7a2d125a78483c1547b1b3e10ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 17:18:55 +00:00
David Anderson
c99cd86610 Merge "libsnapshot: Introduce a dynamically linked version of libsnapshot." into main 2023-08-01 16:35:44 +00:00
David Anderson
a637416a87 libsnapshot: Introduce a dynamically linked version of libsnapshot.
This will cut down on the binary sizes of update_engine, snapshotctl,
and lpdumpd.

Bug: 291688516
Test: treehugger
Change-Id: Idae5ea075ab21c2bd4fdb839eb065d865cb07d58
2023-08-01 16:35:38 +00:00
Jooyung Han
2e438b3a5d Merge "Revert "Use /bootstrap-apex for bootstrap APEXes"" into main am: deff223842
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2685548

Change-Id: Ie8f8741baff37b992952a0cbc3da41b6ad3f80df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 11:19:12 +00:00
Jooyung Han
deff223842 Merge "Revert "Use /bootstrap-apex for bootstrap APEXes"" into main 2023-08-01 10:44:45 +00:00
Yi-Yo Chiang
b8c23259b1 init: Unify duplicated get_android_dt_dir with libfs_mgr
init and libfs_mgr both defines get_android_dt_dir() with subtle
differences. Merge the two implementations into libfs_mgr to reduce code
duplication (in terms of source code and code gen)

Note:
init's implementation checks the kernel cmdline first and then the
kernel bootconfig, while libfs_mgr's order is the opposite.
Realistically I don't think this order matter much though. If any, we
should prioritize bootconfig over kernel cmdline most of the time.

Bug: 293695109
Test: Presubmit
Merged-In: Ic8d2c965c62f9e873ccdaf77d67c7708f25a7b56
Change-Id: Ic8d2c965c62f9e873ccdaf77d67c7708f25a7b56
2023-08-01 10:15:05 +00:00
Jooyung Han
840691be71 Revert "Use /bootstrap-apex for bootstrap APEXes"
Revert submission 2666915-share-bootstrap

Reason for revert: b/293949266 vold_prepare_subdirs fails to create apexdata directories.

Reverted changes: /q/submissionid:2666915-share-bootstrap

Change-Id: I3e97e8511755844de4b54f51ff20afc154bd8e74
2023-08-01 09:06:47 +00:00
Yi-Yo Chiang
974ed3575d Merge changes Ib70a8498,I06f7450c into main am: d53c1a7b62
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2671361

Change-Id: Idb00910809cfaa3e8d8381be88b05acec7d72bae
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 05:40:22 +00:00
Yi-Yo Chiang
c2f876b3db Merge "fs_mgr: Refactor mandatory overlayfs kernel patch checks" into main am: bb1cc95f6c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2670897

Change-Id: Iedb91d59db16d18f88cbe2dfb9e46cce41a5b0c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 05:40:07 +00:00
Kelvin Zhang
8e6a2c8fab Merge "Make libdebuggerd ramdisk available." into main am: dccb1e904d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2684517

Change-Id: I2cc4e64d59114868e5038835378690b22ddb5e9d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 05:39:51 +00:00
Yi-Yo Chiang
d53c1a7b62 Merge changes Ib70a8498,I06f7450c into main
* changes:
  fs_mgr: Split libfs_mgr and libfstab
  fs_mgr: Remove `include_dirs` declaration
2023-08-01 05:11:13 +00:00
Yi-Yo Chiang
96126069c2 fs_mgr: Split libfs_mgr and libfstab
The goal is to make the header definitions of the two curiously
intertwined libraries less chaotic.

After this change, libfstab's header would be self contained. In the
sense that all symbols exported by its headers are defined in its
compilation units.
libfs_mgr would still embed libfstab like before, it can use internal
symbols (symbols not exported by public headers) of libfstab through
the libfstab/fstab_priv.h private header.

Keep include_fstab/ as a symbolic link pointing to its new location.
This is a temporary workaround as there are still some bad build rules
(incorrectly) depending on the old include path with Android.bp
`include_dirs` directive.

Bug: 293695109
Test: build
Change-Id: Ib70a84984ac2cbfca5f5b27fadebf6a16e58146a
2023-08-01 04:56:41 +00:00
Yi-Yo Chiang
c30f033b4e fs_mgr: Remove include_dirs declaration
We aren't using anything through the removed path.
We also shouldn't use `include_dirs` to begin with, as it bypasses any
build system checks.

Bug: 293695109
Test: build
Change-Id: I06f7450c3ce545aa2583f8c3f8db18c45073f69e
2023-08-01 04:56:41 +00:00
Yi-Yo Chiang
bb1cc95f6c Merge "fs_mgr: Refactor mandatory overlayfs kernel patch checks" into main 2023-08-01 04:56:06 +00:00
Kelvin Zhang
dccb1e904d Merge "Make libdebuggerd ramdisk available." into main 2023-08-01 04:46:48 +00:00
Yi-Yo Chiang
ea70c490fa Merge "libfstab: Unexport InRecovery()" into main am: f6dc8ee31e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2682015

Change-Id: Icf7aa381f4dfe669e6261e47219ce65f86b846e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 03:51:01 +00:00
Yi-Yo Chiang
d838dde6aa fs_mgr: Refactor mandatory overlayfs kernel patch checks
The check result can just return the exact mount flags to use, this
reduces code duplication at the caller's side.

Bug: 293695109
Test: adb-remount-test
Change-Id: I9b5c918968f2494c0c1be3cb8d8e6b527a9c4eb2
2023-08-01 03:32:54 +00:00
Yi-Yo Chiang
f6dc8ee31e Merge "libfstab: Unexport InRecovery()" into main 2023-08-01 03:19:48 +00:00
Yi-Yo Chiang
7b5c38f8eb libfstab: Unexport InRecovery()
It was accidentally moved to the public header when I was previously
refactoring the code. It hasn't caused any harm yet, but we probably
don't want to export this, too.

Bug: 293695109
Test: build
Change-Id: Id81c802cc6cc697c5a4204638aa467966bea1562
2023-08-01 03:19:39 +00:00
Jooyung Han
6b0c2c3cc6 Merge "Use /bootstrap-apex for bootstrap APEXes" into main am: 58ba0b44c2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2666915

Change-Id: Ifccb5b15c8fc1b7e9a2c9140127fc884090d35c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-31 22:25:08 +00:00
Jooyung Han
ae91cd0dd6 Merge "init: move MarkServicesUpdate later" into main am: e90d93ab6e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2680615

Change-Id: I55371baa91b3963fcc655121bc281fff8972de81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-31 22:24:30 +00:00
Jooyung Han
58ba0b44c2 Merge "Use /bootstrap-apex for bootstrap APEXes" into main 2023-07-31 21:53:57 +00:00
Jooyung Han
e90d93ab6e Merge "init: move MarkServicesUpdate later" into main 2023-07-31 21:47:13 +00:00
Christopher Ferris
48d6e0452e Make libdebuggerd ramdisk available.
Test: Builds and debuggerd unit tests pass.
Change-Id: I2a5bd96e349f81ae0bec8dbffc49646c1f58bfea
2023-07-31 14:24:01 -07:00
Jooyung Han
201801ce8e Use /bootstrap-apex for bootstrap APEXes
This new directory is bind-mounted to /apex in the bootstrap mount
namespace so that apexd-bootstrap mounts bootstrap APEXes there via
/apex.

The directory is detached from /apex in the default mount namespace but
still visible in case bootstrap APEXes are needed.

However, there are (mostly, virtual) devices which don't need two mount
namespaces. Those devices don't need to make /bootstrap-apex directory
at all.

Bug: 290148078
Test: atest VendorApexHostTestCases
Test: atest MicrodroidTests
Change-Id: I541cec71d9970b14971d46e01e4808b23590dbed
2023-07-31 18:16:46 +09:00
Akilesh Kailash
5eb2c1e898 Merge "libsnapshot: Verify the ordering of COW operations." into main am: 1db90d0aac
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2668076

Change-Id: I001c81b563dafbc1fb5b4dd6e16fbec76294ff92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-28 23:37:21 +00:00
Akilesh Kailash
1db90d0aac Merge "libsnapshot: Verify the ordering of COW operations." into main 2023-07-28 22:52:20 +00:00
Daniel Zheng
29d1636f84 Merge "Adding include to functional" into main am: b0f9c07590
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2679741

Change-Id: Ia2332c046edaa70bb79bd208cb16a6cdb9423e25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-28 20:40:35 +00:00
Daniel Zheng
b0f9c07590 Merge "Adding include to functional" into main 2023-07-28 20:00:44 +00:00
Daniel Zheng
750fe6a37b Adding include to functional
adding include to functional since we use it in this file. Some users
are reporting build issues due to missing this include

Test: m fastboot
Change-Id: I9ba11bdaf7dcedf5f9ebfb6fa50013be50738f48
2023-07-28 11:00:16 -07:00
Akilesh Kailash
63ec4c6180 libsnapshot: Verify the ordering of COW operations.
Sequence op should contain all ordered ops followed
by Replace and Zero ops. There shouldn't be any non-ordered
ops embedded between ordered ops in the sequence ordering.

Bug: 290159346
Test: inspect_cow <cow_file>, OTA
Change-Id: Ia840340b0e4be07525f216838043bf0265f690c3
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-07-28 10:11:06 -07:00
Jooyung Han
5ffd88f26f init: move MarkServicesUpdate later
MarkServicesUpdate() starts delayed services which are mostly for
APEXes. (e.g. start a service from APEX). But before
"DefaultNamespaceReady", services are started in "bootstrap" mount
namespace, which makes services from non-bootstrap APEXes fail to start.

This is a quick fix for the problem before coming up with better
solution in the future.

Bug: 293535323
Test: add 'start adbd' before 'perform_apex_config' in init.rc
      adbd starts successfully.
Change-Id: I846689f7c38cdca83c1f7faec0106b8174527e09
2023-07-28 17:28:27 +09:00
Treehugger Robot
b6d50d3984 Merge "trusty: keymint: Statically link Rust deps" into main am: 545f3e0d35
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2679717

Change-Id: I5e6a937abb70d2ff734336885709d85d16510862
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-27 23:44:17 +00:00
Treehugger Robot
f0e1d5105e Merge changes I02e3046b,I5b33ca47 into main am: 50eaceedda
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2675707

Change-Id: I80fe24293f3147a80195d270f216254bbf233f69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-27 23:43:59 +00:00