Commit graph

3669 commits

Author SHA1 Message Date
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
Artur Satayev
500946b637 Introduce load_exports action.
The action reads a file with individual `export` actions declared on
each line, and calls `setenv` for each.

See go/updatable-classpath for details on how this is going to be used.

Bug: 180105615
Test: manual
Change-Id: I5390e52cf8ffd9c3babf31ed854eeecc727351eb
2021-02-19 17:12:26 +00:00
Lisa Liu
08c862fa00 init: ro.boottime.init.modules
Add a property ro.boottime.init.modules to provide kernel modules
loading time in milliseconds. Also add corresponding log to show in init
log along with loaded module count.

Test: boot test
Bug: 178143513
Change-Id: I77e3939c2a271da6841350a8c2a34ad32f637377
2021-02-19 15:59:04 +08:00
Treehugger Robot
ab2290b7d2 Merge "Build first-stage init in Soong" am: 9e22a46db9 am: b8eed6199c am: 844eaae056
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1588294

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2d1fa78344f72783d447479176cd2503e6c50792
2021-02-18 00:30:32 +00:00
Treehugger Robot
844eaae056 Merge "Build first-stage init in Soong" am: 9e22a46db9 am: b8eed6199c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1588294

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifa81eb2609fdf1b16783c06c5762e6bf97593a92
2021-02-18 00:08:40 +00:00
Treehugger Robot
f5186a5128 Merge "Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"" am: ca474f994d am: aea25045ba am: fa48b67e98
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1590280

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifdbd05d3e1c993bf1b6c92161669555fba108abd
2021-02-17 00:46:03 +00:00
Treehugger Robot
fa48b67e98 Merge "Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"" am: ca474f994d am: aea25045ba
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1590280

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia4e260336598133c4c5f31e7e1bca3d7c76c368a
2021-02-17 00:25:28 +00:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Treehugger Robot
34add4fe2c Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: d0aa350c02 am: 504895aacb am: d856628451
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1589006

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85c87dc31f7599b64202578ed33587eeadb1650f
2021-02-16 19:41:17 +00:00
Treehugger Robot
d856628451 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" am: d0aa350c02 am: 504895aacb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1589006

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia4581660b38a7782043c41baba6e62dfaae55b72
2021-02-16 18:48:21 +00:00
Bob Badour
187b7d1950 [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:
  Android.bp
  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/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: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Jiyong Park
13eb053a25 Build first-stage init in Soong
The first-stage init has been built in Make due to some requirements
(like placing it directly under the root directory rather than bin/, and
creating mountpoints like /proc, etc.) that are not supported in Soong.

However, Ie06dc5a93635ea8b1e18be517ed8615b6c82fee6 will make it possible
to satisfy the requirements in Soong. The build of the boot image is
done in Soong and we can create mount points using the `dirs` property
and create a symlink /init that points to /bin/init_vendor using the
`symlinks` property.

To complete the picture of build everying in Soong, this change adds a
Soong-version of the first-stage init.

Note that the Soong-based boot image creation is currently only for the
microdroid usecase. Therefore, the Android.mk-based first-stage init
still remains and will be removed later.

Bug: 178562516
Test: m init_first_stage_soong

Change-Id: I278cb60a11d94fb48341fd3592be0652a25bdbfb
2021-02-16 12:21:49 +09:00
Jiyong Park
9c4ecdd84e Revert^2 "Remove ART APEX from the bootstrap apexes"
6d869dd6ab

Change-Id: I24906b7520ae01e586687ae26fcf6d8b63d9978d
2021-02-10 07:17:19 +00:00
Akilesh Kailash
d7a562aaaa Merge "libsnapshot: No transition of snapuserd during second stage init" am: b5f0a3b73b am: c42cac92f7 am: 08ce68c0d3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581175

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iec4df6052ab21cad2e8b55a4ade21d0c706af71e
2021-02-10 02:11:02 +00:00
Akilesh Kailash
08ce68c0d3 Merge "libsnapshot: No transition of snapuserd during second stage init" am: b5f0a3b73b am: c42cac92f7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581175

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4a4497bb19b23470a25a57c5f4822ee096e61799
2021-02-10 01:44:51 +00:00
Akilesh Kailash
03e803455e libsnapshot: No transition of snapuserd during second stage init
When there is a transition of daemon from selinux stage, we observe
intermittent hangs during OTA. This is a workaround wherein
we don't do the transition and allow the daemon to continue which
was spawned during selinux stage.

Bug: 179331261
Test: Incremental OTA, full OTA on pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I622a0ed8afcd404bac4919b1de00728de2c12eaf
2021-02-09 22:45:29 +00:00
Treehugger Robot
27a3410388 Merge "Relax the language around parallel_restorecon." am: cb9e1decf0 am: c9884e0e8b am: b5d4ddf10e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581174

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0431870e70325732436ee00832d8de3f11a5c18d
2021-02-09 13:00:28 +00:00
Treehugger Robot
b5d4ddf10e Merge "Relax the language around parallel_restorecon." am: cb9e1decf0 am: c9884e0e8b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1581174

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iff3e847b75e5e8f4add51f66459d10f4cc3d16b8
2021-02-09 12:32:45 +00:00
David Anderson
bb159ad483 Relax the language around parallel_restorecon.
Bug: 179702321
Change-Id: I030c861d1e676bca63a25317a509fcd2438b664e
2021-02-08 22:30:39 -08:00
Elliott Hughes
eed2499960 Merge "Let the kernel hwrng thread manage hw_random mixing." am: b363fc8b74 am: c5036ee28e am: c444bce2c5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1578124

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If977978ab5765c6fa9dea4c0869c06213a8adb4e
2021-02-06 02:31:59 +00:00
Elliott Hughes
c444bce2c5 Merge "Let the kernel hwrng thread manage hw_random mixing." am: b363fc8b74 am: c5036ee28e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1578124

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I79ec073dbe94d6f625ba73d73ec259d43073ef31
2021-02-06 02:07:55 +00:00
Elliott Hughes
b363fc8b74 Merge "Let the kernel hwrng thread manage hw_random mixing." 2021-02-06 00:52:19 +00:00
Elliott Hughes
eedd38a82a Let the kernel hwrng thread manage hw_random mixing.
This has been something the kernel does automatically since 2014, so
there's no obvious reason to add extra work during boot to duplicate
that effort.

Bug: http://b/179086242
Test: treehugger
Change-Id: I44cce99a892e4f2a6a303c2126bd29f955f5fb23
2021-02-05 11:10:00 -08:00
Elliott Hughes
8a8ef9751d Merge "Remove all the cpp_std: "experimental"s." am: cb1c783530 am: fa49431873 am: 5e67bba69f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1575483

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If89bf968b4686358498220994fe3f8f2549c4b79
2021-02-05 03:37:55 +00:00
Elliott Hughes
5e67bba69f Merge "Remove all the cpp_std: "experimental"s." am: cb1c783530 am: fa49431873
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1575483

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2865007a4be31eff6570f5f6eab1ce2bf6971017
2021-02-05 02:49:47 +00:00
Elliott Hughes
9bfd986422 Remove all the cpp_std: "experimental"s.
None of them are necessary, and it's more intention-revealing to say
`c++2a` or whatever anyway.

Test: treehugger
Change-Id: Ie1df26499d160d6fc757d17fcb0121997bda14f9
2021-02-04 09:05:01 -08:00
Bart Sears
57bae7a731 Merge "Revert "Remove ART APEX from the bootstrap apexes"" am: 6ba9afd1e9 am: 15de287cfc am: fb8c06ab94
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1566910

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id6f5630d5ccebfdffac8fb28ab097e914973ae60
2021-02-02 03:19:01 +00:00
Bart Sears
fb8c06ab94 Merge "Revert "Remove ART APEX from the bootstrap apexes"" am: 6ba9afd1e9 am: 15de287cfc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1566910

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic4261c67c795e49cfbba1044b5a3d12d617956ae
2021-02-02 02:43:39 +00:00
chapin
6d869dd6ab Revert "Remove ART APEX from the bootstrap apexes"
Revert submission 1563392-remove_art_from_bootstrap

Reason for revert: Bug: 179002105
Reverted Changes:
I65e2a2089:Remove ART APEX from the bootstrap apexes
Ic20df80e2:Remove ART APEX from the bootstrap apexes

Change-Id: I474ab95805c5ca28e0bba91f3d226e8db5a7a9ea
2021-02-01 22:29:59 +00:00
Elliot Berman
d96d0f7d58 first_stage_mount: Create snapshot devices before launching first_stage_console
During device bringup, dynamic partitions may not be properly
configured by some sort of build or load misconfiguration. Diagnosing
such issues can be difficult without being able to see which partitions
are available and what they contain.

Aditionally, making logical partitions available to first stage console
permits early mounting of vendor partition and allows primitive
validation of vendor scripts without requiring full Android
environment. For instance, vendor_dlkm partition and modules can be
probed needing to have a full Android bootup.

Creation of logical partitions is done only when first_stage_console is
requested in order to have minimal impact on normal boot. Thus, only a
small refactor is required to split CreateLogicalPartitions out of
MountPartitions.

Bug: 174685384
Bug: 173732805
Change-Id: I828ce999be6d786bf46dd5655dfda81d046906ab
Signed-off-by: Elliot Berman <eberman@quicinc.com>
2021-01-31 01:35:18 -08:00
Treehugger Robot
391f695eda Merge "Remove ART APEX from the bootstrap apexes" am: dfab416188 am: 7472ac1537 am: 9b147f7347
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1563459

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6a15d3bf7d0d888ace8db46979570bad0437e0ff
2021-01-30 04:57:25 +00:00
Treehugger Robot
9b147f7347 Merge "Remove ART APEX from the bootstrap apexes" am: dfab416188 am: 7472ac1537
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1563459

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I23524bc7a2b30598cf096b1b52bf2606ecf03eca
2021-01-30 04:37:55 +00:00
Jiyong Park
b99c12ef10 Remove ART APEX from the bootstrap apexes
Test: forrest
Bug: 169779935
Change-Id: I65e2a2089fa12674f3abbbe2f154eeec984dd5df
2021-01-29 12:08:31 +09:00
Tianjie Xu
ed839dc4b9 Merge "Set hashtree algorithm for verity partitions" am: b9c7459fba am: 161e4a8e24 am: 33e1b08f0e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1553475

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0b9d32da9daa63c630eef7e9071e309beabb8a9d
2021-01-28 04:28:15 +00:00
Tianjie Xu
33e1b08f0e Merge "Set hashtree algorithm for verity partitions" am: b9c7459fba am: 161e4a8e24
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1553475

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5ca90dacea5c14500cb95522369de3064efb9fbc
2021-01-28 04:09:51 +00:00
Tianjie Xu
b9c7459fba Merge "Set hashtree algorithm for verity partitions" 2021-01-28 03:03:21 +00:00
Treehugger Robot
be40d700cf Merge "ueventd: deprecate paths without /etc/" am: 587f5e922c am: 5850f8efd6 am: c0aeaaba14
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526382

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3b6386acf9656c60425bb6a9150366bd22aac685
2021-01-27 04:18:11 +00:00
Treehugger Robot
c557cbb679 Merge "Make second stage init visible to microdroid" am: e8cc75f059 am: 405bb6ed44 am: e4dd4f554a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1557543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I849ba5086f4e44025056b659d0055a97a7a27093
2021-01-27 04:10:59 +00:00
Treehugger Robot
c0aeaaba14 Merge "ueventd: deprecate paths without /etc/" am: 587f5e922c am: 5850f8efd6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526382

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7ebecc9c845cac20dc5af3aee66abab067fd9fb6
2021-01-27 01:13:54 +00:00
Treehugger Robot
e4dd4f554a Merge "Make second stage init visible to microdroid" am: e8cc75f059 am: 405bb6ed44
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1557543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2a996964a1694bdf21119ae72b0312e232386e17
2021-01-27 01:13:21 +00:00
Treehugger Robot
587f5e922c Merge "ueventd: deprecate paths without /etc/" 2021-01-26 23:53:54 +00:00
Treehugger Robot
e8cc75f059 Merge "Make second stage init visible to microdroid" 2021-01-26 23:47:46 +00:00
Tom Cherry
71dd7064cc ueventd: deprecate paths without /etc/
ueventd.rc scripts belong in the /etc/ directory of their given
partition, not the root of the partition.  This can cause problems,
especially since Android.bp cannot write to the root directly, forcing
vendors to use Android.mk for these files.  Note that
/system/etc/ueventd.rc moved long ago.

Test: Tree-hugger
Change-Id: I2dcaafc3c3f687f76ab6bc38af979c8b43346db0
2021-01-26 12:26:09 -08:00
Treehugger Robot
e2b0d1a809 Merge "Revert "first_stage_mount: Create snapshot devices before launching first_stage_console"" am: f2d359cbaa am: 72cca38225 am: 6b8a836733
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1558926

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I946713041b7eb36e9c79fda1405a8fb95557af49
2021-01-26 19:23:00 +00:00
Treehugger Robot
6b8a836733 Merge "Revert "first_stage_mount: Create snapshot devices before launching first_stage_console"" am: f2d359cbaa am: 72cca38225
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1558926

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6770e5889b05388c5d44ced44b509d50a5b6eaa0
2021-01-26 18:41:52 +00:00
Yiwei Zhang
4c467e3c15 Revert "first_stage_mount: Create snapshot devices before launching first_stage_console"
This reverts commit 9583e92257.

Reason for revert: <fail to flash a device>
Bug: 178433260

Change-Id: I0e9ab3eff38ddf9ad420cf1479eca16f6f29d1b5
2021-01-26 06:00:46 +00:00
David Anderson
262e7ca1f6 Merge changes I82b7d77b,I6b77690c am: ad7d1d13a4 am: 85d6c1cff5 am: 3526a48e87
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526995

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I36ff5ab45ba8a5073dfd7fef1c5bbabce0b85ad1
2021-01-25 22:22:11 +00:00
David Anderson
3526a48e87 Merge changes I82b7d77b,I6b77690c am: ad7d1d13a4 am: 85d6c1cff5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526995

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3865a6659fdc430e9573e9fe5e8a522520b76438
2021-01-25 21:56:04 +00:00
Elliot Berman
9583e92257 first_stage_mount: Create snapshot devices before launching first_stage_console
During device bringup, dynamic partitions may not be properly
configured by some sort of build or load misconfiguration. Diagnosing
such issues can be difficult without being able to see which partitions
are available and what they contain.

Aditionally, making logical partitions available to first stage console
permits early mounting of vendor partition and allows primitive
validation of vendor scripts without requiring full Android
environment. For instance, vendor_dlkm partition and modules can be
probed needing to have a full Android bootup.

Creation of logical partitions is done only when first_stage_console is
requested in order to have minimal impact on normal boot. Thus, only a
small refactor is required to split CreateLogicalPartitions out of
MountPartitions.

Bug: 174685384
Bug: 173732805
Change-Id: I82b7d77b9dc75af59b5e18b574e3eb99c8aff9e2
Signed-off-by: Elliot Berman <eberman@quicinc.com>
2021-01-25 09:53:36 -08:00
Elliot Berman
a619f22e37 first_stage_mount: Move CreateLogicalPartitions to DoFirstStageMount
In preparation for later commit:
   first_stage_mount: Create snapshot devices before launching
first_stage_console

Bug: 173732805
Bug: 174685384
Change-Id: I6b77690c7cf68f6235c99bf4ff897b0ee41c4d0e
Signed-off-by: Elliot Berman <eberman@quicinc.com>
2021-01-25 09:53:35 -08:00
Jiyong Park
903537884f Make second stage init visible to microdroid
microdroid is the base image for on-device VMs. We will use Android
components (init, adbd, servicemanager, ...) on the VM as much as
possible.

Bug: 177630284
Test: m microdroid
Change-Id: I36890644baaaf8f441698411dd869ddb220734fb
2021-01-25 19:12:17 +09:00
Woody Lin
106eb02fe6 Merge "Add init.svc_debug.no_fatal.<svc_name> to skip SVC_CRITICAL" am: 81bf17ce0f am: 1d24da452d am: 568cd24f41
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1554980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7244d08c7956d28b664e17057b9f587d38ef7498
2021-01-23 01:43:11 +00:00
Woody Lin
568cd24f41 Merge "Add init.svc_debug.no_fatal.<svc_name> to skip SVC_CRITICAL" am: 81bf17ce0f am: 1d24da452d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1554980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I24d7311db98edd38ae5b58c5943c1f5851b64594
2021-01-23 01:27:57 +00:00
Woody Lin
ef9d460ea8 Add init.svc_debug.no_fatal.<svc_name> to skip SVC_CRITICAL
For user who would like to retain the crash symptom and avoid device
from power cycle for live debugging, set
init.svc_debug.no_fatal.<svc_name> to "true" to skip FATAL reboot.

Bug: 177593855
Change-Id: I0bdb6191e5963c08e1ea301a60060acf916dd49b
2021-01-22 15:01:36 +08:00
Tianjie
327237d13a Set hashtree algorithm for verity partitions
This is used in cts tests to verify that algorithms in blocklist aren't
used to build the hashtree. The system properties are required to perform
the check on unrooted devices.

Bug: 175236047
Test: flash, getprop; atest CtsNativeVerifiedBootTestCases

Change-Id: I2dcfdb06f85dbe92cde45e836dd68e7bd835020f
2021-01-20 19:02:34 -08:00
Treehugger Robot
0033d173ec Merge "Make ro.product.cpu.abilist* to be fetched dynamically" am: 8e3826b8b1 am: e45bdf9293 am: 1e1836140c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1538764

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iccc60c4977bec77e30c2bc0868b484fe27ad02eb
2021-01-15 13:59:18 +00:00
Treehugger Robot
1e1836140c Merge "Make ro.product.cpu.abilist* to be fetched dynamically" am: 8e3826b8b1 am: e45bdf9293
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1538764

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I682ffbdbf13c875a6fabad658cf03edca0009c84
2021-01-14 18:49:55 +00:00
Treehugger Robot
8e3826b8b1 Merge "Make ro.product.cpu.abilist* to be fetched dynamically" 2021-01-14 18:34:21 +00:00
Treehugger Robot
c7a6f9d544 Merge "Let init mount/unmount debugfs for non-user builds" am: 8376d87e2d am: 2bd8b0a33a am: 54be11cf54
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1542228

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iad2c594e104d94f792ec1cbb34627397be42cff9
2021-01-13 05:52:23 +00:00
Treehugger Robot
54be11cf54 Merge "Let init mount/unmount debugfs for non-user builds" am: 8376d87e2d am: 2bd8b0a33a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1542228

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1c78fb1c001db0cba52db0135b449c73b56dc5ee
2021-01-13 05:32:50 +00:00
Treehugger Robot
8376d87e2d Merge "Let init mount/unmount debugfs for non-user builds" 2021-01-13 04:24:22 +00:00
SzuWei Lin
db8d87c646 Merge "Deprecate /factory" am: bedae3910c am: 232c427b52 am: 977b7d21bc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1547514

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I199e2acf90c7166e66e8f27084e1007076e08411
2021-01-13 02:18:26 +00:00
SzuWei Lin
977b7d21bc Merge "Deprecate /factory" am: bedae3910c am: 232c427b52
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1547514

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id1355101b19f7bedabba3ff58d93ac20273e6666
2021-01-13 01:59:57 +00:00
SzuWei Lin
bedae3910c Merge "Deprecate /factory" 2021-01-13 01:11:43 +00:00
Hridya Valsaraju
fb921a1c4e Let init mount/unmount debugfs for non-user builds
This change will help non-user builds with keeping debugfs
disabled during run time. Instead, debugfs will be mounted by init
to enable boot time initializations to set up vendor debug data
collection and unmounted after boot. It will be also be mounted by
dumpstate for bug report generation and unmounted after.

This change is only intended to help vendors (who depend on debugfs to
collect debug information from userdebug/eng builds) keep debugfs
disabled during runtime. Platform code must not depend on debugfs at all.

Test: manual
Bug: 176936478
Change-Id: I2e89d5b9540e3de094976563682d4b8c5c125876
2021-01-12 14:41:53 -08:00
David Anderson
9051b026d3 Merge changes from topic "snapuserd-selinux" am: 270c98f190 am: 956696c7d8 am: efe26e5380
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1546849

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic8d0f4386a9d3d9d9bcee8dbe788f244014b11fd
2021-01-12 22:24:51 +00:00
David Anderson
efe26e5380 Merge changes from topic "snapuserd-selinux" am: 270c98f190 am: 956696c7d8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1546849

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ecbf88e6ecaf4ef62cc2c171519fbf461c4ab4a
2021-01-12 22:08:49 +00:00
SzuWei Lin
478868826f Deprecate /factory
After Treblized, AOSP do not handle /factory folder. Also, AOSP
does not mount any partition to /factory. /factory has no possibility
to have any content. For factory purpose, it can be implemented in
vendor.

Bug: 177280838
Test: na
Change-Id: I0a2537336c2ef1efbad3e4f9e876aeaa607bc737
2021-01-12 12:18:39 +08:00
David Anderson
491e4da372 init: Add an selinux transition for snapuserd.
With compressed VAB updates, it is not possible to mount /system without
first running snapuserd, which is the userspace component to the dm-user
kernel module. This poses a problem because as soon as selinux
enforcement is enabled, snapuserd (running in a kernel context) does not
have access to read and decompress the underlying system partition.

To account for this, we split SelinuxInitialize into multiple steps:

First, sepolicy is read into an in-memory string.

Second, the device-mapper tables for all snapshots are rebuilt. This
flushes any pending reads and creates new dm-user devices. The original
kernel-privileged snapuserd is then killed.

Third, sepolicy is loaded from the in-memory string.

Fourth, we re-launch snapuserd and connect it to the newly created
dm-user devices. As part of this step we restorecon device-mapper
devices and /dev/block/by-name/super, since the new snapuserd is in a
limited context.

Finally, we set enforcing mode.

This sequence ensures that snapuserd has appropriate privileges with a
minimal number of permissive audits.

Bug: 173476209
Test: full OTA with VABC applies and boots
Change-Id: Ie4e0f5166b01c31a6f337afc26fc58b96217604e
2021-01-08 16:39:51 -08:00
SzuWei Lin
0061d4da01 Make ro.product.cpu.abilist* to be fetched dynamically
Basically, ro.product.cpu.abilist* are defined by
ro.vendor.cpu.abilist*. And they can be overried by
ro.odm.cpu.abilist* and ro.product.cpu.abilist*.
ro.system.cpu.abilist* are for fallback if others are no defined.

Bug: 176520383
Test: check the result by flashing aosp_arm64-userdebug on
Test: aosp_blueline-user and aosp_blueline-user hacked by
Test: 64-bits-only
Change-Id: I01ae01af099a4ec8fe3d4525edecc233a477ff60
2021-01-08 15:02:42 +08:00
Nicolas Geoffray
a782a5c8d6 Merge "Add boot animation progress system property." am: 5266e041ef am: 6d2e6e246c am: 69fab4410c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1530810

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifde01593e054ae005cb58d7d4d58380da4103629
2021-01-07 10:18:08 +00:00
Nicolas Geoffray
69fab4410c Merge "Add boot animation progress system property." am: 5266e041ef am: 6d2e6e246c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1530810

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib39e27f457e40ca98b79250a3a51626147b2ea68
2021-01-07 10:02:53 +00:00
Nicolas Geoffray
5266e041ef Merge "Add boot animation progress system property." 2021-01-07 09:23:35 +00:00
Jiyong Park
8957b3267e Merge "init: Sort the list of flattened APEX folders to avoid variations" am: 0f2c5417c3 am: 570fe2083c am: 8b40485f58
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1538222

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie86d99f0e8ff660a3b2fcce76c19590e4f12318c
2020-12-31 05:08:15 +00:00
Jiyong Park
8b40485f58 Merge "init: Sort the list of flattened APEX folders to avoid variations" am: 0f2c5417c3 am: 570fe2083c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1538222

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I90ee4644f921d6bde03dbaef3f3e86fc080affaa
2020-12-31 04:34:56 +00:00
Adrian DC
9449583bc3 init: Sort the list of flattened APEX folders to avoid variations
* In 'ActivateFlattenedApexesFrom', the 'readdir' detects
   the APEX folders in a random way that depends on filesystems,
   built packages and order of the build chain

 * In normal cases, this is not an issue, however when building
   with Go configurations, we have a case where the package
   'com.android.tethering.inprocess' is built along the
   'com.android.tethering' overriden binary, and depending on
   the 'readdir' output, the mounts break the Tethering service

Change-Id: I8ac4a0284d8d885f732c71e846933869cf16a0bd
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2020-12-30 22:41:33 +01:00
Bernie Innocenti
5e5916375f Merge "Add explicit Result::ok() checks where needed" am: bc053268cf am: 0b0c5424a8 am: d2a4c1f841
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1229625

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2c670a3776c37b7d60e89469e13ec32c3172fee2
2020-12-22 07:02:53 +00:00
Bernie Innocenti
d2a4c1f841 Merge "Add explicit Result::ok() checks where needed" am: bc053268cf am: 0b0c5424a8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1229625

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I66dafc280da0421afccadcd6c1c24e74dc306bf2
2020-12-21 19:20:02 +00:00
Bernie Innocenti
062ef5356d Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests
Exempt-From-Owner-Approval: mechanical mass refactoring
Change-Id: I8d40b1e3cb5d2f76baf77b8a190df4366909f7b6
2020-12-20 17:06:17 +00:00
Treehugger Robot
e84a8425b4 Merge "init: don't generate tombstones for expected test failures" am: 0b8d2fef69 am: 2a90da3ea8 am: 2d50616415
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1529980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I038d020bf27c45c1ab74a98f8f2e8c4817bde3df
2020-12-15 19:11:19 +00:00
Treehugger Robot
2d50616415 Merge "init: don't generate tombstones for expected test failures" am: 0b8d2fef69 am: 2a90da3ea8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1529980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I96debd5144ce163cdab07a7018208858e17658f4
2020-12-15 19:02:55 +00:00
Nicolas Geoffray
e106f0aaeb Add boot animation progress system property.
Test: m
Bug: 175686819
Change-Id: Ic2757054b908e2c7ff51e256e8683616df74fb33
2020-12-15 18:34:47 +00:00
Treehugger Robot
0b8d2fef69 Merge "init: don't generate tombstones for expected test failures" 2020-12-15 18:22:09 +00:00
Nikita Ioffe
4511691572 Merge "Log start of the test to logcat" am: 356b184468 am: e7f989d826 am: 3f473c9dfb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526419

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0dc82c58cef51b6145af52dc5d1fc16be571e0dc
2020-12-15 16:30:20 +00:00
Nikita Ioffe
3f473c9dfb Merge "Log start of the test to logcat" am: 356b184468 am: e7f989d826
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526419

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If31b80253977f61e0cee5edf5ca9cdff4e73aa71
2020-12-15 16:15:59 +00:00
Tom Cherry
94b1c57d93 init: don't generate tombstones for expected test failures
The firmware_handler.HandleAbort and subcontext.RecoverAfterAbort
tests intentionally abort in the child process to ensure that
ueventd/init can recover if their child processes die.  This generates
a tombstone which causes confusion.  This change resets SIGABRT to
SIG_DFL right before the abort(), so that the child processes will
exit normally without generating a tombstone or writing a crash to
logcat.

Bug: 169771958
Bug: 175383788
Test: run the above tests and verify no stack traces are printed to
      logcat and no tombstones are generated.
Change-Id: Ica09548d1c7a766bf5d9ff2e26c9fd558e85c7c1
2020-12-15 06:38:55 -08:00
Nikita Ioffe
3496966eed Merge "Add reboot_test" 2020-12-15 12:34:00 +00:00
Nikita Ioffe
356b184468 Merge "Log start of the test to logcat" 2020-12-15 12:21:46 +00:00
Treehugger Robot
82f688e397 Merge "Add new owners to various sub-projects." am: e107d445f6 am: 25e7a66ad5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1526395

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie4793f6147ac1930d379203e1ed23ce45d4bc624
2020-12-11 23:29:15 +00:00
Elliott Hughes
21de4e727e Add new owners to various sub-projects.
Test: treehugger
Change-Id: Ia2a99c0499633ccc5d23c37a1ec93867c876d637
2020-12-11 12:45:45 -08:00
Nikita Ioffe
9e4b111a33 Log start of the test to logcat
This makes it easier to associate logs written during the test with the
test case that was running.

Test: atest CtsInitTestCases
Change-Id: I832f1c9ba8358341c934fdd91a65f5739bc98e37
2020-12-11 18:00:45 +00:00
Nikita Ioffe
660ffde3dc Add reboot_test
This test spawns several services backed by /system/bin/yes executable,
and then stops them either while SIGTERM or SIGKILL.

Ideally we want to unit test more of reboot logic, but that requires a
bigger refactoring.

Test: atest CtsInitTestCases
Bug: 170315126
Bug: 174335499
Change-Id: Ife48b1636c6ca2d0aac73f4eb6f4737343a88e7a
2020-12-11 16:37:10 +00:00
Tom Cherry
e2d6d3e8f2 Merge "init: remove DumpShutdownDebugInformation()" am: 6ece3c44fe am: afcc16e4e9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1523598

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie865819e057b04761999a408bfb9e0a542f75384
2020-12-10 19:41:31 +00:00
Tom Cherry
6ece3c44fe Merge "init: remove DumpShutdownDebugInformation()" 2020-12-10 18:55:52 +00:00
Tom Cherry
959ea63b30 init: remove DumpShutdownDebugInformation()
This hasn't helped investigating the issue, and the issue itself isn't
a problem anymore, so we remove these logs.

Bug: 155203339
Test: reboot
Change-Id: I20e51d8fcad5572906a8d556bec8a8dee4522834
2020-12-10 07:34:29 -08:00
Yifan Hong
6c9f509cdb Merge changes from topic "readonly_generic_ramdisk" am: 696882455b am: 3401909e7c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1519823

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I696a169b18eb038958dafa45f63cd9a5528456c0
2020-12-09 20:42:04 +00:00
Elliott Hughes
93f97df267 Merge "Use freecon() with getcon()/getfilecon()." am: 2acdc9de33 am: ebcf0925fc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1521162

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaae3f3c53604eb9fc24a83b49516b75c29490372
2020-12-09 20:40:06 +00:00
Yifan Hong
696882455b Merge changes from topic "readonly_generic_ramdisk"
* changes:
  Add /metadata to ramdisk.
  Also create dirs under /first_stage_ramdisk for GKI.
  Refactor the list of empty dirs in ramdisk in its own list.
  Revert "Move e2fsck into /first_stage_ramdisk."
2020-12-09 19:46:17 +00:00
Elliott Hughes
2acdc9de33 Merge "Use freecon() with getcon()/getfilecon()." 2020-12-09 19:03:16 +00:00
Tom Cherry
26ff6deb67 Merge "ueventd: add no_fnm_pathname option" am: 6cf3695502 am: a95f900d69
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1518705

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7e6ecd974922ef6a5b26cd722860d59d8032b62f
2020-12-09 16:19:06 +00:00
Tom Cherry
1597ec0ac5 Merge "ueventd: add the import option from the init parser" am: 0608e36fb9 am: 877e2374a7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1520220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5983dc88d2dc8f4225b168969e25f9f969f71c55
2020-12-09 16:18:55 +00:00
Tom Cherry
6cf3695502 Merge "ueventd: add no_fnm_pathname option" 2020-12-09 15:50:16 +00:00
Tom Cherry
0608e36fb9 Merge "ueventd: add the import option from the init parser" 2020-12-09 15:47:25 +00:00
Elliott Hughes
d92c6a12da Use freecon() with getcon()/getfilecon().
Bug: https://issuetracker.google.com/175090444
Test: treehugger
Change-Id: Ia2b8102f1c9a4fd56ec1ff026ba5b4f375102b9b
2020-12-08 22:30:17 -08:00