Commit graph

4383 commits

Author SHA1 Message Date
Elliott Hughes
20f66bed7a Merge "There's only one <sys/system_properties.h> now." into main 2024-08-10 17:15:08 +00:00
Treehugger Robot
576b1be2eb Merge changes I2b0fcb8d,I72510d61 into main
* changes:
  init_kill_services_test: += system_suspend
  init_kill_services_test: formatting for merges
2024-08-09 22:23:31 +00:00
Steven Moreland
aed90550d0 init_kill_services_test: smoreland@ owners
I've always maintained this test, would also take
overall init ownership, ;p

Bugs: me
Test: N/A
Change-Id: Id0ea93226b9afd22f8bc192a5a1b61e15d01f3e2
2024-08-09 20:52:43 +00:00
Steven Moreland
164f297007 init_kill_services_test: += system_suspend
Get coverage for this.

Bugs: me
Test: atest init_kill_services_test
Change-Id: I2b0fcb8d273f89de6d0ad115a8de0c0314dbfc3f
2024-08-09 20:50:51 +00:00
Steven Moreland
d945d20408 init_kill_services_test: formatting for merges
Adding formatting here, as we will start a push for people
using this, if they run into any linkToDeath issue, or if
they want to test this.

Bugs: me
Test: N/A
Change-Id: I72510d61926ce694671d897519463f37892a8d12
2024-08-09 20:50:34 +00:00
Elliott Hughes
30203af8fd There's only one <sys/system_properties.h> now.
Change-Id: I4d535484b9e25fda304fb748b7796e513c832265
2024-08-09 15:55:38 +00:00
Jooyung Han
f91503bd18 Clean up userspace-reboot (#2)
Bug: 292469129
Test: CtsInitTestCases
Test: system/core/bootstat/boot_reason_test.sh
Change-Id: I00deb50c5634ade6b69d5b6bf4d08c5101e0beb8
2024-08-09 16:17:20 +09:00
Jooyung Han
e34549af33 Clean up userspace-reboot
The feature was deprecated last year.

Bug: 292469129
Test: atest CtsInitTestCases
Change-Id: I826502770ab3fa566be57a33829f1103efa893fb
2024-08-09 15:58:53 +09:00
Tiffany Yang
ccb950f9ed Merge "init: Wait for /dev/hvc1 during ARCVM first-stage mount" into main 2024-08-05 18:37:56 +00:00
Jiyong Park
b6b55fc945 Merge "Update visibility according to the change AVF directories layout" into main 2024-07-23 07:21:23 +00:00
Treehugger Robot
d909570786 Merge "init: set a new trigger when a vold checkpoint is committed" into main 2024-07-22 09:12:29 +00:00
Jiyong Park
d959fc72c1 Update visibility according to the change AVF directories layout
Bug: 352458998
Test: m nothing
Change-Id: Ibdae7e76a66104cc644b7f82059a2dc5f08659d0
2024-07-22 11:24:03 +09:00
Mike McTernan
b525463558 init: set a new trigger when a vold checkpoint is committed
Add post-fs-data-checkpointed trigger when vold completes checkpointing
after an OTA update.

Bug: 350362101
Test: ABTD
Change-Id: I647a73a942174015b46c5f40bd8f8d3347977ecd
2024-07-19 16:40:23 +00:00
Tiffany Yang
b885e4ad53 init: Wait for /dev/hvc1 during ARCVM first-stage mount
This commit introduces a function to allow ARC-specific logic during
first-stage mount by checking for the existence of an indicator file
at the path "/is_arcvm".

ARC uses the virtio-console device `hvc1` to pass byte data to Android
before second-stage init. Ensure that /dev/hvc1 is initialized before
ARCVM continues booting, but allow other devices to bypass this device
initialization.

Bug: 325538592
Test: boot ARC, ensure /dev/hvc1 can be read during PropertyInit
Change-Id: Ic258b7b004b59da462f4990131a5c11fc94eca62
2024-07-18 23:58:21 +00:00
Tiffany Yang
0fb39f6e69 init: Support for initializing virtio-console devices
This change allows init to ensure that a specified virtio-console
device file (`/dev/hvc*`) is available before `ueventd` coldboot.
Times out if device path is not encountered within 10 seconds.

Bug: 325538592
Test: build bertha_x86_64 and bertha_arm64
Change-Id: Ia1512e69ea607bf4d235595caa53668e2dac500c
2024-07-10 18:59:44 -07:00
Jiyong Park
0bdd68bb06 Use no_full_install: true instead of installable: false
This is a follow-up on I37380c19232f2c497bdf492a83cdc16616f0ae8d.

Bug: 338160898
Bug: 345110999
Test: Microdroid boots even with BOARD_USES_RECOVERY_AS_BOOT
Change-Id: I41c1e40aeaffd5499fb6bd25e80b5be83470bc6b
2024-07-03 18:42:59 +09:00
Akilesh Kailash
9418c6712c Merge "libsnapshot: Check if the vendor is updated from Android S for GRF" into main 2024-06-29 00:11:19 +00:00
Akilesh Kailash
1bbf8f042f libsnapshot: Check if the vendor is updated from Android S for GRF
In a GRF config, if Vendor partition is updated from Android 12; post
OTA reboot, first stage init will communicate to daemon to check if the
daemon can support socket handoff. If that succeeds, then it is a signal
that the vendor has been updated from Android 12. Use a marker in
/metadata to signal that the vendor was updated. If the marker is present,
then post OTA reboot, userspace snapshot will be used.

Bug: 333854394
Test: OTA
Android U (system) + S (vendor) -> Android V (system) + V (Vendor)

Change-Id: Ie38c4379010789a84e5b44529b407f9f82135271
Signed-off-by: Akilesh Kailash <akailash@google.com>
2024-06-28 15:34:41 -07:00
Nelson Li
c2970dd06f Rewrite init_vendor using select syntax
The `select` syntax rewrite makes it more concise and easier to
understand.

Bug: 347605145
Test: m init_vendor
Change-Id: I866bbe9360fdbdf69cac3c6a24bbe37306227755
2024-06-19 02:14:23 +00:00
Nelson Li
064ac0bf15 Convert init_vendor to Android.bp
`init_first_stage` is a dependency of `init_vendor` only when
`BOARD_USES_RECOVERY_AS_BOOT` is false.
Since `BOARD_USES_RECOVERY_AS_BOOT` is already defined in
`build/make/core/android_soong_config_vars.mk` within a
soong_namespace, we can use the `soong_config_module_type` to easily
convert this to Android.bp.

Bug: 347600829
Test: m init_vendor
Change-Id: I1ddcd5fb62983b01e51452c9b7367750e03e7f48
2024-06-17 05:03:56 +00:00
Treehugger Robot
a1188013f3 Merge "make apex init .XXrc parsing honour .35rc even though we're not yet sdk=35" into main 2024-06-14 14:37:05 +00:00
Steven Moreland
e767a71114 Merge "init: enable 'user root' check at build time" into main 2024-06-05 19:23:20 +00:00
Steven Moreland
81a1b3ec23 init: enable 'user root' check at build time
For visibility.

We could make this only for new API levels, but it isn't
currently exposed at build time, and visibility is good
on upgrades.

Bug: 340953047
Test: build, on device passing and failing requirements
Change-Id: I3a0ea47560c65114bc1b8685954d1fb7687cb8df
2024-06-05 00:58:49 +00:00
Elliott Hughes
c088de1879 libc++fs is part of libc++ now.
Change-Id: I2be806de736377e77bb49e4b3b9f72e25f7d717a
2024-06-04 16:47:32 +00:00
Nate Myren
cdd4cb7db8 Merge "Revert^2 "Only write appcompat properties if flag is defined"" into main 2024-05-31 01:31:38 +00:00
Treehugger Robot
0b64326377 Merge "init: 'user root' check use vendor API" into main 2024-05-29 13:27:16 +00:00
Steven Moreland
5088e588f7 init: 'user root' check use vendor API
This changes user root to use the year date format
that vendor API uses.

Previously this still applied to V devices, which switched
to using API level 202404 after 35.

They recommend the year/date form, and there is no
constant for this.

Bug: 340953047
Test: service_test
Change-Id: I5ba8d1251c877a785e41f0cfcc35d7cb0776f8c7
2024-05-29 00:05:26 +00:00
Nate Myren
b9e0545c85 Revert^2 "Only write appcompat properties if flag is defined"
This reverts commit 6d8304aa46.

Reason for revert: resubmission

Change-Id: Ifb66efa2b1b7a734302316259690950306af99ec
2024-05-28 23:40:59 +00:00
Bart Van Assche
262f1e8096 Create the /dev/sys/block/by-name/zoned_device symbolic link
This link will be used to change the sysfs attributes of the zoned block
device from an .rc file.

Bug: 335708738
Change-Id: I99f74c121e7d9da404c0564860c03ac1efe6c6d8
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2024-05-24 09:36:46 -07:00
Bart Van Assche
254436b3ae Make more DeviceHandler member functions private
Make all member functions private that are not called from outside
DeviceHandlermember functions.

Bug: 335708738
Change-Id: Ibe2e5f6b8b45a79b5be59665627e0a46de4e439a
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2024-05-23 12:45:40 -07:00
Bart Van Assche
ba1e0bdd6c Merge "init: Use std::string_view instead of std::string where appropriate" into main 2024-05-22 23:16:30 +00:00
Bart Van Assche
564d970bd0 init: Use std::string_view instead of std::string where appropriate
Slightly reduce the time that is required to start the init process by
changing two static std::string variables into std::string_view variables.

Change-Id: Ib683a603da5f3d8968b26453b12544fed8a6397f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2024-05-22 16:14:23 -07:00
Sami Tolvanen
b87b255540 riscv64: increase ASLR randomness for Sv48/57
Linux 6.9+ supports 33 bits with Sv48 and Sv57. Increase the
maximum and update the comment.

Bug: https://github.com/google/android-riscv64/issues/1
Test: Treehugger
Change-Id: Ia2731143ad30c5febe2058d35a381c01b14d8c3c
2024-05-21 17:33:22 +00:00
Treehugger Robot
edbddd3097 Merge "firmware_handler: Print full FW path before loading" into main 2024-05-21 16:16:02 +00:00
Treehugger Robot
0d8a598b40 Merge "init: delay 'user root' test to W+" into main 2024-05-21 15:43:26 +00:00
Steven Moreland
a8a2c5a7e1 init: delay 'user root' test to W+
We'll make it a build time check in V after this.

Due to being a runtime flog, it was hard to spot and
debug, so delaying.

Bug: 340953047
Test: boot, CtsInitTestCases
Change-Id: Ica1a1c780e230c88615dad7937404d2b0fe9c68f
2024-05-20 22:05:00 +00:00
Maciej Żenczykowski
5e88a32def make apex init .XXrc parsing honour .35rc even though we're not yet sdk=35
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I315cfe77c60988d8cdc8ef64bf8cb2f5c37c93db
2024-05-20 14:25:56 +00:00
Treehugger Robot
be6e1459ee Merge "Add restorecon flags for force and data data" into main 2024-05-16 23:15:55 +00:00
Luzanne Batoon
1ebf9cb663 Add restorecon flags for force and data data
Test: m
Bug: 210155681

Change-Id: I9d5b64c48d21e83fb8f03dac261efc530c5f8aa6
2024-05-16 21:35:54 +00:00
Steven Moreland
bf7e0df4d6 Merge "16k kernel dev option changes ro.build.fingerprint" into main 2024-05-16 00:44:41 +00:00
Steven Moreland
188d59a919 16k kernel dev option changes ro.build.fingerprint
When someone uses the 16kb dev option, they switch
out the kernel, but the same build is used. Make
sure this is visible in the fingerprint to help
split up any analytics or reports.

Bug: 332406754
Test: no change on normal device, on 16k dev option device:

:) adb shell getprop ro.product.build.16k_page.enabled
true
:) adb shell getconf PAGE_SIZE
16384
:) adb shell getprop ro.build.fingerprint
generic/aosp_cf_x86_64_phone_pgagnostic_16kb/vsoc_x86_64_pgagnostic:VanillaIceCream/MAIN.b7aab5e4/eng.smorel.20240514.203625:userdebug/test-keys
                                       ^^^^^^
             ----------------------------/

