Commit Graph

2420 Commits

Author SHA1 Message Date
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
Tom Cherry 81101cb216 Merge "Don't check permissions bits on init scripts for host_init_verifier" 2018-06-20 17:06:11 +00:00
David Anderson 39d0c5bef4 Merge "init: Create logical partitions via liblp."
am: 08839ff904

Change-Id: I8630d57e48a3016173a43b6dbd68ab974e6d5e01
2018-06-19 18:14:39 -07:00
Treehugger Robot 08839ff904 Merge "init: Create logical partitions via liblp." 2018-06-20 01:09:35 +00:00
Jiyong Park c4e89cde85 Merge "libselinux is dynamically linked from init"
am: 20480a22a1

Change-Id: I0f76ee0fe718cb73818c87cb3938b517f710122b
2018-06-19 17:10:29 -07:00
Treehugger Robot 20480a22a1 Merge "libselinux is dynamically linked from init" 2018-06-20 00:00:38 +00:00
Tom Cherry d72432de93 Don't check permissions bits on init scripts for host_init_verifier
Also get rid of the copy in parser.  There's no incentive to switch to
a tokenizer that doesn't modify the input, nor is there a reason to
waste cycles making a copy of every init script as its processed.

Bug: 36970783
Test: boot
Change-Id: I8aca9c9d6f1961e1ab35dee50691a6791fc6ec66
2018-06-19 15:18:40 -07:00
David Anderson 6590df2763 init: Create logical partitions via liblp.
Currently, init can create logical partitions by hardcoding them in
fs_mgr or by specifying them in device-tree. This change allows init to
also create logical partitions by using liblp, which stores partition
tables in a physical partition. The current name for this partition is
"android".

Two aspects of this code will change long-term. One, the prototype code
using device-tree will be deleted once fastboot supports logical
partitions. Two, libdm will obsolete most of the code in
fs_mgr_dm_linear.cpp. For now however we preserve how the prototype code
functions and we layer liblp on top of the existing dm_linear logic.

Bug: 79173901
Test: N/A
Change-Id: If014a109da78fa12269bf0df0dda39028ac2d1aa
2018-06-19 14:03:58 -07:00
Jiyong Park 012171d3af libselinux is dynamically linked from init
init is now dynamically linked to libselinux. This gives us about 100KB
extra space, which is valuable in the recovery partition.

Bug: 63673171
Test: m -j
Test: adb reboot recovery
Change-Id: I72c4f886cbbb9ce54f8221f05547f5b9f0e1adb0
2018-06-19 16:55:05 +09:00
Tom Cherry e33a115a39 Merge "Support oem_#### users/groups for host_init_verifier"
am: fe80d069a0

Change-Id: Ie59394a402c0d8c6cb5d9a3be574ccdb6e71eacc
2018-06-18 09:05:18 -07:00
Tom Cherry fe80d069a0 Merge "Support oem_#### users/groups for host_init_verifier" 2018-06-18 15:50:52 +00:00
Tom Cherry 831e67192c Merge "Relax host init parser to work with the build system"
am: 4632f4e868

Change-Id: I583443a7e546b7b32454b7cf5ef2e60f3b73cc09
2018-06-15 10:07:13 -07:00
Tom Cherry 4632f4e868 Merge "Relax host init parser to work with the build system" 2018-06-15 17:03:42 +00:00
Tom Cherry 290427b442 Support oem_#### users/groups for host_init_verifier
Bug: 36970783
Test: oem_#### users and groups no longer fail in host_init_verifier
Change-Id: I48174f528994d1b225ed897328cc207bdebf07a8
2018-06-14 21:12:02 +00:00
Tom Cherry 863d808c2e Relax host init parser to work with the build system
It's not going to be possible to safely assume $OUT has the right init
scripts to be parsed at a given point, so instead we fall back to
parsing init scripts individually.

This isn't a full revert of the previous commits.  We retain parsing
correctness of the 'import' statements and we retain using the new
host side property functionality.

Also, fix a bug where main was not actually returning -1 on failure

Bug: 36970783
Test: testing individual files still works correctly
Change-Id: I4ae5620f234caa08993deb2c30825904a75f6654
2018-06-14 14:08:33 -07:00
Wei Wang fb0500e0aa Merge "Revert "init: Add warning in init first stage mount""
am: 62dbf90225

Change-Id: If44dbd27d97e629ffe101578ed017676dde8a62b
2018-06-14 13:56:18 -07:00
Treehugger Robot 62dbf90225 Merge "Revert "init: Add warning in init first stage mount"" 2018-06-14 20:40:17 +00:00
Wei Wang 37acac49e2 Revert "init: Add warning in init first stage mount"
This reverts commit fdafb3d0ec.

Reason for revert: coldboot time increase
 
Bug: 110210279
Test: Boot

Change-Id: Ibb92c1856f3fc114685c40df67556131409a9231
2018-06-14 18:51:43 +00:00
Jiyong Park aa39f52a56 Merge changes from topic "sharedlib_in_recovery"
am: 91061985f5

Change-Id: Icaabb1cb46057771f71eb3fa0fad7be49d50dc64
2018-06-13 16:44:02 -07:00
Treehugger Robot 91061985f5 Merge changes from topic "sharedlib_in_recovery"
* changes:
  Build init with shared libraries
  Shared libs are supported in recovery mode
2018-06-13 23:14:29 +00:00
Wei Wang 849ea35725 Merge "init: Add warning in init first stage mount"
am: 4aa8421203

Change-Id: I5f8d12857a40ae68fecb86f5f3c069182e0261ef
2018-06-13 13:51:33 -07:00
Wei Wang fdafb3d0ec init: Add warning in init first stage mount
init need find required devices and it some times takes a long time due
to rogue drivers. Add a warning if the timing is longer than 50ms.

Bug: 80494921
Test: Reboot
Change-Id: I8f937d7ca7127dc89ed76bb6e5f1781459d5c94a
2018-06-13 11:02:13 -07:00
Tom Cherry daa054fa11 Merge "ueventd: fix extraneous 'Invalid section' error"
am: 86e65e9cac

Change-Id: Ia317ea6029f9251639c5b8875eaa5536880ae5f2
2018-06-12 15:18:34 -07:00
Tom Cherry 86e65e9cac Merge "ueventd: fix extraneous 'Invalid section' error" 2018-06-12 22:05:48 +00:00