summaryrefslogtreecommitdiffstats
path: root/init/init.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | Revert "init: Set ADDR_COMPAT_LAYOUT before spawning processes."Nick Kralevich2013-03-141-16/+0
| | | | | | | | | | | | | | | | This logic has been moved to platform/frameworks/base commit 8a0a929422682ba3eb6a205dc6c0638e68b909de and is no longer needed here. This reverts commit 01b1dee0ab7ad649760f9d8a7cead2a3f6d9cf70.
* | Label sockets consistently with the seclabel value if specified.Stephen Smalley2012-11-161-19/+27
| | | | | | | | | | | | | | | | This is necessary to ensure that the adbd socket is created in the adbd domain rather than the init domain. Change-Id: Id4997d7f074aeefea62b41c87b46a6609e03f527 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | am 7b88a90d: Merge "Remove HAVE_SELINUX guards"Kenny Root2012-10-171-26/+1
|\ \ | | | | | | | | | | | | * commit '7b88a90da2a27e347fc16c14fa577f4ae1ef07fd': Remove HAVE_SELINUX guards
| * | Remove HAVE_SELINUX guardsKenny Root2012-10-161-26/+1
| | | | | | | | | | | | Change-Id: I8272c573b3c5dc663203bafab68fad5e94d89364
* | | init: Set ADDR_COMPAT_LAYOUT before spawning processes.Nick Kralevich2012-10-051-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some Android programs have problems with memory which grows from the top down. Temporarily set ADDR_COMPAT_LAYOUT to avoid breaking those programs. Bug: 7188322 Change-Id: I61760500e670b4563838c63b82d4a0b6e354a86e
* | | am 11c783f1: am 9494f297: Merge "Implement SELinux/MAC checks for property ↵Kenny Root2012-08-131-0/+43
|\ \ \ | |/ / | | | | | | | | | | | | | | | service." * commit '11c783f1ead9f276e8854cb1adaebeed8517e8a1': Implement SELinux/MAC checks for property service.
| * | Implement SELinux/MAC checks for property service.rpcraig2012-08-091-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a set of changes to the init property service implementation to apply a SELinux check over who can change what properties. Also included control hooks for the 'ctl' keys. Change-Id: I5a18809bf5536f6459a36b6bf0d622b9f5061aa0 Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
* | | resolved conflicts for merge of 4dcd52ab to jb-mr1-devKenny Root2012-08-131-85/+26
|\ \ \ | |/ / | | | | | | Change-Id: Ibd0c03a7883a2e31adab18543c016776b7b36866
| * | Add support for reloading policy from /data/system.Stephen Smalley2012-08-091-85/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support runtime policy management, add support for reloading policy from /data/system. This can be triggered by setting the selinux.loadpolicy property to 1, whether from init.rc after mounting /data or from the system_server (e.g. upon invocation of a new device admin API for provisioning policy). ueventd and installd are restarted upon policy reloads to pick up the new policy configurations relevant to their operation. Change-Id: I97479aecef8cec23b32f60e09cc778cc5520b691 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | | am faad67fa: am ef3f7fa3: Merge "Set the SELinux security label on new ↵Jean-Baptiste Queru2012-08-081-0/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | directories." * commit 'faad67fac68642ca039fe5c29099acebf546f5ee': Set the SELinux security label on new directories.
| * | Merge "Set the SELinux security label on new directories."Jean-Baptiste Queru2012-08-081-0/+6
| |\ \
| | * | Set the SELinux security label on new directories.Stephen Smalley2012-07-261-0/+6
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically set the SELinux security label on directories created by init.rc. This avoids the need to separately call restorecon on each such directory from the init.rc file. Also restorecon /dev and /dev/socket after initial policy load so that they are labeled correctly before any other dev nodes or sockets are created. Change-Id: If6af6c4887cdead949737cebdd673957e9273ead Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | | Add watchdogdArve Hjønnevåg2012-06-141-0/+4
|/ / | | | | | | | | | | | | | | "/sbin/watchdogd <interval> <margin>" will open /dev/watchdog, try to set the timeout to <interval>+<margin> then write to it every <interval> seconds to reset the watchdog. Change-Id: I15571980cdb868ec19f20e80bf8274b32107d36d
* | Don't set ro.carrier in init.cAndrew Flynn2012-04-131-1/+0
| | | | | | | | | | | | | | It will instead be set using PRODUCT_PROPERTY_OVERRIDES in makefiles Change-Id: Idc8b480af4c15e15c2d97cdd82a20f259e027c52
* | init: Change umask of forked processes to 077Nick Kralevich2012-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify init to set the umask to 077 when forking processes. This helps protect against inadvertant information disclosure in init's child processes. ueventd: Keep umask at 000. uevent needs to be able to create device nodes with exactly the permissions it indicates. Testing: 1) Do an "ls -lR /data /dev" on the device before and after the umask change and diff the output. Verified by hand that the permission change wouldn't cause any problems. 2) Verify that package installation works, and the permissions are as expected, when installing a program from market and "adb install". Bug: 3272072 Change-Id: Ie4f7f06c0ee9da8d9b6fce25d71d8991a9bce406
* | init: manually set controlling tty for console servicesColin Cross2012-03-181-0/+1
|/ | | | | | | | | | | | | | Normally, calling open on a tty will set that tty as the process group controlling tty if none already exists. However, if the tty is /dev/console, the kernel will never automatically set it as the controlling tty. Call the TIOCSCTTY manually on the fd, which will always attempt to set it as the controlling tty. Fixes ctrl-c on the console shell when androidboot.console is not passed on the kernel command line and the default /dev/console is used. Change-Id: I449cc41b47e93ac38ad6987413bb54131e1ec0cd
* Fix typo in queue_property_triggers identChris Dearman2012-03-011-1/+1
| | | | | Signed-off-by: Chris Dearman <chris@mips.com> Change-Id: I5f18ccb0912b9bb89c9f5104f9505c610c109af8
* Extend init and ueventd for SE Android.Stephen Smalley2012-02-011-1/+175
| | | | | | | | | | | | | | | Add SE Android support for init and ueventd. init: - Load policy at boot. - Set the security context for service daemons and their sockets. - New built-in commands: setcon, setenforce, restorecon, setsebool. - New option for services: seclabel. ueventd: - Set the security context for device directories and nodes. Change-Id: I98ed752cde503c94d99dfa5b5a47e3c33db16aac
* init: export all androidboot cmd line values as ro.boot.xx propsDima Zavin2012-01-111-61/+91
| | | | | | | | Also, clean up how we initialize the ro.xx properties and process the kernel command line. Change-Id: Iedda6c90e31340a189171a44b2767480403354f7 Signed-off-by: Dima Zavin <dima@android.com>
* init: import the hardware specific init file in init.rcDima Zavin2012-01-111-2/+0
| | | | | | | | This removes the hardcoding of the file import in init and instead allows the init.rc file to fully control what is loaded. Change-Id: I933e5bbab57f1e8705a370d660f92c6508da94d2 Signed-off-by: Dima Zavin <dima@android.com>
* init: initialize property area early at bootDima Zavin2012-01-111-21/+15
| | | | | | | | | | The property service is still started later, but the property area and the initial boot properties are initialized before the init.rc file is processed. This allows init.rc files to have access to boot properties during parsing. Change-Id: Iae9ed1093c821831a864b39ae6bc697e62b94757 Signed-off-by: Dima Zavin <dima@android.com>
* Fix the class_reset commandKen Sumrall2011-10-261-1/+5
| | | | | | | | | | The class_reset command used to reset services that had been set to "disabled" in the init.rc file to a non-disabled state. Now, if the service was originally set to "disabled", have the reset command set it back to disabled. Otherwise, set it to the "reset" state as it currently does. Change-Id: I0c10582e46a8e443d4748d9d893ae762b19b653a
* Pick up on androidboot.hardware kernel cmd optionVladimir Chtchetkine2011-09-281-39/+8
| | | | | | | x86 emulator passes hardware name through the androidboot.hardware kernel cmd option, and ueventd must pick up on it to locate proper ueventd.rc file for that hardware. Change-Id: Id61c5b67fe6275a15c7aa62556e0b89eda7968f8
* init: do not load default.prop from ramdisk in charger modeDima Zavin2011-09-061-1/+5
| | | | | Change-Id: Ic471b891829d7f857674b925c9948954972d9ecb Signed-off-by: Dima Zavin <dima@android.com>
* init: add charge mode handlingDima Zavin2011-09-021-8/+15
| | | | | | | | | | | | Introduces a 'charger' section that is processed when androidboot.mode supplied on the kernel commandline is "charger". In this mode, sections such as fs, post-fs, etc are skipped. Only the 'early-init' and 'init' sections of the init rc files are processed before processing the 'charger' section. Change-Id: If9eb6334de18f04cbcf2aab784578e2993615242 Signed-off-by: Dima Zavin <dima@android.com>
* init/cutils: move list utility code to cutils from initDima Zavin2011-09-021-1/+1
| | | | | Change-Id: I357ceee813700297d8343159f22a07659e768d41 Signed-off-by: Dima Zavin <dima@android.com>
* init/cutils: move kernel logging interface to libcutils from initDima Zavin2011-09-021-1/+1
| | | | | Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8 Signed-off-by: Dima Zavin <dima@android.com>
* init: check for list empty when getting commands for actionDima Zavin2011-08-261-1/+1
| | | | | Change-Id: Id42d6a6b6297919b2e6520e074e31b5e01ae17bc Signed-off-by: Dima Zavin <dima@android.com>
* am 45e8fc6b: am 8621b5ea: am 212282c3: am 80dbd2a7: Merge "Fix build error ↵Conley Owens2011-07-251-0/+2
|\ | | | | | | | | | | | | in init when building with bootchart" * commit '45e8fc6bfd9221274f48861287ff7af06ee7a199': Fix build error in init when building with bootchart
| * am 8621b5ea: am 212282c3: am 80dbd2a7: Merge "Fix build error in init when ↵Conley Owens2011-07-251-0/+2
| |\ | | | | | | | | | | | | | | | | | | building with bootchart" * commit '8621b5ea475822499128e6f138a9dfc224bbb569': Fix build error in init when building with bootchart
| | * Fix build error in init when building with bootchartCarl-Emil Lagerstedt2011-04-111-0/+2
| | | | | | | | | | | | | | | | | | | | | There was a build error in init.c if you enabled bootchart, this should probably be shipped upstream if not fixed already. Change-Id: Iea3451c3e15d5cac00c5420d99bfce9a950aaaac
* | | defer firmware load until after filesystems are mountedBrian Swetland2011-03-251-0/+7
|/ / | | | | | | | | | | | | | | | | In some situations a driver could try to request firmware before /system is mounted. Previously we'd fail the request. Now we will retry the read-from-filesystem every 100ms until we find the firmware or we've finished the "fs" and "post-fs" stages of init. Change-Id: Ie32402f7d41c818bf20f3297286ed5f99705b72c
* | Changes to init to support encrypted filesystems.Ken Sumrall2010-12-181-5/+21
| | | | | | | | | | | | | | | | | | These are the changes to init and init.rc necessary to support booting with and encrypted /data filesystem. A corresponding change to init.<device>.rc goes along with this change. Change-Id: I0c7e2cc39568358014a82e317735c0eae14dd683
* | Revert "Add "slow_start" keyword to init"Iliyan Malchev2010-12-081-4/+0
| | | | | | | | This reverts commit 50b3afd9f39619f69dc6f4efc29be88933eb3614.
* | Add "slow_start" keyword to initPaul Eastham2010-12-041-0/+4
| | | | | | | | | | | | | | This keyword will cause init to wait a few seconds before exec'ing the target binary. Maybe only useful for hacks and debugging. Change-Id: I85caa0bcbc0be7e48bd21eb9e31e039c0740c8d5
* | check the return value of setuid and friendsNick Kralevich2010-11-171-3/+12
| | | | | | | | | | | | | | | | | | Under some circumstances, setuid() and family can fail, returning a non-zero value. (see "man setuid" for details). If this happens, we want to ensure that init doesn't spawn a process which has root privileges when it's not suppose to. Change-Id: Idd03f2c8f82a7eaf6e696b5bcfe308e51ea58b52
* | Allow AID_RADIO to restart the ril-daemon.Wink Saville2010-10-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | This enhances robustness by allowing the Telephony Framework to restart ril-daemon if it notices some catastrophic failure. Added setprop ctl.restart. Added ril-daemon to setprop control_perms and allow users/groups with the AID_RADIO ID to control it. Change-Id: I195abdd754a731ce0b77e8f71ab47fde8c3e7977
* | am 78ea2374: am 912ff85b: init: Add support for SOCK_SEQPACKET socket typeMike Lockwood2010-10-011-3/+4
|\ \ | |/ | | | | | | | | | | Merge commit '78ea2374c5c87d7bb58747b1a6173c598f386600' * commit '78ea2374c5c87d7bb58747b1a6173c598f386600': init: Add support for SOCK_SEQPACKET socket type
| * init: Add support for SOCK_SEQPACKET socket typeMike Lockwood2010-10-011-3/+4
| | | | | | | | | | Change-Id: Ib264ecf9beb2685b070436d2bdec9655c7a31b47 Signed-off-by: Mike Lockwood <lockwood@android.com>
* | Mount /dev with nosuidNick Kralevich2010-06-221-1/+1
| | | | | | | | Change-Id: I66c7fcf9b65405dfc12d344ef3ed225d0ad2db84
* | Revert "Mount /dev with noexec and nosuid"Nick Kralevich2010-06-151-1/+1
| | | | | | | | This reverts commit 4ec97f2b257f5c9ed7cf6f0245212f4e3eb60c1b.
* | Mount /dev with noexec and nosuidNick Kralevich2010-06-081-1/+1
|/ | | | Change-Id: Iea182c1e6a72c281abd17bf83ff765bb9cb59270
* init: Fix init spinning once init.rc is completeColin Cross2010-04-221-1/+2
| | | | | | | | | | When the init process ran out of actions to execute, cur_action was NULL and action_queue_empty() was true, but cur_command was still set. This patch clears cur_command when a new action is retreived, and only depends on cur_action and action_queue_empty() to determine the poll timeout. Change-Id: Iaa95063c8c267a5b1ada9f20363b99c433e61ac4
* init: Move uevent handling to an external ueventd processColin Cross2010-04-211-86/+17
| | | | Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
* init: Split parser into generic parser and init parserColin Cross2010-04-211-5/+5
| | | | Change-Id: I451ebc4ff12f2ac660eb533fa10ad561fa25c9dd
* init: Allow services to start before property triggers are upColin Cross2010-04-211-4/+7
| | | | Change-Id: I4f87657123bea88b7b5c537781868908d8d66b01
* init: Move list and log handling to list.h and log.hColin Cross2010-04-211-0/+2
| | | | Change-Id: I298f575c590d0f28b7ad78747f3ebdbba56b7a27
* init: Handle commands in event queue loopColin Cross2010-04-161-142/+245
| | | | Change-Id: I679059dae43143f3c8f16b68de5694539b699e50
* init: Move prototypes for util.c into util.hColin Cross2010-04-131-0/+1
| | | | Change-Id: I46a91849ce5297eb2597dd6134412f817564ec24
* init: Move signal handling to signal_handler.cColin Cross2010-04-131-111/+6
| | | | Change-Id: I3a24afa28a1cd279c749d6f384f687b8de56067e