summaryrefslogtreecommitdiffstats
path: root/init/util.h
Commit message (Collapse)AuthorAgeFilesLines
* Log more timing information from init.Elliott Hughes2015-03-281-1/+16
| | | | | | | | | | | | | | | | | Also make important events in init's life NOTICE rather than INFO, and ensure that NOTICE events actually make it to the kernel log. Also fix the logging so that if you have a printf format string error, the compiler now catches it. Also give messages from init, ueventd, and watchdogd distinct tags. (Previously they'd all call themselves "init", and dmesg doesn't include pids, so you couldn't untangle them.) Also include the tag in SELinux messages. Bug: 19544788 Change-Id: Ica6daea065bfdb80155c52c0b06f346a7df208fe
* Remove /proc/cpuinfo parsingRom Lemarchand2015-03-141-1/+0
| | | | | | | | | | - Clean up the paths for ro.revision and ro.hardware parsing - Use ro.hardwre in ueventd instead of parsing the kernel command line (cherry-pick of 38b340a52f8e864650db8bae1eb88d5c00485db0.) Bug: 19366018 Change-Id: I018a293f3d46e736a8b65132b5b00b0f7c20edae
* Clean up reading and writing in init.Elliott Hughes2015-02-061-1/+6
| | | | | | | | | | | | | This isn't particularly useful in and of itself, but it does introduce the first (trivial) unit test, improves the documentation (including details about how to debug init crashes), and made me aware of how unpleasant the existing parser is. I also fixed a bug in passing --- unless you thought the "peboot" and "pm" commands were features... Bug: 19217569 Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
* Build init as C++.Elliott Hughes2015-02-041-1/+1
| | | | | | This is just the minimal change to keep it building. Change-Id: I245c5b8413a1db114576c81462eb5737f5ffcef2
* Init: Remove unused variablesAndreas Gampe2014-11-241-1/+1
| | | | | | | | For build-system CFLAGS clean-up, fix unused variables. Use a #define instead of static variable in a header file. Change-Id: Id47bf38e51644b61a9f3ac1893a16553695f1aac
* init: call restorecon on /sysNick Kralevich2013-09-031-0/+1
| | | | | | Not all files on /sys are not getting labeled properly. Fix them. Change-Id: I9dcff76354e7f50d41f1b6e702836cfbbc149278
* Add support for socket security context specification.Stephen Smalley2013-08-231-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* Set the SELinux security label on new directories.Stephen Smalley2012-07-261-0/+2
| | | | | | | | | | | 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>
* Pick up on androidboot.hardware kernel cmd optionVladimir Chtchetkine2011-09-281-0/+1
| | | | | | | 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: Add ueventd.rc parsing to ueventdColin Cross2010-04-211-0/+2
| | | | Change-Id: Iea53050d6c10e8cabf563e5d80e84eaf78873695
* init: Move uevent handling to an external ueventd processColin Cross2010-04-211-0/+7
| | | | Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
* init: Add wait command and mount wait flagColin Cross2010-04-211-0/+1
| | | | Change-Id: I6b4c10f8f246095a7fb7342388ec4f6ff97d5733
* init: create symlinks to block device nodesColin Cross2010-04-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | eMMC block device names may change based on the detection order of the eMMC device and any other SD bus devices, such as a removable SD card. This patch adds support to init for: * Symlinks to block devices. When a block device uevent is processed, if it starts with "/devices/platform", the platform driver name is parsed out, and symlinks to the block device are created in /dev/block/platform/<platform driver>/ * Symlinks based on partition name and number. If the uevent for a block device contains information on the partition name or number, symlinks are created under /dev/block/platform/<platform driver>/by-num/p<partition> and /dev/block/platform/<platform driver>/by-name/<partition name> init.rc can then use a device path like the following to mount an eMMC device: /dev/block/platform/<platform>/by-name/system /system ro Change-Id: Id11bb7cdf1e2ada7752a5bd671cbf87237b34ae2
* init: Move prototypes for util.c into util.hColin Cross2010-04-131-0/+27
Change-Id: I46a91849ce5297eb2597dd6134412f817564ec24