Commit graph

81076 commits

Author SHA1 Message Date
Mike McTernan
3fbe2ca34e Merge "confirmationui:fuzzer: update contact details" 2023-05-16 20:10:47 +00:00
Treehugger Robot
9f6e88567b Merge "Support ZSTD in userspace COW" 2023-05-16 19:02:57 +00:00
Kelvin Zhang
32dcac7851 Support ZSTD in userspace COW
Perf:
Lz4:
Update took 429 seconds
merge time 35.4s
cow size: 3.18GB

ZSTD:
Update took 676 seconds
merge time 49.4s
cow size: 2.62GB

Gz:
Update took 1057 seconds
merge time: 50.0s
cow size: 2.55GB

In summary, ZSTD is a middle point between LZ4 and GZ.

Speed: LZ4 > ZSTD > GZ
Space: LZ4 > ZSTD > GZ

Bug: 274129758

Change-Id: I203bf088b7c2a9ce429f75478799da0e7126febf
2023-05-16 10:13:52 -07:00
Mike McTernan
4066926374 confirmationui:fuzzer: update contact details
Bug: None
Test: make trusty_confirmationui_tipc_fuzzer
Change-Id: Ie81bf916c41498abc226389f63b22b57da55d446
2023-05-16 09:05:29 +01:00
David Anderson
c6ec101713 Merge "bootstat: Adds additional reboot reason patterns" 2023-05-16 03:03:53 +00:00
Chun-Wei Wang
3e0baf8642 Merge "Export active dsu slot to system prop" 2023-05-16 00:40:49 +00:00
JW Wang
a37c4d2796 Export active dsu slot to system prop
The prop can be consumed by init scripts to do customized setup:

on property:ro.gsid.dsu_slot=oemtest
    # Do setup for test
on property:ro.gsid.dsu_slot=oemdemo
    # Do setup for demo

Bug: 277691885
Test: m
Change-Id: I7bd78b9ba31021b27d57c6f092dad5d7ebf6e59b
2023-05-15 09:48:59 +08:00
Treehugger Robot
90bbf8253f Merge "Add support for reading modules.load.charger when booting into charger mode" 2023-05-13 03:09:21 +00:00
Isaac J. Manjarres
6f742376bc Add support for reading modules.load.charger when booting into charger mode
When booting up, Android can boot into one of three modes: normal,
recovery, and charger mode. The set of modules that should be loaded
during first stage init in each mode can differ, which is why init
reads the list of modules to load from modules.load.recovery when
booting into recovery, and modules.load otherwise.

This means that init will read the list of modules to load during first
stage init from modules.load even when booting into charger mode. This
is not ideal, as it causes modules that need to be loaded during
first stage init only when booting into charger mode to also be loaded
during first stage init of normal boot, which can degrade boot time.

Thus, add support for reading modules.load.charger, which contains the
list of modules that need to be loaded during first stage init when
booting into charger mode.

Bug: 266752750
Change-Id: Ib9178bdfe5a6aac57b86b6d453b03625e95d5b48
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
2023-05-12 16:26:35 -07:00
Jiyong Park
a819eb223f Merge "init: automatically add a new loop device when there are no idle loop devices" 2023-05-10 23:22:25 +00:00
David Anderson
25613816d8 Merge "libsnapshot: Fix flaky low-space tests." 2023-05-10 18:29:56 +00:00
David Anderson
d90545bc33 libsnapshot: Fix flaky low-space tests.
These tests have been a plague of flakiness forever, and while we've
made improvements, the test is fundamentally flaky, and keeps showing up
in presubmit.

