summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
AgeCommit message (Collapse)Author
2016-03-29init/builtins.cpp: Switch to finit_moduleNick Kralevich
Switch insmod from using init_module to finit_module. From "man finit_module": The finit_module() system call is like init_module(), but reads the module to be loaded from the file descriptor fd. It is useful when the authenticity of a kernel module can be determined from its location in the file system; in cases where that is possible, the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided. finit_module is preferred over init_module because it allows LSMs, such as SELinux, to perform a permission check on kernel module loads based on the file from which the module is loaded. This functionality is not yet implemented in the Linux kernel, but is on the SEAndroid TODO list. See https://bitbucket.org/seandroid/wiki/wiki/ToDo Bug: 27824855 Change-Id: Id0ea88cd1930393c8c73ce38e63d5b2eeadf946a
2016-03-04Distinguish between unencrypted and unencryptablePaul Lawrence
Set ro.crypto.state flag to unencrypted and unsupported accordingly Bug: 18002358 Change-Id: I1f88ce9704c5505d7b63256e2ebe5f8441c79ad0
2016-02-04User 0 directories are created by vold now.Jeff Sharkey
This ensures that all users on device follow a consistent path for setup and validation of encryption policy. Also add remaining user-specific directories and fix linking order. Bug: 25796509 Change-Id: I8c2e42a78569817f7f5ea03f54b743a6661fdb9c
2016-02-02Remove code to handle non-default file encryptionPaul Lawrence
Change-Id: I6d986853929c0237c0d958329b8e9aab47907a00
2016-02-01On FDE devices, initialize user 0Paul Crowley
Fix ugly special cases for user 0: initialize them explicitly. Bug: 26704408 Change-Id: I1b8536b9e5e87ea98b4009a309f2e22c56006651
2016-01-21Merge "Remove no-longer-needed crypto init builtins"Paul Crowley
2016-01-21Merge "Allow paths of .rc files to be specified at mount_all" am: e7f9779886Hung-ying Tyan
am: 436a8aa9de * commit '436a8aa9de9c90a8ee95e02e97bf65e50c80d4f4': Allow paths of .rc files to be specified at mount_all
2016-01-21Allow paths of .rc files to be specified at mount_allHung-ying Tyan
In current implementation, the mount_all command imports all .rc files under /{system,vendor,odm}/etc/init/ after mouting filesystems is complete. There's a need from ODMs to import different .rc files under different boot modes (e.g., factory mode). Without this support, they will have to fiddle around the init implementation. This commit makes mount_all import the .rc files/directories specified as additional arguments. If no path is given, the original ones are applied the same way as the current implementation. BUG: 26549689 Change-Id: Ie67ce13dde4c440ff8bf534826bc392c882a433f
2016-01-20Remove no-longer-needed crypto init builtinsPaul Crowley
Changes to the way FBE works to support lifecycles mean that these commands aren't needed any more. Bug: 22358539 Change-Id: Id73339e0aa8070dd688f35b5d59de75236961395
2016-01-08Merge "init: Allows shutting down cleanly." am: f9f4ee8b72Bertrand Simonnet
am: a8c931b7f5 * commit 'a8c931b7f57c8ce74f520d591e99bb367f91dc81': init: Allows shutting down cleanly.
2016-01-08init: Allows shutting down cleanly.Bertrand SIMONNET
When ro.build.shutdown_timeout is set, init will send a SIGTERM signal to all services on reboot. The normal shutdown process will continue once all services have exited or after the shutdown timeout (ro.build.shutdown_timeout). If ro.build.shutdown_timeout is not set, we assume a 0s timeout. Bug: 26216447 Test: manual: Ask to reboot. All services exit cleanly. Change-Id: If921f6e8d87211e500ac9fa86f3e1eabe02d18cf
2015-12-10Merge "Set up dm-verity in EIO mode instead of logging mode" am: 0d1214c68eSami Tolvanen
am: 42a86f8d1e * commit '42a86f8d1e918356e86d4eb3fb2444a8c42d25ff': Set up dm-verity in EIO mode instead of logging mode
2015-12-10Merge "Set up dm-verity in EIO mode instead of logging mode"Sami Tolvanen
2015-12-09Add createuserkeyPaul Lawrence
Needed so we can make the user0 key on first boot Change-Id: I4699dbf2efdec44bb09bc4cfa7eeb59e56cb93ab
2015-12-04Track rename of base/ to android-base/.Elliott Hughes
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-12-02Set up dm-verity in EIO mode instead of logging modeSami Tolvanen
If the device is corrupted, set up dm-verity in EIO mode instead of logging mode. This prevents corrupted blocks from being returned to user space. Note that restart mode is used by default and a warning will be displayed to the user after corruption is first detected. Bug: 19277516 Change-Id: I38966d73eb814836bc34b4bad1192583e5010b36
2015-09-01resolved conflicts for merge of cda81d01 to mnc-dr-dev-plus-aospTom Cherry
Change-Id: I747b279bc49f9f82b8f8859c49b3fc2a4e3b4977
2015-09-01init: Use classes for parsing and clean up memory allocationsTom Cherry
Create a Parser class that uses multiple SectionParser interfaces to handle parsing the different sections of an init rc. Create an ActionParser and ServiceParser that implement SectionParser and parse the sections corresponding to Action and Service classes. Remove the legacy keyword structure and replace it with std::map's that map keyword -> (minimum args, maximum args, function pointer) for Commands and Service Options. Create an ImportParser that implements SectionParser and handles the import 'section'. Clean up the unsafe memory handling of the Action class by using std::unique_ptr. Change-Id: Ic5ea5510cb956dbc3f78745a35096ca7d6da7085
2015-08-21am 08a6775f: am 2d8be6c2: Merge "init: import init rc scripts from file ↵Tom Cherry
systems after mount_all" * commit '08a6775f8cdadf48e7b5f4f4d710180fda43b2b6': init: import init rc scripts from file systems after mount_all
2015-08-21init: import init rc scripts from file systems after mount_allTom Cherry
Import /{system,vendor,odm}/etc/init/... after file systems are mounted Bug: 23186545 Change-Id: Idb0cae9773f904c0330054c8b3e31eb87b2fb7cb
2015-08-19am d1b11a04: am e656be33: Merge "Add |opts| argument to android_fork_execvp_ext"Yusuke Sato
* commit 'd1b11a04903be74ba6a47307d8c3ef2731e3f4ab': Add |opts| argument to android_fork_execvp_ext
2015-08-19Add |opts| argument to android_fork_execvp_extYusuke Sato
to allow the caller to send data to the child's stdin. Bug: 21725996 Change-Id: I818f5cf61045286c8d64a91b6d50f05740329be1
2015-08-07am 4036f5ab: am 4bf3dc93: Merge "Create Service and ServiceManager classes"Tom Cherry
* commit '4036f5ab2ffbe5a2e47d46aa376e9791385cc31b': Create Service and ServiceManager classes
2015-08-07Create Service and ServiceManager classesTom Cherry
Change-Id: I363a5e4751ad83d2f4096882a6fbbeddca03acfe
2015-08-03resolved conflicts for merge of 0070026c to mnc-dr-dev-plus-aospTom Cherry
Change-Id: Ibc802572898b6913c1f5d94aaae19974bfc0eb85
2015-08-03am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"Yusuke Sato
* commit '2f9e1db37416cdb580d870218b5fbfbed47a3758': Stop calling fsck on shutdown by default
2015-08-03Merge "init: use std::vector<std::string> for argument passing"Tom Cherry
2015-07-31Merge "Stop calling fsck on shutdown by default"Yusuke Sato
2015-07-31init: use std::vector<std::string> for argument passingTom Cherry
Change-Id: Ie7a64e65de3a20d0c7f7d8efc0f7c1ba121d07fe
2015-07-30am a21d8562: am d548e30f: Merge "init: Create classes for Action and Command"Tom Cherry
* commit 'a21d85620560896bbed0cd43db9ed3224ab4e974': init: Create classes for Action and Command
2015-07-30init: Create classes for Action and CommandTom Cherry
This creates the concept of 'event_trigger' vs 'property_trigger' Previously these were merged into one, such that 'on property:a=b && property:b=c' is triggered when properties a=b and b=c as expected, however combinations such as 'on early-boot && boot' would trigger during both early-boot and boot. Similarly, 'on early-boot && property:a=b' would trigger on both early-boot and again when property a equals b. The event trigger distinction ensures that the first example fails to parse and the second example only triggers on early-boot if property a equals b. This coalesces Actions with the same triggers into a single Action object Change-Id: I8f661d96e8a2d40236f252301bfe10979d663ea6
2015-07-25am bd5f10ad: am 699be5f6: Merge "init: do expand_props before calling the ↵Yabin Cui
builtins." * commit 'bd5f10addfba8df40c8293d95c002044acbfa526': init: do expand_props before calling the builtins.
2015-07-24init: do expand_props before calling the builtins.Yabin Cui
Also switch expand_props to std::string. Bug: 22654233 Change-Id: I62910d4f74e2b1a5bd2b14aea440767a2a8462b7
2015-07-24resolved conflicts for merge of bff40697 to mnc-dr-dev-plus-aospYabin Cui
Change-Id: I7d7a614a5eb987ef6aecd32ed15a6eaa43e93957
2015-07-24init: Let property_get return std::string.Yabin Cui
Bug: 22654233 Change-Id: Id6091f58432f75e966b9871256049fbe17766c10
2015-07-22am 7f12fa27: am f5b46079: Merge "init: use init\'s property expansion code ↵Elliott Hughes
for mount_all" * commit '7f12fa275604504ed874c08d6b7f906e8e522c73': init: use init's property expansion code for mount_all
2015-07-22init: use init's property expansion code for mount_allNan Liu
Change-Id: I3bd00c74cd126b66927eca7812943f8427009356 Signed-off-by: Nan Liu <nan.liu619@gmail.com>
2015-07-21Stop calling fsck on shutdown by defaultYusuke Sato
Instead, run the command only when sys.powerctl is set to "shutdown,userrequested". This way, we can avoid running fsck when shutdown is triggered due to a low power state. This is a follow-up CL for http://r.android.com/158525. Bug: 21853106 Change-Id: Ie57c23cd25162cc2a8726f876a9ba212080105fb
2015-07-21am ab64465d: am 0e3ce82b: Merge "Use fsck.f2fs -a instead of -f for faster boot"Yusuke Sato
* commit 'ab64465d1f16f414c0bde5e3c4707c32b8220bbc': Use fsck.f2fs -a instead of -f for faster boot
2015-07-15Use fsck.f2fs -a instead of -f for faster bootYusuke Sato
and run fsck with -f on clean shutdown instead. With -f, fsck.f2fs always performs a full scan of the /data partition regardless of whether the partition is clean or not. The full scan takes more than 2 seconds on volantis-userdebug and delays the OS boot. With -a, the command does almost nothing when the partition is clean and finishes within 20-30ms on volantis-userdebug. When the partition has an error or its check point has CP_FSCK_FLAG (aka "need_fsck"), the command does exactly the same full scan as -f to fix it. Bug: 21853106 Change-Id: I126263caf34c0f5bb8f5e6794454d4e72526ce38
2015-07-14am ee923139: Merge "Set up user directory crypto in init." into mnc-dr-devPaul Crowley
* commit 'ee923139c346e6751203fc7d2a341388e01c7b19': Set up user directory crypto in init. logd: switch to unordered_map from BasicHashtable rootdir: make sure the /oem mountpoint is always available
2015-07-13Merge "Set up user directory crypto in init." into mnc-dr-devPaul Crowley
2015-07-13am d5ef9841: Merge "Change init sequence to support file level encryption" ↵Paul Lawrence
into mnc-dr-dev * commit 'd5ef984195779aa9e27d7baabdd751d641eea1a0': Change init sequence to support file level encryption
2015-07-07Change init sequence to support file level encryptionPaul Lawrence
File level encryption must get the key between mounting userdata and calling post_fs_data when the directories are created. This requires access to keymaster, which in turn is found from a system property. Split property loaded into system and data, and load in right order. Bug: 22233063
2015-07-07am 81046166: Merge "Revert "Change init sequence to support file level ↵Paul Lawrence
encryption"" into mnc-dev * commit '8104616696ac5e806b16a393ea02c4f5d8efc328': Revert "Change init sequence to support file level encryption"
2015-07-07Revert "Change init sequence to support file level encryption"Paul Lawrence
This reverts commit d815178b7512cb44d8b5f234e3f823b5a3e44dea. Change-Id: I7e3f55d3092fcd04ea9f62f1971c9d42570f096c
2015-07-06am a65e402b: Merge "Change init sequence to support file level encryption" ↵Paul Lawrence
into mnc-dev * commit 'a65e402b613e927697d35e7936c6d80908d77e88': Change init sequence to support file level encryption
2015-07-06Change init sequence to support file level encryptionPaul Lawrence
File level encryption must get the key between mounting userdata and calling post_fs_data when the directories are created. This requires access to keymaster, which in turn is found from a system property. Split property loaded into system and data, and load in right order. Bug: 22233063 Change-Id: I8a6c40d44e17de386417a443c9dfc3b4e7fe59a5
2015-06-23Set up user directory crypto in init.Paul Crowley
(cherry-picked from commit b94032b79c3cded501e2d5f7c328cf8c0c3911c4) Bug: 19704432 Change-Id: Ife4928ffbee39c8ae69e6ba66d9ce5ef5a0beb76
2015-05-29DO NOT MERGE Securely encrypt the master keyPaul Lawrence
(chery-picked from commit 806d10be2336f32cdca16c2540cbf3d548f2fec7) Move all key management into vold Reuse vold's existing key management through the crypto footer to manage the device wide keys. Use ro.crypto.type flag to determine crypto type, which prevents any issues when running in block encrypted mode, as well as speeding up boot in block or no encryption. This is one of four changes to enable this functionality: https://android-review.googlesource.com/#/c/148586/ https://android-review.googlesource.com/#/c/148604/ https://android-review.googlesource.com/#/c/148606/ https://android-review.googlesource.com/#/c/148607/ Bug: 18151196 Change-Id: I6a8a18f43ae837e330e2785bd26c2c306ae1816b