Commit graph

80977 commits

Author SHA1 Message Date
Daniel Zheng
f8da682c84 Merge "Added Flashing Plan" 2023-03-03 07:42:55 +00:00
Daniel Zheng
bc01da5c0d Changed FlashTask and RebootTask to take in FlashingPlan
Test: tested flash {partition} on raven and reboot {target} on raven
Change-Id: I26f4723474c3a142b086c1ac361578f8487ec3b9
Bug: 194686221
2023-03-03 06:49:34 +00:00
Daniel Zheng
7df2ab9c87 Added Flashing Plan
Fastboot has a lot of flags that are used by many different functions
including the Flashall Class and newly added FlashSuperTask. Passing all
of these flags as paramaters is cumbersome, so adding a Flashing Plan
that contains these flags simplifies the code.

Test: tested Flashall and update img.zip on raven
Change-Id: I9c842f25389a20b852d55f684e1b86040af1d86a
Bug: 194686221
2023-03-03 06:49:32 +00:00
Inseob Kim
e89ee18b9b Merge "libprocessgroup: fix boot time performance regression" 2023-03-03 05:02:29 +00:00
Suren Baghdasaryan
4f7cc8c345 libprocessgroup: fix boot time performance regression
The way processes are accounted in DoKillProcessGroupOnce has been
changed recently, which affects retries in KillProcessGroup. More specifically, initialPid was not counted before and would not
cause a retry with 5ms sleep.
Restore previous behavior to avoid boot time regressions.

Bug: 271198843
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ibc1bdd855898688a4a03806671e6ac31570aedf9
2023-03-03 00:11:13 +00:00
Treehugger Robot
55ba50e20f Merge "Use ro.boot.serialconsole to disable console services" am: 8dab2ef586
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2451765

Change-Id: I7885352f27b5a64cf36151c919996d73d65414e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 20:29:11 +00:00
Treehugger Robot
8dab2ef586 Merge "Use ro.boot.serialconsole to disable console services" 2023-03-02 20:04:33 +00:00
Treehugger Robot
1e9592f022 Merge "Fix the missing std" am: bb4c61aa34
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2465171

Change-Id: I699fec00c6ab0057b39d0f0582b9ae6eb3574154
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 01:59:01 +00:00
Treehugger Robot
bb4c61aa34 Merge "Fix the missing std" 2023-03-02 01:50:18 +00:00
Elliott Hughes
8e58ce6824 Merge "Update shell_and_utilities docs for U." am: 799550dd1f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2464831

Change-Id: I7c2ac6e2a4a82d86e3aebe01096a564530bcdae3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 01:21:56 +00:00
Krzysztof Kosiński
0cc793ef16 Merge "Fix invalid uses of PLOG." am: 0f90ba64bd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2462673

Change-Id: Ie0177ea1595e0509ade79074d0928e3cce5c9470
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-02 01:21:45 +00:00
Elliott Hughes
799550dd1f Merge "Update shell_and_utilities docs for U." 2023-03-02 01:05:07 +00:00
Krzysztof Kosiński
0f90ba64bd Merge "Fix invalid uses of PLOG." 2023-03-02 00:52:20 +00:00
Dmitrii Merkurev
cdbfa7a3e8 fastboot: Introduce ParseNetworkSerial unit tests
Introduced positive and negative unit tests to cover
ParseNetworkSerial logic. Alongside with that move
result related stuff to the separate header.

Test: atest fastboot_test
Test: manually checked basic functionality works fine
Bug: 271155012
Change-Id: Icac6053c11b5a36daa64555209555826ea28cc61
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-03-02 00:03:49 +00:00
zijunzhao
6634c1741e Fix the missing std
Bug: b/239662094
Test: enable Wunqualified-std-cast-call locally and run m to build
Change-Id: I203af8dbbbf1d889b9fc5efd5b62fa165ee09dc2
2023-03-01 23:30:29 +00:00
Elliott Hughes
f603989156 Update shell_and_utilities docs for U.
Also add a few relevant links for anyone wanting more background.

Test: N/A
Change-Id: I31c98313f2237c93b89e7a5db44952f394604a1b
2023-03-01 22:05:37 +00:00
Treehugger Robot
c5d45ccbb0 Merge "fastboot: Fix fastboot_vendor_boot_img_utils_test mac os compilation" am: 18b6e9b819
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2463156

Change-Id: Iaf240e3f1fa981a1d49021a458cc7c0f64902a5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 17:44:55 +00:00
Treehugger Robot
18b6e9b819 Merge "fastboot: Fix fastboot_vendor_boot_img_utils_test mac os compilation" 2023-03-01 17:03:44 +00:00
Dmitrii Merkurev
95c90c6588 fastboot: Fix fastboot_vendor_boot_img_utils_test mac os compilation
Use more universal lseek instead of lseek64

Test: atest fastboot_vendor_boot_img_utils_test
Test: mm on mac os
Bug: 271152365
Change-Id: I4d094dd2c24e4ffec8ea7fe2f3b355122fd8cd19
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-03-01 15:49:56 +00:00
Treehugger Robot
3532d3876a Merge "crash_dump: suggest lldbclient.py rather than gdbclient.py." am: a010a27da9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2461713

