summaryrefslogtreecommitdiffstats
path: root/init/devices.c
Commit message (Collapse)AuthorAgeFilesLines
* liblog: enable logging to logd.Mark Salyzyn2014-02-281-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | * Modify liblog to send all messages to the new syslog user space daemon. Original-Change-Id: I0ce439738cd921efb2db4c1d6a289a96bdbc8bc2 Original-Change-Id: If4eb0d09409f7e9be3eb4bb7017073dc7e931ab4 Signed-off-by: Nick Kralevich <nnk@google.com> * Add a TARGET_USES_LOGD make flag for BoardConfig.mk to manage whether logd is enabled for use or not. * rename syslog to logd to avert confusion with bionic syslog * Add fake log support back in * prefilter for logging messages from logd * Fill in timestamps at logging source * update abstract log reader * switch from using suffix for id to v3 format * log a message when creating devices that a deprecated interface is being utilized. Signed-off-by: Mark Salyzyn <salyzyn@google.com> (cherry pick from commit 099e2c1f6f706a8600c1cef74cce9066fc315480) Change-Id: I47929a5432977a1d7235267a435cec0a7d6bd440
* Remove an unused #include of <asm/page.h>.Elliott Hughes2014-02-241-1/+0
| | | | Change-Id: I000aead8c82ec11151f69e6ce439dd09b0f0b4f4
* init: add subsystem rules to ueventd.rcGreg Hackmann2013-11-261-29/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default ueventd creates device nodes under /dev based on the ueventd DEVPATH. Several subsystems have special rules which are hardcoded in devices.c. Moving forward these special rules should go in ueventd.rc. Special rules have the syntax: subsystem <s> devname (uevent_devname|uevent_devpath) [dirname <dir>] Devices matching SUBSYSTEM=<s> will be populated under <dir>. dirname is optional and defaults to /dev. If dirname is provided, <dir> must start with "/". If devname is uevent_devname, ueventd will create the device node as <dir>/DEVNAME. DEVNAME may include intermediate subdirectories, which ueventd will automatically create. If devname is uevent_devpath, ueventd will use the legacy behavior of computing DEVPATH_BASE=basepath(DEVPATH), and creating the device node as <dir>/DEVPATH_BASE. The new parsing code is based on init_parser.c, with small tweaks to handle commands which don't fall under a section header. Change-Id: I3bd1b59d7e62dfc9d289cf6ae889e237fb5bd7c5 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* init: handle ueventd path truncation betterGreg Hackmann2013-11-261-2/+16
| | | | | | | | Log an error before discarding problematic events, and add a missing truncation check to the usb subsystem's unique codepath Change-Id: I0d05aa287ffc63b46d1752d2a7409d35dc8caca7 Signed-off-by: Greg Hackmann <ghackmann@google.com>
* 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-221-0/+2
|\ | | | | | | | | * commit '5954ecb87b8c77425d8cc766c0cc798957a07a7d': Allow more characters in partition name links
| * Allow more characters in partition name linksJohan Redestig2013-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 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
| * ueventd: allow platform devices to have just a /devices/ prefix - DO NOT MERGEDima Zavin2013-03-111-39/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using device tree, platform devices may not have a /devices/platform/ path prefix, but can be rooted in /devices/. Modify the platform device tracking code to store the device path as well as the name. This way, when we create symlinks, we can correctly skip the base platform device prefix and get to the proper device node path. Change-Id: I939ef8fbcb45c5c803cd9a054e40136a912efc72 Signed-off-by: Dima Zavin <dima@android.com>
* | Update ueventd set the SELinux context on sysfsStephen Smalley2013-04-031-0/+9
| | | | | | | | | | | | | | | | This change enables labeling of dynamically created sysfs nodes with specific SELinux security contexts. Change-Id: If8b8d66120453123c1371ce063b6f20e8b96b6ef Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | ueventd: allow platform devices to have just a /devices/ prefixDima Zavin2013-03-141-39/+44
|/ | | | | | | | | | | | | | When using device tree, platform devices may not have a /devices/platform/ path prefix, but can be rooted in /devices/. Modify the platform device tracking code to store the device path as well as the name. This way, when we create symlinks, we can correctly skip the base platform device prefix and get to the proper device node path. Change-Id: I939ef8fbcb45c5c803cd9a054e40136a912efc72 Signed-off-by: Dima Zavin <dima@android.com>
* ueventd: Increase uevent buffer sizeAndrew Boie2013-01-041-2/+2
| | | | | | | | | | | | | As it turns out, no, 64K is not enough. A device provisioning tool was generating many uevents as it manipulated the GPT, causing events near the end of the process (including events as a result of the final BLKRRPART ioctl()) to get lost. It's not clear what the best value for this should be, but increasing to 256K fixed the problem in this case. Change-Id: I4883b34e96c89e8a6fa581bc9cd121bb021b5694 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* am 7b88a90d: Merge "Remove HAVE_SELINUX guards"Kenny Root2012-10-171-12/+5
|\ | | | | | | | | * commit '7b88a90da2a27e347fc16c14fa577f4ae1ef07fd': Remove HAVE_SELINUX guards
| * Remove HAVE_SELINUX guardsKenny Root2012-10-161-12/+5
| | | | | | | | Change-Id: I8272c573b3c5dc663203bafab68fad5e94d89364
* | am ee0d281a: am c95c15b1: Merge "Char device /dev/dri/card0 was not created ↵Jean-Baptiste Queru2012-08-141-0/+3
|\ \ | |/ | | | | | | | | | | during startup." * commit 'ee0d281a3e5fe611bdda23db18fa0e5684ee43ed': Char device /dev/dri/card0 was not created during startup.
| * Merge "Char device /dev/dri/card0 was not created during startup."Jean-Baptiste Queru2012-08-141-0/+3
| |\
| | * Char device /dev/dri/card0 was not created during startup.Lukasz Anaczkowski2012-07-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This device is required by libdrm for GPUs like IvyBridge. Change-Id: I0ac47056a9cec2100f3e6eaa5591571fe6bbc145 Signed-off-by: Lukasz Anaczkowski <lukasz.anaczkowski@intel.com> Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
* | | resolved conflicts for merge of 4dcd52ab to jb-mr1-devKenny Root2012-08-131-6/+5
|\ \ \ | |/ / | | | | | | Change-Id: Ibd0c03a7883a2e31adab18543c016776b7b36866
| * | Add support for reloading policy from /data/system.Stephen Smalley2012-08-091-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | 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-27/+1
| |\ \ | | |/ | |/|
| | * Set the SELinux security label on new directories.Stephen Smalley2012-07-261-27/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'goog/jb-dev-mako' into jb-mr1-devEd Heyl2012-07-281-11/+19
|\ \ \
| * | | HACK: use /firmware/image as a 3rd choiceIliyan Malchev2012-06-111-11/+19
| |/ / | | | | | | | | | | | | Change-Id: I74af2e2dc872f88b904ead13e300ae32547e70c8 Signed-off-by: Iliyan Malchev <malchev@google.com>
* | | ueventd: fixup /sys permissions on change ueventsColin Cross2012-07-241-1/+1
|/ / | | | | | | | | | | | | Change uevents may be triggered after new files are created on a device in /sys, run the sys permissions fixup when they occur. Change-Id: Iec2725c9f8a032e5124190444edaf189a766b0b2
* | Add handling for DEVNAME for usb devicesWei Zhong2012-03-231-13/+39
|/ | | | | | | | | | When creating device node, user-space handler should honor device node provided by kernel if present. Bug: 6105248 Change-Id: I9ab3810563f29f065c239e15149882db28f08893 Signed-off-by: Wei Zhong <wzhong@google.com>
* Extend init and ueventd for SE Android.Stephen Smalley2012-02-011-12/+70
| | | | | | | | | | | | | | | 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/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>
* libcutils/init: move uevent socket opening code to libcutilsDima Zavin2011-09-021-28/+2
| | | | | Change-Id: I90adf78c0eb6185505f2bf7b62e96e25ab918345 Signed-off-by: Dima Zavin <dima@android.com>
* rename uevent_checked_recv to uevent_kernel_multicast_recvNick Kralevich2011-05-111-1/+1
| | | | Change-Id: I1839627490080efcbb7269699709064856312f8b
* am b0d0e260: resolved conflicts for merge of 2baeb898 to honeycomb-plus-aospNick Kralevich2011-04-271-29/+5
|\ | | | | | | | | * commit 'b0d0e260bd6118959fa0e2d3c84037b3e0178551': Fold uevent message origin checking from init into libcutils.
| * resolved conflicts for merge of 2baeb898 to honeycomb-plus-aospNick Kralevich2011-04-271-29/+5
| |\ | | | | | | | | | Change-Id: Ib3169b3a36aa13ef413da624355b1737e9b76fd9
| | * Fold uevent message origin checking from init into libcutils.Vernon Tang2011-04-281-29/+5
| | | | | | | | | | | | Change-Id: I7cbc0cb840d1b4962e6c360fdad9a9c0ce20e87b
* | | am de35f274: am 03752be0: am 0c297f5e: Merge "Revert "Fold uevent message ↵Nick Kralevich2011-04-271-5/+29
|\ \ \ | |/ / | | | | | | | | | | | | | | | origin checking from init into libcutils."" * commit 'de35f2741c4e32e331a92be99f7c04b92b94beb2': Revert "Fold uevent message origin checking from init into libcutils."
| * | am 03752be0: am 0c297f5e: Merge "Revert "Fold uevent message origin checking ↵Nick Kralevich2011-04-271-5/+29
| |\ \ | | |/ | | | | | | | | | | | | | | | from init into libcutils."" * commit '03752be0a437d12e19ac73ebe23385fe6f756e2c': Revert "Fold uevent message origin checking from init into libcutils."
| | * Revert "Fold uevent message origin checking from init into libcutils."Nick Kralevich2011-04-271-5/+29
| | | | | | | | | | | | | | | | | | This reverts commit 8405ec0e7562a370174d9973dd94984c47e49c36. The original change does not compile.
* | | am e3ab4245: am a7cf7ed9: am 282c2ab4: Merge "Fold uevent message origin ↵Nick Kralevich2011-04-271-29/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | checking from init into libcutils." * commit 'e3ab42457077ec2a66bac553e59a7fee08d4fa9e': Fold uevent message origin checking from init into libcutils.
| * | am a7cf7ed9: am 282c2ab4: Merge "Fold uevent message origin checking from ↵Nick Kralevich2011-04-271-29/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | init into libcutils." * commit 'a7cf7ed93486240ca48a407e67c7c3683a3b93aa': Fold uevent message origin checking from init into libcutils.
| | * Fold uevent message origin checking from init into libcutils.Vernon Tang2011-04-271-29/+5
| | | | | | | | | | | | Change-Id: I1a38e611a7ad990f74306ce453740a1eeed2416d
* | | ueventd: track platform device uevents to parse block device namesColin Cross2011-03-311-10/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mmc block devices on panda boards use a platform device called omap/omap_hsmmc.0. The number of path entries in the uevent after the platform device is unknown, and the number of path entries in the platform device is unknown, so the only way to determine how many entries make up the platform device is to compare against a list of platform devices. Add a list of platform devices that have been registered, and iterate through it to determine the platform device portion of a block device uevent. Change-Id: I1480bc6429172ca6997d548787be3863ce062472
* | | ueventd: refactor uevent handlingColin Cross2011-03-311-89/+126
| | | | | | | | | | | | Change-Id: I2002be3580ff87b0a55dc030a9099bf6d795011f
* | | defer firmware load until after filesystems are mountedBrian Swetland2011-03-251-9/+20
|/ / | | | | | | | | | | | | | | | | 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
* | Add missing headers for compilation on x86 targetsOlivier Bailly2010-11-171-0/+1
| | | | | | | | Change-Id: I5f4dc797b353a0f01fa00d38375ec303bf863254
* | init: Abort firmware transfer if firmware is missingBenoit Goby2010-11-091-1/+3
| | | | | | | | | | | | | | | | If firmware is not found, write -1 /sys/$DEVPATH/loading to cancel the firmware load. Otherwise the driver has to wait for the 60s timeout. Change-Id: Id2787cda9b2be45b9adea41f6f161cd54cda212e Signed-off-by: Benoit Goby <benoit@android.com>
* | am 439b4dfb: am bc57d4ce: init: support owner/permission setting for sysfs ↵Brian Swetland2010-10-261-29/+48
|\ \ | |/ | | | | attributes of devices
| * init: support owner/permission setting for sysfs attributes of devicesBrian Swetland2010-10-261-29/+48
| | | | | | | | | | | | | | | | | | This should be much nicer than peppering init.rc with chown/chmod directives. Also, remove some dead code and obsolete comments. Change-Id: I10895f10a9cf2f1226c8d12976cd3db3743da9ec
* | resolved conflicts for merge of 3b5214a6 to masterBrian Swetland2010-09-191-9/+18
|\ \ | |/ | | | | Change-Id: Id73c53c6c2e9c21eb9b1d1e624aaeb25097ea7a4
| * add /vendor supportBrian Swetland2010-09-191-9/+18
| | | | | | | | | | | | | | | | | | | | - look in /vendor/firmware/... in addition to /system/etc/firmware/... for firmware loading - add /vendor/bin to path before /system/bin - add /vendor/lib to ldpath before /system/lib - configure appropriate permissions for /system/vendor/bin - symlink /vendor -> /system/vendor Change-Id: I0c06ca1e38a44f0c7024cee6cea8907aa93a4532
* | am 49b8124a: am 17dcc5c5: Use makedev helper for device major and minor numbersColin Cross2010-09-031-4/+1
|\ \ | |/ | | | | | | | | | | Merge commit '49b8124a1759cb8b27e0c21a1a5a54b8a81bdb19' * commit '49b8124a1759cb8b27e0c21a1a5a54b8a81bdb19': Use makedev helper for device major and minor numbers