Commit Graph

68366 Commits

Author SHA1 Message Date
Lisa Liu 82674dedcd bootstat: Add Tj thermal shutdown
Add "reboot,thermal,tj" to kBootReasonMap

Bug: 174705050
Test: adb shell echo 110000 > /dev/thermal/tz-by-name/BIG/emul_temp
adb shell bootstat -p

Change-Id: Iea7da4024a57eff7a758e0e9a2321eb220fc5c28
2021-03-17 08:56:06 +00:00
David Anderson 102f7e4d7e Merge "libsnapshot: Add boot_complete metrics." 2021-03-16 00:30:46 +00:00
Nicolas Geoffray f85f3d628e Merge "Add libsigchain as dependency of platform." 2021-03-15 16:04:38 +00:00
Alistair Delva fb1cffb46b Merge "init: check for verifiedbootstate in properties" 2021-03-15 04:03:17 +00:00
Inseob Kim b56165cce3 Merge "Allow precompiled sepolicy w/o system_ext/product" 2021-03-14 15:28:42 +00:00
Nicolas Geoffray 8a3f8853d3 Add libsigchain as dependency of platform.
Test: m and boot
Test: atest CtsJniTestCases
Bug: 142944043
Change-Id: Iefded35c478d6278c56fbfa02e5cb364a9326c5c
2021-03-13 16:07:13 +00:00
David Anderson a0992300f2 libsnapshot: Add boot_complete metrics.
Bug: 180535575
Test: apply OTA
Change-Id: Ifea51c4c83ba03012f557927e8694e7c613335a7
2021-03-12 18:35:44 -08:00
David Anderson ccc7db3d92 Merge "libsnapshot: Fix CowWriter::Finalize() not restoring footer correctly." 2021-03-12 18:43:58 +00:00
Roman Kiryanov dce1f88bfb Merge "Populate `ro.boot.qemu` for the emulator device" 2021-03-12 06:06:03 +00:00
Roman Kiryanov 7787e70417 Merge "Populate only emulator specific properties into `ro.kernel.`" 2021-03-12 06:05:35 +00:00
Roman Kiryanov a3d37ac9b2 Merge "Move the `androidboot.` literal into its own variable" 2021-03-12 04:32:13 +00:00
Inseob Kim d99d977f17 Allow precompiled sepolicy w/o system_ext/product
Some devices might not have system_ext or product partitions. But init
has been refusing to use precompiled sepolicy because init always checks
system / system_ext / product hashes, regardless of existence. This
makes system_ext and product optional, so hash check can be skipped for
non-existing partitions. Of course system is always checked.

Bug: 181640066
Test: boot microdroid and cuttlefish, see precompiled sepolicy works
Change-Id: I32c296fffd894c27097e8b4e10ade977a21d61ab
2021-03-12 11:40:15 +09:00
Roman Kiryanov 4a47c74b75 Populate `ro.boot.qemu` for the emulator device
Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ied78f42363c1f6580fe6e5660b14c257960aed98
2021-03-11 16:49:17 -08:00
Roman Kiryanov 1a705d4943 Populate only emulator specific properties into `ro.kernel.`
`ro.kernel.` is an emulator specific prefix.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ie4a19127f05f3074ccb02bd055711e9b70702ba6
2021-03-11 16:48:26 -08:00
Roman Kiryanov ccc15c5dbd Move the `androidboot.` literal into its own variable
Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I19f25671c82fff34dd52e3557361c4340706aab0
2021-03-11 16:46:00 -08:00
David Anderson bf3020b749 libsnapshot: Fix CowWriter::Finalize() not restoring footer correctly.
Bug: 173432386
Test: cow_api_test
Change-Id: If1b856fcdcd6b6ded5e00342037308c6b35d6fc0
2021-03-11 16:16:36 -08:00
Kris Alder d5bd5437b0 Merge "enable fuzzing trusty targets automatically" 2021-03-11 17:54:04 +00:00
Suren Baghdasaryan d9f1884aeb Merge "libprocessgroup: introduce optional attribute for cgroup controllers" 2021-03-11 17:42:37 +00:00
Suren Baghdasaryan 7f19b1e6de libprocessgroup: introduce optional attribute for cgroup controllers
Memory cgroup controller is not used by high-end Android devices and is
disabled in Android kernels 5.10+, however Android Go devices still
require this controller.
Similarly schedtune controller is being replaced with cpu controller's
utilclamp feature, however some devices are using older kernels which
only support schedtune.
To prevent spamming logcat with errors we need a way to mark a
controller optional in such cases without removing it from
cgroups.json file.
Introduce "Optional" attribute to cgroup controller's cgroups.json
description to accomodate these cases. When an optional controller
fails to mount due to lack of support in the kernel it will log an
informational message without generating further errors.

