Commit graph

75906 commits

Author SHA1 Message Date
Steven Moreland
c340a08b1b libutils: RefBase always disallow on stack
Before, we only did this in sp<> constructors, but we can always make
this check during the initial incStrong.

Since prebuilts call into the existing report race function declared
in StrongPointer.h, we still call this function from RefBase.cpp.

Bug: 232557259
Test: libutils_test
Change-Id: I4080b1869b83ecf655fc9c182b6de768a6358adf
2022-07-26 22:10:51 +00: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
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
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
Treehugger Robot
0c1fdc1a09 Merge "Add zhangkelvin@ as owner of fastboot" 2022-07-12 18:38:20 +00:00
Kelvin Zhang
1fcdce21d6 Add zhangkelvin@ as owner of fastboot
Working on replacing aio w/ liburing in fastboot recently

Change-Id: I8076e2e53dc8d620faf9bff7f37ba2d2538460d6
2022-07-12 11:05:33 -07:00
Akilesh Kailash
58f66339ef Merge "libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow" 2022-07-12 17:53:09 +00:00
Treehugger Robot
c29f0745d5 Merge "Convert fastboot/libsnapshot to new BootControl client" 2022-07-12 17:47:20 +00:00
Sandeep Dhavale
f607e37fd0 Merge "Print OTA merge progress state in logs" 2022-07-12 17:12:23 +00:00
Pete Bentley
00bf9dcb01 Merge "Move boringssl self tests from early-init to init." 2022-07-12 09:50:40 +00:00
Treehugger Robot
eebd7f2b7d Merge "Do not enforce EROFS for android-T and below." 2022-07-12 06:39:59 +00:00
jiajia tang
f083957850 Replace deprecated atoms.proto file path
Path of "frameworks/base/cmds/statsd/src/atoms.proto"
is out of date. Latest path is
"frameworks/proto_logging/stats/atoms.proto".

Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
Change-Id: Ib9471e812466238d79e836b026123f167aaad701
2022-07-12 06:01:44 +00:00
Akilesh Kailash
bfbd9b0e6e libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow
Check if compression feature is enabled.

Bug: 238143011
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I77663799a5371f1de8b4e29d7c777a24249d1b7b
2022-07-12 05:23:48 +00:00
Sandeep Dhavale
5bdb9dbb79 Print OTA merge progress state in logs
Currently OTA merge process prints enum values in logs in numerical
form. This patch changes the log messages from numerical enums to
more friendly names.

Test: Manual OTA

===========Logs==========
CheckTargetMergeState for vendor_dlkm_b returned: Merging
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: Merging
CheckTargetMergeState for vendor_dlkm_b returned: MergeCompleted
ProcessUpdateState handling state: Merging
CheckTargetMergeState for product_b returned: MergeCompleted
ProcessUpdateState handling state: MergeCompleted

Bug: 234518211
Change-Id: If690d3ea86e6fe37e8b3e4bd52e87b70ae92495c
2022-07-12 03:40:11 +00:00
Treehugger Robot
932e069f0f Merge "Don't kill subcontext if it's null" 2022-07-11 06:47:19 +00:00
Inseob Kim
5caaa5575e Don't kill subcontext if it's null
We don't initialize subcontext in microdroid. subcontext->pid() will
crash in such case.

Test: atest MicrodroidTests
Change-Id: Ifca65acededbf7f113d8bf16afbb8e2c1aa91b41
2022-07-11 14:34:15 +09:00
Kelvin Zhang
6befe78c3c Convert fastboot/libsnapshot to new BootControl client
Thew new client will use AIDL if available, and fallback to HIDL
otherwise.

Test: th
Bug: 227536004
Change-Id: I9af21037a76a4a6db00144f5b2774ea23f3a5cc2
2022-07-08 10:57:53 -07:00
P.Adarsh Reddy
a571d4a9bc Do not enforce EROFS for android-T and below.
EROFS is not mandatory for android T and below,
so skip the test for those.

Bug: 237765186
Test: vts_fs_test fs#ErofsSupported
Change-Id: Iceea46f8f2d443636de504962b718a2461605591
2022-07-08 12:14:01 +00:00
Pete Bentley
c017e2ce0a Move boringssl self tests from early-init to init.
In previous releases, these self tests had a secondary purpose
of writing a flag file to save future processes from running
some slow self checks.  This is no longer true in T.

However running the tests from early-init has caused issues
on some devices as the kernel's entropy pool is not yet
initialised, causing the process to block for a second or more.

Bug: 231946889
Test: m && flashall
Change-Id: I2116f2029ca6a21e4359407dfff4dc79edd39084
2022-07-07 15:34:46 +01:00
Jooyung Han
678f0b4828 Add ctl.apex_(un)load properties to (un)load apex
These props are supposed to be used by apexd when installing an apex
without reboot. During the installation, apexd will unmount the current
one and mount the new one. Since the path and its contents will be
replaced, anything loaded from the apex should be unloaded before
unmounting. After apexd mounts the apex again, then init should re-read
.rc files from the apex.

This change only addes required properties:
- ctl.apex_load <apex_name>
- ctl.apex_unload <apex_name>
- init.apex.<apex_name> = loaded | unloaded

Bug: 232114573
Bug: 232173613
Test: atest CtsInitTestCases
Change-Id: I4a8942d67912e2f11acc51bec756c4e3c218179a
2022-07-07 15:58:33 +09:00
Yi-Yo Chiang
d7e6353a69 first_stage_mount: Bind mount /system after switch root
This ensures /system to be a mountpoint, which allows adb-remount to
change the subtree propagation type of /system and MS_MOVE submounts
under /system.

Test: Add submount under /system and adb remount
Change-Id: Ib281be41eaf86bc3e6b7dfac893e5e27b8374da8
2022-07-06 21:51:35 +08:00
Treehugger Robot
ff3fdf36ef Merge "Check userspace snapshots only for API level >= T" 2022-07-06 08:59:12 +00:00
Benergy Meenan Ravuri
7680c29bc9 Check userspace snapshots only for API level >= T
Skip checking for userspace snapshots enabled property
for API level < T as this feature is not applicable for
GRF targets.

Bug: 236450435
Test: vts_ota_config_test
Change-Id: Ib5083f6237cdf4962aae06f166811d67cf6c385e
2022-07-05 16:43:31 +05:30
Yi-yo Chiang
827389c9a4 Merge "fs_mgr_fstab: Refactor & cleanup DSU mounting logic" 2022-07-04 05:32:51 +00:00
Jason Chiu
23ff619088 Merge "bootstat: add more bootreasons" 2022-07-03 14:07:17 +00:00
Jason Chiu
17251023bd bootstat: add more bootreasons
add more bootreasons for new projects

Bug: 219902794
Test: trigger apc watchdog then "adb root; adb shell bootstat -p"
Signed-off-by: Jason Chiu <jasoncschiu@google.com>
Change-Id: I7e19c4d48fb3d5b1c49dc8688936cf1d6eea6e9c
2022-07-03 14:07:09 +00:00