summaryrefslogtreecommitdiffstats
path: root/init
Commit message (Collapse)AuthorAgeFilesLines
* init: remove obsolete rle logoMarcin Chojnacki2013-10-164-190/+21
| | | | | | | | | Obsolete RLE 565 logo is used nowhere, because 565 framebuffer isn't used for years. It's not necessary to keep this thing alive anymore. Change-Id: Ie61e168790f791230530cd3eb1c68b1f7344c9a7
* Add a restorecon_recursive built-in command to init.Stephen Smalley2013-10-104-3/+24
| | | | | | | | | | | Functionally equivalent to the restorecon -R toolbox command. A use case is given by: I48eaa2b9901ac8c978192c14493ba1058a089423 Also, fix error handling and documentation for restorecon command. Change-Id: Ia7fbcc82645baf52c6bff0490d3492f458881cbb Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* init: Fix queue_all_property_triggers with nonexistent propertiesBenoit Goby2013-09-241-2/+4
| | | | | | | | | | | Don't queue actions for "on property=*" if the property does not exist. This fixes these errors on boot: init: property 'sys.powerctl' doesn't exist while expanding '${sys.powerctl}' init: powerctl: cannot expand '${sys.powerctl} Change-Id: I3bd354d73a860f856be5df2c654f940445f9efd9
* Merge "init: Fix get_hardware_name() to cope with long /proc/cpuinfo output"Colin Cross2013-09-181-6/+30
|\
| * init: Fix get_hardware_name() to cope with long /proc/cpuinfo outputJon Medhurst2012-12-101-6/+30
| | | | | | | | | | | | | | | | | | | | | | get_hardware_name() uses a fixed size buffer to slurp the contents of /proc/cpuinfo into and with newer multicore systems this is not big enough, leading to the inability to pick up the hardware name. Fix this by using a dynamically allocated, exponentially growing buffer. Change-Id: I51c6c276b6e110f462839e205a4428adc6656e75 Signed-off-by: Jon Medhurst <tixy@linaro.org>
* | init: support longer command linesAndrew Boie2013-09-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | The Linux kernel supports command lines up to 2048 bytes on x86, see COMMAND_LINE_SIZE in asm/setup.h. If any androidboot.xxxx arguments were past the 1024 byte limit here, they were lost. Change-Id: I6247c511a7de04109490fffa0125801d274a5501 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* | Merge "[GNSS] Add AID_GPS to property user white list"Colin Cross2013-09-041-0/+2
|\ \
| * | [GNSS] Add AID_GPS to property user white listNicolas SUET2013-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add "gps." and "persist.gps." to property_perms white list. Change-Id: I7177170676d774c87e08d1548f5264ac27cba3ff Orig-Change-Id: I7a94caa26be4aefd2fe4f155908e2f8f09858bee Signed-off-by: Nicolas SUET <nicolas.suet@intel.com> Signed-off-by: jerome Pantaloni <jeromex.pantaloni@intel.com> Signed-off-by: Jian Luo <jian.luo@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Signed-off-by: Jack Ren <jack.ren@intel.com> Author-tracking-BZ: 118091
* | | init: call restorecon on /sysNick Kralevich2013-09-033-0/+17
| | | | | | | | | | | | | | | | | | Not all files on /sys are not getting labeled properly. Fix them. Change-Id: I9dcff76354e7f50d41f1b6e702836cfbbc149278
* | | init: allow disabling selinux via a kernel command lineNick Kralevich2013-09-031-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new "androidboot.selinux" option, to control how userspace handles SELinux. This kernel command line can have three options: * disabled * permissive * enforcing "disabled" completely disables userspace support for SELinux. No policy is ever loaded, nor is the SELinux filesystem /sys/fs/selinux ever mounted. "permissive" loads the SELinux policy, but puts SELinux into permissive mode. SELinux policy violations are logged, but not rejected. "enforcing", the default, loads the SELinux policy, and places SELinux into enforcing mode. Policy violations are rejected. This change addresses post review comments for change b710ed21dec88c0dde8209264df054c842561589 . Change-Id: I912583db8e6a0e9c63380de32ad8ffc47a8a440f
* | | init: move SELinux into enforcing mode.Nick Kralevich2013-09-031-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When init starts up, immediately put SELinux into enforcing mode. This is currently a no-op. We currently have everything in the unconfined domain, so this should not break anything. (if it does, I'll roll it back immediately) If the kernel doesn't have SELinux support compiled in, then don't try loading a policy and continue without SELinux protections. Change-Id: Id0279cf82c545ea0f7090137b7566a5bc3ddd641
* | | Merge "init: load factory properties"Dima Zavin2013-08-281-7/+14
|\ \ \ | |/ / |/| |
| * | init: load factory propertiesAndrew Boie2013-08-201-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These properties are typically set at device provisioning time or in the factory. They contain unit-specific data that isn't touched by software updates or factory data reset. Only read-only properties can be read by this mechanism. Change-Id: Ifff9184f039072c3c0ce99f825c3075afb524514 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* | | Merge "Add support for socket security context specification."Colin Cross2013-08-247-14/+24
|\ \ \
| * | | Add support for socket security context specification.Stephen Smalley2013-08-237-14/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an optional argument to the socket option for specifying a SELinux security context for the socket. Normally the socket security context is automatically computed from the service security context or set using the seclabel option, but this facility allows dealing with two scenarios that cannot be addressed using the existing mechanisms: 1) Use of logwrapper to wrap a service. In this case, init cannot determine the service security context as it does not directly execute it and we do not want logwrapper to run in the same domain as the service. 2) Situations where a service has multiple sockets and we want to label them distinctly. Change-Id: I7ae9088c326a2140e56a8044bfb21a91505aea11 Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | | Handle policy reloads within ueventd rather than restarting it.Stephen Smalley2013-07-261-0/+11
|/ / | | | | | | | | | | | | | | | | | | | | Restarting ueventd upon policy reloads has reportedly created stability problems for some users and could cause events to be lost. Stop restarting ueventd and instead handle policy reloads within ueventd. Also stops restarting installd upon policy reloads. Change-Id: Ic7f310d69a7c420e48fbc974000cf4a5b9ab4a3b Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | am 5954ecb8: Merge "Allow more characters in partition name links"Colin Cross2013-07-222-3/+18
|\ \ | | | | | | | | | | | | * commit '5954ecb87b8c77425d8cc766c0cc798957a07a7d': Allow more characters in partition name links
| * | Allow more characters in partition name linksJohan Redestig2013-07-182-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have several partitions with underscores in their names which would not be properly linked in: /dev/block/platform/msm_sdcc.1/by-name/ With this change more characters (_-.) are allowed in partition name links. Also, any other character is replaced with '_' so the resulting link names have the same length as the partition name. Change-Id: I746566c03db98b10326c755692362d2c10e528ae
* | | am b1a9f8cf: resolved conflicts for merge of b6c60285 to stage-aosp-masterColin Cross2013-06-241-28/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | * commit 'b1a9f8cf4b15a861ab998a4c5f0c69068f22c62a': init: move initial property area allocation into bionic property_service: make /dev/__properties__ readable
| * \ \ resolved conflicts for merge of b6c60285 to stage-aosp-masterColin Cross2013-06-241-28/+5
| |\ \ \ | | |/ / | | | | | | | | Change-Id: I5afba55b668065499fa28369cf217d4f5eafab4a
| | * | Merge changes Ieb94caab,I762da21eColin Cross2013-06-251-30/+5
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | * changes: init: move initial property area allocation into bionic property_service: make /dev/__properties__ readable
| | | * | init: move initial property area allocation into bionicGreg Hackmann2013-06-191-28/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bionic's __system_property_add() now expands the property area as needed by mapping in more pages. Rather than duplicate the mapping code, move it inside bionic and have bionic's __system_property_area_init() set up the first page. Signed-off-by: Greg Hackmann <ghackmann@google.com> (cherry picked from commit f14eef0c3c456bfe39f7e9d57c8f7ae4ec775972) Change-Id: Ieb94caab1527c71f2155efe3795490b0ea215a29
| | | * | property_service: make /dev/__properties__ readableNick Kralevich2013-06-191-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, system properties are passed via the environment variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed from parent to child. This is insecure for setuid executables, as the environment variable can be changed by the caller. Make the /dev/__properties__ file accessible, so an app can get properties directly from the file, rather than relying on environment variables. Preserve the environment variable for compatibility with pre-existing apps. Bug: 8045561 (cherry picked from commit 7ece0a862cf97e85bbe69458a32a2bd165456874) Change-Id: I762da21ef4075f288745efed0ec7d16c2b71303c
* | | | | am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | * commit '39021a48a0e0687c654423acd5a4c99a1d79440d': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| * | | | am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | * commit '83ada447aed69dfcd0a88e952eced8db1e4d6584': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | * | | Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
| | |\ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | * changes: init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | | * | init: Retain traditional restart behavior for critical and oneshot services.Mike Kasick2012-03-224-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an SVC_RESTART state that's used for an explicit "restart" of a running service. This retains the traditional restart behavior for critical and oneshot services (previously altered by 7e36edd8), whereby these services are "simply restarted" instead of counting as a crash (for a critical serivce) or going into the disabled state (for a oneshot service).
| | | * | init: Safely restart services to avoid race conditions.Mike Kasick2012-03-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, service restarts (either an explicit "restart", or a "stop, start" pair) exhibited a race condition whereby the new (restarting) service process was often spawned before the old (stopping) process had terminated. This may have resulted in the new service process failing to acquire a limited resource (file lock, socket bind, etc.) that the old process had not yet released. Now, a stopping service remains in the SVC_RUNNING state until its exiting process has been reaped by waitpid. This prevents a "stop, start" sequence from spawning a second service process before resources held by the first are released. This enables safe service restarts by stopping the service, waiting for the old service process to terminate, and (only then) starting the new service process. In the event of "restarting" an already stopped service, the previous behavior is maintained whereby the service is simply started. This scenario could be special-cased by the restart command, however, we have observed instances where services are, unintentionally, stopped and started "too quickly," and so simultaneous processes for the same service should never be allowed. Note that this commit alters the behaviors for explicit restarts of critical and oneshot services. Previously these serivces would simply be restarted, whereas now, an explicit restart of a critical service counts as a crash (which may result in a recovery reboot) and oneshot services go into the disabled state.
* | | | | am 99c1a416: resolved conflicts for merge of 95a41f6b to stage-aosp-masterColin Cross2013-06-175-88/+58
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '99c1a4168ba792437f298d31cd4631ff01661476': init: fix copying boot properties toolbox: hide property implementation from watchprops init: verify size of property buffers passed to property_get init: move the system property writer implementation init: switch property_get to use __system_property_get
| * | | | resolved conflicts for merge of 95a41f6b to stage-aosp-masterColin Cross2013-06-175-88/+58
| |\ \ \ \ | | |/ / / | | | | | | | | | | Change-Id: Icfae29edf989fb43a7f0b8bda188a9807f76a3b9
| | * | | init: fix copying boot propertiesColin Cross2013-06-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous patch "init: verify size of property buffers passed to property_get" incorrectly modified one of the callers, resulting in ro.serialno, ro.bootmode, ro.baseband, and ro.bootloader always being set to their default values. Bug: 9469860 (cherry picked from commit 67e3663fc93c65b69b5d121db05b0833b98d97f1) Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
| | * | | init: verify size of property buffers passed to property_getColin Cross2013-06-172-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that the buffer passed as the value parameter to property_get is always big enough. (cherry picked from commit 88ac54a4e8d2a63e4fd9c465e115795ace316776) Change-Id: Iacc2b42bfe4069e0bfcbb1c48474f30126a93139
| | * | | init: move the system property writer implementationColin Cross2013-06-171-51/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the system property writer implementation into bionic to keep it next to the reader implementation and allow for better testing. (cherry picked from commit 9f5af635010a7ba92edf1fca543f7271cc9d75c8) Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0
| | * | | init: switch property_get to use __system_property_getColin Cross2013-06-175-39/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09) Change-Id: If3fba2cc1dd5c167b0924ddfe42dbe2e6387208a
| | * | | init: prevent action being added to the action_queue twiceColin Cross2013-06-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Property triggers may cause an action to be queued twice, resulting in a loop in the action queue. Keep actions that are not on the queue in the list_empty state (act->qlist->next == act->qlist), and only add them to the list if they are in that state. Bug: 8335133 Change-Id: I3a3ec18176cf19cbaa3a45220a03c7560eacfe79
* | | | | am 76c58893: Free file handle for /firmware/image after useAjay Dudani2013-06-141-0/+1
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | * commit '76c5889325c2ada5dda07fd9af20a4a485978538': Free file handle for /firmware/image after use
| * | | | Free file handle for /firmware/image after useAjay Dudani2013-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Id59e25486b45dffc87a89a961970a6e8128a5237
* | | | | am 7e723498: Merge "Add permission for bluetooth app in non-primary users" ↵Matthew Xie2013-05-221-0/+8
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | into jb-mr2-dev * commit '7e72349865db83d62f98eec8bca4b170712fe0e0': Add permission for bluetooth app in non-primary users
| * | | | Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-devMatthew Xie2013-05-221-0/+8
| |\ \ \ \
| | * | | | Add permission for bluetooth app in non-primary usersMatthew Xie2013-05-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bug 8954114 Change-Id: Id6a42f5a5beefa22c3cc8eecfb39a2222017a3b4
* | | | | | am 49be2407: Revert "Add logic to fixup file contexts after a policy update."gcondra@google.com2013-05-201-6/+1
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '49be240735a06f44e1d91aa51dd299779ad36d96': Revert "Add logic to fixup file contexts after a policy update."
| * | | | | Revert "Add logic to fixup file contexts after a policy update."repo sync2013-05-171-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ebcf93e3bf92bf46c54c8e0f2ec8936bb2db6aea.
* | | | | | am 477e35d6: Revert "Add persistent property for SELinux enforcment status."gcondra@google.com2013-05-201-1/+0
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '477e35d6d56c7fe9b2305becdf3ed4f590ddfbd6': Revert "Add persistent property for SELinux enforcment status."
| * | | | | Revert "Add persistent property for SELinux enforcment status."repo sync2013-05-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b89bdfde422eff751b3f939f10ab57e22af83eaa.
* | | | | | am 8a387870: Revert "Reload policy after setting up the data partition."gcondra@google.com2013-05-204-9/+3
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '8a3878700eb9cd8ecf495cd01f15face5c3879c8': Revert "Reload policy after setting up the data partition."
| * | | | | Revert "Reload policy after setting up the data partition."repo sync2013-05-174-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fee250d27a9c03af1ba439047b976d89563b1887.
* | | | | | am 3d32cd93: Revert "Remove /system from the dirs to relabel."gcondra@google.com2013-05-201-0/+1
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '3d32cd938746215e5fa9b1a3c3b78903e043ae73': Revert "Remove /system from the dirs to relabel."
| * | | | | Revert "Remove /system from the dirs to relabel."repo sync2013-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3d4d07b2fa3b2447646d3c87a0b401e993ad8363.
* | | | | | am 52351300: Revert "Add a version check for SELinux policy on device."gcondra@google.com2013-05-201-59/+0
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | * commit '52351300d156826bf22c493828571f45a1cea16a': Revert "Add a version check for SELinux policy on device."
| * | | | | Revert "Add a version check for SELinux policy on device."repo sync2013-05-171-59/+0
| |/ / / / | | | | | | | | | | | | | | | This reverts commit 921be8b6568df0057c4eacbac2e1022b71e09620.