summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Wipe device on policy errorPaul Crowley2016-05-101-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we fail to set a crypto policy on a system-DE directory, this is a serious and unrecoverable condition; the only way forward is to erase the entire device. In a future commit we will also allow users the option of booting again. Bug: 28318405 Change-Id: Iff1e52c5bbee1beed29dc4b609d24bfeb7d138da
| * | init/builtins.cpp: Switch to finit_moduleNick Kralevich2016-05-041-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 124a9c97e9815142a33480b81a5a3041a7cd66bd) Change-Id: I5e87de1a7b8c3d8849bf757c71b08e81c378b021
* | | Merge "Don\'t start defaultcrypto twice" into nyc-devPaul Lawrence2016-04-191-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | am: fe5d55a * commit 'fe5d55a68b9dc3a593d3f6ee5be919b8a9de710c': Don't start defaultcrypto twice Change-Id: I0e9a27208ea046a2cf738992ba97141da9026c08
| * | Don't start defaultcrypto twicePaul Lawrence2016-04-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The old way (using triggers) starts defaultcrypto twice because queue_property_triggers_action retriggers the action. Bug: 27452459 Change-Id: I48c844836f551673d0dbfed6c33bd8ee1e035f40
* | | Merge "init: write bootloader message directly." into nyc-devYabin Cui2016-04-091-8/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | am: a3a7a88 * commit 'a3a7a886f5277b6223140761e58cea0753854225': init: write bootloader message directly. Change-Id: I764e0288b40264b8e48fc09011c3c0475b71a04e
| * | init: write bootloader message directly.Yabin Cui2016-04-081-8/+5
| | | | | | | | | | | | | | | Bug: 27176738 Change-Id: I8c95a193f3436c0893d5103760b700f3052888db
| * | init: turn off backlight when performing shutdown cleanupMark Salyzyn2016-04-051-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry pick from commit a98cc9c202b9ff97df89e2258bf04bc3b8b57301) Try writing a "0" into: - /sys/class/leds/lcd-backlight/brightness - /sys/class/backlight/*/brightness to turn off the backlight during shutdown cleanup. Bug: 27506425 Change-Id: Ic8a44dc8909b303f24e14f71cfb43292df60efde
| * | init: watchdog restarted during shutdown fsckMark Salyzyn2016-04-051-0/+16
| | | | | | | | | | | | | | | | | | | | | (cherry pick from commit ad575e04a1d89f5a2a4e3006a58e801cad9c9805) Bug: 27506425 Change-Id: I40967068d18ce1a8cbaf0b750e7a7af6eab3e4e8
* | | Merge "init: drop unused header android_filesystem_config.h" am: 54c27c7Elliott Hughes2016-04-081-1/+0
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | am: 8cb6a9c * commit '8cb6a9cdb7cb1feaff29914aa88c68399e32f14f': init: drop unused header android_filesystem_config.h Change-Id: I1cc001c883199e8355e97d93a2f6ce0d46bdd767
| * | init: drop unused header android_filesystem_config.hWilliam Roberts2016-04-071-1/+0
| | | | | | | | | | | | | | | | | | Change-Id: I66e637bc2d7fd5f385f40f150becfe515c53c19a Bug: 27999086 Signed-off-by: William Roberts <william.c.roberts@intel.com>
* | | Merge "init: turn off backlight when performing shutdown cleanup" am: adf1cdeMark Salyzyn2016-04-051-0/+30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | am: 23702b5 * commit '23702b538b3a02ca35f24c55d406a7cc7b14641f': init: turn off backlight when performing shutdown cleanup Change-Id: I249106a3b6c22e77d06bca5aee1d92184b00ba33
| * | init: turn off backlight when performing shutdown cleanupMark Salyzyn2016-04-051-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Try writing a "0" into: - /sys/class/leds/lcd-backlight/brightness - /sys/class/backlight/*/brightness to turn off the backlight during shutdown cleanup. Bug: 27506425 Change-Id: Ic8a44dc8909b303f24e14f71cfb43292df60efde
* | | Merge "init: watchdog restarted during shutdown fsck" am: 3443caaMark Salyzyn2016-04-051-0/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | am: 34dcdd8 * commit '34dcdd8075a0c12de552219d4f326bccd1c8fe62': init: watchdog restarted during shutdown fsck Change-Id: I28e3a730f2d854c51f1d760a5400faecd3f1fafc
| * | init: watchdog restarted during shutdown fsckMark Salyzyn2016-04-051-0/+16
| | | | | | | | | | | | | | | Bug: 27506425 Change-Id: I40967068d18ce1a8cbaf0b750e7a7af6eab3e4e8
* | | Merge "init/builtins.cpp: Switch to finit_module" am: b3cf2e0Nick Kralevich2016-03-301-8/+10
|\| | | |/ |/| | | | | | | | | | | | | am: 699b115 * commit '699b115be3c79547e9cc6d8bca771d77eb384915': init/builtins.cpp: Switch to finit_module Change-Id: Iab21b9e058fe9435847ba9bca4cb2d1c0f50c88f
| * init/builtins.cpp: Switch to finit_moduleNick Kralevich2016-03-291-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Distinguish between unencrypted and unencryptablePaul Lawrence2016-03-041-3/+3
| | | | | | | | | | | | | | Set ro.crypto.state flag to unencrypted and unsupported accordingly Bug: 18002358 Change-Id: I1f88ce9704c5505d7b63256e2ebe5f8441c79ad0
* | User 0 directories are created by vold now.Jeff Sharkey2016-02-041-3/+0
| | | | | | | | | | | | | | | | | | | | 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
* | Remove code to handle non-default file encryptionPaul Lawrence2016-02-021-8/+1
| | | | | | | | Change-Id: I6d986853929c0237c0d958329b8e9aab47907a00
* | On FDE devices, initialize user 0Paul Crowley2016-02-011-0/+8
| | | | | | | | | | | | | | Fix ugly special cases for user 0: initialize them explicitly. Bug: 26704408 Change-Id: I1b8536b9e5e87ea98b4009a309f2e22c56006651
* | Merge "Remove no-longer-needed crypto init builtins"Paul Crowley2016-01-211-18/+0
|\ \
| * | Remove no-longer-needed crypto init builtinsPaul Crowley2016-01-201-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | Changes to the way FBE works to support lifecycles mean that these commands aren't needed any more. Bug: 22358539 Change-Id: Id73339e0aa8070dd688f35b5d59de75236961395
* | | Merge "Allow paths of .rc files to be specified at mount_all" am: e7f9779886Hung-ying Tyan2016-01-211-12/+25
|\ \ \ | |/ / |/| / | |/ | | | | | | am: 436a8aa9de * commit '436a8aa9de9c90a8ee95e02e97bf65e50c80d4f4': Allow paths of .rc files to be specified at mount_all
| * Allow paths of .rc files to be specified at mount_allHung-ying Tyan2016-01-211-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "init: Allows shutting down cleanly." am: f9f4ee8b72Bertrand Simonnet2016-01-081-0/+40
|\| | | | | | | | | | | | | am: a8c931b7f5 * commit 'a8c931b7f57c8ce74f520d591e99bb367f91dc81': init: Allows shutting down cleanly.
| * init: Allows shutting down cleanly.Bertrand SIMONNET2016-01-081-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Set up dm-verity in EIO mode instead of logging mode" am: 0d1214c68eSami Tolvanen2015-12-101-1/+1
|\| | | | | | | | | | | | | am: 42a86f8d1e * commit '42a86f8d1e918356e86d4eb3fb2444a8c42d25ff': Set up dm-verity in EIO mode instead of logging mode
| * Merge "Set up dm-verity in EIO mode instead of logging mode"Sami Tolvanen2015-12-101-1/+1
| |\
| | * Set up dm-verity in EIO mode instead of logging modeSami Tolvanen2015-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add createuserkeyPaul Lawrence2015-12-091-0/+10
|/ / | | | | | | | | | | Needed so we can make the user0 key on first boot Change-Id: I4699dbf2efdec44bb09bc4cfa7eeb59e56cb93ab
* / Track rename of base/ to android-base/.Elliott Hughes2015-12-041-1/+1
|/ | | | Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
* resolved conflicts for merge of cda81d01 to mnc-dr-dev-plus-aospTom Cherry2015-09-011-113/+103
|\ | | | | | | Change-Id: I747b279bc49f9f82b8f8859c49b3fc2a4e3b4977
| * init: Use classes for parsing and clean up memory allocationsTom Cherry2015-09-011-108/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 08a6775f: am 2d8be6c2: Merge "init: import init rc scripts from file ↵Tom Cherry2015-08-211-0/+15
|\| | | | | | | | | | | | | systems after mount_all" * commit '08a6775f8cdadf48e7b5f4f4d710180fda43b2b6': init: import init rc scripts from file systems after mount_all
| * init: import init rc scripts from file systems after mount_allTom Cherry2015-08-211-0/+15
| | | | | | | | | | | | | | Import /{system,vendor,odm}/etc/init/... after file systems are mounted Bug: 23186545 Change-Id: Idb0cae9773f904c0330054c8b3e31eb87b2fb7cb
* | am d1b11a04: am e656be33: Merge "Add |opts| argument to android_fork_execvp_ext"Yusuke Sato2015-08-191-2/+2
|\| | | | | | | | | * commit 'd1b11a04903be74ba6a47307d8c3ef2731e3f4ab': Add |opts| argument to android_fork_execvp_ext
| * Add |opts| argument to android_fork_execvp_extYusuke Sato2015-08-191-2/+2
| | | | | | | | | | | | | | to allow the caller to send data to the child's stdin. Bug: 21725996 Change-Id: I818f5cf61045286c8d64a91b6d50f05740329be1
* | am 4036f5ab: am 4bf3dc93: Merge "Create Service and ServiceManager classes"Tom Cherry2015-08-071-46/+35
|\| | | | | | | | | * commit '4036f5ab2ffbe5a2e47d46aa376e9791385cc31b': Create Service and ServiceManager classes
| * Create Service and ServiceManager classesTom Cherry2015-08-071-46/+35
| | | | | | | | Change-Id: I363a5e4751ad83d2f4096882a6fbbeddca03acfe
* | resolved conflicts for merge of 0070026c to mnc-dr-dev-plus-aospTom Cherry2015-08-031-140/+129
|\| | | | | | | Change-Id: Ibc802572898b6913c1f5d94aaae19974bfc0eb85
| * Merge "init: use std::vector<std::string> for argument passing"Tom Cherry2015-08-031-137/+126
| |\
| | * init: use std::vector<std::string> for argument passingTom Cherry2015-07-311-137/+126
| | | | | | | | | | | | Change-Id: Ie7a64e65de3a20d0c7f7d8efc0f7c1ba121d07fe
* | | am 2f9e1db3: am b5d6ad81: Merge "Stop calling fsck on shutdown by default"Yusuke Sato2015-08-031-7/+11
|\| | | | | | | | | | | | | | * commit '2f9e1db37416cdb580d870218b5fbfbed47a3758': Stop calling fsck on shutdown by default
| * | Merge "Stop calling fsck on shutdown by default"Yusuke Sato2015-07-311-7/+11
| |\ \ | | |/ | |/|
| | * Stop calling fsck on shutdown by defaultYusuke Sato2015-07-211-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am a21d8562: am d548e30f: Merge "init: Create classes for Action and Command"Tom Cherry2015-07-301-4/+5
|\| | | | | | | | | | | | | | * commit 'a21d85620560896bbed0cd43db9ed3224ab4e974': init: Create classes for Action and Command
| * | init: Create classes for Action and CommandTom Cherry2015-07-301-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am bd5f10ad: am 699be5f6: Merge "init: do expand_props before calling the ↵Yabin Cui2015-07-251-52/+7
|\| | | | | | | | | | | | | | | | | | | | builtins." * commit 'bd5f10addfba8df40c8293d95c002044acbfa526': init: do expand_props before calling the builtins.
| * | init: do expand_props before calling the builtins.Yabin Cui2015-07-241-52/+7
| | | | | | | | | | | | | | | | | | | | | | | | Also switch expand_props to std::string. Bug: 22654233 Change-Id: I62910d4f74e2b1a5bd2b14aea440767a2a8462b7
* | | resolved conflicts for merge of bff40697 to mnc-dr-dev-plus-aospYabin Cui2015-07-241-3/+2
|\| | | | | | | | | | | Change-Id: I7d7a614a5eb987ef6aecd32ed15a6eaa43e93957