Bug: 181866655
Test: boot and observe libprocessgroup messages in logcat
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ib5bcfdd8d338704f3f9d8b326d8ddd88b67915a1
2021-03-11 17:42:30 +00:00
Alistair Delva c19a7dd30e Merge changes from topic "bootconfig-selinux-property"
* changes:
  Allow selinux to be set by bootconfig
  Allow android_dt_dir to be set by bootconfig
2021-03-11 15:52:02 +00:00
Kris Alder 5e8ee3102e enable fuzzing trusty targets automatically
The non-test fuzz targets should run automatically in Haiku.

None of these should be built for Host, and all but the
trusty_test_fuzzer should be built for Target.

Test: built locally (make haiku) and checked that non-test trusty fuzz
targets are included as expected.

Change-Id: Ic67b1e1ddea8ed61b83deef66acdeb0891489195
2021-03-11 15:07:01 +00:00
Martijn Coenen 43defd972f Merge "Add some keystore boot levels." 2021-03-11 09:25:40 +00:00
Suren Baghdasaryan 72ad5d2958 Merge "libprocessgroup: remove a false error message" 2021-03-11 03:04:41 +00:00
Suren Baghdasaryan f46a2297d0 libprocessgroup: remove a false error message
Remove an error message generated when changing permissions succeed.

Bug: 181866655
Test: boot and observe libprocessgroup messages in logcat
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If95fcbd5171b73191504beffdc504c44eef3b4c1
2021-03-11 03:01:46 +00:00
Peter Collingbourne 90947d442c Merge "Teach debuggerd to pass the secondary ring buffer to __scudo_get_error_info()." 2021-03-11 01:15:49 +00:00
Akilesh Kailash bd83b72bc8 Merge "libsnapshot:snapuserd: Multithreading support" 2021-03-11 00:51:20 +00:00
Devin Moore 394a1ede40 Merge "Handle "hardware" bootconfig parameter as "androidboot.hardware"" 2021-03-10 22:42:12 +00:00
Akilesh Kailash 8f0840940e libsnapshot:snapuserd: Multithreading support
Add worker threads per partition to serve the IO request.

Remove memset of buffer in IO path which was impacting
4k IO performance.

update_verifier performance:

1: ~10-12 seconds with this change (both on full OTA and incremental
OTA); ~70 seconds observed without this changeset

2: ~8 seconds without the daemon once merge is completed
and snapshot devices are removed.

Bug: 181293939
Test: update_verifier, full OTA, incremental OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Id90887f3f4a664ee5d39433715d1c166acbd6c60
2021-03-10 07:53:16 +00:00
Devin Moore 0a799bdfd6 Handle "hardware" bootconfig parameter as "androidboot.hardware"
The parameter "androidboot.hardware" has been removed from bootconfig
and replaced by "hardware" parameter.

Test: launch_cvd with 4.19 and 5.10 kernels
Test: atest CtsFsMgrTestCases
Bug: 173815685
Change-Id: I627426ae1bd0a165b70b8f2584ec184abfb4236f
2021-03-09 14:10:48 -08:00
Devin Moore 6c01baf075 init: check for verifiedbootstate in properties
This check in export_oem_lock_status happens after PropertyInit() so
all of the ro.boot.* properties will be set. There is no need to import
the kernel cmdline again.

Test: build and boot cuttlefish
Bug: 173815685
Change-Id: I5df7c0105566d4617442dbb8e77eb26e465775f1
2021-03-09 13:56:25 -08:00
Alistair Delva 63594a4dbc Allow selinux to be set by bootconfig
The androidboot.selinux property is loaded in a special way, because it
happens in the "selinux_setup" stage, and not the true second stage.
Allow it to be passed through bootconfig instead of only via the kernel
cmdline.

Bug: 173815685
Test: launch_cvd -extra_kernel_cmdline androidboot.selinux=permissive
Test: launch_cvd -guest_enforce_security=false [bootconfig method]
[..]
init: Permissive SELinux boot, forcing sys.init.perf_lsm_hooks to 1.
[..]
Change-Id: I92003c7a2dac5d6e7d0e0f4ee2757f86cc0087c7
2021-03-09 19:18:50 +00:00
Alistair Delva 3bb240bd4c Allow android_dt_dir to be set by bootconfig
The androidboot.android_dt_dir property is special, because it is loaded
to find out where to get the other DT properties from, and those DT
properties are supposed to override the cmdline/bootconfig ones. So, it
need special casing, and that special case lacked bootconfig support.

