Commit graph

3735 commits

Author SHA1 Message Date
David Anderson
5392f87b72 Merge "Fix shutdown animation cannot be shown" am: 95983cbbb6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1795394

Change-Id: I5bf7c171fb96642943f9b550d87302e4147e7813
2021-08-18 17:45:58 +00:00
David Anderson
95983cbbb6 Merge "Fix shutdown animation cannot be shown" 2021-08-18 17:26:50 +00:00
Elliott Hughes
5153cdee39 Merge "Split up the system/core/ TEST_MAPPING." am: 0589b7eb94
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1797132

Change-Id: I49316e97d5997bf5a0e5f7932aa3f1016b4566e6
2021-08-18 16:41:35 +00:00
Elliott Hughes
0589b7eb94 Merge "Split up the system/core/ TEST_MAPPING." 2021-08-18 16:25:15 +00:00
Treehugger Robot
e7b9de02f6 Merge "init: python3." am: ba62af23b4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1798336

Change-Id: Ie9a09fae7183abb57f09a1b4467bc5d4bb2001d7
2021-08-18 00:15:21 +00:00
Treehugger Robot
ba62af23b4 Merge "init: python3." 2021-08-17 23:57:35 +00:00
Elliott Hughes
34b0cc11a8 init: python3.
I've actually left the two other scripts on python2, since they're not
used in the build, and I don't actually know whether anyone's still
using them manually. Leaving them on python2 should be a sign to future
maintainers (assuming they're far enough in the future) that maybe
no-one's using them and they can just be deleted instead.

Test: treehugger
Change-Id: I4d7dfdbf9f2a34ddd15cd4be077eeef2248cc596
2021-08-17 14:46:59 -07:00
Suren Baghdasaryan
5cdaecf693 init: Add extra_free_kbytes.sh script to adjust watermark_scale_factor am: 642048d969
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1780972

Change-Id: I0e818f411b580cbe37288f0fe9ac77c4e2f5d75a
2021-08-17 19:24:24 +00:00
Xin Li
b0356efd79 Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-master 2021-08-17 18:14:27 +00:00
Suren Baghdasaryan
642048d969 init: Add extra_free_kbytes.sh script to adjust watermark_scale_factor
Android uses an out-of-tree /proc/sys/vm/extra_free_kbytes kernel knob
to increase low watermark. A similar /proc/sys/vm/watermark_scale_factor
knob supported in upstream kernel can be used for the same purpose.
The script implements conversion from desired extra_free_kbytes value
to watermark_scale_factor value and sets watermark_scale_factor according
to the value for extra_free_kbytes provided as a parameter.
Note that watermark_scale_factor affects high watermark differently
from extra_free_kbytes. While extra_free_kbytes increases low and high
watermarks by the same amount, watermark_scale_factor affects high
watermark 2x times. Therefore it is expected that replacing the usage
extra_free_kbytes with watermark_scale_factor will keep the same low
watermark but high watermark will be higher than before.

Usage:
    extra_free_kbytes.sh <extra_free_kbytes value>

Bug: 109664768
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id8949be731da77be884cdeec3a765ea291dbc2f0
2021-08-17 17:02:18 +00:00
Elliott Hughes
22e082e87a Split up the system/core/ TEST_MAPPING.
A lot of things had moved out of system/core/ without their TEST_MAPPING
entries having gone with them, reducing the amount of presubmit coverage
for those things.

In order to reduce the likelihood of that happening again, I've pushed
all that remained in the system/core/ TEST_MAPPING down into the
individual subdirectories.

Test: treehugger
Change-Id: Ib75d65f9200fa64ae1552471da6fbe5b7023cf94
2021-08-16 16:37:10 -07:00
Hongguang Chen
f156552ef1 Merge "Add Quiescent Reboot Target" 2021-08-16 18:12:17 +00:00
zengshuchuan
21c97a5780 Fix shutdown animation cannot be shown
Don't start shutdown critical service or turn off
backlight, when ro.init.shutdown_animation=true

Bug: 196511757
Test: config ro.init.shutdown_animation=true and build
      shutdownanimation.zip to /system/media/
Signed-off-by: zengshuchuan <zengshuchuan@allwinnertech.com>
Change-Id: I5932b7281af630e80247048a70fe1b24f536d1d9
2021-08-13 17:34:39 +08:00
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