This change removes the code that attempts to fill /data until it's
almost full, which is unreliable and destructive. Instead, attempt to
allocate a file that is one block smaller than the maximum file size.
This should always fail with ENOSPC, as opposed to the maximum file size
which would fail with EFBIG.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: I4652b83e31c50975ddb50b6cbe846e102ba0f322
2023-05-09 10:12:14 -07:00
tangjie1
2b26bdf973 init: automatically add a new loop device when there are no idle loop devices
Signed-off-by: tangjie1 <tangjie1@xiaomi.com>
Change-Id: I5fe6df9b733c4932334097aff6b7781dcb34027e
2023-05-09 22:15:33 +08:00
Pawan Wagh
82c4ce215b Merge "Added defaults for storaged fuzzers" 2023-05-08 22:53:03 +00:00
Mitchell Wills
dab6a32b2e Merge "Fix the return values of DmTable::valid to match the expected type" 2023-05-08 22:05:34 +00:00
Mitchell Wills
2da7808bad Fix the return values of DmTable::valid to match the expected type
Test: make libdm
Change-Id: Id2be81eafe5168be9bfb37a5bcabfbdba3de8fa7
2023-05-08 13:26:35 -07:00
Pawan Wagh
bef5f65494 Added defaults for storaged fuzzers
- Added cc_defaults
- Disabled leak detection
- Adding triage_assigneer

Test: m storaged_service_fuzzer storaged_private_service_fuzzer
Bug: 280444808
Change-Id: Id885f2f86850a77d2dc6503788e921756393f299
2023-05-05 23:55:27 +00:00
Maciej Żenczykowski
1f7c08e241 Merge "remove inprocess tethering" 2023-05-05 20:31:58 +00:00
Daniel Zheng
f47f3f7584 Merge "Fail on fastboot-info.txt format error" 2023-05-05 19:37:18 +00:00
Daniel Zheng
d441d52540 Fail on fastboot-info.txt format error
If fastboot-info.txt has wrong format we should not fall back on
hardcoded list silently. Instead we should LOG(FATAL) and fail.
Hardcoded list should only be used when fastboot-info.txt is not found
or is empty 

Test:  fastboot flashall 
Bug: 194686221
Change-Id: I1cada102f3ff12c1f3002d0b61d3785fc25543c1
2023-05-05 10:50:17 -07:00
Daniel Zheng
d7150ea505 Merge changes from topic "fastboot_version"
* changes:
  Adding fastboot-info version to host tool
  Updating fastboot-info version check
2023-05-04 17:49:07 +00:00
Dmitrii Merkurev
82899e4190 Merge "remount: Increase scratch size from 50% to 85% of available data" 2023-05-04 04:29:04 +00:00
David Anderson
c274088e5c Merge changes I7ec850b5,I62aa8c7b
* changes:
  libsnapshot: Use pointers instead of references in ICowOpIter.
  libsnapshot: Move BLOCK_SZ to snapuserd.
2023-05-04 02:51:29 +00:00
David Anderson
f16b2f7988 Merge "snapuserd: Remove dead code from legacy snapuserd." 2023-05-03 22:53:17 +00:00
Steven Moreland
b8304d1502 Merge changes I138f3ace,I19f7fc51
* changes:
  init: V devices need to specify user
  init.usb.rc: specify user manually
2023-05-03 17:45:01 +00:00
David Anderson
f9bdc146ff Merge changes Ie8ac02ad,I876f858a,Iccfd6e72
* changes:
  libsnapshot: Improve inspect_cow output.
  libsnapshot: Rename and clarify some methods in ICowOpIter.
  libsnapshot: Remove fallible ICowReader::GetHeader.
2023-05-03 16:52:11 +00:00
Dmitrii Merkurev
9292c09c06 remount: Increase scratch size from 50% to 85% of available data
adb remount clearly indicates that the user will use
a scratch partition to modify RO content. In this CL we're
trying to be more aggressive and take more space from
data to scratch to improve the developers experience.

Bug: 228945443
Test: launch cvd with updated value and check it reflects
Change-Id: Ied9cee6e98d3b2dd594babcf213071a80bd3cf14
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-05-03 05:39:51 +01:00
David Anderson
1318e76655 libsnapshot: Use pointers instead of references in ICowOpIter.
Most callers already converted the reference to a pointer, and pointers
will make it much easier to move around the op list.