Bug: 173815685
Test: launch_cvd -extra_kernel_cmdline androidboot.android_dt_dir=/tmp
[..]
init: Using Android DT directory /tmp
[..]
Change-Id: Ie0958dd0a96394d65f6568653b754ea6f885212e
2021-03-09 19:14:17 +00:00
David Anderson 9865e47e1e Merge "libsnapshot: Collect more COW size data in snapshot merge stats." 2021-03-09 18:48:58 +00:00
Martijn Coenen e94b36637d Add some keystore boot levels.
The first user of keystore boot levels is on-device signing; transition
the boot level to 30 before running the post-fs data hook, and
transition it to 40 right after on-device signing is done. This leaves
some space for future boot levels to be inserted, if we wanted.

Bug: 165630556
Test: inspect logs
Change-Id: If0a74cbe9ea8fce806020d8a42a978cfb9117ded
2021-03-09 09:59:57 +00:00
Neil Fuller f0e39a9dfe Merge "Really fix Mac build." 2021-03-09 09:50:07 +00:00
David Anderson bc3dec4e8c Merge "liblp: Remove uses of alignment_offset." 2021-03-08 22:24:47 +00:00
David Anderson c90fce4387 Merge "init: only mlock() system pages when performing snapuserd transitions." 2021-03-08 19:32:34 +00:00
Elliott Hughes 39d6c8eef8 Really fix Mac build.
This reverts commit 66bfb9adac, and
instead includes a header that has a definition of TEMP_FAILURE_RETRY
for macOS.

Bug: http://b/181852591
Test: N/A
Change-Id: I63ccdcb58a2b2806217e3faedde9ba33936c8189
2021-03-08 10:59:36 -08:00
Devin Moore 7c98b89886 Merge changes from topic "bootconfig_args"
* changes:
  fs_mgr: handle more bootconfig parameters
  init: handle more bootconfig parameters
2021-03-08 18:27:50 +00:00
Kiyoung Kim fcb28f5d30 Merge "Check if service is executed before APEX is ready" 2021-03-07 23:56:06 +00:00
Alistair Delva 478d0698bb Merge "Fix Mac build." 2021-03-06 23:04:18 +00:00
Treehugger Robot fce8e0f4a4 Merge "fastbootd: Fix USB transport data is repeated every 256K" 2021-03-06 05:50:50 +00:00
Yifan Hong 5f23388c7a fastbootd: Fix USB transport data is repeated every 256K
When Write() is called on data > 256K, the written data
repeats every 256K because of the buggy line in this change.

Test: fastboot fetch vendor_boot.img
Fixes: 180654366

Change-Id: I33b129de27000d3f32f284469998daf540d4f856
2021-03-05 19:45:00 -08:00
Treehugger Robot 3f24fefe29 Merge "Untag addresses in registers before looking up the mapping." 2021-03-06 02:41:05 +00:00
Elliott Hughes 66bfb9adac Fix Mac build.
The Mac doesn't need fs_config (there's a `darwin: { enabled: false } }`
at the only caller), so stop trying to build it here rather than fix it
so it builds again.

Test: treehugger
Change-Id: I88d6b3a44b1ab823a419789d8545fcf10061079c
2021-03-05 17:58:28 -08:00
Yifan Hong 294a13ae0d Merge "bootstat: clarify unit." 2021-03-06 01:20:15 +00:00
David Anderson 9fd8862741 init: only mlock() system pages when performing snapuserd transitions.
Bug: 181032115
Test: manual test w/ VABC OTA
Change-Id: Ib4d2856b9b5eaf8688534f9d84edeb64d4b3244d
2021-03-05 15:44:25 -08:00
Treehugger Robot 0b589672e9 Merge "Ban exit-time destructors in libcutils." 2021-03-05 21:54:52 +00:00
Treehugger Robot 1c9f84edeb Merge "Disallow exit-time destructors in libutils." 2021-03-05 21:43:53 +00:00
Devin Moore 20b74257a6 fs_mgr: handle more bootconfig parameters
As parameters are moved from kernel cmdline to bootconfig,
fs_mgr needs to be updated to handle the new location.
/proc/bootconfig should be checked first, if not present, then check
/proc/cmdline.

Test: atest CtsFsMgrTestCases
Test: launch_cvd
Test: launch_cvd with 4.19 kernel artifacts that do not support
bootconfig
Test: Both of the above configurations with --num_instances 0 or 4
Test: Both configurations with androidboot.boot_devices or
androidboot.boot_device set
Bug: 173815685

Change-Id: I23fb07a17c25c9459833cb931ced79d5ccc3e42a
2021-03-05 09:21:19 -08:00