Commit graph

110 commits

Author SHA1 Message Date
Stephen Smalley
e2eb69db6d Handle policy reloads within ueventd rather than restarting it.
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>
2013-07-26 15:39:41 -04:00
Colin Cross
f987398723 am 5954ecb8: Merge "Allow more characters in partition name links"
* commit '5954ecb87b8c77425d8cc766c0cc798957a07a7d':
  Allow more characters in partition name links
2013-07-22 15:40:55 -07:00
Johan Redestig
93ca79b445 Allow more characters in partition name links
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
2013-07-18 10:06:01 +02:00
Ajay Dudani
05a5205566 am 76c58893: Free file handle for /firmware/image after use
* commit '76c5889325c2ada5dda07fd9af20a4a485978538':
  Free file handle for /firmware/image after use
2013-06-14 08:36:02 -07:00
Ajay Dudani
76c5889325 Free file handle for /firmware/image after use
Change-Id: Id59e25486b45dffc87a89a961970a6e8128a5237
2013-06-13 13:18:12 -07:00
Stephen Smalley
5f7b017f41 Update ueventd set the SELinux context on sysfs
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>
2013-04-03 17:44:19 -07:00
Dima Zavin
f395c9237d ueventd: allow platform devices to have just a /devices/ prefix
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>
2013-03-14 18:14:32 -07:00
Dima Zavin
53a0288463 ueventd: allow platform devices to have just a /devices/ prefix - DO NOT MERGE
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>
2013-03-11 11:13:17 -07:00
Andrew Boie
d562ca78aa ueventd: Increase uevent buffer size
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>
2013-01-04 11:37:34 -08:00
Kenny Root
2a36ae5608 am 7b88a90d: Merge "Remove HAVE_SELINUX guards"
* commit '7b88a90da2a27e347fc16c14fa577f4ae1ef07fd':
  Remove HAVE_SELINUX guards
2012-10-17 09:57:10 -07:00
Kenny Root
b5982bf7c6 Remove HAVE_SELINUX guards
Change-Id: I8272c573b3c5dc663203bafab68fad5e94d89364
2012-10-16 23:18:18 -07:00
Jean-Baptiste Queru
96539e8153 am ee0d281a: am c95c15b1: Merge "Char device /dev/dri/card0 was not created during startup."
* commit 'ee0d281a3e5fe611bdda23db18fa0e5684ee43ed':
  Char device /dev/dri/card0 was not created during startup.
2012-08-14 08:41:16 -07:00
Jean-Baptiste Queru
c95c15b192 Merge "Char device /dev/dri/card0 was not created during startup." 2012-08-14 08:06:44 -07:00
Kenny Root
605103fb55 resolved conflicts for merge of 4dcd52ab to jb-mr1-dev
Change-Id: Ibd0c03a7883a2e31adab18543c016776b7b36866
2012-08-13 10:21:35 -07:00
Stephen Smalley
ae6f3d7c05 Add support for reloading policy from /data/system.
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>
2012-08-09 09:59:10 -04:00
Jean-Baptiste Queru
ff5c802e6c am faad67fa: am ef3f7fa3: Merge "Set the SELinux security label on new directories."
* commit 'faad67fac68642ca039fe5c29099acebf546f5ee':
  Set the SELinux security label on new directories.
2012-08-08 14:06:27 -07:00
Jean-Baptiste Queru
ef3f7fa32b Merge "Set the SELinux security label on new directories." 2012-08-08 13:42:20 -07:00
Ed Heyl
3cac204d35 Merge remote-tracking branch 'goog/jb-dev-mako' into jb-mr1-dev 2012-07-28 11:48:12 -07:00
Stephen Smalley
e096e36e50 Set the SELinux security label on new directories.
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>
2012-07-26 09:01:22 -04:00
Colin Cross
308bc52d33 ueventd: fixup /sys permissions on change uevents
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
2012-07-24 12:36:40 -07:00
Lukasz Anaczkowski
e6f8d45da8 Char device /dev/dri/card0 was not created during startup.
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>
2012-07-23 16:08:17 -07:00
Iliyan Malchev
029d44e6ae HACK: use /firmware/image as a 3rd choice
Change-Id: I74af2e2dc872f88b904ead13e300ae32547e70c8
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-11 14:18:45 -07:00
Wei Zhong
f97b887848 Add handling for DEVNAME for usb devices
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>
2012-03-23 14:16:37 -07:00
Stephen Smalley
e46f9d510d Extend init and ueventd for SE Android.
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
2012-02-01 07:49:08 -05:00
Dima Zavin
da04c52ab1 init/cutils: move list utility code to cutils from init
Change-Id: I357ceee813700297d8343159f22a07659e768d41
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:18 -07:00
Dima Zavin
2d55e02d0f libcutils/init: move uevent socket opening code to libcutils
Change-Id: I90adf78c0eb6185505f2bf7b62e96e25ab918345
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:17 -07:00
Nick Kralevich
57de8b8f27 rename uevent_checked_recv to uevent_kernel_multicast_recv
Change-Id: I1839627490080efcbb7269699709064856312f8b
2011-05-11 14:58:24 -07:00
Nick Kralevich
4682abaaa6 am b0d0e260: resolved conflicts for merge of 2baeb898 to honeycomb-plus-aosp
* commit 'b0d0e260bd6118959fa0e2d3c84037b3e0178551':
  Fold uevent message origin checking from init into libcutils.
