Commit graph

68774 commits

Author SHA1 Message Date
yuehu mi
ddffa0ea74 ueventd: the parallel restorecon dirs is configurable [1/1]
PD#SWPL-45884
BUG:187441275

Problem:
ueventd: coldboot took too much time

Solution:
1.The parallel restorecon dirs can be configured in ueventd.rc
2.Add 'parallel_restorecon_dir' keywords
parallel_restorecon_dir <directory>

Verify:
redi

Change-Id: Id5b13f18d36afb894891697f21ac63e78b3fe130
Signed-off-by: yuehu mi <yuehu.mi@amlogic.com>
2021-06-02 20:02:59 +08:00
Treehugger Robot
0f62609aa7 Merge "fs_mgr_fstab: Parse overlayfs options from fs flags" 2021-06-02 07:20:46 +00:00
Yo Chiang
4b18faf982 Merge "Remove deprecated fs_mgr_overlayfs_required_devices()" 2021-06-02 07:17:00 +00:00
David Anderson
b4cd291317 Merge "Update documentation for SnapshotMergeReport." 2021-06-01 22:14:55 +00:00
Treehugger Robot
de5ac631bd Merge "adb-remount-test: Make awk scripts mawk-v1.3.3-compatible" 2021-06-01 20:31:44 +00:00
Yi-Yo Chiang
ad3a57bdba adb-remount-test: Make awk scripts mawk-v1.3.3-compatible
Our CI is failing because the host machine is using mawk instead of gawk.
mawk v1.3.3 cannot parse regex such as '/[/]/', while mawk v1.3.4 and
gawk can.
Change regex of '[/]' to '\/' so that our test script is as backward
compatible as possible.

Bug: 188862155
Test: Run adb-remount-test.sh on CI
Change-Id: Ia4fbce58a61325a5e5280ede0d5b7760832d8ec1
2021-05-31 17:52:07 +08:00
Andrew Walbran
89ddf50566 Merge "Create data directory for VirtualizationService." 2021-05-28 12:06:58 +00:00
Yi-Yo Chiang
a07ed968b5 Remove deprecated fs_mgr_overlayfs_required_devices()
It is unused since Ifc8720378259654472d3822e97059b6c366f601d

Bug: 188862155
Test: Build pass
Change-Id: I6304e0dedb36d03a87c556083e937b4a2ce30b1b
2021-05-28 08:30:55 +00:00
Arve Hjønnevåg
7c8ec7b33b Merge "trusty: apploader: Handle invalid version error" 2021-05-27 18:45:16 +00:00
Michael Butler
2e3dabc629 Merge "Revert "Add libneuralnetworks_shim.so to requireLibs."" 2021-05-27 18:05:25 +00:00
Andrew Walbran
2934ee0bcd Create data directory for VirtualizationService.
Bug: 184131523
Test: Built, flashed, ran microdroid VM via virtmanager
Change-Id: I1e6a5f7a304a02de1efb29e253d8bbd54f3f704d
2021-05-27 13:07:50 +00:00
Yo Chiang
869ab86944 Merge "Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds" 2021-05-27 08:54:20 +00:00
Yi-Yo Chiang
7b81023e2a fs_mgr_fstab: Parse overlayfs options from fs flags
Parse the "lowerdir=" option from fs mount flags instead of fs_mgr flags
for consistency.

Before:

  none /mnt/product/test1 overlay ro lowerdir=/1:/2,first_stage_mount

After:

  none /mnt/product/test1 overlay ro,lowerdir=/1:/2 first_stage_mount

Bug: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I6d6abd44ab32afadec428005f4aece834f9c8905
2021-05-27 16:37:53 +08:00
Andrew Walbran
f9bafc53b9 Merge "Rename VirtManager to VirtualizationService." 2021-05-26 21:43:54 +00:00
Nikita Ioffe
45acb369ee Merge "libdm: Add DeleteDeviceDeferred API" 2021-05-26 20:20:22 +00:00
Nikita Ioffe
d13cef7435 libdm: Add DeleteDeviceDeferred API
This can be useful in case when a device mapper device can't be deleted
straight away, and instead delete needs to be enqueued until last
reference to the device is closed.

Bug: 187864524
Bug: 188713178
Test: atest libdm_test
Change-Id: Ie8a130baa54e6e16d8d159389bd760bf873eca40
2021-05-26 19:29:07 +01:00
David Anderson
7e2d32bc06 Merge "KillZramBackingDevice: Return immediately if backing_dev is none." 2021-05-26 03:29:05 +00:00
Akilesh Kailash
18a307beb4 Merge "snapuserd: Add test case" 2021-05-26 02:29:53 +00:00
Kelvin Zhang
22d2c263a8 Merge "Add helptext for snapshotctl map" 2021-05-25 21:00:44 +00:00
Kelvin Zhang
c1e78883eb Add helptext for snapshotctl map
Test: no need
Change-Id: I709d02ccd478d6bed34808dc20cbba9ed89097c1
2021-05-25 14:43:52 -04:00
Yi-Yo Chiang
23816e84ca Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds
Rename fs_mgr_overlayfs_mount_fstab_entry() to
fs_mgr_mount_overlayfs_fstab_entry() and move it out of
fs_mgr_overlayfs.cpp to make it available for user builds.

