Commit graph

80387 commits

Author SHA1 Message Date
David Anderson
717b97a201 libdm: Fix failing test on older kernels.
This test was added only for behavior introduced in the 5.15 kernel, where uevents are delayed until a table is laoded.

Bug: 263291020
Test: libdm_test
Change-Id: I6236c4304d8e6b780704df405290f7361d5827cc
2023-01-24 05:20:57 +00:00
Treehugger Robot
1e53806ad9 Merge changes from topic "251425963"
* changes:
  BatteryMonitor: fix build error with health hal v2 updraged
  fastboot: Update health AIDL HAL to V2
  storage: Update health AIDL HAL to V2
  BatteryMonitor: get battery health data from sys file nodes
2023-01-24 00:52:34 +00:00
Jack Wu
2ed5c9c1a7 BatteryMonitor: fix build error with health hal v2 updraged
libbatterymonitor_V1 is used for some libraries linking health
aidl_interface V1 but at the same time BatteryMonitor also uses
battery hal V2 structure, it will cause compiling error.

Folk BatteryMonitor is also required along with folk libbatterymonitor

Bug: 251425963
Test: build
Change-Id: I796db83b1a67ad63e7f75f966e829a790b5c9c89
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-21 15:28:23 +08:00
Jack Wu
0635794d2d fastboot: Update health AIDL HAL to V2
Bug: 251425963
Test: Build
Change-Id: I538ebee69ebe69a1ad1fa934bb7440ef12fc2cc2
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-21 15:21:00 +08:00
Jack Wu
ef38a14bef storage: Update health AIDL HAL to V2
Bug: 251425963
Test: Build
Change-Id: I477023edb68fdefdce5a46bde2bd1538e58c5c21
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-21 15:20:41 +08:00
Jack Wu
e561d03cdf BatteryMonitor: get battery health data from sys file nodes
Requirements for battery health aidl hal v2, include sysfs nodes:
  - Battery state of health
  - Charging state
  - Charging policy
  - Date of manufacturing of the battery
  - Date of first use of the battery

and functions
  - setChargingPolicy
  - getChargingPolicy
  - getBatteryHealthData

Bug: 251425963
Test: m
Change-Id: I210dc403ba95b1b75759227f84bc32f32be1bbaf
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-21 15:20:19 +08:00
Florian Mayer
3d11890797 Merge "[MTE] warn about async crashes being imprecise" 2023-01-20 02:12:42 +00:00
Florian Mayer
5fcdfd2504 [MTE] warn about async crashes being imprecise
Bug: 175335730
Change-Id: If666c98b53dee1c63c48887f4448bc54f78a0a9f
2023-01-20 00:33:29 +00:00
Eric Biggers
90b384adb7 Merge "bootstat.rc: remove trigger that logged post_decrypt_time_elapsed" 2023-01-18 19:44:44 +00:00
Eric Biggers
381c884a96 Merge "Clean up references to FDE in documentation and comments" 2023-01-18 19:43:50 +00:00
Vova Sharaienko
ed20f1ca8f Merge "[TeX] Introduced Telemetry Express Native Logging Library" 2023-01-18 06:42:10 +00:00
Vova Sharaienko
3aaf79bea4 [TeX] Introduced Telemetry Express Native Logging Library
- added support C++ TeX Counter logging API