Bug: 280529365
Test: builds
Change-Id: I7ec850b58a79c33e57b0e2602e1be953484daa46
2023-05-02 19:45:31 -07:00
David Anderson
4485a6dfa4 libsnapshot: Move BLOCK_SZ to snapuserd.
Block sizes should not be hardcoded, since the value is set in the
cow header. Move this to snapuserd to isolate use.

Bug: 280529365
Test: builds
Change-Id: I62aa8c7b795f9d258d4b6deb0779a536cba65d52
2023-05-02 19:45:25 -07:00
David Anderson
de20e57f08 libsnapshot: Improve inspect_cow output.
Clean up the formatting and unit display, and add a line displaying how
long it took to parse the COW.

Example of new output:

    Version: 2.0
    Header size: 38
    Footer size: 84
    Block size: 4096
    Merge ops: 0
    Readahead buffer: 2097152 bytes
    Footer: ops usage: 1005680 bytes
    Footer: op count: 50284
    Parse time: 6.77921ms
    Data ops: 50015
    Replace ops: 50015
    Zero ops: 0
    Copy ops: 0
    Xor ops: 0

Bug: 280529365
Test: inspect_cow /dev/block/mapper/product_b-cow
Change-Id: Ie8ac02adc004289cc3a08ef44aa3048280a2407f
2023-05-02 19:45:19 -07:00
David Anderson
82356c3f6a libsnapshot: Rename and clarify some methods in ICowOpIter.
Done and RDone are not exactly symmetrical, so rename them to match
their underlying STL behavior. Done becomes "AtEnd" and RDone becomes
"AtBegin".

Bug: 280529365
Test: builds
Change-Id: I876f858a7bef84d8b37c1c822fb42941fbcded25
2023-05-02 19:45:16 -07:00
David Anderson
359350250b libsnapshot: Remove fallible ICowReader::GetHeader.
This function cannot fail, so replace it with an infallible version.
This is also slightly more efficient since there's no copying involved.

Bug: 280529365
Test: builds
Change-Id: Iccfd6e72bc2192f4e1efda50cf544e1e956a9263
2023-05-02 19:45:12 -07:00
Akilesh Kailash
33ff356a3f Merge "libsnapshot: Turn off vabc_legacy_tests on presubmit" 2023-05-03 02:13:37 +00:00
Steven Moreland
e5349196b2 init: V devices need to specify user
This also specifies user on an adbd service
declaration which was missing before. It seems
that certain services are declared mulitple
times.

Fixes: 276813155
Test: boot (on CF, the only V device in the tree)
Test: remove 'user' specification and see error

Change-Id: I138f3ace72d46f221551ad61e75ba4c01632da59
2023-05-03 01:06:38 +00:00
Steven Moreland
7d53332195 init.usb.rc: specify user manually
Merging as a separate CL due to a log showing up
related to this on hwasan (is a prebuilt pulling
this in?)

Bug: 276813155
Test: boot cf
Change-Id: I19f7fc51c937d0eb1ee17781fc5d201a0972c4b0
2023-05-03 01:06:38 +00:00
Akilesh Kailash
defe8381aa libsnapshot: Turn off vabc_legacy_tests on presubmit
Temporarily turn off these tests until root cause is found.

Bug: 279009697
Test: presubmit
Change-Id: I90f695fac318b71871ff60c1f74c90265437687d
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-05-02 20:40:25 +00:00
David Anderson
d71f1c7225 Merge "libsnapshot: Remove the IByteSink API." 2023-05-02 18:05:41 +00:00
David Anderson
467af3d67b libsnapshot: Remove the IByteSink API.
Bug: 278637212
Test: builds
Change-Id: I355aa1e7b1f67352848f2659489a7b831ac89cf8
2023-05-02 08:21:06 -07:00
David Anderson
cd1595509d Merge "snapuserd: Remove IByteSink usage from snapuserd." 2023-05-02 03:01:04 +00:00
Daniel Zheng
451e46f1ae Adding fastboot-info version to host tool
Replacing check with PLATFORM_TOOLS_VERSION with FASTBOOT_INFO_VERSION
to indicate waht version of fastboot_info.txt we currently support. This
makes mor sense since PLATFORM_TOOLS_VERSION won't be updated every time
me make a change to the host tool