Add checks to unsure overlayfs mount point doesn't contain symbolic
link or /../.

Check the mount point with an allowlist if user build. The mount point
should either be /vendor, /product ... or their submounts, or strict
submounts of /mnt/vendor and /mnt/product.

Bug: 188862155
Test: Boot test with overlayfs mount entries on user build
Change-Id: I3b60dfa4b63cf2ae0754f53d1d08365aa7be1ee0
2021-05-25 22:10:30 +08:00
Yo Chiang
f7584a223c Merge changes I5058cbe8,Ia0b3f1c9
* changes:
  adb-remount-test: Strengthen skip_administrative_mounts
  fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
2021-05-25 05:01:17 +00:00
Andrew Walbran
3aedc7edc8 Rename VirtManager to VirtualizationService.
Bug: 188042280
Test: atest VirtualizationTestCases
Change-Id: I0e549ef02c7327f57c3d04853b3eefed7403d8e8
2021-05-24 11:41:13 +00:00
Yi-Yo Chiang
f931ad9446 adb-remount-test: Strengthen skip_administrative_mounts
Refactor skip_administrative_mounts so that it filters by device name,
mount point and filesystem type. (Was filtering by device name and mount
point.)

We need this because pseudo filesystems such as tmpfs and overlayfs can
have free-formed device name:

  blah /mnt/mnt_point overlay ro,lowerdir=...

However the filesystem type (third field of /proc/mounts) must be
reflecting the actual filesystem, so to robustly filter out
administrative filesystems, we have to check the filesystem type field.

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: I5058cbe8a36920f25b73a5d5833e9fc5a096e90f
2021-05-23 16:42:11 +08:00
Akilesh Kailash
b3b264c15f snapuserd: Add test case
Add unit test to test reading dm-user block device
without user-space daemon. IO's should fail
with IO error.

Bug: 188362117
Test: cow_snapuserd_test
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ida4efb4373904f6bb92f9904af9fe8443724bd2c
2021-05-22 17:57:48 +00:00
Yi-Yo Chiang
7b90e6936c fs_mgr_overlayfs_mount_fstab_entry(): Rename source device name
adb-remount-test.sh would fail if a overlayfs named "overlay" is mounted
in first_stage_init via fs_mgr_overlayfs_mount_fstab_entry():

  [  FAILED  ] overlay takeover unexpected at this phase

Prepend the source device name with "overlay-", so that the overlayfs
mounted by fs_mgr_overlayfs_mount_fstab_entry() mustn't be named
"overlay".

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: Ia0b3f1c92ed5650c3e584fba23758344a4733657
2021-05-22 22:33:13 +08:00
Treehugger Robot
a14beb2dbc Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" 2021-05-22 03:46:09 +00:00
David Anderson
5267127597 Update documentation for SnapshotMergeReport.
Bug: 188909957
Test: N/A
Change-Id: I84496a3cce44745ff9b6ef91f3af2bb8102bf2a0
2021-05-21 18:58:27 -07:00
Michael Butler
6ecfbf3309 Revert "Add libneuralnetworks_shim.so to requireLibs."
This reverts commit 14f6751df1.

Reason for revert: Removing libneuralnetworks_shim.so from Android S

Change-Id: I23acbdc31ddc488ad59225b483936905fa3652ee
Merged-In: I23acbdc31ddc488ad59225b483936905fa3652ee
2021-05-21 19:57:26 +00:00
Vishnu Nair
0878f71613 Fix implicit cast from ssize_t to size_t in KeyedVector.h
Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Change-Id: I8866aef7f09ca5173604abe18c586b68bbf12ed6
2021-05-21 16:45:46 +00:00
Elliott Hughes
2dc28bcfc4 Merge "Increase coverage of Timers to 100%." 2021-05-20 19:37:59 +00:00
Yo Chiang
71db89b1da Merge "fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()" 2021-05-20 06:40:36 +00:00
Yi-Yo Chiang
dcf1c1f462 fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()
* Add logs.
* Append "override_creds=off" overlayfs mount flag only if
  fs_mgr_overlayfs_valid() returns kOverrideCredsRequired.
  Pre-4.6 kernels or kernels without the override_creds patch don't
  need or don't recognize the override_creds mount flag.
  (Background: I832c8ca3fce0269bdef4ce988541adb7ba9662ed)
* mkdir(mount_point) before mount() to ensure the mount point exists.
  This could happen if the mount point is in a tmpfs, such as /mnt.

