Commit graph

3772 commits

Author SHA1 Message Date
Shikha Malhotra
3779f10fee Merge "Move flattened APEX activation logic to apexd." am: f870b88e1b am: 60658140ec
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1782386

Change-Id: I619814df7b4251c4dea03209f17bee86fd10450d
2021-08-06 08:46:43 +00:00
Shikha Malhotra
f870b88e1b Merge "Move flattened APEX activation logic to apexd." 2021-08-06 08:15:23 +00:00
Shikha Malhotra
720694dcca Move flattened APEX activation logic to apexd.
Also the check that linker configuration should not be updated if APEX
is in updatable state, is removed as now with refactoring of code and its
movement to apex project, that is also needed.

Resolves: https://b.corp.google.com/issues/192838499
Test: Run the AVD Device and check that it boots and run atest
ApexTestCases

Change-Id: I80a94fa0a4145d30546bb34a6d478a20a2881368
2021-08-05 19:57:21 +00:00
Tom Cherry
7f2888b192 Merge "Allow mapping of raw block devices to partition names" am: 18a9324e3f am: 43fede94a0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1783247

Change-Id: I4e69effc5afceb1aeb2105bf3c434e7aea7da769
2021-08-02 19:19:50 +00:00
Tom Cherry
18a9324e3f Merge "Allow mapping of raw block devices to partition names" 2021-08-02 18:59:25 +00:00
Jooyung Han
8362c09327 Merge "init: no bootstrap mount namespace for microdroid" am: 3bf878786c am: 26c6fdd16b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1781199

Change-Id: I394732062b3137e2e57c72f091490bcbdfb683fd
2021-07-30 18:38:42 +00:00
Yi-Yo Chiang
dc28bef023 Merge "init: Separate the required modules of core and recovery variants" am: 81dad902f6 am: feb6ff1ef9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1739813

Change-Id: I2b460230b3a5bbcd260bd0ac17bd328bd51f5ca6
2021-07-30 18:35:26 +00:00
Tom Cherry
96e5f9b5b8 Allow mapping of raw block devices to partition names
Allow mapping of raw block devices (those without a partition table)
to partition names for first stage mount and ueventd.  For example, a
block device `vdb` that contains only an ext4 metadata partition could
be mapped to `metadata` such that /dev/block/by-name/metadata is
created.

The mapping is provided by the `androidboot.partition_map` bootconfig
or kernel command line parameter.

Bug: 159943320
Test: boot with raw vdb,metadata;vdc,userdata partitions
Change-Id: Ib6a939d6fb88b85c46c81d613425a127627a734b
2021-07-30 10:35:58 -07:00
Jooyung Han
3bf878786c Merge "init: no bootstrap mount namespace for microdroid" 2021-07-30 12:41:14 +00:00
Yi-Yo Chiang
81dad902f6 Merge "init: Separate the required modules of core and recovery variants" 2021-07-30 10:09:40 +00:00
Jooyung Han
653b063871 init: no bootstrap mount namespace for microdroid
The reason for two mount namespace (bootstrap/default) is that we have
two sets of different APEXes to activate. But in microdroid, we don't
need two separate mount namespaces because there's only one set of
non-updatable APEXes in built-in directories and payloads (passed from
host Android).

Bug: 185991357
Test: MicrodroidHostTestCases
Change-Id: I4469f3b1d90f9543ecb980a450eaaf1c20b94c58
2021-07-29 17:11:23 +09:00
David Anderson
4071156ff1 Merge "snapuserd: Allow connecting to the first-stage daemon." am: 59c744bd3d am: 426fffa0e6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1774685

Change-Id: I524904b99e243e5e322352bbcb6aec5b1a66683f
2021-07-28 22:25:06 +00:00
David Anderson
0e5ad5a093 snapuserd: Allow connecting to the first-stage daemon.
Currently there is no socket for daemon instances launched during the
selinux phase of init. We don't create any sockets due to the complexity
of the required sepolicy.

This workaround will allow us to create the socket with very minimal
sepolicy changes. init will launch a one-off instance of snapuserd in
"proxy" mode, and then the following steps will occur:

1. The proxy daemon will be given two sockets, the "normal" socket that
snapuserd clients would connect to, and a "proxy" socket.
2. The proxy daemon will listen on the proxy socket.
3. The first-stage daemon will wake up and connect to the proxy daemon
as a client.
4. The proxy will send the normal socket via SCM_RIGHTS, then exit.
5. The first-stage daemon can now listen and accept on the normal
socket.

Ordering of these events is achieved through a snapuserd.proxy_ready
property.

Some special-casing was needed in init to make this work. The snapuserd
socket owned by snapuserd_proxy is placed into a "persist" mode so it
doesn't get deleted when snapuserd_proxy exits. There's also a special
case method to create a Service object around a previously existing pid.

Finally, first-stage init is technically on a different updateable
partition than snapuserd. Thus, we add a way to query snapuserd to see
if it supports socket handoff. If it does, we communicate this
information through an environment variable to second-stage init.

Bug: 193833730
Test: manual test
Change-Id: I1950b31028980f0138bc03578cd455eb60ea4a58
2021-07-27 19:35:29 -07:00
Akilesh Kailash
f8ff5dcbf2 Merge "snapuserd: Refactor code to a seperate directory" am: 0b23b2a346 am: 9e2696cb4b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1777726

Change-Id: Ic5ef922213d37c9fc8abfd68c84a3186d6ee6de9
2021-07-27 21:44:26 +00:00
Akilesh Kailash
0b23b2a346 Merge "snapuserd: Refactor code to a seperate directory" 2021-07-27 21:14:19 +00:00
Akilesh Kailash
36aeeb3f56 snapuserd: Refactor code to a seperate directory
Move all the code relevant to snapuserd to a seperate
directory. Add OWNERS file.

No other code changes apart from moving files around
and fixing couple location of header paths
at few places.

Bug: 194642092
Test: Compile, Full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ib1d852bfeda4eca5c996d6cd7b057f141cb5ddad
2021-07-26 07:04:06 +00:00
Yi-Yo Chiang
9ba6a5b8a2 init: Separate the required modules of core and recovery variants
So that init_second_stage (core) depends on core variant tools and rc
files, and init_second_stage.recovery depends on recovery variant tools
and recovery specific rc files.

Bug: 191369319
Test: Presubmit
Test: Check the ninja graph, init_second_stage.recovery no longer depend
  on core variation modules
Test: Check out/soong/Android-${PRODUCT}.mk
Change-Id: I03f0cf6af10617fe2e7de677e9dde1aecb2afc74
2021-07-24 22:51:55 +08:00
Eric Biggers
3b1101e872 Merge "Revert "init: make reboot_on_failure not apply to manually stopped services"" am: e080240b26 am: cbf5029ab8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1775427

Change-Id: I89efb2b2a9f093c3b1973773bcd55b7a3f91e734
2021-07-23 03:07:34 +00:00
Eric Biggers
d14a178d01 Revert "init: make reboot_on_failure not apply to manually stopped services"
This reverts commit 1c51525f66 because it
accidentally made reboot_on_failure be a no-op for all services.  This
is because Reap() itself calls KillProcessGroup() on devices with a
vendor level >= R, which in turn sets SVC_STOPPING.  I had overlooked
this somehow, probably because I didn't consider that a service can
consist of multiple processes.

It turns out that real FDE devices don't actually need the above commit
because FDE devices aren't allowed to have updatable apexes enabled, and
without updatable apexes enabled, apexd exits automatically and
therefore doesn't have to be stopped.  This can be verified by using the
aosp_cf_x86_phone_noapex build target, rather than aosp_cf_x86_phone
which I had used for testing before.  So just revert it for now.

Bug: 194370048
Change-Id: I90eddf2a87397449b241e5acaaa8d4a4241d73a9
2021-07-22 13:06:41 -07:00
Treehugger Robot
a7ac810749 Merge "Revert "Re-land removing RECOVERY_AS_BOOT check for init_first_stage"" am: d939aa2405 am: eafdcd0b27
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1765788

Change-Id: I0b54cb36881d6e31233d83e4a81e0aab04a41fa8
2021-07-15 09:29:40 +00:00
Bowgo Tsai
ab079af28f Revert "Re-land removing RECOVERY_AS_BOOT check for init_first_stage"
This reverts commit 4818f74888.