2011-04-27 13:49:59 -07:00
Nick Kralevich
b0d0e260bd resolved conflicts for merge of 2baeb898 to honeycomb-plus-aosp
Change-Id: Ib3169b3a36aa13ef413da624355b1737e9b76fd9
2011-04-27 13:09:24 -07:00
Vernon Tang
3f582e92f0 Fold uevent message origin checking from init into libcutils.
Change-Id: I7cbc0cb840d1b4962e6c360fdad9a9c0ce20e87b
2011-04-28 05:16:21 +10:00
Nick Kralevich
bb738d6727 am de35f274: am 03752be0: am 0c297f5e: Merge "Revert "Fold uevent message origin checking from init into libcutils.""
* commit 'de35f2741c4e32e331a92be99f7c04b92b94beb2':
  Revert "Fold uevent message origin checking from init into libcutils."
2011-04-27 10:37:48 -07:00
Nick Kralevich
de35f2741c am 03752be0: am 0c297f5e: Merge "Revert "Fold uevent message origin checking from init into libcutils.""
* commit '03752be0a437d12e19ac73ebe23385fe6f756e2c':
  Revert "Fold uevent message origin checking from init into libcutils."
2011-04-27 10:35:06 -07:00
Nick Kralevich
de9e65dd65 Revert "Fold uevent message origin checking from init into libcutils."
This reverts commit 8405ec0e75.

The original change does not compile.
2011-04-27 10:21:24 -07:00
Nick Kralevich
3268eda4dc am e3ab4245: am a7cf7ed9: am 282c2ab4: Merge "Fold uevent message origin checking from init into libcutils."
* commit 'e3ab42457077ec2a66bac553e59a7fee08d4fa9e':
  Fold uevent message origin checking from init into libcutils.
2011-04-27 10:00:34 -07:00
Nick Kralevich
e3ab424570 am a7cf7ed9: am 282c2ab4: Merge "Fold uevent message origin checking from init into libcutils."
* commit 'a7cf7ed93486240ca48a407e67c7c3683a3b93aa':
  Fold uevent message origin checking from init into libcutils.
2011-04-27 09:59:14 -07:00
Vernon Tang
8405ec0e75 Fold uevent message origin checking from init into libcutils.
Change-Id: I1a38e611a7ad990f74306ce453740a1eeed2416d
2011-04-27 14:17:15 +10:00
Colin Cross
fadb85e3bd ueventd: track platform device uevents to parse block device names
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
2011-03-31 16:44:04 -07:00
Colin Cross
eb5ba83065 ueventd: refactor uevent handling
Change-Id: I2002be3580ff87b0a55dc030a9099bf6d795011f
2011-03-31 16:37:20 -07:00
Brian Swetland
8d48c8e457 defer firmware load until after filesystems are mounted
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
2011-03-25 13:01:35 -07:00
Olivier Bailly
b93e5812fa Add missing headers for compilation on x86 targets
Change-Id: I5f4dc797b353a0f01fa00d38375ec303bf863254
2010-11-17 11:47:23 -08:00
Benoit Goby
609d8828d3 init: Abort firmware transfer if firmware is missing
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>
2010-11-09 18:49:40 -08:00
Brian Swetland
7ca8f1243b am 439b4dfb: am bc57d4ce: init: support owner/permission setting for sysfs attributes of devices 2010-10-26 15:42:22 -07:00
Brian Swetland
bc57d4ce92 init: support owner/permission setting for sysfs attributes of devices
This should be much nicer than peppering init.rc with chown/chmod
directives.

Also, remove some dead code and obsolete comments.

Change-Id: I10895f10a9cf2f1226c8d12976cd3db3743da9ec
2010-10-26 15:37:06 -07:00
Brian Swetland
d06df51bcd resolved conflicts for merge of 3b5214a6 to master
Change-Id: Id73c53c6c2e9c21eb9b1d1e624aaeb25097ea7a4
2010-09-19 04:35:19 -07:00
Brian Swetland
02863b957c add /vendor support
- 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
2010-09-19 03:36:39 -07:00
Colin Cross
3eaa4e52d3 am 49b8124a: am 17dcc5c5: Use makedev helper for device major and minor numbers
Merge commit '49b8124a1759cb8b27e0c21a1a5a54b8a81bdb19'

* commit '49b8124a1759cb8b27e0c21a1a5a54b8a81bdb19':
  Use makedev helper for device major and minor numbers
2010-09-03 14:13:05 -07:00
Colin Cross
17dcc5c57d Use makedev helper for device major and minor numbers
Major and minor numbers can be greater than 255.  Major numbers
are 12 bits, and minor numbers are 20 bits.  Supporting major
and minor numbers > 255 allows the use of the extended block
device for extra mmc partitions.

Change-Id: I4c42bfe0781069e8e4cb13ebe26e860cdc03f866
2010-09-03 12:27:01 -07:00
Benoit Goby
d2278638d6 init: Add symlinks to USB character devices
Since we now support USB host mode, devices might get a different device
file depending if other devices are connected on the host port. This
patch creates symlinks to USB character devices that depend on the port
devices are connected to, but not on the order they have been probed.
(e.g. /dev/usb/tty2-1:1.0 -> /dev/ttyUSB0)

Change-Id: I285bcc2d59446fbff8a7abbe39c21781f3bb4bd3
2010-08-10 15:13:07 -07:00
Nick Kralevich
fad7204e9e resolved conflicts for merge of 5f5d5c8c to gingerbread
Change-Id: Ieee2cd67d33f3e774fcfd96f8a5f67a0374aa873
2010-07-19 15:53:05 -07:00
Nick Kralevich
5f5d5c8cef validate the source of uevent messages
Bug: 2844206
Change-Id: If2eee54181abfc6c7fda0232f98fa6bb5d12c60c
2010-07-19 14:54:50 -07:00