Commit graph

75928 commits

Author SHA1 Message Date
Thiébaud Weksteen
3c1f230971 Remove e2fsdroid and sload_f2fs dep from fastboot
In commit 5d72d6c, an unused code path for e2fsdroid and sload_f2fs was
removed from fastboot. Remove them from the build dependency list.

Bug: 237960487
Test: m fastboot
Change-Id: Ibee72a86eeb43fcde3a032094bfc1c19de09bc03
2022-08-11 15:36:17 +10:00
Thiébaud Weksteen
6eb4d64eae Merge "Remove unused execution paths when formatting" 2022-07-24 23:59:18 +00:00
Treehugger Robot
e7bc3e3764 Merge "libfiemap: Add a test case for larger block size filesystems." 2022-07-23 03:18:58 +00:00
David Anderson
d76c31ba40 libfiemap: Add a test case for larger block size filesystems.
This adds a test case for filesystems with larger than 4KiB alignment.
It creates a temporary FAT filesystem and attempts to create a backing
image. The actual size of the block device should be the requested size.

Test: fiemap_image_test
Bug: N/A
Change-Id: I8ef574b22dbf6d47f4855b7de681c927cf81f2b7
2022-07-22 17:44:12 -07:00
Deyao Ren
ec73481e58 Merge "Add apex name to service" 2022-07-22 23:03:45 +00:00
Jooyung Han
ba1fbaf50c Merge "Respect namespace mnt" 2022-07-22 22:41:14 +00:00
Jooyung Han
5eb441caca Respect namespace mnt
This fixes the regression of aosp/2153354.
SwitchToMountNamespaceIfNeeded() is supposed to switch between "default"
mount namespace and "bootstrap" mount namespace. But it shouldn't affect
services with its own mount namespace.

Bug: 239882455
Test: make a hal service start in a separate mount namespace
    using 'namespace mnt' in its definition.
    see the mount namespace of the service process
    $ cat /proc/$(pgrep -f myservice)/ns/mnt
Change-Id: I8c80eaec723241c405f48980b9e88640123c43ad
2022-07-23 01:41:18 +09:00
Deyao Ren
df40ed1be1 Add apex name to service
Passed apex file name to service. The file name will be parsed
to determine 1) whether the service is from an apex; 2) apex name

Bug: 236090201

Change-Id: I2c292c0c067f4bf44bb25b1f80e4f972b94f7258
2022-07-22 04:00:30 +00:00
Tri Vo
6a058f492c Merge "storageproxyd: Remove setuid, setgid, and capset" 2022-07-21 23:59:45 +00:00
Thiébaud Weksteen
5d72d6ce20 Remove unused execution paths when formatting
fastboot uses the internal functions generate_ext4_image and
generate_f2fs_image when called via the `format` subcommand. An option
for populating the newly created fs with an initial directory exists,
but it is not exposed to the command line interface (initial_dir is
always ""). Remove the unused codepaths for this preloading.

Test: atest --host fastboot_test
Bug: 237960487
Change-Id: I7acfe6352cf26b5cbe0e5553b288c3798e96a893
2022-07-21 14:50:05 +10:00
Yi-yo Chiang
44f1f094b3 Merge "fs_mgr_overlayfs: Try "/system" and "/" when setting "/system" shared type" 2022-07-21 03:52:52 +00:00
Yi-Yo Chiang
379be50f9c fs_mgr_overlayfs: Try "/system" and "/" when setting "/system" shared type
b/239574953 uncovers an obscure test device configuration that breaks
with aosp/2146960.

Without aosp/2146960, "/system" is not a mountpoint, because after
switch_root, the "/system" mount entry becomes "/", thus changing the
subtree propagation type of "/system" would fail.
With aosp/2146960, "/system" is bind-mounted to itself after
switch_root, ensuring "/system" being a mountpoint, thus changing the
subtree propagation type of "/system" is allowed.

Before we can re-land aosp/2146960, just try both "/system" and "/"
when changing the subtree shared propagation type of "/system", so
both scenarios are handled.

Test: Add submount under /system and adb remount
Change-Id: I4006a5c1b1987d5f6452efa069ec5c7d2ac7c8ec
2022-07-21 03:52:26 +00:00
David Anderson
c20b6b58fc Merge "remount: Ensure that scratch images are block-size aligned." 2022-07-21 01:56:09 +00:00
David Anderson
2d8bc21823 remount: Ensure that scratch images are block-size aligned.
Bug: 218976943
Test: adb remount
Change-Id: I46a4592c4ba504865a633437d734ce26e5fba6a5
2022-07-20 16:20:03 +00:00
Yi-yo Chiang
e321b113d6 Merge "Revert "first_stage_mount: Bind mount /system after switch root"" 2022-07-20 03:49:59 +00:00
Treehugger Robot
c89e97f627 Merge "vts_fs_test: checks AVB 1.0 isn't used" 2022-07-20 03:29:26 +00:00
David Anderson
f4753d1cc5 Merge "Fix for Cannot load etc/recovery.fstab when doing OTA upgrade" 2022-07-19 21:11:55 +00:00
Zhuoyao Zhang
54ec48fad7 Revert "first_stage_mount: Bind mount /system after switch root"
This reverts commit d7e6353a69.

