summaryrefslogtreecommitdiffstats
path: root/init/util.h
Commit message (Collapse)AuthorAgeFilesLines
* am ecf184c9: am 9c9280d8: Merge "init: get rid of the remaining double mounts"Nick Kralevich2015-04-261-1/+2
|\ | | | | | | | | * commit 'ecf184c901b78994773d687763c1478752e9375e': init: get rid of the remaining double mounts
| * init: get rid of the remaining double mountsNick Kralevich2015-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't double mount /dev and its subdirectories anymore. Instead, the first stage init is solely responsible for mounting it. Don't have init prepare the property space. This is the responsibility of the second stage init. Don't have SELinux use the property space to determine how we should be running. Instead, create a new function and extract the data we need directly from /proc/cmdline. SELinux needs this information in the first stage init process where the property service isn't available. Change-Id: I5b4f3bec79463a7381a68f30bdda78b5cc122a96
* | resolved conflicts for merge of 79f33846 to lmp-mr1-dev-plus-aospEd Tam2015-04-131-1/+1
|\ \ | |/ |/| | | Change-Id: I24c60a2747931917a3ea09b953905ce0f4145280
| * fs_mgr: introduce fs_mgr_format to format wiped partitionsChris Fries2015-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Move fastboot's format logic into fs_mgr, to consolidate the knowledge about how to do this (and when to wipe metadata). Try to format these formattable paritions if they are wiped. If formatting fails, we will fall out to let recovery mode handle it. Bug: 20082763 Change-Id: I397cc197550e78d932e8a154fd234695c46dbe7b
| * am 0cbaed42: am a8ba1f2f: Merge "Add support for socket security context ↵Colin Cross2013-08-231-1/+1
| |\ | | | | | | | | | | | | | | | | | | specification." * commit '0cbaed4211b514dd2aaa4d28f8936ba58e83c6a5': Add support for socket security context specification.
| * | init: call restorecon on /sysNick Kralevich2013-07-151-0/+1
| | | | | | | | | | | | | | | | | | Not all files on /sys are not getting labeled properly. Fix them. Change-Id: I9dcff76354e7f50d41f1b6e702836cfbbc149278
* | | 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