Commit graph

80426 commits

Author SHA1 Message Date
Kelvin Zhang
2a2760fe0a Merge "Initialize COW options using update manifest" 2023-02-24 01:25:24 +00:00
Kelvin Zhang
b5a9607232 Initialize COW options using update manifest
Update manifest contains feature specifications such as whether to use
multi-threading or batched writes, initialize COW options using the
manifest allows these features to be enabled/disabled at update install
time.

Test: th
Change-Id: Iff66c43567d4890ae1c88624db49014584b1d96f
2023-02-23 13:21:20 -08:00
Bart Van Assche
95465fe718 Merge "init: Simplify struct BuiltinArguments" 2023-02-23 20:18:35 +00:00
Treehugger Robot
a4651021d7 Merge "[gwp-asan] fix tests under clang coverage, and extend invariants" 2023-02-23 18:31:37 +00:00
Bart Van Assche
3dfb8bc889 init: Simplify struct BuiltinArguments
Make the code that creates BuiltinArguments instances easier to read by
using initializer lists instead of constructor calls. Remove the
BuiltinArguments constructors.

Change-Id: I6cf215a81d298cf7e524e22fb75db820e0225c9a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-23 16:06:42 +00:00
Jack Wu
bae352bddb Merge "BatteryMonitor: batteryStateOfHealth should be a property" 2023-02-23 06:45:16 +00:00
Jiyong Park
8437b9a082 Merge "Fix failure on mounting system_ext partition" 2023-02-23 03:56:40 +00:00
Daniel Zheng
50eb9227e4 Merge "Added support for reboot task" 2023-02-23 03:49:54 +00:00
AleX Pelosi
ff7089295a BatteryMonitor: batteryStateOfHealth should be a property
Bug: 251427118
Test: m
Change-Id: I21bcd160f51cf8818d0c3c8c54c615314808e586
Signed-off-by: AleX Pelosi <apelosi@google.com>
2023-02-23 01:22:34 +00:00
Daniel Zheng
71b3b43495 Added support for reboot task
Test: tested on raven device
Change-Id: I4935d720f567e70da95ea8da37f3404b80b313c8
Bug: 194686221

Changed reboot {target} to work off tasks. reboot-{target} commands are
also supported.

Test: tested reboot on raven device
Change-Id: I05aed269d121a5d651c1ab1180a1b4878ae213fd

Modified load_buf to be able to find images in $OUT directory

Test: tested flash {partition} and flash {partition} {img_name} on raven
device

Change-Id: I3879792d11ad15bc910670853d2a7fe200fcc66f
2023-02-23 00:15:08 +00:00
Alistair Delva
5591f12834 Use ro.boot.serialconsole to disable console services
For many years, services declaring "console" would only be started if the
console device specified by androidboot.console= was present under /dev.
However, they would also be started if the /dev/console node existed.

This fallback causes problems with newer GKI kernel images which now
hard-code "console=ttynull" via CONFIG_CMDLINE, which essentially means
/dev/console always exists, even though this console points nowhere.

It also causes problems on devices where the androidboot.console was not
the same as the kernel dmesg console ("console="), such as cuttlefish,
because those platforms could not simultaneously enable kernel logging
but disable the interactive serial console feature. The framework just
assumed both would be muxed on the same serial port. Cuttlefish had a
workaround, to use "androidboot.console=invalid" to avoid the fallback,
but this doesn't work on devices which still want to mux the kernel logs
and interactive serial console.

This change resolves the issue in a better way, by introducing a new
boolean property called "androidboot.serialconsole". Setting this to "0"
will disable the console services, regardless of whether the
/dev/console or /dev/${ro.boot.console} devices exist. Older kernels
and bootloaders don't need to set this and can rely on the old behavior
in init, but bootloaders booting newer kernels must set it to avoid the
"performance is impacted" message due to console services being started.

Bug: 266982931
Bug: 223797063
Bug: 267428635
Test: "launch_cvd" with "androidboot.console=invalid" removed;
      See the "performance is impacted" message.
Test: "launch_cvd" with "androidboot.serialconsole=0";
      The "performance is impacted" message is gone.
Change-Id: Iaad4d27ffe4df74ed49606d3cabe83483c350df4
2023-02-22 14:31:24 -08:00
Mitch Phillips
70aa219034 [gwp-asan] fix tests under clang coverage, and extend invariants
1. Fixes this test under clang coverage, which is run under presubmit
   for TEST_MAPPING files. When we spawn under a minijail, and the
   process exited normally (which is the case for recoverable), clang
   coverage would use atexit handlers to dump some stuff using banned
   prctl's and other syscalls. Instead of allow-listing them all which
   sounds like a huge pain, call _exit() which skips those handlers.

2. Extends the invariant testing to make sure that recoverable GWP-ASan
   recovers both the first time, and a second time in a different slot.