Change-Id: I6658a583af0633a87b520a0cb59bc8be68a33863
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 04:38:33 +00:00
Krzysztof Kosiński
0310ec4b55 Fix invalid uses of PLOG.
PLOG reports the value of errno. These four PLOG statements are
after functions that are not syscalls, leading to confusing logs
such as "Failed to apply Foo task profile: Success".

Bug: 271196526
Test: N/A
Change-Id: Iede5274d1ceebabec8432527112291ba63dca090
2023-03-01 04:17:57 +00:00
Treehugger Robot
a010a27da9 Merge "crash_dump: suggest lldbclient.py rather than gdbclient.py." 2023-03-01 04:00:33 +00:00
Treehugger Robot
2442556230 Merge "fastboot: Fix IPv6 connect and -s host parsing" am: 396b107a41
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2460216

Change-Id: I188718522c6e5db52d381918b4ce5aad576c71ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 23:42:29 +00:00
Treehugger Robot
396b107a41 Merge "fastboot: Fix IPv6 connect and -s host parsing" 2023-02-28 22:46:02 +00:00
Elliott Hughes
5a4e62513f crash_dump: suggest lldbclient.py rather than gdbclient.py.
They're the same script right now, but gdbclient.py is a bit misleading,
even if we're not likely to ever actually remove it.

Test: treehugger
Change-Id: Ic514f98bf13b3e699be4dbad2bafef22d41d9ffd
2023-02-28 22:16:19 +00:00
Dmitrii Merkurev
4785554ca1 fastboot: Fix IPv6 connect and -s host parsing
During fastboot connect / disconnect introduction, we
completely broke the IPv6 support (it was considering
all IPv6 addresses as a USB serial).

Makeing sure this problem isn't reproducible anymore
alongside with fixing EXCPECT causing process crash
and improve network serial error detection.

Bug: 271152365
Change-Id: Ic52aa5fff1948a64ac3d2672f3cf4d2b022e5cea
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-28 21:02:48 +00:00
Steven Moreland
198d6a16a7 Merge "init: add log w/ service PID" am: 007769a0d7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2459588

Change-Id: Ic5ee5fa329ea2ba24ef82c4650c8e818e3540fd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 19:54:46 +00:00
Suren Baghdasaryan
2038ed868b Merge "Kill its process group even if the given process is already dead" am: 763593e395
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2459289

Change-Id: Icb4b2f94a5ade70ad3ead99a8898cca301dc53b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-28 19:35:59 +00:00
Steven Moreland
007769a0d7 Merge "init: add log w/ service PID" 2023-02-28 19:07:41 +00:00
Suren Baghdasaryan
763593e395 Merge "Kill its process group even if the given process is already dead" 2023-02-28 18:25:57 +00:00
Jing Ji
304c0f1c14 Kill its process group even if the given process is already dead
So the child processes in the process group won't be orphaned
when we decide to kill the process group of a given process but
find it's already dead.

Bug: 266633286
Test: atest MicrodroidDemoApp
Change-Id: Ib6f45b992566f0ab5cf152463c95294a306dd736
2023-02-27 22:01:34 -08:00
Steven Moreland
8e25d9c5b0 init: add log w/ service PID
We could combine this with the existing log, but I
wouldn't want to make that appear later.

Ironically, adding this log to try to reduce logs.

Bug: 36785118
Test: :) adb logcat -d | grep "started service" | wc -l
131

Change-Id: I38f4e9740871aa256eef0c62e897038eb46871a5
2023-02-28 01:42:24 +00:00
Kelvin Zhang
599cc32d20 Merge "Initialize COW options using update manifest" am: 2a2760fe0a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2454005

Change-Id: I06dfe0e56d2449e0a320469779aef6f8c5d1cc4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 05:47:30 +00:00
Kelvin Zhang
2a2760fe0a Merge "Initialize COW options using update manifest" 2023-02-24 01:25:24 +00:00
Bart Van Assche
81af4365b8 Merge "init: Simplify struct BuiltinArguments" am: 95465fe718
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2451825

Change-Id: Iae3bcd1356e1504de0d1348dbce2371fa52e454a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 23:55:17 +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
a15e7ab8cf Merge "[gwp-asan] fix tests under clang coverage, and extend invariants" am: a4651021d7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2451045

Change-Id: I67c528d7b81cfb29bffc8183607ed9f05bb2d641
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 19:47:06 +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
e8d76aae3f Merge "BatteryMonitor: batteryStateOfHealth should be a property" am: bae352bddb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2441728

Change-Id: I7f3a15566a9da89d29b14f998b18c4ef911fb627
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 07:29:54 +00:00
Jack Wu
bae352bddb Merge "BatteryMonitor: batteryStateOfHealth should be a property" 2023-02-23 06:45:16 +00:00
Jiyong Park
df10d96f4a Merge "Fix failure on mounting system_ext partition" am: 8437b9a082
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2442800

Change-Id: I9b3b7c159f274cd90b6e27b2d5d67a88ef936e34
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 04:52:42 +00:00
Daniel Zheng
004148c2b4 Merge "Added support for reboot task" am: 50eb9227e4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2412254

Change-Id: Ib1c81630a7ed812049e071ed15d6370257d6b440
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-23 04:52:11 +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