Bug: 186342252
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I1a05696346610d7fd61de6d25c379520fd58ca9b
2021-05-20 06:40:27 +00:00
Yo Chiang
b440fc9c06 Merge "first_stage_mount: Remove "overlay" hack from InitRequiredDevices()" 2021-05-20 06:40:07 +00:00
Yi-Yo Chiang
87290f8e9b first_stage_mount: Remove "overlay" hack from InitRequiredDevices()
GetDmVerityDevices() should filter out overlayfs fstab entries in the
first place, so InitRequiredDevices() don't need to filter out overlayfs
pseudo device names.

Bug: 186342252
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I0ac8b7ac0f21daa0c191580d9349adf217854864
2021-05-20 06:39:57 +00:00
Yo Chiang
4087bc555b Merge "fs_mgr_vendor_overlay: Mount vendor overlay with noatime" 2021-05-19 09:57:19 +00:00
Akilesh Kailash
78092feb9b Merge "snapuserd: Send header-response once per entire IO request" 2021-05-19 01:00:23 +00:00
Treehugger Robot
83361ae6fc Merge "tombstoned: fix file creation for ANRs." 2021-05-19 00:33:54 +00:00
Akilesh Kailash
8d442f477e snapuserd: Send header-response once per entire IO request
Header response from daemon is sent once at the
beginning of the payload. This is a corner case
when the IO request can get broken into multiple chunks
if the IO is un-aligned.

Additionally, add error checks in the IO path
to validate sector information when the read
requests are merged.

Bug: 188361387
Test: Simulate an IO request to forcefully break the IO
response into multiple chunks and verify the correctness.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I1f4fa7a79c60493f4bbed3ad49e257098b930beb
2021-05-18 23:36:28 +00:00
Josh Gao
931274862f tombstoned: fix file creation for ANRs.
Bug: http://b/188315622
Test: manual
Change-Id: I2948b929beb3093b59c8d37b706c857e7422a3cc
2021-05-18 16:20:00 -07:00
Treehugger Robot
5123a3eafc Merge "ueventd: Run external handler as non-root group" 2021-05-18 22:01:59 +00:00
Elliott Hughes
4139da606d Increase coverage of Timers to 100%.
Test: treehugger
Change-Id: I3dda9a1a60c88886e5ef42de72bf341ba6cd0361
2021-05-18 13:10:50 -07:00
Yi-Yo Chiang
7cbed5a9ce fs_mgr_vendor_overlay: Mount vendor overlay with noatime
Change relatime to noatime as our filesystems and partitions are all
read-only, so relatime doesn't really work in the first place.

Test: atest -v fs_mgr_vendor_overlay_test
Test: Presubmit
Change-Id: I869bba24c2d6d8a986bf0eec0f487ba7b935ab4b
2021-05-18 17:26:57 +08:00
shisiyuan
423c4f1994 KillZramBackingDevice: Return immediately if backing_dev is none.
It's possible that CONFIG_ZRAM_WRITEBACK is y,
but userspace doesn't set the /sys/block/zram0/backing_dev,
so its value is 'none'.
It's the same with "CONFIG_ZRAM_WRITEBACK is not set".

Change-Id: I2df89ceee68e4685deef5113bada21be96779e9b
Signed-off-by: shisiyuan <shisiyuan@xiaomi.com>
2021-05-18 14:47:47 +08:00
Suchang Woo
10c6374e81 ueventd: Run external handler as non-root group
The external firmware handler always has root group privileges because
it is forked/executed without setgid() by ueventd which has root
privileges. This patch calls setgid() with group ID specified in
ueventd.rc before execv().

Test: atest CtsInitTestCases
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: Id1430e783b0e409d55ac80fe213e81ba099729e2
2021-05-17 10:37:19 +09:00
Treehugger Robot
a6c57d5752 Merge "Allow others to read the profile ref dir" 2021-05-14 22:32:59 +00:00
Treehugger Robot
08a7cf2baa Merge "libprocessgroup: remove failure log for aggregate profiles" 2021-05-14 22:06:37 +00:00
Wei Wang
8722e4d219 libprocessgroup: remove failure log for aggregate profiles
The inner profile should print error message if needed.

Bug: 178070122
Test: Build
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I2d9d54e21fb064678feccdbae453a398806d51d6
2021-05-14 12:44:45 -07:00
Calin Juravle
11197dd8a8 Allow others to read the profile ref dir
ART wants to optimize the time when the profile information
is saved for an app. To do so, it needs access to both, the current
profile, and the reference profile. This will allow ART to access
the ref profiles, which previously was not needed.

Test: m & flash
Bug: 185979271
Change-Id: Ie07bce81d2fba9c0b0ae4f322418e960c024e15d
2021-05-14 18:34:02 +00:00
Peter Collingbourne
93406da189 Merge "Run MTE tests on zero-sized allocations." 2021-05-14 03:58:13 +00:00