Bug: N/A
Test: CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="*" atest debuggerd_test
Change-Id: I6059e21db4c2898b1c9777a00d2a54497d80ef79
2023-02-22 12:27:37 -08:00
Treehugger Robot
25f451ab56 Merge "Fix labels on /data/system/shutdown-checkpoints/" 2023-02-22 10:21:25 +00:00
Woody Lin
0bcf0bf8f3 Fix labels on /data/system/shutdown-checkpoints/
Bug: 260366497
Bug: 264600011
Test: The correct label is assigned to dir after taking reboot
Test: Both system_server and dumpstate can access it
Change-Id: Icecbb59ddf936088aa3873bf1b143a08f035fefe
2023-02-22 15:57:17 +08:00
Bart Van Assche
8f09cb5ba6 Merge changes I71b34181,Ibd05137a
* changes:
  init: Document the locking strategy used in class PropWaiterState
  init: Document the locking strategy in class ShutdownState
2023-02-21 23:15:14 +00:00
Lianjun Huang
ccd094cd4e Fix failure on mounting system_ext partition
There can be more than one fstab entry of system partition.
For example, the filesystem of one entry is ext4 and another is erofs.

system /system ext4 ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey

If both filesystems of system and system_ext paritions are erofs,
only the ext4 fstab entry will be returned by GetEntryForMountPoint,
and system_ext cann't be mounted.

So we need to return both of the fstab entries and try all of them.

Signed-off-by: Lianjun Huang <huanglianjun@xiaomi.com>
Change-Id: I407553d48b1749cd0554f057a6bfd38daa96fdcb
Signed-off-by: Lianjun Huang <huanglianjun@xiaomi.corp-partner.google.com>
2023-02-20 16:50:03 +08:00
Bart Van Assche
b6b7ccc24f init: Document the locking strategy used in class PropWaiterState
Let the compiler verify that lock_ is held when any of the data members
are accessed.

Bug: 266255006
Change-Id: I71b341815d84ab530627d934ad4d4681b652b9d8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-17 13:55:11 -08:00
Bart Van Assche
68a59e1c72 init: Document the locking strategy in class ShutdownState
Let the compiler verify that shutdown_command_lock_ is held when
shutdown_command_ is accessed.

Bug: 266255006
Change-Id: Ibd05137ab65e20f247f35bbb2bb1865e05f51f41
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-17 13:55:11 -08:00
Treehugger Robot
16ab2b67f7 Merge "Add KM_SET_ATTESTATION_IDS_KM3 to enum list" 2023-02-16 23:56:16 +00:00
Donnie Pollitz
dedd899baa Add KM_SET_ATTESTATION_IDS_KM3 to enum list
* This command is needed to support provisioning KeyMintv3 attestation IDs

Bug: 265381212
Test: Ran KM Vts
Change-Id: I9b9bf3753b90c58096fa85a4e7303b47eaafe31f
Signed-off-by: Donnie Pollitz <donpollitz@google.com>
2023-02-16 10:59:47 +01:00
Dmitrii Merkurev
45380e4ace Merge "fastboot: Use copy constructor to copy fastboot match callback" 2023-02-15 19:05:55 +00:00
Dmitrii Merkurev
96ea7b9ccf Merge "fastboot: Follow fastboot pattern to show network-connected device status" 2023-02-15 19:05:34 +00:00
Bart Van Assche
678516efa1 Merge changes Ib9a6b75b,Ifb71fa24,If329e912
* changes:
  init_test: Close all file descriptors before calling execv()
  init_test: Fix a race condition
  init_test: Simplify the gentle_kill test
2023-02-15 18:56:42 +00:00
David Anderson
9bbe597b59 Merge "snapuserd: Use fixtures in snapuserd_test." 2023-02-15 17:51:48 +00:00
Bart Van Assche
468067a204 init_test: Close all file descriptors before calling execv()
This change improves test reliability.

Change-Id: Ib9a6b75bbd81968eb7e2fd90ea567155bc8355f7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-15 09:27:32 -08:00
Bart Van Assche
878560dae0 init_test: Fix a race condition
Wait until strace has attached to the service instead of assuming that
it has attached after one second.

Change-Id: Ifb71fa2419563e1334d8500ea867ec92121395e0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-15 09:27:32 -08:00
Bart Van Assche
947d75f0b8 init_test: Simplify the gentle_kill test
Remove the ConvertToArgv() function. Do not cast the std::string::find()
result. Make the strace path absolute.

Change-Id: If329e91275c834ba375863e40901f6be07a5f347
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-15 09:27:32 -08:00
Dmitrii Merkurev
c48cd9f6c0 fastboot: Follow fastboot pattern to show network-connected device status
Bug: 269348113
Test: checked output
Change-Id: Ie6c48d36bd67fcb060ad3f4a35185fd9cc59ff81
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-15 15:34:58 +00:00
Dmitrii Merkurev
b5b8276db1 fastboot: Use copy constructor to copy fastboot match callback
Test: fastboot -s 15171FDF6000CV getvar all on OSX
Bug: 269348113
Change-Id: I968626c95ee19ea348bac48cac308e3c817e0d55
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-15 15:21:22 +00:00
Treehugger Robot
368a908334 Merge "Fastboot: Add new TEXT message to protocol to handle long lines." 2023-02-15 11:49:24 +00:00
David Anderson
5169ec88c6 snapuserd: Use fixtures in snapuserd_test.
This refactors snapuserd_test to use SnapuserdTest as a fixture, to
avoid needing a separate harness instance.