cheers

Change-Id: I9632237cef4a3b077761022eda8cf42784a41753
2024-05-15 20:18:51 +00:00
Florian Mayer
53748d08e5 Merge "Prevent mte_upgrade_test from hanging if MTE is disabled" into main 2024-05-15 17:48:31 +00:00
Florian Mayer
6726655b5c Merge "Fix mte_upgrade_test" into main 2024-05-15 16:49:25 +00:00
Florian Mayer
1277bd4dfd Prevent mte_upgrade_test from hanging if MTE is disabled
Turns out we didn't need the syscall because the kernel checks
for async MTE fault on exit.

Test: atest mte_upgrade_test with and without MTE
Change-Id: Iebdf181d67b4586926499c7549c72e73efc13c56
2024-05-15 16:04:43 +00:00
Florian Mayer
b3c145e0f7 Fix mte_upgrade_test
init ignored the rc file because of incorrect permissions
also replace deprecated "push" with "push-file"

Test: atest mte_upgrade_test
Bug: 335232356
Change-Id: I4c17311dbb1d001567f4cdda65036f16aec2b5c1
2024-05-14 17:38:51 -07:00
Florian Mayer
0b36b59e45 Create OWNERS for test_upgrade_mte
Change-Id: I0dd6bccf9f6a1767f11fd3e687d819eceaab7b5e
2024-05-14 19:43:07 +00:00
Treehugger Robot
babf597508 Merge "Use no_full_install: true instead of installable: false" into main 2024-05-04 00:04:03 +00:00
Nate Myren
31b1582797 Merge "Revert "Only write appcompat properties if flag is defined"" into main 2024-05-02 19:49:45 +00:00
Nate Myren
6d8304aa46 Revert "Only write appcompat properties if flag is defined"
Revert submission 3049635-cherrypicker-L52500030003287943:N44300030053199935

