Commit graph

2643 commits

Author SHA1 Message Date
Tom Cherry
8c901dda30 init: fix typo in error message
Test: none
Change-Id: Ie8417c7c6e3f6600544006c4a84b5bdfaff9725f
2018-07-24 15:54:33 -07:00
TreeHugger Robot
c67c7f9a3a Merge "Revert "Use more shared libraries in adb and init."" into stage-aosp-master 2018-07-23 19:18:34 +00:00
Hridya Valsaraju
22c2202e75 Revert "Use more shared libraries in adb and init."
This reverts commit fbd79687e6.

Reason for revert: b/111734137

Change-Id: I70e23ed20d16821a555b448d4ac76fe9e130afa5
2018-07-23 17:48:57 +00:00
Dario Freni
4fa866a467 Add support for /product-services partition.
This CL is largely and adaptation of
Ie996def20e25dc1afe0c74af2096af844934b2dc

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.
Change-Id: I1046dfe19bf874da929c9131b76a1f85422fbb80
2018-07-23 16:14:36 +01:00
Tom Cherry
9ad886c3cb Merge "init: rename init_first_stage"
am: 1d2b29a902

Change-Id: Ic92fae3ca17b0f05eabd8172548f8072d0eb6060
2018-07-20 21:19:13 -07:00
Tom Cherry
3203244471 Merge "init: clean up logging initialization"
am: 258109ce4a

Change-Id: I4918bc14048dc9fed10293b7a15cfb3b059f6181
2018-07-20 21:18:36 -07:00
Tom Cherry
1272c0ec21 Merge "init: removed unused includes"
am: 21d03d83fa

Change-Id: I31669436a744cca21127e8321c39d02967cc81ea
2018-07-20 21:17:59 -07:00
Treehugger Robot
1d2b29a902 Merge "init: rename init_first_stage" 2018-07-21 02:47:36 +00:00
Tom Cherry
258109ce4a Merge "init: clean up logging initialization" 2018-07-21 02:01:14 +00:00
Tom Cherry
f02506938e init: removed unused includes
Test: build
Change-Id: Ie3020491f67f6930acebe6397be6997b59477b96
2018-07-20 22:48:51 +00:00
Tom Cherry
38a11ccdd1 init: rename init_first_stage
In preparation for splitting first stage init from the rest of the
init executable, rename these files which are specifically involved in
first stage mount operations to a more appropriate name.

Test: builds
Change-Id: I8a2d4e8c7e1deea1bab45cc8e738727bc2ceb3e5
2018-07-20 15:31:36 -07:00
Tom Cherry
74069d1734 init: clean up logging initialization
Clean up a few mistakes in logging initialization

1) Only init needs to clear stdout/stderr/stdin, so remove this from
   ueventd, watchdogd, and subcontext init
2) Only init should reboot due to FATAL errors. This was true even
   before this change due to getpid() checks, but there's no reason to
   not just use the DefaultAborter for other processes.
3) It's probably a mistake for FATAL logs in init to try to gracefully
   shutdown the system, so simply call RebootSystem() here.
4) Lastly, remove log.cpp since it's not actually shared code anymore

Test: build
Change-Id: Ic8c323393dc7ee98ed6bb9691361b51d0d915267
2018-07-20 15:30:14 -07:00
Jerry Zhang
fbd79687e6 Use more shared libraries in adb and init.
fs_mgr is used by several different
processes in both system and recovery,
so it makes sense for it to be a shared
library to save space.

libadbd is used by adbd, recovery (as minadbd)
and fastbootd so it should be shared as well.

Bug: 78793464
Test: compiles
Change-Id: I4225f4d1a44e6e5811c68a55595d1f94f0773114
Merged-In: I4225f4d1a44e6e5811c68a55595d1f94f0773114
(cherry picked from commit aacfc68acf)
2018-07-20 17:54:44 +00:00
David Anderson
37716f6c81 Merge "fs_mgr: Remove early prototype code."
am: 881be58f41

Change-Id: I4215c6e183ddbda94cbb0de77f271a68fe21640b
2018-07-19 16:39:56 -07:00
Treehugger Robot
881be58f41 Merge "fs_mgr: Remove early prototype code." 2018-07-19 23:32:33 +00:00
David Anderson
241506b00b Merge "init: Don't look for logical partitions via uevents."
am: 8ab1fd076d

Change-Id: Ic4019cf8dfb24df708104cac4c8d81597e4c1ecc
2018-07-19 14:51:38 -07:00
Treehugger Robot
8ab1fd076d Merge "init: Don't look for logical partitions via uevents." 2018-07-19 21:42:55 +00:00
David Anderson
e0384bbc69 fs_mgr: Remove early prototype code.
This early code is no longer needed now that logical partitions can be
created and flashed normally.