Bug: 269361087
Test: snapuserd_test
Change-Id: Iffdc7b621dbe0aff72eff790e7af3f6bb33036ee
2023-02-14 16:59:31 -08:00
Jeffrey Huang
5c1d43f732 Merge "Create new directory for statsd restricted configs" 2023-02-15 00:26:17 +00:00
Raphael Herouart
99097cc020 Fastboot: Add new TEXT message to protocol to handle long lines.
Trusty Benchmarks need to be evaluated in ABL which is much more
controlled than linux. However fastboot prints evry atomic message from
trusty/abl on its own line starting with "(bootloader)"

Bug: 263454481
Test: - "fastboot oem trusty runtest trusty.hwrng.bench"
Change-Id: I99847a8cc54457c8ec809e219736325dce0ac891
2023-02-14 19:58:42 +00:00
Jeffrey Huang
01a73d74d8 Create new directory for statsd restricted configs
Bug: 264407489
Test: m -j
Change-Id: I10e7d6a4a6d011eb9a7453191ab90771b82aa9b3
2023-02-14 11:25:45 -08:00
Treehugger Robot
d14a7551d5 Merge "Convert Gatekeeper from HIDL to AIDL" 2023-02-14 17:48:17 +00:00
David Anderson
14c7361f9c Merge "storaged: use correct accumulate variable for publishing disk stats" 2023-02-14 17:34:50 +00:00
David Anderson
2d6c30da7f Merge "fastboot: Add a mock transport and some driver tests." 2023-02-14 16:05:44 +00:00
David Anderson
e6d8dd3e15 fastboot: Add a mock transport and some driver tests.
Bug: N/A
Test: fastboot_test
Change-Id: I08d8dfedcc7e9dad9ce418e0f3aaf5ac69a3a2a2
2023-02-13 18:59:48 -08:00
David Anderson
6c5b6a8705 Merge "fastboot: Add a test for super_flash_helper." 2023-02-14 02:12:52 +00:00
Daniel Zheng
6183722bcc Merge "Added support for flash task" 2023-02-14 00:59:22 +00:00
David Anderson
ada871875e fastboot: Add a test for super_flash_helper.
This test checks that the sparsing logic matches a canonical sample
output.

Bug: N/A
Test: fastboot_test
Change-Id: Ic7bad08a79e4223f8352db2397b741c2179e76bb
2023-02-13 15:47:10 -08:00
David Munoz Constantine
360a3f67c4 storaged: use correct accumulate variable for publishing disk stats
In the publish function, the variable mAccumulate_pub is used to log
disk performance. However, the variable mAccumulate is used to log disk
stats. The variable mAccumulate is only populated during a stall event.
The publish function is used to log disk stats on a periodic timer,
therefore, it should not rely on stall events to log stats. Instead,
it should rely on the appropriately named mAccumulate_pub variable.

Test: storaged unit tests

Change-Id: I30e00f2c69618705d3f308630b7e023bfc5e384e
Signed-off-by: David Munoz Constantine <dmunozc@squareup.com>
2023-02-13 15:45:20 -08:00
David Anderson
69863bd977 Merge "liblp: Fix a crash when adding an image to a partition with no extents." 2023-02-13 23:28:14 +00:00
Daniel Zheng
0d30718d9c Added support for flash task
Added Flash Task

Test: tested on raven
Change-Id: I4a6c22f795440afeba18497745dddf8d5c570f65
Bug: 194686221

changed flash {partition_name} to work with tasks

Test: tested flash {partition_name} on raven
Change-Id: I1fa45b949ad8e5017026dd542dfe1389279a9e64
Bug: 194686221
2023-02-13 23:27:41 +00:00
Treehugger Robot
77f4cb4db0 Merge "fastboot: Introduce connect / disconnect for network-connected devices" 2023-02-13 20:25:12 +00:00
Bart Van Assche
05c7e3c0c2 Merge "libprocessgroup: Proceed if activation of an optional controller fails" 2023-02-13 18:06:49 +00:00
Treehugger Robot
cb5b0686e5 Merge "[TeX] Improved readability for Histogram metric APIs" 2023-02-11 04:35:00 +00:00
Vova Sharaienko
8ba8b353ca [TeX] Improved readability for Histogram metric APIs
Bug: 268161449
Test: atest expresslog_test
Change-Id: Idd83ca6ec47288ca6ef7ecce333ceb3c88dd761a
2023-02-11 03:27:08 +00:00
Treehugger Robot
d35f56b199 Merge "libprocessgroup: Rework SetupCgroup()" 2023-02-11 00:14:26 +00:00
Dmitrii Merkurev
0ee285aa68 fastboot: Introduce connect / disconnect for network-connected devices
Use introduced FileLock and network-connected devices storage entities
to introduce fastboot connect / disconnect commands

Test: everything works like discussed here go/fastboot-connect-disconnect on windows/linux
Bug: 267507450
Bug: 267506875
Change-Id: I2d6495ad567a3ddadd471a89b82d78c8c36a3d52
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-11 00:02:22 +00:00