Commit graph

80364 commits

Author SHA1 Message Date
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
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
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
Akilesh Kailash
1324002fbf Merge "libsnapshot: Wait for daemon to terminate after snapshot unamp" 2023-02-10 23:49:33 +00:00
Bart Van Assche
b0947e008a libprocessgroup: Proceed if activation of an optional controller fails
Not all Android kernels support all the cgroup controllers mentioned in
task_profiles.json and/or cgroups.json. Support such kernels by ignoring
certain cgroup activation failures.

Bug: 213617178
Change-Id: I90c0bd959f8a6484c4f2fbc895845e073527271e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-10 15:02:44 -08:00
Akilesh Kailash
d2063ad7dd libsnapshot: Wait for daemon to terminate after snapshot unamp
During verification, update-engine will invoke
SnapshotMap() and Unmap() for every partition verification.

Post Unmap(), update-engine immediately invokes Map()
for next partition. This is a narrow window wherein, daemon
from previous unmap() is still present and init hasn't
terminated it. Thus, when next MapSnapshot() is invoked,
Connect() fails as init may end up terminating the service.

Wait for the daemon to fully terminate and exit
when Detach() is invoked.

Bug: 258514587
Test: OTA on Pixel, Map/Unmap in a loop
Change-Id: I36b7ce183dfa4c89a873118876d195480e28d48c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-02-10 14:31:52 -08:00
Bart Van Assche
1ec6ec4f57 libprocessgroup: Rework SetupCgroup()
Improve the readability of this function by splitting it.

This CL includes the following behavior changes:
- If changing the directory owner and/or mode fails for /sys/fs/cgroup,
  this is considered as a fatal error instead of something that should
  only fail if "Optional" has not been set.
- If mounting the v2 cgroup controller fails, this is considered as an
  error.
- Activating/mounting a cgroup controller only fails if the controller
  has not been marked as optional.

Bug: 213617178
Change-Id: If6908dfdbcb2e1c9637ab4ac8a7625f0a17dc9e0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-10 14:18:38 -08:00
Vova Sharaienko
6f9a9092b7 Merge "[TeX] Introduced Telemetry Express Histogram metric Native API" 2023-02-10 20:31:43 +00:00
Dmitrii Merkurev
4dd1ac9282 Merge "fastboot: Introduce network-connected devices storage" 2023-02-10 20:27:15 +00:00
Treehugger Robot
9ed4eb61a6 Merge "BatteryMonitor: report battery health from health status" 2023-02-10 09:55:21 +00:00
Jack Wu
b57f68aedd BatteryMonitor: report battery health from health status
Bug: 251425963
Test: m
Change-Id: I0a34262c8146032120273ab9be4ef4d3b285d115
Signed-off-by: Jack Wu <wjack@google.com>
2023-02-10 07:40:20 +00:00
Sandeep Dhavale
ee065fe080 Merge "Fastboot: Use AServiceManager_waitForService instead of AServiceManager_getService" 2023-02-10 04:12:06 +00:00
Treehugger Robot
120902971b Merge "Only run GentleKill test as root" 2023-02-10 03:22:00 +00:00
Bart Van Assche
d9098252c6 Merge "libprocessgroup: Introduce a local variable in CgroupMap::ActivateControllers()" 2023-02-09 21:38:05 +00:00
David Anderson
d45181f1c2 Merge "fastboot: Add fastboot_test to TEST_MAPPING." 2023-02-09 21:33:26 +00:00