Bug: 79173901
Test: N/A
Change-Id: I393ef23b3d3ce1cd9c80833358051838d0e9f333
2018-07-19 14:38:33 -07:00
David Anderson
ab8414dd6c init: Don't look for logical partitions via uevents.
When using AVB, init's first stage regenerates uevent to find the paths
of block devices for verified partitions. If it can't find them all, it
will panic, causing the device to boot to recovery.

This does not work with logical partitions, since devices for those
partitions are created later in the first stage. In fact, they cannot be
created until uevent regeneration completes, since logical partitions are
are created by finding the "super" partition.

To address this we exclude logical partitions (as marked in fstab) from
the device finding process. Note that partitions moved from GPT to liblp
will no longer appear in by_name_symlink_map_.

Bug: 79173901
Test: AVB 2.0 device boots after deleting the vendor partition,
      creating a super partition, and flashing it with a dynamic
      vendor partition.

Change-Id: I19371b05912240480dc50864a2c04131258a7103
2018-07-19 14:38:27 -07:00
Tom Cherry
e98e1f55be Merge "Fix loading ueventd.${ro.hardware}.rc."
am: 1fefb9f129

Change-Id: I7573922226736ece024e31e15fc1a7b9e2d08a9f
2018-07-19 08:09:29 -07:00
Sen Jiang
d76f174a78 Fix loading ueventd.${ro.hardware}.rc.
Regression introduced in aosp/717324.

Bug: 111543389
Test: device boots further
Change-Id: I4cf57381104aa1a801cf82a42b1c5ae1a2273e89
2018-07-18 18:10:36 -07:00
Tom Cherry
97c0fd5287 Merge "ueventd: add a test for ueventd_parser.cpp"
am: bd130567f8

Change-Id: I7337e84645a9f18ffc263b681eca88285d95b69d
2018-07-18 10:04:04 -07:00
Tom Cherry
5f0198bfbb ueventd: add a test for ueventd_parser.cpp
Test: this unit test
Change-Id: Ib23f23ea5b362bb458adf8208573e5dc80ad6cf0
2018-07-17 15:28:51 -07:00
Tom Cherry
689d86a029 Merge "ueventd: let scripts provide firmware directories"
am: b504f38d7e

Change-Id: I6dd9cfe20b733fad5afb066b07484c33eb599c02
2018-07-16 17:15:18 -07:00
Tom Cherry
b504f38d7e Merge "ueventd: let scripts provide firmware directories" 2018-07-16 23:00:53 +00:00
Tom Cherry
7421fa1aed ueventd: let scripts provide firmware directories
Since some vendors will have firmware in mount points in
/mnt/vendor/..., we extend the ueventd script language to allow
specifying the firmware directories.

Also, move the existing 4 directories to ueventd.rc as a primary user
of this mechanism.

Bug: 111337229
Test: boot sailfish; firmwares load
Change-Id: I0854b0b786ad761e40d2332312c637610432fce2
2018-07-13 15:34:25 -07:00
Tom Cherry
f4657d4b80 Merge "init: actually remount /sys when changing network namespaces"
am: a8df2b95cb

Change-Id: I00330bacd9fd7bcb825298ef72ca54d134206c99
2018-07-13 13:09:53 -07:00
Tom Cherry
9bb0a4de46 init: actually remount /sys when changing network namespaces
Fix a typo from before.

Bug: 73334854
Test: build
Change-Id: I66631a6f251960be0e02d8a119fa0ff7a00fb24c
2018-07-13 11:07:11 -07:00
Bowgo Tsai
7c4bb66d83 Merge "Add /mnt/product rw mount point for product partitions."
am: 35f2704226

Change-Id: I631decdbb3549d72478279da83ec4a5f99023b24
2018-07-02 19:03:38 -07:00
Bowgo Tsai
acc31cee1b Add /mnt/product rw mount point for product partitions.
1. init creates /mnt/product used to mount product-specific rw partitions.
2. If a device tree fstab entry for early mount specifies a mount point
   under /mnt/product e.g. /mnt/product/foo, init will create
   /mnt/product/foo mount point.

Bug: 110808288
Test: change dt fstab entry to mount /mnt/product/foo; mount point is
      created correctly, and partition is mounted in early mount.

Change-Id: I321e314992abe1084fd67a382c205f5c0c92bf3d
2018-06-29 10:36:03 +08:00
Tom Cherry
588391fd69 Merge "init: add unit tests for tokenizer.cpp"
am: 749ee86faf

Change-Id: I64f78aefbd64b4154e776cfe8cd48ca91b93693f
2018-06-27 16:10:34 -07:00
Tom Cherry
749ee86faf Merge "init: add unit tests for tokenizer.cpp" 2018-06-27 23:01:27 +00:00
Tom Cherry
117ea4f45a Merge "init: fix the parse error when meeting escape characters"
am: 78ea17a641

