summaryrefslogtreecommitdiffstats
path: root/src/rfkill (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering2015-10-271-0/+1
|
* util-lib: split out IO related calls to io-util.[ch]Lennart Poettering2015-10-261-0/+1
|
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-0/+1
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* util: split out escaping code into escape.[ch]Lennart Poettering2015-10-241-0/+1
| | | | This really deserves its own file, given how much code this is now.
* rfkill: consistently use = in designatorThomas Hindoe Paaboel Andersen2015-10-111-2/+2
|
* rfkill: rework and make it listen on /dev/rfkillLennart Poettering2015-10-011-77/+355
| | | | | | | | | | | | | | With this rework we introduce systemd-rfkill.service as singleton that is activated via systemd-rfkill.socket that listens on /dev/rfkill. That way, we get notified each time a new rfkill device shows up or changes state, in which case we restore and save its current setting to disk. This is nicer than the previous logic, as this means we save/restore state even of rfkill devices that are around only intermittently, and save/restore the state even if the system is shutdown abruptly instead of cleanly. This implements what I suggested in #1019 and obsoletes it.
* fileio: consolidate write_string_file*()Daniel Mack2015-07-071-1/+1
| | | | | | | Merge write_string_file(), write_string_file_no_create() and write_string_file_atomic() into write_string_file() and provide a flags mask that allows combinations of atomic writing, newline appending and automatic file creation. Change all users accordingly.
* rfkill: rework how we generate file names from rfkill devicesLennart Poettering2014-12-031-23/+24
| | | | | | | | | Generate the file name from ID_PATH plus the rfkill type (wlan, bluetooth, ...) and ignore the rfkill device name, since it apparently is not a stable identifier. Also, ensure that devices disappearing don't result in broken services, simply exit cleanly.
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-281-1/+1
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-281-5/+5
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-281-5/+5
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* rfkill: Avoid error when state restore is disabledBastien Nocera2013-12-061-1/+4
| | | | | | When the state restore is disabled, we would print: "Unknown verb: load" instead of simply skipping loading the state.
* util: unify reading of /proc/cmdlineLennart Poettering2013-11-061-1/+1
| | | | | | Instead of individually checking for containers in each user do this once in a new call proc_cmdline() that read the file only if we are not in a container.
* trivial: rfkill - don't include util.h twiceTom Gundersen2013-10-191-1/+0
|
* trivial: rfkill: It's util.h, not utils.hColin Walters2013-10-191-1/+1
| | | | How about we actually run make locally before pushing, eh?
* kerne-command-line: introduce option 'systemd.restore_state'Tom Gundersen2013-10-191-1/+2
| | | | | | | | When set to 0 this will stop tools like the backlight and rfkill tools to restore state from previous boot. This is useful in case the stored state is bogus to the extent that it is preventing you from resetting it (e.g., the backlight settings cause the screen to be off on boot on a system where the backlight can not be adjusted directly from the keyboard).
* backlight: include ID_PATH in file names for backlight settingsLennart Poettering2013-10-141-1/+1
| | | | | | Much like for rfkill devices we should provide some stability regarding enumeration order, hence include the stable bits of the device path in the file name we store settings under.
* rfkill: use ID_PATH as identifier for rfkill state filesLennart Poettering2013-10-141-24/+16
| | | | | | Let's include the stable device path for the rfkill devices in the name of the file we store the rfkill state in, so that we have some stability regarding enumeration order.
* rfkill: add new rfkill tool to save/restore rfkill state across rebootsLennart Poettering2013-10-142-0/+147
This works analogous to the existing backlight and random seed services