Reason for revert: b/239574953 breaking emulator based test on g3

Change-Id: Ib7d17fe8383937c7764f6612cf89db4fb7e5a4d3
2022-07-19 18:09:42 +00:00
Jiyong Park
f3e6cf0a76 Merge "Replace #apex with #systemapi" 2022-07-19 15:35:13 +00:00
Bowgo Tsai
80cb505f64 vts_fs_test: checks AVB 1.0 isn't used
AVB 1.0 support in fs_mgr has been removed in commit
Ibfb46aa6c2f761dbb3a9b5f0b16336e510417620.

Adding a VTS test case to ensure the legacy 'verify' fs_mgr
flag isn't used anymore.

Also converting GetFstabPath() to a public API in the fstab.h,
so the test case can read then parse the fstab file.

Bug: 204948957
Test: atest vts_fs_test
Change-Id: Ib6ed7cb8b6ad719b19cd876acf10f4312ecb51b6
2022-07-19 16:27:59 +08:00
Jiyong Park
ccb1ce32cc Merge "Enhance documentation about SetMmapRndBitsAction" 2022-07-19 04:41:32 +00:00
Jiyong Park
2d79c6c096 Merge "init: don't touch mmap_rnd_compat_bits on 64-bit only builds" 2022-07-19 04:40:39 +00:00
Jiyong Park
5b16ccb36e Enhance documentation about SetMmapRndBitsAction
Bug: N/A
Test: N/A
Change-Id: I0408158d181ef08831a55e1381477f5b128a5c52
2022-07-19 10:47:47 +09:00
Jooyung Han
11e757c9cc Merge "Update linker configuration when loading apex" 2022-07-18 23:39:56 +00:00
Yi-yo Chiang
53f1fab6ac Merge "first_stage_mount: Bind mount /system after switch root" 2022-07-18 09:47:56 +00:00
Jooyung Han
626be07153 Update linker configuration when loading apex
On ctl.apex_load <apex_name> control message, init invokes linkerconfig
to update linker configuration for the updated apex.

Bug: 232173613
Test: CtsInitTestCases
Test: VendorApexHostTestCases
Change-Id: I01d975849c3f4efe74205a7b04ebbd6864ba1121
2022-07-18 17:45:15 +09:00
Treehugger Robot
4bc5277152 Merge "first_stage_mount: Fix log typo "check_at_most_once"" 2022-07-18 05:58:42 +00:00
Jiyong Park
11d7bc52df init: don't touch mmap_rnd_compat_bits on 64-bit only builds
mmap_rnd_compat_bits is for address space randomization of 32-bit
applications on 64-bit system. Configuring it is not only unnecessary
for 64-bit "only" builds, but also can cause a boot failure if the
kernel is built without CONFIG_COMPAT which is the case for Microdroid.

Use ro.product.abilist32 to determine whether 32-bit applications are
supported and if not, don't configure it, but mmap_rnd_bits.

Bug: 237950549
Test: run Microdroid with the kernel built with aosp/2153639

Change-Id: Ifca6fa02f14ad4c7d8f9b2ab8852494c12945c3a
2022-07-18 14:31:13 +09:00
Yi-Yo Chiang
a3832d496b first_stage_mount: Fix log typo "check_at_most_once"
Was "check_most_at_once", should be "check_at_most_once".
Also straighten the if-then-else logic from:
  if (cond) {
    // then
  } else {
    // error...
    return;
  }
to:
  if (!cond) {
    // error...
    return;
  }
  // fallthrough is "then"

Test: Presubmit
Change-Id: I85c1e94c47a727089374d5d05ecd40f4187b66a1
2022-07-18 04:38:02 +00:00
Jiyong Park
d97e52d888 Replace #apex with #systemapi
Currently, for an API symbol to be accessible to APEXes, it needs to be
marked as either # systemapi or # apex. It was originally just # apex,
but we added # systemapi to clearly identify the origin of the APIs.

The intended use is

* #apex is for APEX-visible symbols that are defined in an APEX
* #systemapi is for APEX-visible symbols that are defined in the
  platform (the non-updatable part)

This intention is documented build/soong/docs/map_files.md, but isn't
enforced at all.

With b/239274367, this is now enforced and therefore the #apex tags in
the platform library are replaced with `#systemapi`

This change does not alter any functionality.

Bug: 239274367
Test: m
Change-Id: Ibdb9122c9969749e055404078bc2280edaa7346d
2022-07-17 17:43:24 +09:00
Jooyung Han
46fa45d82c Merge "Return Result<T> from Do(Un)LoadApex()" 2022-07-16 02:49:06 +00:00
Jooyung Han
a2fe3e577e Return Result<T> from Do(Un)LoadApex()
For consistent error message. This is a preparation step for the
follow-up change: to generate linker configuration in DoLoadApex()

Bug: 232173613
Test: CtsInitTestCases
Change-Id: I27954ae2429e82da1bde1925ef62b277c24129d3
2022-07-16 08:37:06 +09:00
Tri Vo
846da873b4 storageproxyd: Remove setuid, setgid, and capset
These operations require excessive SELinux and UNIX permissions.