Change-Id: I55967f9ca86d92468dffa3ff5c0488dfe603bba9
2018-06-27 13:50:02 -07:00
Tom Cherry
2a5a4e72f3 init: add unit tests for tokenizer.cpp
Test: this unit test
Change-Id: Iae24f3bf7850dd4b298281f6608bce195096d60a
2018-06-27 13:22:16 -07:00
liwugang
332afef5f4 init: fix the parse error when meeting escape characters
After dealing with some specical escape characters('\n','\r','\t','\\',"\r\n")
it doesn't goto the next position in the next loop, so it process the current
character twice.

For example, when parsing the string "test\ntoken" we expect the
"test'\n'token" but actually we got the "test'\n'ntoken"

Test: have espace characters in init .rc files
Change-Id: I015c087a5c6e5ee9c490f29a83b15b89443f7f81
Signed-off-by: liwugang <liwugang@xiaomi.com>
2018-06-26 13:30:54 +08:00
Christopher Morin
00ac033d6c Merge "init: Don't set ro.serialno when androidboot.serialno is not set"
am: 27eda482be

Change-Id: I5ea45a03ef91395b43fce85ad6a36a59c4cd3839
2018-06-22 13:26:09 -07:00
Chris Morin
39d124b92c init: Don't set ro.serialno when androidboot.serialno is not set
This functionality is useful for improving boottimes on the ARC++
project. Without this change, ro.serialno would be set to the empty
string when androidboot.serialno was unset in the kernel commandline.

Bug: 62039211
Test: boot with androidboot.serialno unset and ensure ro.serialno is
unset

Change-Id: Iaee339dfa3f0c871e5e9c1fc0534347f2b3e8a07
2018-06-21 18:54:28 -07:00
Wei Wang
736d63c7d1 Merge "init: print service name when started waiting"
am: d41a1f9add

Change-Id: I3672fe86c4fb75ca22d4a5862a291d79062822b0
2018-06-21 12:23:54 -07:00
Treehugger Robot
d41a1f9add Merge "init: print service name when started waiting" 2018-06-21 19:17:08 +00:00
Yifan Hong
6dd458a67c Merge "Revert "init: dummy host_init_verifier for mac""
am: 16bb55cb7b

Change-Id: Ibcb16e6a5b297650687c81bee1a8b86852a51fd5
2018-06-20 16:04:28 -07:00
Yifan Hong
16bb55cb7b Merge "Revert "init: dummy host_init_verifier for mac"" 2018-06-20 22:56:39 +00:00
Wei Wang
2c4ee75b1e init: print service name when started waiting
Bug: 110479595
Test: Boot
Change-Id: I448a64cec4c1cd5b736f8b9d04cd26429067bb71
2018-06-20 15:55:10 -07:00
Yifan Hong
3c4aa11cab Revert "init: dummy host_init_verifier for mac"
This reverts commit f567367584.

Reason for revert: mac build

Change-Id: Icd5d08206c50854d6645e07c4fb29705222bd226
2018-06-20 22:49:48 +00:00
Tom Cherry
b3badbac58 Merge "init: dummy host_init_verifier for mac"
am: b0e193c609

Change-Id: I39069f0ae304895751eaeb524f0fb0053cf2b4cc
2018-06-20 14:27:34 -07:00
Treehugger Robot
b0e193c609 Merge "init: dummy host_init_verifier for mac" 2018-06-20 21:19:49 +00:00
Tom Cherry
eedd4cd77a Merge "init: document what host init verifier checks"
am: ab8131f18f

Change-Id: I68d3ffd44b64f5de8608c43e170516fe39479900
2018-06-20 14:10:28 -07:00
Treehugger Robot
ab8131f18f Merge "init: document what host init verifier checks" 2018-06-20 21:00:42 +00:00
Tom Cherry
f567367584 init: dummy host_init_verifier for mac
Let's start by fixing the build, then see how possible this will be to do fully.

Bug: 110477913
Test: n/a
Change-Id: If52e15bd070781a405c5494631ede033c1067903
2018-06-20 12:29:59 -07:00
Tom Cherry
47111aee40 init: document what host init verifier checks
Bug: 36970783
Test: n/a
Change-Id: Ic42a55d7b5bb4fec364ac3b5d9a67bcd38cbcc8d
2018-06-20 10:21:37 -07:00
Tom Cherry
50cc21a9e2 Merge "Don't check permissions bits on init scripts for host_init_verifier"
am: 81101cb216

Change-Id: I2d62e2121a8c2740d893d253f7abedc1ec824ee2
2018-06-20 10:09:28 -07:00