The previous commit might introduce a build break on legacy
devices that with a smaller /boot partition size, because it
outputs the first-stage init and the second-stage init binaries
in the following locations, respectively (when
BOARD_USES_RECOVERY_AS_BOOT is true).

    * $OUT/recovery/root/first_stage_ramdisk/init
    * $OUT/recovery/root/system/bin/init

The first one is not needed because there is already a symlink
under $OUT/recovery/root:  init -> /system/bin/init.

Bug: 193565271
Test: `lunch aosp_flame-userdebug`, `make bootimage_debug` then
      checks the output under $OUT/debug_ramdisk/.
Test: Performs the same check for `lunch aosp_bramble-userdebug`.
Change-Id: I6277a6c4c0980bd976cc35db6ca99eafc6bf3f5a
2021-07-14 19:21:40 +08:00
Treehugger Robot
8df4eb971e Merge "Re-land removing RECOVERY_AS_BOOT check for init_first_stage" am: 662729bc2e am: 852981c0c3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1762146

Change-Id: Id70e6e4bf858e026e6d88ff9fc8e05f274126b67
2021-07-13 02:01:07 +00:00
Inseob Kim
4818f74888 Re-land removing RECOVERY_AS_BOOT check for init_first_stage
This has kept adb_debug.prop from being installed for
legacy devices with BOARD_USES_RECOVERY_AS_BOOT set to
true.

Bug: 192432810
Bug: 193291885
Test: `lunch aosp_flame-userdebug` and checks `get_build_var
      BOARD_USES_RECOVERY_AS_BOOT` is true.
Test: `make bootimage_debug` then checks
      $OUT/debug_ramdisk/adb_debug.prop exists
Test: build/soong/build_test.bash --dist --incremental

Change-Id: I28e2c082512791407167b610843f18731ed6d673
2021-07-10 23:42:53 +08:00
Devin Moore
b278c3ab62 Merge "init: remove extra space in list of bootconfig values" am: 53ad66f41b am: 706013153c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1757971

Change-Id: Ib08af168afe3a936e610b423432503aadffbd2b1
2021-07-08 16:15:25 +00:00
Treehugger Robot
2fba3bfa75 Merge "init: Enable hwasan error reporting." am: 905ef0e025 am: 12afdda04a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1758940

Change-Id: I6e32eaca8d3444b5b31ca0202c3c6082b34c24c9
2021-07-08 16:15:20 +00:00
Devin Moore
53ad66f41b Merge "init: remove extra space in list of bootconfig values" 2021-07-08 16:06:43 +00:00
Devin Moore
6d5445b9f4 init: remove extra space in list of bootconfig values
If a bootconfig argument has a list of values, it has a space between
them in /proc/bootconfig.

Example:
BOARD_BOOTCONFIG := parameter=value1,value2,value3

In /proc/bootconfig, it looks like:
parameter = "value1", "value2", "value3"

Before this CL, that example would end up with the value string of:
"value1, value2, value3"

To keep consistent behavior with kernel cmdline the value string should be:
"value1,value2,value3"

Test: Boot cuttlefish with test bootconfig params and verify ro.boot.*
Bug: 192257482
Change-Id: Iccdec451f53330162fa2c9ad2b7c2630f32b4168
2021-07-08 01:52:46 +00:00
David Anderson
8138717679 init: Enable hwasan error reporting.
Bug: 172541617
Test: builds with SANITIZE_TARGET=hwaddress
Change-Id: Ic749172bf9dd64bca0e8c7e34ac0b323685ad945
2021-07-07 18:49:19 -07:00
Nikita Ioffe
f2e69b0f36 Merge "Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible" am: fb1e841a9f am: 5392128031
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1756529

Change-Id: If72cb85878747508d1f7eea0c426b603eee82d12
2021-07-08 01:43:29 +00:00
Nikita Ioffe
fb1e841a9f Merge "Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible" 2021-07-08 01:16:49 +00:00
David Anderson
a6f8728b4c Merge "Fix gid not being set in ueventd when device nodes already exist." am: ccea7dfae7 am: be6fac8123
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1755589

Change-Id: Idefaab3d4e67ccff826910cc67e328d795cf6737
2021-07-07 22:31:41 +00:00
Nikita Ioffe
1f662999e3 Also populate lastUpdateMillis in ActivateFlattenedApexesIfPossible
Test: m
Bug: 192647837
Change-Id: I11dca132168d6a30372d7a68fe590894d3cc5ccf
2021-07-05 16:44:03 +01:00
David Anderson
f8825fafc8 Fix gid not being set in ueventd when device nodes already exist.
The chown() call will fix the uid for pre-existing nodes, but not the
gid. This fix ensures the correct gid is set if needed.

Bug: 187738549
Test: manual test modifying ueventd.rc
Change-Id: I0fadd745a7c57a089fed9afc2572ace597a05396
2021-07-02 20:50:23 -07:00
Chenfu.Liao
d672e47b32 Add Quiescent Reboot Target
[Description]
In the Quiescent Reboot process,
the android init process will pass the reboot target name "quiescent"
to the kernel through reboot syscall.

Kernel will write the boot-quiescent flag
to the misc partition to notify the bootloader.

When rebooting, bootloader will be added to
bootargs androidboot.quiescent=1 to notify android .

In the new version of GKI,
the filp_open function is not allowed
so that it is impossible to write the quiescent flag
in the Kernel to the misc partition.

https://android-review.googlesource.com/c/kernel/common/+/1705108
/1..29/android/abi_gki_aarch64_mtk#b641

Bug: 192634025

Test:
adb reboot quiescent
adb shell setprop sys.powerctl reboot,quiescent

Change-Id: I5ac982a1f16df39fa6bf567729a18ca8225f21f2
2021-07-02 09:38:17 +00:00
Nikita Ioffe
736288d4a7 Merge "Only run RebootTest under root" into sc-dev am: bfa4e30bf2
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15132987

Change-Id: Ie9fc9a512624f2e2a4f8fb0647b68089f6fb7574
2021-07-01 22:36:48 +00:00
Nikita Ioffe
bfa4e30bf2 Merge "Only run RebootTest under root" into sc-dev 2021-07-01 22:25:24 +00:00
Inseob Kim
ddb1971e97 Revert "Remove RECOVERY_AS_BOOT check for init_first_stage" am: 9fa041c9a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15166552

Change-Id: I549937e822fac8691ec502299d03abf8fbcc3746
2021-07-01 03:32:00 +00:00
Inseob Kim
9fa041c9a4 Revert "Remove RECOVERY_AS_BOOT check for init_first_stage"
This reverts commit 94c2593ea0.

Reason for revert: build breakage

Change-Id: I270a56bb33d19a2747298c69f6ec1b24746d97bf
2021-07-01 02:33:53 +00:00
Inseob Kim
8bfd66fa22 Remove RECOVERY_AS_BOOT check for init_first_stage am: 94c2593ea0
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15125801

Change-Id: Ie8508bab88ede58b3d725ebf326396f9a78dfc50
2021-06-30 23:36:36 +00:00
Inseob Kim
94c2593ea0 Remove RECOVERY_AS_BOOT check for init_first_stage
This has kept adb_debug.prop from being installed.

Ignore-AOSP-First: fixes sc-release test breakage

Bug: 192432810
Test: build ramdisk-debug.img and see contents
Change-Id: I254579d2c6427213f40e9ae8e50d046e19390ba5
2021-06-30 11:35:21 +00:00
Nikita Ioffe
49b3a5c891 Only run RebootTest under root
This test requires running test services, which causes test to crash
(and still incorrectly be reported as passing) when running on
non-rooted device.

Ignore-AOSP-First: reboot_test is not in AOSP yet
Bug: 190958734
Test: atest CtsInitTestCases
Change-Id: I3c5c9917d0a787d66272ccf4aefc57e6573841bc
2021-06-29 23:23:33 +00:00
Devin Moore
2ce7438220 Merge "Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware""" am: 41d3223d3f am: a5fcfcb383
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1741484

Change-Id: Ied442412076370e3af4cdfc4eaa007fdb96be8a4
2021-06-29 20:16:32 +00:00
Devin Moore
68bb5c4195 Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware""
This reverts commit 0a799bdfd6.
Now that the kernel bootconfig feature has been to updated to handle
mixed subkeys and values, androidboot.hardware parameter is supported.