Instead of dropping privileges after starting we will start
storageproxyd as "system" user.

Bug: 205904330
Test: com.android.storage-unittest.td
Change-Id: I0b2503a746c52474c8cc2e1f7a2fbe17c98d6d8b
2022-07-15 10:34:05 -07:00
daren.liao
cadee353fa Fix for Cannot load etc/recovery.fstab when doing OTA upgrade
1.In ANP, the path of the executable file recovery is sbin/recovery, and in ANR it is system/bin/recovery
2.Add a judgment on whether sbin/recovery exists in fs_mgr_fstab.cpp,
Make it possible to correctly load etc/recovery.fstab in recovery mode

Bug: 237368169
Change-Id: I8df76a003bc2edbaa01d9dd173a0cba1401ef3ac
2022-07-15 17:58:09 +08:00
Christopher Ferris
86cc51ae60 Merge "Revert "Add support for only starting 64 bit zygote."" 2022-07-15 00:24:10 +00:00
Jooyung Han
e89c457157 Merge "init starts servicemanagers in "default" mount ns" 2022-07-15 00:12:55 +00:00
Treehugger Robot
45545c68d1 Merge "boot_reason: Add reasons for boot_reason_test.sh" 2022-07-14 22:45:18 +00:00
Christopher Ferris
3fa3f861d4 Revert "Add support for only starting 64 bit zygote."
This reverts commit da94c7f650.

Reason for revert: It appears this change slows down boot on normal devices.

Technically, this change is not necessary, but it prevents starting the secondary and having it throw an error in the only run 64 bit zygote config. But it's easier to throw the error than slow down boot up.

Bug: 238971179

Test: Verified that on a 64 with 32 config, the secondary zygote
Test: starts but exits.
Change-Id: I7ab0496a402db83e70168d52e5d5911b82a3b06a
2022-07-14 22:13:29 +00:00
David Anderson
0f7b66b604 Merge changes I29453595,I6586c8e5
* changes:
  vts_fs_test: Only require EROFS in T+ kernels.
  Revert "Do not enforce EROFS for android-T and below."
2022-07-14 17:33:08 +00:00
Treehugger Robot
2b0c119bff Merge "bootstat: add more bootreasons" 2022-07-14 17:27:29 +00:00
Jooyung Han
c5fa15e08c init starts servicemanagers in "default" mount ns
servicemanager/hwservicemanager are pre-apexd services but still wants
to see VINTF fragments from APEXes, especially from /data.

Like ueventd, these services need to be started in "default" mount
namespace.

Bug: 237672865
Test: m && boot
Change-Id: I0266c5be5530a1a07f8ffa23a26186d45a55613f
2022-07-14 18:31:21 +09:00
David Anderson
c2f95c4b79 vts_fs_test: Only require EROFS in T+ kernels.
Bug: 237765186
Test: vts_fs_test
Change-Id: I294535953bfbe0f246347487b746d3adf2fca1aa
2022-07-13 16:45:11 -07:00
David Anderson
ffda48e959 Revert "Do not enforce EROFS for android-T and below."
This reverts commit a571d4a9bc.

Reason for revert: Incorrect fix

Change-Id: I6586c8e53cc89418d1802807a1a2e108f7e825d3
2022-07-13 16:36:43 -07:00
Elliott Hughes
1012626192 Merge "Add support for only starting 64 bit zygote." 2022-07-13 19:57:47 +00:00
Jone Chou
11160ed297 bootstat: add more bootreasons
add more bootreasons for new platform

Bug: 236191641
Test: trigger apc watchdog then "adb root; adb shell bootstat -p"
Change-Id: I8bbbe57e6c70959a4ec848b59065d0ee9fca50db
2022-07-13 17:13:16 +00:00
Treehugger Robot
e271146ec8 Merge "Add ctl.apex_(un)load properties to (un)load apex" 2022-07-13 04:04:20 +00:00
Treehugger Robot
b718a4372b Merge "Replace deprecated atoms.proto file path" 2022-07-13 02:06:14 +00:00
Treehugger Robot
4cc0cb2b62 Merge "Make 'mkbootfs' print a usage message for insufficent args." 2022-07-13 00:49:33 +00:00
jiajia tang
52f9adf176 boot_reason: Add reasons for boot_reason_test.sh
Add "power_on_key" and "power_on_cable" to match
heuristics in system/core/bootstat/bootstat.cpp

Change-Id: I947026d658c8a385aab7a3ade9efacffb9538d56
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
2022-07-13 00:36:15 +00:00
Mateus Azis
023f67b95e Make 'mkbootfs' print a usage message for insufficent args.
Right now, it just prints "no directories to process". There is also no
indication anywhere about the availability of the -f and -d flags.

Also took the opportunity to perform small quality-of-life improvements,
like updating error messages, hiding internal functions.

Test: (cd system/core/mkbootfs && mma) && ./out/host/linux-x86/bin/mkbootfs
Change-Id: Ia81eff0308e6e2686dde979d47c0bf938afbaf82
2022-07-12 16:00:07 -07:00