Reason for revert: b/338244859
Bug: 338244859

Reverted changes: /q/submissionid:3049635-cherrypicker-L52500030003287943:N44300030053199935

Change-Id: I4b99429ce5df0af30e6ad99d3463d4dc2c96c012
2024-05-01 19:21:49 +00:00
Jiyong Park
b33025849d Use no_full_install: true instead of installable: false
So far, we have used `instalable: false` to avoid collision with the
other modules that are installed to the same path. A typical example was
<foo> and <foo>.microdroid. The latter is a modified version of the
former for the inclusion of the microdroid image. They however both have
the same instalation path (ex: system/bin) and stem (ex: foo) so that we
can reference them using the same path regardless of whether we are in
Android or microdroid.

However, the use of `installable: false` for the purpose is actually
incorrect, because `installable: false` also means, obviously, "this
module shouldn't be installed". The only reason this incorrect way has
worked is simply because packaging modules (ex: android_filesystem)
didn't respect the property when gathering the modules.

As packaging modules are now fixed to respect `installable: false`, we
need a correct way of avoiding the collision. `no_full_install: true` is
it.

If a module has this property set to true, it is never installed to the
full instal path like out/target/product/<partition>/... It can be
installed only via packaging modules.

Bug: 338160898
Test: m
Change-Id: I37380c19232f2c497bdf492a83cdc16616f0ae8d
2024-05-01 20:59:19 +09:00