Bug: 258868665
Test: build
Change-Id: I86ae4335c89196708d4174dd5613ddc89622b17c
2023-01-18 04:36:20 +00:00
Eric Biggers
5265b8d425 Clean up references to FDE in documentation and comments
Bug: 208476087
Change-Id: I328026d68c9dd7a5042ef4b5369f34af93760b37
2023-01-18 02:17:43 +00:00
Eric Biggers
2239b57cc1 bootstat.rc: remove trigger that logged post_decrypt_time_elapsed
I missed this in commit d76e4e01c9 ("bootstat: remove unused FDE boot
events") (https://r.android.com/2232787).

Bug: 208476087
Change-Id: I7fca8257931607b40cb84e8e96a889472094ed6e
2023-01-18 02:14:35 +00:00
David Anderson
298f6c033b Merge "Disable multilib for CtsInitTestCases." 2023-01-17 23:15:47 +00:00
Treehugger Robot
b9e1821201 Merge "Find a zoned partition automatically" 2023-01-17 22:22:26 +00:00
Treehugger Robot
a812f45678 Merge "Pass fault address to GWP-ASan's changed API." 2023-01-17 20:29:46 +00:00
Treehugger Robot
aaa402ae6a Merge "TEST_MAPPING: add vts core lib tests" 2023-01-17 18:40:24 +00:00
Jaegeuk Kim
b92e5b5c48 Find a zoned partition automatically
Since we cannot create a gpt table on zoned LU, we cannot make a generic symlink
from it. Instead, let's make it by uevent, "/dev/block/by-name/zoned_device".
Note that, we support only one zoned device in the system.

Bug: 265180564
Change-Id: Ie62b0fd68b77e3e43cf0f5c5cad9503150174271
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2023-01-14 10:29:31 -08:00
Treehugger Robot
c332f33187 Merge "init: Make console a shutdown critical service" 2023-01-13 21:10:22 +00:00
Florian Mayer
cad7f577d1 Merge "Handle scudo_ring_buffer_size = 0" 2023-01-13 17:54:50 +00:00
Akilesh Kailash
545870e53a Merge "init: Wait for daemon to fully spin up all threads" 2023-01-13 06:35:33 +00:00
Gabriel Jacobo
12f9ff8951 init: Make console a shutdown critical service
A critical shutdown service is one that stays on right until the system
is rebooted. In order to be able to capture kernel messages right until
reboot this is required, otherwise after the console service is
terminated some messages can be lost.

Test: Reboot and verify messages show up on serial further down the reboot process
Change-Id: Iea58b5a76afe45b3346803021e3be81742b02ea0
2023-01-12 16:46:38 -08:00
Florian Mayer
30a25286c4 Handle scudo_ring_buffer_size = 0
Bug: 263287052
Change-Id: I0bec3a817d7a16c72d5dfeddd0dcc86830f5a311
2023-01-12 16:06:10 -08:00
Treehugger Robot
d5d01db888 Merge "fastboot: Copy AVB footer from recovery.img to the end of the partition" 2023-01-13 00:04:58 +00:00
Isaac J. Manjarres
acb49528a7 fastboot: Copy AVB footer from recovery.img to the end of the partition
Copy the AVB footer of the recovery.img to the end of the recovery
partition, so that it can be found when loading a recovery image
from a partition that is larger than the image.

Bug: 261673286
Test: m and flashing recovery image and bootloader can now detect
AVB footer.
Change-Id: Ib93da33c72f3a96eb8d9bcedaab5ef0c3a4d418d
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
2023-01-12 14:33:56 -08:00
David Anderson
9b9924b412 Merge "init: Allow persistent properties to be written asynchronously." 2023-01-12 21:50:42 +00:00
Mitch Phillips
8a34b179ad Pass fault address to GWP-ASan's changed API.
GWP-ASan changed one of the APIs upstream to now take the fault address
as well. This is to support the recoverable mode.

Add the fault address as well.

Test: gwp_asan_unittest
Bug: N/A
Change-Id: I8a4edd3fad159d91cc036050d330bbb8f9c8d435
2023-01-12 09:48:11 -08:00
Elliott Hughes
beeef8c01a Merge "mkbootfs: consistency." 2023-01-12 17:02:53 +00:00
David Drysdale
82ef14bf76 Merge "Helper for setting attestation IDs" 2023-01-12 06:20:45 +00:00
Treehugger Robot
52d91b3fc0 Merge "usb: migration to USB gadget AIDL" 2023-01-12 05:37:41 +00:00
Elliott Hughes
ad1a0a9b0b mkbootfs: consistency.
Move all the error reporting over to err()/errx() rather than the
current mix of errx(), fprintf()+exit(), and the homebrew die().

Also make the two "read all the lines in the file" loops match, by
copying the newer getline() style into the older fgets() loop.

Test: treehugger
Change-Id: Ia732df90588d7fd12dfe965e11c6ed72a96b098d
2023-01-12 04:34:15 +00:00
Treehugger Robot
99b26cf41b Merge "remount: Add checkpoint instructions with warning" 2023-01-12 01:44:03 +00:00
Treehugger Robot
a4dae3c6f5 Merge "Do not create worker thread if threading isn't enabled" 2023-01-12 01:12:06 +00:00
Chih-hung Hsieh
4c3b71ee83 Merge "Suppress clang-analyzer-security.FloatLoopCounter warnings" 2023-01-12 00:18:27 +00:00
Daniel Rosenberg
61b2304ffb remount: Add checkpoint instructions with warning
When debugging an issue before boot complete, it may be necessary to
remount before checkpointing can finish. This gives instructions on
ending checkpointing early, allowing a remount, along with a warning to
not do that unless you know what you are doing.

Bug: 252989722
Test: Displays text in log
Change-Id: Ibdd39464b980ec531a900e162469a884f9096904
2023-01-12 00:04:54 +00:00
Treehugger Robot
e8d42e65c8 Merge changes I169b52cf,Ieb0e4e24
* changes:
  init: Add test for gentle_kill
  init: Add gentle_kill service property
2023-01-11 23:16:55 +00:00
Chih-Hung Hsieh
dfd1d517b1 Suppress clang-analyzer-security.FloatLoopCounter warnings
* Suppress also the alias check name cert-flp30-c.
* Leave comment in code for code owners to rewrite
  the loop with integer counters.

Bug: 265171053
Test: presubmit; tidy-system-core-storaged_subset
Change-Id: I8297161366a7a2e1c7cdbec8efb7a8e9e435166a
2023-01-11 14:21:46 -08:00
Treehugger Robot
46134b9cae Merge "Zero-length packet send bug resolution for fastboot." 2023-01-11 20:55:28 +00:00
Akilesh Kailash
717ee9120a Merge "init: Avoid killing all processes during reboot if update is in progress" 2023-01-11 20:52:13 +00:00
Shaju Mathew
dce1371666 Zero-length packet send bug resolution for fastboot.
Bug: 208675141

Test: Treehugger, cursory test of fastbootd against macOS Monterey running fastboot.

Change-Id: Id2ac1be428470385c866d505f860e50bd9132e2e
Signed-off-by: Shaju Mathew <shaju@google.com>
2023-01-11 19:32:01 +00:00
Akilesh Kailash
5140f3ad47 init: Wait for daemon to fully spin up all threads
During selinux transition, daemon will notify `init` process
by writing to file "/metadata/ota/daemon-alive-indicator".

Init will wait until daemon notifies it. Furthermore, daemon
will only write to that file once all threads are spin up
and attached to dm-user misc devices.

Once snapshot-merge is completed, this file will be removed.
Additionally, during boot, init will also ensure that
there are no stale files and will try to remove just
before selinux transition.

Bug: 262407519
Test: OTA on Pixel - Verify new file exits and init waits until daemon
is fully up.
Change-Id: Iabef58ad282d80a7afa493e9df9468ae41a13e44
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-01-11 19:24:56 +00:00
Treehugger Robot
7fcaa14e27 Merge "Add comment about out-of-bounds being on purpose" 2023-01-11 18:55:18 +00:00
Treehugger Robot
d2401873f2 Merge "Parser::ParseConfigFile returns Result<void>" 2023-01-11 12:11:18 +00:00
Treehugger Robot
bf3c1c56d8 Merge "BatteryMonitor: fix depending on multiple versions of the same aidl_interface" 2023-01-11 11:25:17 +00:00
Jooyung Han
6b88d1684c Parser::ParseConfigFile returns Result<void>
ParseApexConfigs() uses Parser::ParseConfigFile() to parse .rc files in
the target apex. ParseConfigFile() returning bool (with logging on
error) doesn't propagate the error message back to the callers
(including apexd or PackageManager).

We'd better to migrate other Parse*() methods of Parser class to return
Result<T>. But this change focuses on plumbing error progagation for
APEX configs.

Bug: 238820991
Test: atest CtsInitTestCases
Change-Id: Ifad97635dbb53a70053ec73a7a5b7e742466daf6
2023-01-11 17:20:16 +09:00
Akilesh Kailash
2c52d09078 init: Avoid killing all processes during reboot if update is in progress
Bug: 262321167
Test: Reboot device post OTA reboot
Change-Id: I5d13844e4e157d24a414dce668163bb1915bf65e
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-01-11 06:00:34 +00:00
Daniel Rosenberg
ed8178c8cc init: Add test for gentle_kill
Tests that a service marked as gentle_kill terminiated with SIGTERM

Bug: 249043036
Test: atest CtsInitTestCases:init#GentleKill
Change-Id: I169b52cfd74f07b4d2439761ea315117323b3fcb
2023-01-10 18:29:46 -08:00
Daniel Rosenberg
de76688e40 init: Add gentle_kill service property
If a service specifies gentle_kill, attempt to stop it will send SIGTERM
instead of SIGKILL. After 200ms, it will issue a SIGKILL.

Bug: 249043036
Test: atest CtsInitTestCases:init#GentleKill
      Added in next patch
Change-Id: Ieb0e4e24d31780aca1cf291f9d21d49cee181cf2
2023-01-10 18:29:46 -08:00
Jack Wu
f83e5a6ebd BatteryMonitor: fix depending on multiple versions of the same aidl_interface
When health aidl_interface version updraged, some libraries are
depending on V1 and libbatterymonitor or libhealthd_charger_ui at
the same time. It will cause multiple versions depending if
libbatterymonitor or libhealthd_charger_ui are depending on new
version.

Fork libbatterymonitor and libhealthd_charger_ui to generate two
versions, so that other libraries can depend on the same aidl_interface
version, to avoid multiple versions depending.

Bug: 251425963
Test: build
Change-Id: I37ba23169428677550176916e5d0b52c154d7b85
Signed-off-by: Jack Wu <wjack@google.com>
2023-01-11 08:58:46 +08:00