Commit Graph

2288 Commits

Author SHA1 Message Date
Luis Hector Chavez 4ce56af101 Merge "init: Use android::base::boot_clock instead of /proc/uptime" am: 8e73e6f242
am: c12004dd23

Change-Id: I3a5a13cefa2baadfb50771664727712f9dd5b803
2018-04-19 10:59:22 -07:00
Treehugger Robot 8e73e6f242 Merge "init: Use android::base::boot_clock instead of /proc/uptime" 2018-04-19 17:43:07 +00:00
Paul Crowley 6ed4cd9cde Merge "Set property for metadata encryption on first boot" am: def249956c
am: 533870c48f

Change-Id: Ia1e25e29fdb3196a8c6dafd41271c253bd24ce59
2018-04-18 17:32:09 -07:00
Treehugger Robot def249956c Merge "Set property for metadata encryption on first boot" 2018-04-19 00:17:42 +00:00
Paul Crowley e383334457 Set property for metadata encryption on first boot
Bug: 77335096
Test: device boots twice with and without metadata encryption
Change-Id: Iaed78288cb37865ba23833721b73b11414e7e862
2018-04-18 14:42:45 -07:00
Tri Vo 4640149fd5 Merge "Add /mnt/vendor rw mount point for vendor partitions." 2018-04-18 19:32:32 +00:00
Tom Cherry 8ee01a9d76 Merge "init: add sigstop option for debugging services from their start" am: b41879111d
am: f0d28c85b6

Change-Id: If41c3cbbe761642d4138f8a0670191326c66b449
2018-04-18 07:03:36 -07:00
Tom Cherry b41879111d Merge "init: add sigstop option for debugging services from their start" 2018-04-18 13:51:15 +00:00
Tom Cherry 8f38048f7d init: add sigstop option for debugging services from their start
Test: the examples in README.md
Change-Id: Idb528ea4017f8f4ce62911928c040f4bc558d196
2018-04-17 14:52:49 -07:00
Tri Vo 5026903c7a Merge "Add /mnt/vendor rw mount point for vendor partitions." into pi-dev
am: b35c019d5c

Change-Id: I9541e3e1dcb941d0dd8a8bfcdb8cc637ffecc229
2018-04-17 13:42:12 -07:00
TreeHugger Robot b35c019d5c Merge "Add /mnt/vendor rw mount point for vendor partitions." into pi-dev 2018-04-17 19:16:55 +00:00
Paul Crowley 08e8aa4e52 Merge "Re-land "If enablefilecrypto or init_user0 fails, reboot into recovery."" am: ca10ecb3ae
am: e72619c947

Change-Id: I739a56c5d1a5508b6ccc45710f4f2bc32fefa86e
2018-04-17 12:14:26 -07:00
Tri Vo 0b66969ba0 Add /mnt/vendor rw mount point for vendor partitions.
Changes to init's behavior during early mount:
1. Mounting of tmpfs on /mnt is moved from init stage to early mount.
2. init creates /mnt/vendor used to mount vendor partitions.
3. If a device tree fstab entry for early mount specifies a mount point
under /mnt/vendor e.g. /mnt/vendor/foo, init will create
/mnt/vendor/foo mount point.

Bug: 64905218
Test: change dt fstab entry to mount persist to /mnt/vendor/persist;
mount point is created correctly, and partition is mounted in early
mount. See go/pag/1069774
Test: device boots with /mnt/vendor and previous contents of /mnt present,
and selinux label "mnt_vendor_file" is applied correctly.
Test: cts-tradefed run commandAndExit cts --skip-all-system-status-check
--primary-abi-only --skip-preconditions -m CtsAppSecurityHostTestCases
-t android.appsecurity.cts.PermissionsHostTest
Change-Id: I3739130739eadf508355c7f2531366fcaed74175
Merged-In: I3739130739eadf508355c7f2531366fcaed74175
(cherry picked from commit b511475664)
2018-04-17 11:19:44 -07:00
Tri Vo b511475664 Add /mnt/vendor rw mount point for vendor partitions.
Changes to init's behavior during early mount:
1. Mounting of tmpfs on /mnt is moved from init stage to early mount.
2. init creates /mnt/vendor used to mount vendor partitions.
3. If a device tree fstab entry for early mount specifies a mount point
under /mnt/vendor e.g. /mnt/vendor/foo, init will create
/mnt/vendor/foo mount point.

Bug: 64905218
Test: change dt fstab entry to mount persist to /mnt/vendor/persist;
mount point is created correctly, and partition is mounted in early
mount. See go/pag/1069774
Test: device boots with /mnt/vendor and previous contents of /mnt present,
and selinux label "mnt_vendor_file" is applied correctly.
Test: cts-tradefed run commandAndExit cts --skip-all-system-status-check
--primary-abi-only --skip-preconditions -m CtsAppSecurityHostTestCases
-t android.appsecurity.cts.PermissionsHostTest
Change-Id: I3739130739eadf508355c7f2531366fcaed74175
2018-04-17 10:15:07 -07:00
Paul Crowley c73b21558b Re-land "If enablefilecrypto or init_user0 fails, reboot into recovery."
An earlier such change was reverted in commit e242a97db5.