Test: build and boot Cuttlefish with "androidboot.hardware=cutf_vm"
Bug: 191502832
Merged-In: I0e436a27730d20689bc6974562c3e88d744385db
Change-Id: I0e436a27730d20689bc6974562c3e88d744385db
2021-06-29 12:53:08 -07:00
Devin Moore
41d3223d3f Merge "Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware""" 2021-06-29 19:47:15 +00:00
David Anderson
8eaae7faf3 Merge "init: fix to set sd device label correctly for FS" am: da75aa7b6b am: c760de2173
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1717435

Change-Id: Ia3546dca6ac00b9960638c558615ad91ba1986bd
2021-06-29 04:36:58 +00:00
Guo Weichao
bcefbb1dfb init: fix to set sd device label correctly for FS
The sysfs node of sd blk_device is /sys/fs/f2fs/sd-<num>, we shouldn't
skip partition number at this time.

Bug: 189257443
Test: access sd-<num> sysfs correctly
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Change-Id: Ibcd7bb265f8fca9cd26f8770403f1bafad433acb
2021-06-25 21:42:17 +08:00
Inseob Kim
86454f80ef Merge "Completely migrate init first stage to Soong" into sc-dev 2021-06-24 23:21:04 +00:00
Devin Moore
2d93a2a100 reboot_utils: Check bootconfig for reboot parameters
Androidboot parameters have moved from /proc/cmdline to /proc/bootconfig
so we need to check both places in reboot_utils.
"ro.boot.*" properties can not be used because this is initialized
before the properties are set.

Test: boot Cuttlefish with init_fatal_panic and
init_fatal_reboot_target in bootconfig and in cmdline
Bug: 191494101

Merged-In: I6c230496ec1c3632470d20ff4a31f28db96ea71b
Change-Id: I6c230496ec1c3632470d20ff4a31f28db96ea71b
2021-06-23 11:27:52 +00:00
Inseob Kim
7418252a4e Completely migrate init first stage to Soong
adb_debug.prop is migrated too. And ramdisk_available is added to all
dependencies.

Bug: 187196593
Test: boot
Change-Id: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
Merged-In: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
2021-06-23 04:26:12 +00:00
Devin Moore
73ab10dbf4 Merge "reboot_utils: Check bootconfig for reboot parameters" am: 86cfa5802c am: a883aaf547
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1741519

Change-Id: Ibc988d4b5e40a59d7722254e0d375ad0e77f48cb
2021-06-22 22:52:30 +00:00
Devin Moore
86cfa5802c Merge "reboot_utils: Check bootconfig for reboot parameters" 2021-06-22 22:17:27 +00:00
Devin Moore
86ec18bca5 Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware""
This reverts commit 0a799bdfd6.
Now that the kernel bootconfig feature has been to updated to handle
mixed subkeys and values, androidboot.hardware parameter is supported.

Test: build and boot Cuttlefish with "androidboot.hardware=cutf_vm"
Bug: 191502832
Change-Id: I0e436a27730d20689bc6974562c3e88d744385db
2021-06-22 09:54:57 -07:00
Devin Moore
2652fdb8aa reboot_utils: Check bootconfig for reboot parameters
Androidboot parameters have moved from /proc/cmdline to /proc/bootconfig
so we need to check both places in reboot_utils.
"ro.boot.*" properties can not be used because this is initialized
before the properties are set.

Test: boot Cuttlefish with init_fatal_panic and
init_fatal_reboot_target in bootconfig and in cmdline
Bug: 191494101

Change-Id: I6c230496ec1c3632470d20ff4a31f28db96ea71b
2021-06-21 09:43:27 -07:00
Inseob Kim
6bfb9fe130 Merge "Completely migrate init first stage to Soong" am: 65156052cc am: ae9de7bcf2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1734596

Change-Id: I01053ce453f8cc88c24d09813dcc28f88b6d7657
2021-06-18 18:14:51 +00:00
Inseob Kim
2e20058069 Completely migrate init first stage to Soong
adb_debug.prop is migrated too. And ramdisk_available is added to all
dependencies.

Bug: 187196593
Test: boot
Change-Id: I59cd149e0021211b8fd59c44b93bbf18dc8637bf
2021-06-18 14:26:55 +09:00
Treehugger Robot
7794308dd3 Merge "Add some README.md text for init triggers." am: 04d0f7d303 am: 283798235e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1724076

Change-Id: I2628cf5fafa4999555687345b178662a1ffe0559
2021-06-15 20:11:32 +00:00
Treehugger Robot
04d0f7d303 Merge "Add some README.md text for init triggers." 2021-06-15 19:27:53 +00:00
David Anderson
6bc2a789bb Use std::shared_ptr in Epoll's callback list. am: 1de7384c10
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14923579

Change-Id: I06355a0b0e7a6c33d160f7dd2a1f10b038928f1c
2021-06-14 10:09:17 +00:00
David Anderson
1de7384c10 Use std::shared_ptr in Epoll's callback list.
Ignore-AOSP-First: Awaiting security triage
Bug: 187862380
Bug: 190126442
Test: CtsInitTestCases
Change-Id: Ibb34a6b8a5675dbc515b7f8a43d7eecf2084510c
(cherry picked from commit aea9781530)
2021-06-09 19:59:20 +00:00
David Anderson
ea700e89db Merge "ueventd: the parallel restorecon dirs is configurable [1/1]" am: cc8572441e am: 0451dc4129
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1699465

Change-Id: Iaaca2833fe4ba9abccf03e63956abd100d5dc617
2021-06-07 23:49:21 +00:00
David Anderson
cc8572441e Merge "ueventd: the parallel restorecon dirs is configurable [1/1]" 2021-06-07 23:08:59 +00:00
David Anderson
93f2916edb Merge "Warn loudly if using deprecated ueventd paths." am: 391056ea73 am: 5f6539dcd0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1726330

Change-Id: I151aa7593a23e67fad14e7b647df319fbb56af14
2021-06-03 22:53:52 +00:00
David Anderson
391056ea73 Merge "Warn loudly if using deprecated ueventd paths." 2021-06-03 22:12:25 +00:00
Yi-Yo Chiang
84fe96bfbc first_stage_mount: mount point must be canonical path
Ban weird paths such as /../system or //vendor in first stage mount.
Add utility function fs_mgr_create_canonical_mount_point() that:

* mkdir(mount_point) to ensure mount_point's existence
* Test that realpath(mount_point) =?= mount_point

Bug: 188898525
Test: Presubmit
Test: Boot CF
Change-Id: Iaf2ec52701277f26cc81f3e15a47b6083a788334
Merged-In: Iaf2ec52701277f26cc81f3e15a47b6083a788334
(cherry picked from commit 3431d52675)
2021-06-03 15:53:12 +08:00
Yo Chiang
59b6a62695 Merge "first_stage_mount: mount point must be canonical path" am: 4063fc4a01 am: 53ce569e4f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1719044

Change-Id: Ied100a325228a90b2d8a2a40a302c9585b2f63bd
2021-06-03 06:56:08 +00:00
David Anderson
0050bef9e1 Warn loudly if using deprecated ueventd paths.
Bug: 189268918
Test: treehugger
Change-Id: Ib4cfa4f3a1f4626afcd37278d93390ad34b0216b
2021-06-02 18:22:28 -07:00
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
Yi-Yo Chiang
3431d52675 first_stage_mount: mount point must be canonical path
Ban weird paths such as /../system or //vendor in first stage mount.
Add utility function fs_mgr_create_canonical_mount_point() that:

* mkdir(mount_point) to ensure mount_point's existence
* Test that realpath(mount_point) =?= mount_point

Bug: 188898525
Test: Presubmit
Test: Boot CF
Change-Id: Iaf2ec52701277f26cc81f3e15a47b6083a788334
2021-06-02 16:38:17 +08:00
David Anderson
8ce8c89b35 Add some README.md text for init triggers.
Bug: 180475195
Test: N/A
Change-Id: I33ec5a03b6aced835f15315b1755e17d07969d4c
2021-06-01 21:38:41 -07:00
Yo Chiang
30687fbdbe Merge "Make fs_mgr_overlayfs_mount_fstab_entry() available for user builds" am: 869ab86944 am: c88ce98631
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1711246