Test: fastboot flashall
Bug: 194686221
Change-Id: I621b62c92ba129f402857463dae9112a0797ab07
2023-05-01 14:04:13 -07:00
Daniel Zheng
630f29e0db Updating fastboot-info version check
Updating version to just be a single number.  Reason for updating is
to keep format the same as Flashstation's

Test: fastboot_test
Bug: 194686221
Change-Id: I21ab0747e620d3f6d05c5170c3e55707eed0288a
2023-05-01 14:04:12 -07:00
David Anderson
23ff37a038 Merge changes Ia17bcc86,I1954b38f
* changes:
  snapuserd: Remove IByteSink usage from legacy snapuserd.
  libsnapshot: Disable another legacy merge path in tests.
2023-05-01 19:36:34 +00:00
Treehugger Robot
3729536f8e Merge "libprocessgroup: implement task profile validity checks" 2023-05-01 18:46:39 +00:00
Suren Baghdasaryan
8cacb6105c libprocessgroup: implement task profile validity checks
Provide profile validity check functions for cases when user wants to
check whether a profile can be successfully applied before actually
applying it. Add test cases to cover new APIs.

Also add a wrapper function for framework code to call it.

Bug: 277233783
Test: atest task_profiles_test
Test: manually verify freezer with outdated cgroup configuration
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Li Li <dualli@google.com>
Change-Id: Iefb321dead27adbe67721972f164efea213c06cb
2023-04-29 18:35:20 +00:00
David Anderson
3baad9e820 snapuserd: Remove IByteSink usage from snapuserd.
This added some new failure paths, so the patch also includes an RAII
helper to assist with handling those.

Bug: 278637212
Test: vts_libsnapshot_test
      apply ota on CF
Change-Id: Ide59c83cb34b6d448fe9afdc1d15c6139a0c99fa
2023-04-28 14:53:41 -07:00
David Anderson
78d8d5d9de snapuserd: Remove IByteSink usage from legacy snapuserd.
Bug: 278637212
Test: vabc_legacy_tests
      apply ota on CF w/ userspace snapshots disabled
Change-Id: Ia17bcc862ed9a7d7b78732139f457cac58fa79b9
2023-04-28 14:53:41 -07:00
David Anderson
ed4c853d14 libsnapshot: Disable another legacy merge path in tests.
Bug: 279009697
Test: presubmit
Change-Id: I1954b38f497bb8e4f7aa288e80541ac9ad5c075c
2023-04-28 14:53:41 -07:00
David Anderson
2e998a43e1 Merge "libsnapshot: Replace IByteSink usage in snapshot_reader." 2023-04-28 18:21:13 +00:00
Vincent Donnefort
954cc2ad2c Merge "ramdisk_node_list: Add urandom node" 2023-04-28 16:32:19 +00:00
Vincent Donnefort
b6e3d145aa ramdisk_node_list: Add urandom node
Bionic requires random numbers to init the shadow call stack. Those
numbers are obtained via the syscall getrandom (non-blocking) and will
fallback to /dev/urandom if the former fails.

When loading pKVM modules, we are so early in the boot process that the
only source of entropy for the linux RNG are the architecture random
number generators... which might be available on some platforms. Without
any source of entropy, the only way of generating a random number is to
try to generate some, which is what the bionic fallback expects via
urandom.

As a consequence, add the urandom node to the initramfs.

Bug: 274876849
Change-Id: I164b08f026a238dad9f27a345bdef96717f2aa74
2023-04-28 09:51:05 +01:00