summaryrefslogtreecommitdiffstats
path: root/init
Commit message (Collapse)AuthorAgeFilesLines
* Merge "ueventd: require opt-in for modalias handling"Tom Cherry2018-08-0211-44/+122
|\
| * ueventd: require opt-in for modalias handlingTom Cherry2018-08-0111-44/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | Some devices have modules.alias and modules.dep for modprobe and other purposes but do not want to opt into ueventd auto loading their modules. Therefore we add a flag that can be added to ueventd configuration files to opt into this behavior. Bug: 111916071 Bug: 112048758 Test: check that modules are loaded with this opt-in Test: check that modules are not loaded without this opt-in Change-Id: Ifb281b273059b4671eea1ca5bc726c9e79f3adfb
* | Merge "init: run fsck for early mount partitions"Tom Cherry2018-08-012-0/+6
|\ \ | |/ |/|
| * init: run fsck for early mount partitionsTom Cherry2018-07-312-0/+6
| | | | | | | | | | | | Bug: 111883560 Test: fsck runs successfully during early mount Change-Id: I19bcd2610f87f5331f94c228fcbec8f9379fc5e8
* | Merge "liblp: Allow building liblp as a shared library."Treehugger Robot2018-07-281-0/+1
|\ \
| * | liblp: Allow building liblp as a shared library.David Anderson2018-07-271-0/+1
| | | | | | | | | | | | | | | | | | Bug: 79173901 Test: system image, partition_tools both build Change-Id: I70f45d4cebfbddc39d03aa3fb3a56b6c48a20d7e
* | | Merge "init: Cleanly shut down subcontext processes"Treehugger Robot2018-07-273-1/+13
|\ \ \ | |/ / |/| |
| * | init: Cleanly shut down subcontext processesLuis Hector Chavez2018-07-273-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an explicit cleanup for the subcontext processes and avoids them from respawning, which causes a bunch of LOG(FATAL)s when the system is going down. Bug: 80425914 Test: kill -TERM $INIT_PID, no crashes for subcontext inits Change-Id: I135191d959c1dd921b102af316b24d2bc161d6c9
* | | Merge "Move recovery to /system/bin"Treehugger Robot2018-07-271-1/+1
|\ \ \ | |/ / |/| |
| * | Move recovery to /system/binJerry Zhang2018-07-241-1/+1
| |/ | | | | | | | | | | | | | | | | | | Executables should be in /system/bin rather than sbin. Change lookup paths in a few places to reflect this. Test: recovery is in system/bin Bug: 78793464 Change-Id: Ibcdff7abf1f21e2566e02cad8bdb3c26ee500534
* | Merge "Add support for /product-services partition."Treehugger Robot2018-07-272-0/+4
|\ \
| * | Add support for /product-services partition.Dario Freni2018-07-262-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | 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 Merged-In: I1046dfe19bf874da929c9131b76a1f85422fbb80
* / ueventd: Add dynamic kernel module loadingAndrew F. Davis2018-07-266-3/+227
|/ | | | | | | | | | | | | | | | | | | | | | For some platforms it is not known at build time what devices will be attached at runtime. Building into the kernel or pre-loading at init all the modules that could be needed would unnecessary bloat the kernel. The solution is dynamic kernel module loading. The kernel will generate uevents when devices are added, userspace should monitor for these events and load the compatible modules. The init process already monitors for uevents, add here the ability to respond to modalias events and preform the correct action. Adding this to init is preferred over an external program as we can read and process the module alias and dependency files once, instead of for each module needing to be loaded. Test: Run on Beagle-X15, check all needed modules are loaded (lsmod) Change-Id: I1b57d9aeb0a9770f309207183dc4bc2b7b905f14 Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
* init: fix typo in error messageTom Cherry2018-07-241-1/+1
| | | | | Test: none Change-Id: Ie8417c7c6e3f6600544006c4a84b5bdfaff9725f
* Merge "init: rename init_first_stage"Treehugger Robot2018-07-204-19/+17
|\
| * init: rename init_first_stageTom Cherry2018-07-204-19/+17
| | | | | | | | | | | | | | | | | | 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
* | Merge "init: clean up logging initialization"Tom Cherry2018-07-207-131/+48
|\ \
| * | init: clean up logging initializationTom Cherry2018-07-207-131/+48
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / init: removed unused includesTom Cherry2018-07-202-4/+0
|/ | | | | Test: build Change-Id: Ie3020491f67f6930acebe6397be6997b59477b96
* Merge "fs_mgr: Remove early prototype code."Treehugger Robot2018-07-191-20/+0
|\
| * fs_mgr: Remove early prototype code.David Anderson2018-07-191-20/+0
| | | | | | | | | | | | | | | | | | 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
* | Merge "init: Don't look for logical partitions via uevents."Treehugger Robot2018-07-191-2/+13
|\|
| * init: Don't look for logical partitions via uevents.David Anderson2018-07-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix loading ueventd.${ro.hardware}.rc.Sen Jiang2018-07-181-1/+2
| | | | | | | | | | | | | | | | Regression introduced in aosp/717324. Bug: 111543389 Test: device boots further Change-Id: I4cf57381104aa1a801cf82a42b1c5ae1a2273e89
* | ueventd: add a test for ueventd_parser.cppTom Cherry2018-07-174-12/+244
|/ | | | | Test: this unit test Change-Id: Ib23f23ea5b362bb458adf8208573e5dc80ad6cf0
* Merge "ueventd: let scripts provide firmware directories"Tom Cherry2018-07-166-59/+85
|\
| * ueventd: let scripts provide firmware directoriesTom Cherry2018-07-136-59/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | init: actually remount /sys when changing network namespacesTom Cherry2018-07-131-1/+1
|/ | | | | | | | Fix a typo from before. Bug: 73334854 Test: build Change-Id: I66631a6f251960be0e02d8a119fa0ff7a00fb24c
* Add /mnt/product rw mount point for product partitions.Bowgo Tsai2018-06-281-0/+3
| | | | | | | | | | | | | 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
* Merge "init: add unit tests for tokenizer.cpp"Tom Cherry2018-06-272-0/+164
|\
| * init: add unit tests for tokenizer.cppTom Cherry2018-06-272-0/+164
| | | | | | | | | | Test: this unit test Change-Id: Iae24f3bf7850dd4b298281f6608bce195096d60a
* | init: fix the parse error when meeting escape charactersliwugang2018-06-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | init: Don't set ro.serialno when androidboot.serialno is not setChris Morin2018-06-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "init: print service name when started waiting"Treehugger Robot2018-06-211-3/+3
|\ \ | |/ |/|
| * init: print service name when started waitingWei Wang2018-06-201-3/+3
| | | | | | | | | | | | Bug: 110479595 Test: Boot Change-Id: I448a64cec4c1cd5b736f8b9d04cd26429067bb71
* | Merge "Revert "init: dummy host_init_verifier for mac""Yifan Hong2018-06-202-46/+25
|\ \ | |/ |/|
| * Revert "init: dummy host_init_verifier for mac"Yifan Hong2018-06-202-46/+25
| | | | | | | | | | | | | | | | This reverts commit f567367584aaa8eb5f3b701e0548876de1cad2d0. Reason for revert: mac build Change-Id: Icd5d08206c50854d6645e07c4fb29705222bd226
* | Merge "init: dummy host_init_verifier for mac"Treehugger Robot2018-06-202-25/+46
|\|
| * init: dummy host_init_verifier for macTom Cherry2018-06-202-25/+46
| | | | | | | | | | | | | | | | 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
* | Merge "init: document what host init verifier checks"Treehugger Robot2018-06-201-0/+19
|\ \
| * | init: document what host init verifier checksTom Cherry2018-06-201-0/+19
| |/ | | | | | | | | | | Bug: 36970783 Test: n/a Change-Id: Ic42a55d7b5bb4fec364ac3b5d9a67bcd38cbcc8d
* | Merge "Don't check permissions bits on init scripts for host_init_verifier"Tom Cherry2018-06-203-12/+26
|\ \
| * | Don't check permissions bits on init scripts for host_init_verifierTom Cherry2018-06-193-12/+26
| |/ | | | | | | | | | | | | | | | | | | 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
* | Merge "init: Create logical partitions via liblp."Treehugger Robot2018-06-191-16/+41
|\ \
| * | init: Create logical partitions via liblp.David Anderson2018-06-191-16/+41
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "libselinux is dynamically linked from init"Treehugger Robot2018-06-192-2/+2
|\ \ | |/ |/|
| * libselinux is dynamically linked from initJiyong Park2018-06-192-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* | Merge "Support oem_#### users/groups for host_init_verifier"Tom Cherry2018-06-181-0/+8
|\ \ | |/ |/|
| * Support oem_#### users/groups for host_init_verifierTom Cherry2018-06-141-0/+8
| | | | | | | | | | | | Bug: 36970783 Test: oem_#### users and groups no longer fail in host_init_verifier Change-Id: I48174f528994d1b225ed897328cc207bdebf07a8
* | Merge "Relax host init parser to work with the build system"Tom Cherry2018-06-153-42/+28
|\ \ | |/ |/|