Change-Id: Ie9f509f32dfc85deaa38480b7a51c7206ea5aa7e
2021-05-27 09:38:41 +00:00
Yi-Yo Chiang
18a6cc2bac 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
Merged-In: I3b60dfa4b63cf2ae0754f53d1d08365aa7be1ee0
(cherry picked from commit 23816e84ca)
2021-05-27 16:55:28 +08: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
94d1f3b4fa 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: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I1a05696346610d7fd61de6d25c379520fd58ca9b
Merged-In: I1a05696346610d7fd61de6d25c379520fd58ca9b
(cherry picked from commit dcf1c1f462)
2021-05-26 07:31:19 +00:00
Yi-Yo Chiang
aa061738bc 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: 188862155
Test: Boot to normal with overlayfs mount entries in first stage fstab
Change-Id: I0ac8b7ac0f21daa0c191580d9349adf217854864
Merged-In: I0ac8b7ac0f21daa0c191580d9349adf217854864
(cherry picked from commit 87290f8e9b)
2021-05-26 07:31:12 +00:00
David Anderson
26e1ad4fb7 Merge "KillZramBackingDevice: Return immediately if backing_dev is none." am: 7e2d32bc06 am: 4c21150d8d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1710548

Change-Id: Ifd8db64e5d1cd829d2271a917e4bdadff73083e0
2021-05-26 04:24:15 +00:00
David Anderson
7e2d32bc06 Merge "KillZramBackingDevice: Return immediately if backing_dev is none." 2021-05-26 03:29:05 +00: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
51c0482fe4 Merge "fs_mgr_overlayfs: Polish fs_mgr_overlayfs_mount_fstab_entry()" am: 71db89b1da am: 349cb5d4c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1710550

Change-Id: I66894e12496b42fa7b51604f7b329220a03f0b70
2021-05-20 07:15:13 +00:00
Yo Chiang
eea7cf4dfd Merge "first_stage_mount: Remove "overlay" hack from InitRequiredDevices()" am: b440fc9c06 am: 99893a20f7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1711245

Change-Id: Ibe004599e297111f82bb52241c0fa6df16bc37c7
2021-05-20 07:15:07 +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
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
Treehugger Robot
02bb576054 Merge "ueventd: Run external handler as non-root group" am: 5123a3eafc am: 7db6b64f2d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1707926

Change-Id: If2f9837c9ec4c66cadda829f335639078b75a899
2021-05-18 23:47:17 +00: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
Tianjie Xu
0a2bb08371 Merge "Add a unittest for fingerprint calculation" am: 023ac49db2 am: b026f15df0 am: 8408b03092
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1698093

Change-Id: Ic7cca5299f5a9f06cfc701990bcf781e3103f82f
2021-05-11 07:00:04 +00:00
Tianjie
69e880e257 Add a unittest for fingerprint calculation
Add a test to check the build fingerprint when the dynamic build
id is in use.

Bug: 186786987
Test: th
Change-Id: I44d6be0c18552f319bcb8d19cca5659ce580d26c
2021-05-10 12:11:28 -07:00
Tianjie Xu
87eeec4d40 Merge "Support appending vbmeta digest to id/fingerprint" am: 57b9a5370e am: 8b6d881071 am: 4e83aa5beb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1695266

Change-Id: I3be9c44e07194c9c317677fe33e9dc1568548783
2021-05-09 00:10:02 +00:00
Tianjie Xu
57b9a5370e Merge "Support appending vbmeta digest to id/fingerprint" 2021-05-08 22:56:56 +00:00
Roman Kiryanov
bc7acaadda Merge "Remove the tech debt from the property_service" am: 8371ec25ab am: 9beeed390c am: 8456b731d8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1698925

Change-Id: I1cdeeeed17212edcdd120cdddfd79e2ed7106231
2021-05-06 23:58:51 +00:00
Tianjie
becfa77e5d Support appending vbmeta digest to id/fingerprint
Background in http://go/compatible-build-fingerprint. To uniquely
identify the mixed build, we plan to append the unique vbmeta digest
to ro.build.id.

If BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT is true, the build system
will not set ro.build.id. Instead, init will set it at runtime, by
appending the digest to the legacy build id.

Bug: 186786987
Test: build and boot a device with new build id
Change-Id: Idea57df599bfd6eede760671e2555541f7dc3f21
2021-05-06 22:31:54 +00:00
Roman Kiryanov
2d1a401b6e Remove the tech debt from the property_service
emulator migrated to bootconfig, we don't use
the kernel command line to pass userspace properties.

Bug: 182291166
Test: boot
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Iff2f627aec64b7ba2240444639acedc76a1aa806
2021-05-06 11:55:29 -07:00
Treehugger Robot
641371794c Merge "Revert "init: adding fallback paths for debug ramdisk"" am: 0d712ad3a2 am: e21050474a am: 05c21f24f7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1697285

Change-Id: Ic0b4d1855fe4deeee22e0390e7c59062f8f04f70
2021-05-06 08:18:26 +00:00
Treehugger Robot
0d712ad3a2 Merge "Revert "init: adding fallback paths for debug ramdisk"" 2021-05-06 07:05:41 +00:00
David Anderson
6870933e8e Merge "OverlayFS support for fstab" am: 7cdbd8e64d am: 1e5400b429 am: 2f8663919e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1691625

Change-Id: I5b951b3340d095a2afddb7dbf7bf71a53a6db0d9
2021-05-06 02:51:15 +00:00
David Ng
d926aded73 OverlayFS support for fstab
Add overlayfs (lowerdir) mount entry support to fstab.

  overlay  <final dir>  overlay lowerdir=/1:/2

E.g.
  overlay /vendor overlay lowerdir=/odm/vnd_ovl1/1:/odm/vnd_ovl2

Test: Ensure mounting with fstab overlayfs entry
Change-Id: Ib025e203f8ac1836ab62dfa96fb14e8e108f82fb
2021-05-05 09:30:18 -07:00
Bowgo Tsai
26c1b74998 Revert "init: adding fallback paths for debug ramdisk"
This reverts commit 6cb4311f4d.

Reason for revert: no need to keep the compatibility now

Bug: 186485355
Change-Id: Iffdf3abebc17f32e36f3b3fe2b4f9c2592da9653
Test: TreeHugger
2021-05-05 10:31:29 +00:00
David Anderson
b4d299618f Merge "init: Add tests and document the new fnmatch behavior in ExternalFirmwareHandler." am: 6939583deb am: b383eb7f99 am: eb50ea4ea3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1677040

Change-Id: Ia7b82f126dd25b7caa2b66ff8b5381026a816d19
2021-05-05 01:34:39 +00:00
David Anderson
6939583deb Merge "init: Add tests and document the new fnmatch behavior in ExternalFirmwareHandler." 2021-05-05 00:21:34 +00:00
Eric Biggers
6ba6672ce7 Merge "init: make reboot_on_failure not apply to manually stopped services" am: 890fd0c239 am: 7a07e8c1ad am: 506762b310
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1684056

Change-Id: Ia6a0f3b488a278c062b5cb6a01bc95300bbf788a
2021-05-04 21:53:53 +00:00
Eric Biggers
1c51525f66 init: make reboot_on_failure not apply to manually stopped services
Add a new service flag SVC_STOPPING which tracks whether a service is
being manually stopped by init, and make the "reboot_on_failure" service
setting not apply when SVC_STOPPING is set.

This is needed for devices that use FDE, because otherwise the device
reboots during the following init script fragment:

    on property:vold.decrypt=trigger_shutdown_framework
        class_reset late_start
        class_reset main
        class_reset_post_data core
        class_reset_post_data hal

... because that stops all services, including apexd which has been
marked with reboot_on_failure since
https://android-review.googlesource.com/c/platform/system/apex/+/1325212.
So init was killing apexd, then rebooting the device because apexd
"failed" due to having been killed.  Making reboot_on_failure not apply
when init stops a service itself fixes the problem.

This is one of a set of changes that is needed to get FDE working again
so that devices that launched with FDE can be upgraded to Android 12.

Bug: 186165644
Test: Tested FDE on Cuttlefish
Change-Id: I599f7ba107e6c126e8f31d0ae659f0ae672a25e4
2021-05-03 21:38:50 -07:00
Inseob Kim
43f3a6b92c Merge "Fix precompiled sepolicy logic" am: 4664bbc6c7 am: ff9de56e37 am: 257a50e59d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1690527