Bug: 70487538
Test: ensure that angler can boot
Merged-In: Id5f57fce1c9b817a2650e0c848143d8a0d286bf0
Change-Id: Id5f57fce1c9b817a2650e0c848143d8a0d286bf0
2018-04-17 09:03:57 -07:00
Ryan Prichard bef4ec28c4 Merge "init: use signalfd to catch SIGCHLD" am: 07de83831f
am: 5739bf412f

Change-Id: I5a65a3ec20fd5c14b8cbd5843dabc376124b86b5
2018-04-12 16:07:25 -07:00
Tom Cherry 9223bfdabe Merge "init: do not impose vendor_init restrictions on old vendor images" am: 4396bb85da
am: 1aea110cad

Change-Id: I337819da9e62377a3f47acda0772fa20cb676931
2018-04-12 15:51:22 -07:00
Treehugger Robot 07de83831f Merge "init: use signalfd to catch SIGCHLD" 2018-04-12 22:49:27 +00:00
Tom Cherry 125781255e init: do not impose vendor_init restrictions on old vendor images
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Merged-In: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
(cherry picked from commit a1dbeb8d33)
2018-04-12 15:33:15 -07:00
Treehugger Robot ee1b5a605e Merge "Allow vendor-init-actionable for vold-related properties" 2018-04-12 22:33:03 +00:00
Tom Cherry 4396bb85da Merge "init: do not impose vendor_init restrictions on old vendor images" 2018-04-12 22:31:02 +00:00
Ryan Prichard 1325ec8cfb init: use signalfd to catch SIGCHLD
Previously, if init received too many SIGCHLD signals, then the write to
signal_write_fd could fail with EAGAIN. The handler tried to log the
EAGAIN error, and init deadlocked if the interrupted init process had
already acquired a logging-related lock.

Bug: b/77867680
Test: manual
Change-Id: Ief0b5e94d8517827a5a7d03773391ba3ba9447c4
2018-04-12 14:15:26 -07:00
Tom Cherry a1dbeb8d33 init: do not impose vendor_init restrictions on old vendor images
Do not restrict vendor_init restrictions on vendor images that were
built before P, as they will not have the correct permissions.

Bug: 77732028
Test: test new devices and see vendor_init still works
Change-Id: I636a07b54fbfb248e1d1a68a8f3c4d047fd5a9e9
2018-04-12 10:17:45 -07:00
Jaekyun Seok 00ef7d560c Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
Merged-In: Ifec879f07705a52501757b58b1562a97c668b8b0
(cherry picked from commit 65ce3b2cd8)
2018-04-12 12:51:09 +09:00
Jaekyun Seok d82e926917 Allow vendor-init-actionable for vold-related properties
am: 65ce3b2cd8

Change-Id: I42838c531f79d01283538fe2cd4f68368947368f
2018-04-11 20:38:42 -07:00
Luis Hector Chavez 2980f57f2c init: Use android::base::boot_clock instead of /proc/uptime
/proc/uptime internally uses whatever would be returned by
clock_gettime(CLOCK_BOOTTIME), so use android::base::boot_clock instead
which avoids parsing strings and rounding errors.

Bug: 77273909
Test: CtsBootStatsTestCases
Change-Id: Ic162eefcf226073949a18cca55db3c2324b98749
2018-04-12 01:50:50 +00:00
Jaekyun Seok 65ce3b2cd8 Allow vendor-init-actionable for vold-related properties
Bug: 75987246
Bug: 73871799
Test: succeeded building and tested with taimen
Change-Id: Ifec879f07705a52501757b58b1562a97c668b8b0
2018-04-12 08:17:43 +09:00
Jaekyun Seok d082acf3d2 Merge "Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger" am: 5e5509e8fc
am: fb031e37a0

Change-Id: I03d3018bd416cd3dbac237768b1f441223e39238
2018-04-05 14:43:04 -07:00
Jaekyun Seok 66797804c6 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
Merged-In: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
(cherry picked from commit 167ec7f1d2)
2018-04-05 23:08:39 +09:00
Jaekyun Seok 167ec7f1d2 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
2018-04-05 21:20:59 +09:00
Jayant Chowdhary f4bda9a188 Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Merged-In: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-04-02 17:32:23 -07:00
Tao Bao 88161a7a2e Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." am: b7ba61ffc5
am: 30dcecc170

Change-Id: I51c465647fcc705064eb76146557fd9afdafebe9
2018-03-31 17:22:29 +00:00
Tao Bao b7ba61ffc5 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." 2018-03-31 17:03:25 +00:00
Jayant Chowdhary 478c7c1eaf Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-03-31 07:13:33 -07:00
Jaekyun Seok 401313f8f7 Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode" am: a5bf7bad2c
am: 63e16c228e

