History log of /system/core/init/ueventd.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
439224e27530353351c7df504fb29fad9ac776a0 24-Jun-2014 Stephen Smalley <sds@tycho.nsa.gov> Redirect libselinux logging to dmesg for ueventd.

We already do this for init, but had failed to do it for ueventd
and could not capture any logging from libselinux calls made by
ueventd.

Truly enabling non-error logging also requires uncommenting a line
in Android.mk:
LOCAL_CFLAGS += -DLOG_UEVENTS=1
which enables other logging and sets the default log level to INFO,
or otherwise changing the klog level in the ueventd code (is not
settable by init.rc loglevel).

Change-Id: I00e6f9d6271f2a21d9078c96368816d74d6d2850
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
/system/core/init/ueventd.c
c0c1ffea588c7d3c565b79d4f8bf3d4a8f75abc9 02-Jul-2012 Daniel Leung <daniel.leung@intel.com> init/ueventd: adds wildcard matching for ueventd rules

The sysfs nodes can change from devices to devices for
a particular class of peripheral. Some of them even change
after suspend/resume, e.g. rfkill for USB bluetooth adapters.

This patch adds to the way how ueventd rules with wildcard are
handled. In addition to matching the prefix with a trailing
wildcard, now rules can have wildcard anywhere in the rule.
The wildcard matching is implemented using fnmatch(), where
its matching is simliar to shell pathname expansion. It suits
this particular usage model well. To avoid abuse, the number of
slashes has to match between path name and the rule.

For example, instead of creating a rule to match:

/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/rfkill*

, this would suffice:

/sys/devices/pci0000:00/0000:00:1d.0/*/*/*/*/bluetooth/hci0/rfkill*

The prefix matching behavior is retained, such that those
rules do not have to pay for processing penalty with fnmatch().

Change-Id: I3ae6a39c838f6d12801cb71958e481b016f731f5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
/system/core/init/ueventd.c
eb6ffc765b4a2919bbabd3132bf2bd68a4966415 19-Mar-2014 Alex Ray <aray@google.com> ueventd: fix klog debug typo

Change-Id: Ib0acece15145cc0e868452ede8f3acbab419b965
/system/core/init/ueventd.c
18ccc1b8ee8f74ec9dde20782948c78e8ba2667f 07-Mar-2014 Alex Ray <aray@google.com> ueventd: easier debug logging

Move ueventd debug flag into the Android.mk.
Boost klog level if event logging enabled.

Change-Id: Iae48edbc43c487092c2424023576af29c76ff401
/system/core/init/ueventd.c
1d4e86c44589b3a97ca0113493c2e569c3aabcc6 10-Nov-2013 Amir Goldstein <amir@cellrox.com> ueventd: fix a busy loop while reading uevents

Under certain conditions, poll() may raise the POLLERR
flag along with POLLIN, in which case the check for
(ufd.revents == POLLIN) results in an endless busy loop.

The following fix was applied to
hardware/libhardware_legacy/uevent/uevent.c
to fix a similar bug:

commit 3aabb260ceef10377c31c9e45fb239247f5cfeba
Author: Mathias Agopian <mathias@google.com>
Date: Mon Oct 1 14:53:18 2012 -0700

fix a typo in uevent_next_eventi

Bug: 7114973
Change-Id: I15a4c714b59aeb1d02db00517d70b5f0e5ab22c2

Applying the same fix for two more poll loops in init
and ueventd.

Change-Id: I50693f6d3c904992ac4b8a9a14a83c7106e6b9e0
/system/core/init/ueventd.c
4f97fd91e361c8fc2f5fbcab0fa34e2bd68d3218 03-Aug-2012 Veeren Mandalia <v.mandalia@sta.samsung.com> init: fix return value for android uid/gid check

Now get_android_id function returns -EINVAL if the uid/gid is not in the list
of android ids. This will allow ueventd to catch invalid ids and report the
error.

Change-Id: I943b04dd64d518891623e1ee2d561b8061af4863
Signed-off-by: Veeren Mandalia <v.mandalia@sta.samsung.com>
/system/core/init/ueventd.c
6ebf12fe1bc2de7af4522349973e8bfcc71d6126 26-Mar-2012 Nick Kralevich <nnk@google.com> init: Change umask of forked processes to 077

Modify init to set the umask to 077 when forking processes.
This helps protect against inadvertant information disclosure
in init's child processes.

ueventd: Keep umask at 000. uevent needs to be able to
create device nodes with exactly the permissions it
indicates.

Testing:
1) Do an "ls -lR /data /dev" on the device before and after
the umask change and diff the output. Verified by hand
that the permission change wouldn't cause any problems.

2) Verify that package installation works, and the permissions
are as expected, when installing a program from market and
"adb install".

Bug: 3272072
Change-Id: Ie4f7f06c0ee9da8d9b6fce25d71d8991a9bce406
/system/core/init/ueventd.c
2b99543cef1b8b0aa8cca39544939910035117b0 28-Sep-2011 Vladimir Chtchetkine <vchtchetkine@google.com> Pick up on androidboot.hardware kernel cmd option

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
/system/core/init/ueventd.c
8f91282ebe1963b9d27f8779ad1342302b293bd2 01-Sep-2011 Dima Zavin <dima@android.com> init/cutils: move kernel logging interface to libcutils from init

Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8
Signed-off-by: Dima Zavin <dima@android.com>
/system/core/init/ueventd.c
8d48c8e45724c7103f0ace7885d339e49399908b 24-Mar-2011 Brian Swetland <swetland@google.com> 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
/system/core/init/ueventd.c
bc57d4ce925a62f14c28c55e0ff28af1114f12be 27-Oct-2010 Brian Swetland <swetland@google.com> 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
/system/core/init/ueventd.c
44b65d047cc39baf30e21bfd8dd438f6bc1f77f5 20-Apr-2010 Colin Cross <ccross@android.com> init: Add ueventd.rc parsing to ueventd

Change-Id: Iea53050d6c10e8cabf563e5d80e84eaf78873695
/system/core/init/ueventd.c
f83d0b9af5cbe4440cc41ceaa8a7806a13c86282 21-Apr-2010 Colin Cross <ccross@android.com> init: Move uevent handling to an external ueventd process

Change-Id: Iea6c56013062ade633a1754f7bcf8cf09b3dedc1
/system/core/init/ueventd.c