Change-Id: I359d9a1ea580a79d10f06825ee0a9c554f996c7b
2021-04-30 03:06:34 +00:00
Inseob Kim
4664bbc6c7 Merge "Fix precompiled sepolicy logic" 2021-04-30 01:14:15 +00:00
Inseob Kim
28fdb6794c Fix precompiled sepolicy logic
If precompiled vendor policy has system_ext hash, system_ext also has to
have its hash, to use precompiled sepolicy.

Bug: 186727553
Test: remove system_ext's hash and see sepolicy compiled in runtime
Change-Id: I4af3418d614156b5e9cd0b0116c2814ba994ee81
2021-04-29 19:50:38 +09:00
Treehugger Robot
277178c2c5 Merge "Allow a kernel bootconfig to set the qemu key" am: 6cbc7e01b2 am: 0d13e9370c am: 57f01c51e5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1690216

Change-Id: Ia251f2c3fc296783b001d1584f34370e4b73aea6
2021-04-29 04:23:34 +00:00
Treehugger Robot
6cbc7e01b2 Merge "Allow a kernel bootconfig to set the qemu key" 2021-04-29 02:16:33 +00:00
Roman Kiryanov
6e20ff83ac Allow a kernel bootconfig to set the qemu key
The existing code has a lot of references to the
`ro.boot.qemu` and `ro.boot.qemu.something` properties
which is not supported by the bootconfig if we place
everything under `androidboot.qemu`.

Bug: 182291166
Test: getprop | grep qemu
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Icb9d29c8dc39e1fa52a6f2ce43b4f42182b7995d
2021-04-28 15:31:52 -07:00
Treehugger Robot
5f7573c9c4 Merge changes from topic "debug_ramdisk_path" am: c4a1a32e91 am: d6fbaa0945 am: ee2cb68b2d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1687907

Change-Id: If65a7996a499b7a312b0ab0b2a43554c0d807859
2021-04-28 18:59:08 +00:00
Bowgo Tsai
e62fdae795 init: loading debug resources before chroot into first_stage_ramdisk am: 64e92f946f am: 20a73996fa am: ba04147ae5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1684655

Change-Id: I68ff80a39cf6df93486c3b30fa285ab11836b271
2021-04-28 18:59:06 +00:00
Bowgo Tsai
20a73996fa init: loading debug resources before chroot into first_stage_ramdisk am: 64e92f946f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1684655

Change-Id: Idedf53ec0e74a1fd12f4b883a7605200561d5ff3
2021-04-28 18:19:47 +00:00
Treehugger Robot
c4a1a32e91 Merge changes from topic "debug_ramdisk_path"
* changes:
  init: adding fallback paths for debug ramdisk
  init: loading debug resources before chroot into first_stage_ramdisk
2021-04-28 16:27:34 +00:00
Bowgo Tsai
6cb4311f4d init: adding fallback paths for debug ramdisk
Currently the gki_4_19_pixel5 presubmit test uses an old
vendor_boot-debug.img from a release branch. Adding fallback
paths to load debug resources from /first_stage_ramdisk dir to
pass the presubmit.

This CL should be reverted later once the vendor_boot-debug.img
gets updated to store the debug resources on the root dir.

