summaryrefslogtreecommitdiffstats
path: root/init/devices.cpp
Commit message (Collapse)AuthorAgeFilesLines
* init: consider all platform devices for find_platform_deviceTom Cherry2015-04-231-10/+0
| | | | | | | | | | | | | | | | | | | | | | | Certain platforms list their platform devices with a path other than the current /devices or /devices/platform. Additionally, sometimes these paths are a platform device themselves. An example are devices with a path /devices/soc.0/... where /devices/soc.0 is also a platform devices. Instead of continuing to special case these path prefixes, we can consider the entire path, given that no mmc or usb devices create platform devices as subdevices, which they should not by their very nature. This keeps the symlinks for block devices named identically for current platform devices and places them in /dev/block/<full path to device> for devices in locations other than /devices or /devices/platform, eg /dev/block/platform/soc.0/7824900.sdhci This keeps the symlinks for character deviced named identically for all cases. Change-Id: Ifc8eedf1086db1826dbc8f7e96cdfcfa5da876b3
* Further cleanup of the logic in device_init.Elliott Hughes2015-03-281-11/+11
| | | | Change-Id: I96e4b11894926b50792b9b7d7cfa0fe8392abef6
* Fix clang build by removing unused locals.Elliott Hughes2015-03-281-9/+3
| | | | | | | | | | Also don't manually set FD_CLOEXEC on a socket that's always opened with SOCK_CLOEXEC. (None of the other callers to the function do this.) Also move locals to where they're first used to help prevent more of this kind of breakage. Change-Id: I1ba7cd9400f53508dffb51a2bbf9d491ae647f26
* Log more timing information from init.Elliott Hughes2015-03-281-14/+4
| | | | | | | | | | | | | | | | | 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
* Always use strerror to report errno.Elliott Hughes2015-03-201-1/+1
| | | | Change-Id: Icd18e4bd7dc093c18967f45b99cd451359457b03
* init: refactor firmware loading locations into tableDaniel Rosenberg2015-03-201-44/+32
| | | | | Change-Id: I3ce8f9d237bf783335ae85540306aa539a8da568 Signed-off-by: Daniel Rosenberg <drosen@google.com>
* Move sprintf to snprintf.Yabin Cui2015-02-171-1/+1
| | | | | Bug: 19340053 Change-Id: Id0d866e6195ed4752b4be6081eeb2aab8b1dbe9a
* Clean up reading and writing in init.Elliott Hughes2015-02-061-9/+2
| | | | | | | | | | | | | 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
* Stop using #if for conditional compilation.Elliott Hughes2015-02-041-22/+12
| | | | | | | | Use regular 'if' to prevent bitrot. Also remove remaining typedefs. Change-Id: I2e6ca928e2db29b88b643cf990ff05cfb0be94a6
* Build init as C++.Elliott Hughes2015-02-041-0/+1061
This is just the minimal change to keep it building. Change-Id: I245c5b8413a1db114576c81462eb5737f5ffcef2