Change-Id: I1f53688bc49fbc0c43bc98a6c0829dd23e7966cf
2018-03-29 22:29:51 +00:00
Jaekyun Seok f328b0d935 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
Merged-In: I140a8f7ef3fa9823ceced94b00a413800518c240
(cherry picked from commit 1f90ccefb6)
2018-03-30 06:13:12 +09:00
Jaekyun Seok 1f90ccefb6 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
2018-03-29 14:54:51 +09:00
Jaekyun Seok da4b0a27fb Merge "Allow vendor-init-actionable for ro.debuggable" am: 5e7de48f03
am: 000e274f9a

Change-Id: I266c01a444a76b2de3378399a5b6c0fc154b901f
2018-03-28 21:27:23 +00:00
Jaekyun Seok fce960cdf4 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
Merged-In: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
(cherry picked from commit 4f214c5179)
2018-03-29 04:21:22 +09:00
Jaekyun Seok 4f214c5179 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
2018-03-28 12:21:03 +09:00
Tom Cherry 16e2e9d4da Merge "Revert "init: Reboot after timeout passes during reboot"" into pi-dev 2018-03-20 18:42:43 +00:00
Tom Cherry 6d0ec82c04 Merge "Revert "init: Reboot after timeout passes during reboot"" am: 92d55b6c07
am: e48dfe91ca

Change-Id: Ibf0db3721894cf78ba3f67b1e364833ffe1a9b82
2018-03-20 13:55:19 +00:00
Tom Cherry ea31ac2514 Revert "init: Reboot after timeout passes during reboot"
This reverts commit c9fec9d2be.

Looks like ext4 can't handle a system reboot happening in the middle
of an unmount.  We'll have to find another way to handle this.

Bug: 74817735
Bug: 75310371
Test: reboot device
Merged-In: Ib4f7f7fd29988a31a99f146c40f6d987c1fef15e
Change-Id: I7c097ba5734e2e4ff320c8b02fb58324d9380513
2018-03-20 13:39:00 +00:00
Jaekyun Seok 977abec8a6 Merge "Allow vendor_init_actionable to persist.sys.usb.usbradio.config" into pi-dev
am: bfb490e3e8

Change-Id: I3bd2e532c3a1c09a3ea8f80bfb633d237b85dc0f
2018-03-20 05:06:06 +00:00
Tom Cherry 0a72e6cb72 Revert "init: Reboot after timeout passes during reboot"
This reverts commit c9fec9d2be.

Looks like ext4 can't handle a system reboot happening in the middle
of an unmount.  We'll have to find another way to handle this.

Bug: 74817735
Bug: 75310371
Test: reboot device
Change-Id: Ib4f7f7fd29988a31a99f146c40f6d987c1fef15e
2018-03-19 16:37:02 -07:00
Jaekyun Seok 56f832e561 Allow vendor_init_actionable to persist.sys.usb.usbradio.config
persist.sys.usb.usbradio.config can be used as an action trigger in
vendor init scripts.

Bug: 75202311
Bug: 74266614
Test: succeeded building and tested on pixels
Change-Id: I123b5ebce4bbf33f41222c2e11137d52e38ff9f8
2018-03-20 07:40:16 +09:00
Tom Cherry 1f9d5406b3 init: add timers around sync() during shutdown
It seems that these sync() calls may take a long time in some
occasions, so we add these logs to check.

Bug: 74817735
Test: tree hugger
Change-Id: Id3635f6c7a6618b20c7caf93b05e50cc50ef99de
2018-03-15 10:24:00 -07:00
Jaekyun Seok 3b613ccedc Export init.svc.console as an actionable property
The state of console can be used to set up a device for debugging.

Bug: 74266614
Test: succeeded building and tested with Pixels
Change-Id: I3691fa2819594a521e05dad150550ab309a78c68
Merged-In: I3691fa2819594a521e05dad150550ab309a78c68
(cherry picked from commit cba467eeda)
2018-03-14 06:12:43 +09:00
Daniel Mentz bd93ad50ac ueventd: Increase uevent buffer size to 2MB
Let's increase the receive buffer size for the NETLINK_KOBJECT_UEVENT
socket to 2MB. Unless a large number of uevents queue up, that memory is
not allocated anyways. The receive buffer size serves only as an upper
limit for the total amount of memory consumed by all skbs queued to a
specific socket.

We experienced situations where ueventd got blocked for multiple seconds
while writing to /dev/kmsg, and the receive buffer overflowed in the
meantime.

Bug: 72648767
Change-Id: Ice6d7b9c5ed9c83efbad6111086ce95ac6432561
2018-03-13 05:35:44 +00:00
Treehugger Robot 9f5e6dbe85 Merge "Export init.svc.console as an actionable property" 2018-03-12 22:47:29 +00:00