Bug: 186082603
Test: boot a device with boot-debug.img
Test: boot a device with vendor_boot-debug.img
Change-Id: I9fcd77fc5a60a15cff254e432e05f1c9122ad80d
2021-04-27 15:25:31 +08:00
Bowgo Tsai
64e92f946f init: loading debug resources before chroot into first_stage_ramdisk
Currently the debug resources might under /first_stage_ramdisk/*
of the ramdisk, if there is androidboot.force_normal_boot=1 in the
kernel cmdline to request init chroot into /first_stage_ramdisk dir.

To make a generic boot-debug.img works on devices with and without
this chroot, moving the debug resources to the root of the ramdisk.
And copy them for later use before the chroot.

Bug: 186082603
Test: boot a device with boot-debug.img
Test: boot a device with vendor_boot-debug.img
Change-Id: I052a92b2d26c7fdf749991fc55015ff68743efc2
2021-04-27 15:25:18 +08:00
Treehugger Robot
a4c2d51c27 Merge "[Bugfix]Fix userspace-reboot failure when backing_dev exists but zram not swapped on" am: 23a50b3860 am: bce0c15f3f am: 11f3ed6133
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1674154

Change-Id: I1574031bb51c6a0c668be14654ee0ced824ae5ee
2021-04-23 01:09:45 +00:00
Treehugger Robot
23a50b3860 Merge "[Bugfix]Fix userspace-reboot failure when backing_dev exists but zram not swapped on" 2021-04-23 00:28:49 +00:00
Treehugger Robot
73f0dfd416 Merge "init: apexd is started in the current mount namespace" am: 778f2b6837 am: fe5f60d051 am: d61e073a6a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1680266

Change-Id: I6150bf4b982075fc578eec644bd5c0214d0209f1
2021-04-21 06:45:25 +00:00
Jooyung Han
e5232a71b2 init: apexd is started in the current mount namespace
init starts services in "bootstrap" mount namespace until the "default"
mount namespace is ready even when init's current mount namespace is
"default".

apexd and linkerconfig are those processes to set up the mount
namespaces: apexd activates apexes and linkerconfig generates linker
configs.

Previously apexd is allowed to be started in the "current" namespace by
checking its "service name"(it should be "apexd"). But there can be a
certain environment apexd is started in a different way. For example, in
microdroid, apexd is started using "exec -- /system/bin/apexd --vm"
because it wants to run in a different execution mode.

So, instead of checking the service name, its executable's path is
checked against to allow apexd to be started in the current mount
namespace.

Bug: 179342589
Test: MicrodroidTestCase (microdroid boots)
Test: cuttlefish boots
Change-Id: I7c2490e15d481c28ddf382d2d3fdf58a78e467ec
2021-04-20 22:50:12 +09:00
David Anderson
5b7d0be4c3 Merge "ueventd: Allow pattern matching to find external firmware handler" am: 4a3ab034c6 am: dd7da900a0 am: 1875508cdf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1664121

Change-Id: I25b4c6abe1a3197264b271f01c8ecda14e795e6a
2021-04-16 21:41:00 +00:00
David Anderson
19872d0156 init: Add tests and document the new fnmatch behavior in ExternalFirmwareHandler.
Bug: N/A
Test: atest CtsInitTestCases
Change-Id: I232db8416318ba31ea3f78cc07f235d9a47efac4
2021-04-16 13:35:11 -07:00
Suchang Woo
22fdd0ae13 ueventd: Allow pattern matching to find external firmware handler
Only the exact same devpath uevent can launch external handler specified
in ueventd.rc. So, you should specify all possible devpaths, even
firmware with different filenames on the same device. Pattern mactching
can be used to simplify this.

Test: atest CtsInitTestCases
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: If3b7a2cabb8055bf4b768d928f0fc0012da3c177
2021-04-16 13:35:10 -07:00
Treehugger Robot
7f647a232a Merge "Do not populate ro.kernel. properties in init" am: 5e89a35ae3 am: f7c4f3b94b am: ff435d8995
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1676728

Change-Id: I136d3529e90f8f2ba869ac79da5d1cf54409f9de
2021-04-15 20:09:41 +00:00
luwei9
8a3653cfe2 [Bugfix]Fix userspace-reboot failure when backing_dev exists but zram not swapped on
'/sys/block/zram0/backing_dev' will exist even if zram is not swapped on in some devices. And there is no reason to ensure that zram is swapped on if '/sys/block/zram0/backing_dev' exists. So, if we want to kill backing_dev during userspace reboot, we should check if zram is swapped on first.

TEST: as follow
 - adb root
 - adb shell swapoff /dev/block/zram0
 - adb shell echo 1 > /sys/block/zram0/reset
 - adb shell setprop test.userspace.reboot.flag 1
 - adb reboot userspace
 - (wait reboot ending) adb shell getprop test.userspace.reboot.flag (1 will be show if successful)

Signed-off-by: luwei9 <luwei9@xiaomi.com>
Change-Id: Icca569cf8d64bc024b867dae2ab789fc9e76445a
2021-04-15 08:08:20 +00:00
Roman Kiryanov
f4adb894cc Do not populate ro.kernel. properties in init
`ro.kernel.` is deprecated, emulator migrated to
`ro.boot.`.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I074f9a63dc4e3edcc01930b2e8481efd1d85eb55
2021-04-14 20:45:55 -07:00
Yo Chiang
ad5c80fda5 Merge "Load *_compat_cil_file from system_ext as well" am: 3841fdfa3c am: 6e944a9484 am: 832c06c27c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1650271

Change-Id: I62e8157a2a320ee0d8e46aca126ca03d433859d7
2021-04-13 07:40:22 +00:00
Yo Chiang
3841fdfa3c Merge "Load *_compat_cil_file from system_ext as well" 2021-04-13 05:48:04 +00:00
Hridya Valsaraju
1e0028a917 Merge "Use property ro.product.enforce_debugfs_restrictions to enable debugfs restrictions" am: 2a8b028c04 am: bdc512a21b am: 230df281ab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1663702

Change-Id: Ie415770c7639361c9148db761cadf1b26a9c4513
2021-04-12 18:27:55 +00:00
Hridya Valsaraju
2a8b028c04 Merge "Use property ro.product.enforce_debugfs_restrictions to enable debugfs restrictions" 2021-04-12 17:11:23 +00:00
Treehugger Robot
d7f9768f25 Merge "Populate ro.boot.dalvik.vm.checkjni from android.checkjni" am: cd52a78472 am: a50cdc1d0a am: f69c016c5b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1668586

Change-Id: I9693f111b0369ccb6fa485959ebcfdb8dfa51daa
2021-04-08 19:45:34 +00:00
Treehugger Robot
33156eea6f Merge "Populate ro.boot.debug.sf.nobootanimation from android.bootanim" am: a8b2ac4b30 am: 1e9abd4fff am: 5e496f269b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1666095

Change-Id: I344fb7505478ed3fd00245708d3e3252e035c9e4
2021-04-08 19:45:21 +00:00
Roman Kiryanov
0312c20a71 Populate ro.boot.dalvik.vm.checkjni from android.checkjni
emulator passes `android.checkjni` in the kernel
command which we want to use in
frameworks/base/core/jni/AndroidRuntime.cpp

Bug: 182291166
Test: getprop ro.boot.dalvik.vm.checkjni
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: If9473aa9492fa09d8de7cc8fb08614380e4e15f3
2021-04-07 15:55:21 -07:00
Roman Kiryanov
c755e5edf9 Populate ro.boot.debug.sf.nobootanimation from android.bootanim
emulator passes `android.bootanim=0` in the kernel
command line to disable boot animation.

Bug: 182336906
Test: boot emulator with -np-boot-anim
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Id89a6c92dd4724cac414ffbf8ee731b2bfcc7195
2021-04-06 20:44:57 -07:00
Treehugger Robot
35f9c0d65d Merge "ueventd: Fix wrong argument index in devpath comparison" am: 0cf8af6860 am: deca6caf46 am: aec92150f2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1664601

Change-Id: I13b45f9c4544911cde704ca0ef891271eac220a7
2021-04-07 01:19:09 +00:00
Suchang Woo
8681f7e7a3 ueventd: Fix wrong argument index in devpath comparison
args[2](user name to run as) is used instead of args[1](devpath).

Test: atest CtsInitTestCases
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: Id271755993d55e332bad54d0414e2232071e5e8e
2021-04-06 11:15:28 +09:00
Hridya Valsaraju
6b7311fc99 Use property ro.product.enforce_debugfs_restrictions to enable debugfs
restrictions

Use the property ro.product.enforce_debugfs_restrictions to enable
debugfs restrictions instead of checking the launch API level. Vendors
can enable build-time as well as run-time debugfs restrictions by
setting the build flag PRODUCT_SET_DEBUGFS_RESTRICTIONS true which in
turn sets ro.product.enforce_debugfs_restrictions true as well enables
sepolicy neverallow restrictions that prevent debugfs access. The
intention of the build flag is to prevent debugfs dependencies from
creeping in during development on userdebug/eng builds.

Test: build and boot
Bug: 184381659
Change-Id: If555037f973e6e4f35eb7312637f58e8360c3013
2021-04-02 17:00:50 -07:00
Yo Chiang
6979590818 Merge "fs_mgr: Suppress SkipMountingPartitions log in ReadFstabFromFile" am: a2b662cf23 am: 14d8badf58 am: 6b4cb7a2dd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1662019

Change-Id: I8398be0a36d9eed52b88592055c1518cbe10d20e
2021-04-02 07:15:21 +00:00
Yi-Yo Chiang
20579011cf fs_mgr: Suppress SkipMountingPartitions log in ReadFstabFromFile
Minor refactoring and renaming, goal is to make the follow-up patch
easier to read.

Bug: 184132970
Test: Presubmit
Change-Id: I66416161b30ac310934d901cbaf11bc926e2cbf7
2021-04-02 05:23:02 +00:00
Treehugger Robot
484234a373 Merge "Populate all other emulator properties as ro.boot.qemu.*" am: 6463f60a56 am: 07d6796b6f am: 2915bc3bc8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1661935

Change-Id: Icf30f1bdecceec8bf857b35473f238d54a0168e6
2021-04-02 00:11:40 +00:00
Roman Kiryanov
bcc7946ef0 Populate all other emulator properties as ro.boot.qemu.*
Bug: 182291166
Test: getprop | grep "ro\.boot\.qemu\."
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I0d2a4a9edd87999b35fac8496e9cda93fc7d0cf1
2021-04-01 11:39:30 -07:00
Yi-Yo Chiang
731d2473da Load *_compat_cil_file from system_ext as well
So we can extend platform policies with target specific compat rules.
This use case surface in the context of system only upgrade, when the
vendor policy cannot be updated, then the system_ext partition can
contain target specific compat policies.

Bug: 183362912
Test: Presubmit
Change-Id: Ic6436eb8a269f07f932331dedf7dbaa629538ade
2021-03-30 13:05:50 +08:00
Treehugger Robot
752c3c7f83 Merge "Populate more emulator properties to ro.boot." am: 5d5e16db57 am: 669af0aa1e am: 68301b2ddd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624567

Change-Id: I5a9a706afc8d5b87edbb85297b7be591bada972f
2021-03-23 21:12:50 +00:00
Treehugger Robot
942ceeb60a Merge "Do not populate ro.kernel.qemu in ProcessKernelCmdline" am: e37b6f4f67 am: fddb2e3b98 am: 5189edc2c2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1649687

Change-Id: I58dc487de0ce1d3da041c58e3e6f41f77fa403ef
2021-03-23 11:35:34 +00:00
Roman Kiryanov
4ddfd023cc Populate more emulator properties to ro.boot.
ro.boot.config.low_ram
ro.boot.dalvik.vm.heapsize
ro.boot.debug.hwui.renderer
ro.boot.debug.stagefright.ccodec
ro.boot.opengles.version

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I4d7ee19feb13a418a95f31be7534df98dfaeb3e3
2021-03-22 14:34:36 -07:00
Roman Kiryanov
94ce40a527 Do not populate ro.kernel.qemu in ProcessKernelCmdline
The emulator migrated to `ro.boot.qemu`.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Iaa3bdff5cc1efa79c21ae2dc2bdf7ec74731f66c
2021-03-22 14:18:44 -07:00
Will McVicker
b8325c03a0 Merge "init: fix debuggable paths for recovery mode" am: fb9953e4d3 am: dc64a95871 am: f737aa8549
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1634601

Change-Id: Ia4b0829d0a921331444477e447ce9687d8a04dfb
2021-03-18 23:35:37 +00:00
Will McVicker
8891c2002e init: fix debuggable paths for recovery mode
Since recovery mode doesn't switch root to /first_stage_ramdisk, we need
to update the debuggable file paths for recovery mode. Without this,
adb needs to be authorized in recovery mode even with a debug
vendor_ramdisk.

Bug: 182612208
Test: verify adb is authorized on pixel 5
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I557429e1834efcdd92ba0e135377055ffa677137
2021-03-17 18:53:48 +00:00
Alistair Delva
1fa0bd44f0 Merge "init: check for verifiedbootstate in properties" am: fb1cffb46b am: daa9eebcf4 am: 0cf1df828e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1625199

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd08ea7daa8aff0f2f81a1b71867ca819068d392
2021-03-15 05:44:34 +00:00
Alistair Delva
fb1cffb46b Merge "init: check for verifiedbootstate in properties" 2021-03-15 04:03:17 +00:00
Inseob Kim
69bab73587 Merge "Allow precompiled sepolicy w/o system_ext/product" am: b56165cce3 am: cdac5b72f0 am: dc0a85cfe4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1626229

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iff9e0ab96c9b9478d2a5d3d9d9de5bec16227afe
2021-03-14 16:52:08 +00:00
Inseob Kim
b56165cce3 Merge "Allow precompiled sepolicy w/o system_ext/product" 2021-03-14 15:28:42 +00:00
Roman Kiryanov
a69b993066 Merge "Populate ro.boot.qemu for the emulator device" am: dce1f88bfb am: b132468af1 am: e506d1862f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624291

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0a0f8cf848e1a36c6e28d6207b1b4781f6272528
2021-03-12 07:34:07 +00:00
Roman Kiryanov
2f45ab60f7 Merge "Populate only emulator specific properties into ro.kernel." am: 7787e70417 am: 7cf1c09c6c am: 917c6e0daa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1625179

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic5cadcc08201136e3918acd073e85ef752f875f5
2021-03-12 07:33:56 +00:00
Roman Kiryanov
2a2de564fb Merge "Move the androidboot. literal into its own variable" am: a3d37ac9b2 am: 8c1cd62d10 am: 49340ac490
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624290

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic15bdcb74224fa495b614d13f56960dcd4598d13
2021-03-12 06:13:42 +00:00
Roman Kiryanov
dce1f88bfb Merge "Populate ro.boot.qemu for the emulator device" 2021-03-12 06:06:03 +00:00
Roman Kiryanov
7787e70417 Merge "Populate only emulator specific properties into ro.kernel." 2021-03-12 06:05:35 +00:00
Roman Kiryanov
a3d37ac9b2 Merge "Move the androidboot. literal into its own variable" 2021-03-12 04:32:13 +00:00
Inseob Kim
d99d977f17 Allow precompiled sepolicy w/o system_ext/product
Some devices might not have system_ext or product partitions. But init
has been refusing to use precompiled sepolicy because init always checks
system / system_ext / product hashes, regardless of existence. This
makes system_ext and product optional, so hash check can be skipped for
non-existing partitions. Of course system is always checked.

Bug: 181640066
Test: boot microdroid and cuttlefish, see precompiled sepolicy works
Change-Id: I32c296fffd894c27097e8b4e10ade977a21d61ab
2021-03-12 11:40:15 +09:00
Roman Kiryanov
4a47c74b75 Populate ro.boot.qemu for the emulator device
Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ied78f42363c1f6580fe6e5660b14c257960aed98
2021-03-11 16:49:17 -08:00
Roman Kiryanov
1a705d4943 Populate only emulator specific properties into ro.kernel.
`ro.kernel.` is an emulator specific prefix.

Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: Ie4a19127f05f3074ccb02bd055711e9b70702ba6
2021-03-11 16:48:26 -08:00
Roman Kiryanov
ccc15c5dbd Move the androidboot. literal into its own variable
Bug: 182291166
Test: presubmit
Signed-off-by: Roman Kiryanov <rkir@google.com>
Change-Id: I19f25671c82fff34dd52e3557361c4340706aab0
2021-03-11 16:46:00 -08:00
Alistair Delva
4b03eee5ca Merge changes from topic "bootconfig-selinux-property" am: c19a7dd30e am: aff8b2da5c am: 3104a550af
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624584

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie71107e6f7797c0c4026cbc1786c5d683ea7b42d
2021-03-11 17:00:55 +00:00
Alistair Delva
4ea63b727e Allow android_dt_dir to be set by bootconfig am: 3bb240bd4c am: 7d0bfb1956 am: 696017ac7c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624583

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I282bd9e51c8c6947e026a4ac3268d967394a804f
2021-03-11 17:00:52 +00:00
Alistair Delva
7d0bfb1956 Allow android_dt_dir to be set by bootconfig am: 3bb240bd4c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624583

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I08c06f25e2098dbf8e27028a0984fea4d26ee9c8
2021-03-11 16:16:53 +00:00
Alistair Delva
c19a7dd30e Merge changes from topic "bootconfig-selinux-property"
* changes:
  Allow selinux to be set by bootconfig
  Allow android_dt_dir to be set by bootconfig
2021-03-11 15:52:02 +00:00
Devin Moore
7cb6333dc2 Merge "Handle "hardware" bootconfig parameter as "androidboot.hardware"" am: 394a1ede40 am: 330ade5851 am: 0ca6f1617b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1624139

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib37e60a69e8d2b631a5d6d3e5a6659d482885169
2021-03-11 03:21:52 +00:00
Devin Moore
0a799bdfd6 Handle "hardware" bootconfig parameter as "androidboot.hardware"
The parameter "androidboot.hardware" has been removed from bootconfig
and replaced by "hardware" parameter.

Test: launch_cvd with 4.19 and 5.10 kernels
Test: atest CtsFsMgrTestCases
Bug: 173815685
Change-Id: I627426ae1bd0a165b70b8f2584ec184abfb4236f
2021-03-09 14:10:48 -08:00
Devin Moore
6c01baf075 init: check for verifiedbootstate in properties
This check in export_oem_lock_status happens after PropertyInit() so
all of the ro.boot.* properties will be set. There is no need to import
the kernel cmdline again.

Test: build and boot cuttlefish
Bug: 173815685
Change-Id: I5df7c0105566d4617442dbb8e77eb26e465775f1
2021-03-09 13:56:25 -08:00
Alistair Delva
63594a4dbc Allow selinux to be set by bootconfig
The androidboot.selinux property is loaded in a special way, because it
happens in the "selinux_setup" stage, and not the true second stage.
Allow it to be passed through bootconfig instead of only via the kernel
cmdline.

Bug: 173815685
Test: launch_cvd -extra_kernel_cmdline androidboot.selinux=permissive
Test: launch_cvd -guest_enforce_security=false [bootconfig method]
[..]
init: Permissive SELinux boot, forcing sys.init.perf_lsm_hooks to 1.
[..]
Change-Id: I92003c7a2dac5d6e7d0e0f4ee2757f86cc0087c7
2021-03-09 19:18:50 +00:00
Alistair Delva
3bb240bd4c Allow android_dt_dir to be set by bootconfig
The androidboot.android_dt_dir property is special, because it is loaded
to find out where to get the other DT properties from, and those DT
properties are supposed to override the cmdline/bootconfig ones. So, it
need special casing, and that special case lacked bootconfig support.

Bug: 173815685
Test: launch_cvd -extra_kernel_cmdline androidboot.android_dt_dir=/tmp
[..]
init: Using Android DT directory /tmp
[..]
Change-Id: Ie0958dd0a96394d65f6568653b754ea6f885212e
2021-03-09 19:14:17 +00:00
David Anderson
b8112a37c3 Merge "init: only mlock() system pages when performing snapuserd transitions." am: c90fce4387 am: 0d462c23e0 am: a1e59f9d10
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1621424

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3af8018a6e83c9016eb0c7acbca9b4b40a837258
2021-03-08 21:26:42 +00:00
Devin Moore
a924cec7ff init: handle more bootconfig parameters am: 79058486d2 am: 786355f304 am: 2bdd018b39
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1615298

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5ce7e91c2da7b115316dd4393bd723012c3ebbca
2021-03-08 20:13:05 +00:00
David Anderson
c90fce4387 Merge "init: only mlock() system pages when performing snapuserd transitions." 2021-03-08 19:32:34 +00:00
Devin Moore
786355f304 init: handle more bootconfig parameters am: 79058486d2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1615298

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3a7250bb7c6a7694eb2431d31d9f104721a9507b
2021-03-08 18:44:30 +00:00
Devin Moore
7c98b89886 Merge changes from topic "bootconfig_args"
* changes:
  fs_mgr: handle more bootconfig parameters
  init: handle more bootconfig parameters
2021-03-08 18:27:50 +00:00
Kiyoung Kim
64349c250d Merge "Check if service is executed before APEX is ready" am: fcb28f5d30 am: 2acff0c5e8 am: ce276e54ea
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1612017

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id706840b209c415a67b35546d9e7871c4e923262
2021-03-08 01:39:12 +00:00
Kiyoung Kim
fcb28f5d30 Merge "Check if service is executed before APEX is ready" 2021-03-07 23:56:06 +00:00
David Anderson
9fd8862741 init: only mlock() system pages when performing snapuserd transitions.
Bug: 181032115
Test: manual test w/ VABC OTA
Change-Id: Ib4d2856b9b5eaf8688534f9d84edeb64d4b3244d
2021-03-05 15:44:25 -08:00
Devin Moore
79058486d2 init: handle more bootconfig parameters
As parameters are moved from kernel cmdline to bootconfig,
first_stage_init needs to be updated to handle the new
location.
/proc/bootconfig should be checked first, if not present, then check
/proc/cmdline.

Test: launch_cvd
Test: launch_cvd with 4.19 kernel artifacts that do not support
bootconfig
Test: Both of the above configurations with --num_instances 0 or 4
Test: Both configurations with androidboot.boot_devices or
androidboot.boot_device set
Bug: 173815685

Change-Id: I03743f922351d58375e8b9a903899b8bc54bd71e
2021-03-05 09:21:19 -08:00
Kiyoung Kim
0cbee0de2a Check if service is executed before APEX is ready
Any service which is executed when Runtime apex is mounted, but
linkerconfig is not updated can fail to be executed due to missing
information in ld.config.txt. This change updates init to have a status
variable which contains if current mount namespace is default
and APEX is not ready from ld.config.txt, and use bootstrap namespace if
it is not ready.

Bug: 181348374
Test: cuttlefish boot succeeded
Change-Id: Ia574b1fad2110d4e68586680dacbe6137186546e
2021-03-05 16:42:20 +09:00
Treehugger Robot
c72c69e42d Merge "Detect the absence of the default fstab" am: d9b7c9b4a7 am: 900c6010e0 am: 8cc232422c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1607906

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib919bfa1a2d939ae7ca7629be2ac6836b99b8bb5
2021-03-02 23:27:06 +00:00
Treehugger Robot
900c6010e0 Merge "Detect the absence of the default fstab" am: d9b7c9b4a7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1607906

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1f5b467eab74cc86c525a09210811e51459dab97
2021-03-02 21:50:30 +00:00
Jiyong Park
c6f19688f8 Detect the absence of the default fstab
This is a follow-up of I828ce999be6d786bf46dd5655dfda81d046906ab. The
change introduced a behavioral change that fstab is read twice: before
root is changed to /first_stage_ramdisk, and once again after that.
Previously, that happend only after the root is switched. That change
caused a problem when there is no fstab in DT and fstab is provided via
a file. The fstab file has been at
/first_stage_ramdisk/fstab.<hardware> because that file was supposed to
be read after the root switch.

With the change, init fails to read the fstab during the first attempt
because there is no /fstab.<hardware> at the moment. Here comes the
problem. Although it failed to read fstab, DoCreateService() is invoked
because ReadFirstStageFstab() doesn't report the failure; it returns an
empty fstab object. As a result, DoCreateDevices() is called but it
doesn't create the dm linear device because it couldn't find an fstab
entry having `logical` option.

Then after /first_stage_ramdisk becomes the root, the fstab file is
correctly read. But since the prior run of DoCreateDevices() is recorded
as 'done', init doesn't try to do that again; dm linear device is never
created. Then we fail to mount any of the logical partitions.

This change fixes the problem by modifying ReadFirstStageFstab()
function so that the failure is correctly reported back to the caller.
When it fails, DoCreateDevices() is not called.

Bug: N/A
Test: Watch TH
Change-Id: Idf2dbc6c0fb6c311ab3f5ff1f28315f7daa2b4ce
2021-02-26 17:58:34 +09:00
Treehugger Robot
2ba8fdfe2a Merge "first_stage_mount: Create snapshot devices before launching first_stage_console" am: 0c931aa993 am: c30a2b00ca am: 02a1995eec
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1565166

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie422200b33f48618c6f215c5444b49fcafdb10b0
2021-02-25 23:19:29 +00:00
Treehugger Robot
c30a2b00ca Merge "first_stage_mount: Create snapshot devices before launching first_stage_console" am: 0c931aa993
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1565166

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6d92b22489e5bae7acbe7ae7e0ecbf3f738ba719
2021-02-25 21:49:12 +00:00
Treehugger Robot
0c931aa993 Merge "first_stage_mount: Create snapshot devices before launching first_stage_console" 2021-02-25 20:58:12 +00:00
Devin Moore
37377229af Merge "Support bootconfig in first stage init and fs_mgr" am: cb4ebecbbd am: 7e3beff24e am: bf810e9d93
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1580792

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id4b0bc6dab41d30be112065770c85da6efffb353
2021-02-24 17:57:26 +00:00
Devin Moore
7e3beff24e Merge "Support bootconfig in first stage init and fs_mgr" am: cb4ebecbbd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1580792

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib5cdbb7f02f963b8316439f3f9d6c0d656503155
2021-02-24 16:40:07 +00:00
Devin Moore
a4ef15bebb Support bootconfig in first stage init and fs_mgr
Androidboot parameters are being moved from the kernel commandline to
bootconfig.
fs_mgr looks for these parameters in properties and falls back to
reading directly from /proc/cmdline. So both of these sources are
updated for bootconfig.
The androidboot parameters from /proc/bootconfig
are added as ro.boot properties, and fs_mgr will fall back to searching
/proc/bootconfig if it is too early.

Test: boot cuttlefish with androidboot.fstab_suffix and
androidboot.hardware in bootconfig and not in cmdline.
Test: atest CtsFsMgrTestCases
Bug: 173815685

Change-Id: Iea36a0da94c26e1aa37d97c576725e0ad77cd3ad
2021-02-23 07:42:06 -08:00
TreeHugger Robot
38aa1b393d Merge "Merge ab/7061308 into stage." into stage-aosp-master 2021-02-23 08:45:48 +00:00
Treehugger Robot
183a133977 Merge "Revert^2 "Remove ART APEX from the bootstrap apexes"" am: acc82258cc am: 15108cd4a6 am: 059cf3a6ab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581185

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8e38d2670e2fc2daa039aea9848b25a783153aff
2021-02-23 03:15:04 +00:00
Treehugger Robot
059cf3a6ab Merge "Revert^2 "Remove ART APEX from the bootstrap apexes"" am: acc82258cc am: 15108cd4a6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581185

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6846b4c09d601ca10eaf3b957bba7d62655881a3
2021-02-23 02:17:22 +00:00
Treehugger Robot
acc82258cc Merge "Revert^2 "Remove ART APEX from the bootstrap apexes"" 2021-02-23 00:47:22 +00:00
satayev
d317757826 Merge "Introduce load_exports action." am: 7f9fabad4f am: d30a6991bf am: ef9cb4ecf2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1589512

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ica66311b956b1645b2103da6dcfb7f4799ebf944
2021-02-22 19:06:17 +00:00
satayev
ef9cb4ecf2 Merge "Introduce load_exports action." am: 7f9fabad4f am: d30a6991bf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1589512

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I18290eedeb9b6c832a5919a9d3f0e978af24bda3
2021-02-22 18:45:08 +00:00
satayev
7f9fabad4f Merge "Introduce load_exports action." 2021-02-22 17:14:19 +00:00
Lisa (LeeWei) Liu
df57474f63 Merge "init: ro.boottime.init.modules" am: 74b03a16be am: 02d2bcf0f6 am: 2f223491a4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1574952

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icff0d087f53cda187636f5e2f56c94f1f8e7c2ee
2021-02-22 04:19:28 +00:00
Lisa (LeeWei) Liu
2f223491a4 Merge "init: ro.boottime.init.modules" am: 74b03a16be am: 02d2bcf0f6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1574952

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8affbaf1398519f642bbbb20e61ef19391c450dd
2021-02-22 03:50:40 +00:00
Lisa (LeeWei) Liu
74b03a16be Merge "init: ro.boottime.init.modules" 2021-02-22 01:57:17 +00:00
Bob Badour
994fe355d9 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: d0bfde2f78 am: b2145c414a am: 4cf31dacb3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1591651

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3ea2cdf9470b391f3a1067a9f6eb666fd461d92b
2021-02-21 17:31:20 +00:00
Xin Li
493484d39e Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I90ee4644f921d6bde03dbaef3f3e86fc080affaa
Change-Id: I0eff7d54656f2b4da44644429a35bdc5ba954fbc
2021-02-21 09:25:21 -08:00
Bob Badour
4cf31dacb3 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: d0bfde2f78 am: b2145c414a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1591651

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I67de80308f4c4a44d71f597ae9203a47113d245d
2021-02-21 16:53:45 +00:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00