summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* misc: cleanup UUID_STR_LEN definitionsKarel Zak2017-09-159-21/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* logger: make stdin parsing more friendly to static analyzersKarel Zak2017-09-151-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: fix coding style and error messagesKarel Zak2017-09-151-7/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: do not fsync(3) /dev/rfkill file descriptorSami Kerola2017-09-151-1/+1
| | | | | | | | Attempt to fsync() this device returns EINVAL, causing the rfkill always to return EXIT_FAILURE when either block or unblock is requested. Simply closing the file descriptor will fix the issue. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rfkill: allow use of multiple argumentsSami Kerola2017-09-152-35/+56
| | | | | | | | | | | | | | | | There is no reason why multiple arguments could not be supported. Most common use case is to do multiple control commands in one go without us of 'all' argument that can cause unnecessary connection breakage. For example someone might want to add to a system initialization following commands. rfkill block bluetooth uwb wimax wwan gps fm nfc That will ensure everything but wifi is turned off with as few commands as possible, without killing wifi at any point. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* script: support sig{stop/cont}Karel Zak2017-09-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * call wait() only when child exited * suspend all session (including script master process) when child get SIGSTOP and send SIGCONT to child when master process resume This allows to suspend all session and later use "fg" shell command to resume. $ ps af 14722 pts/1 Ss 0:00 bash 4870 pts/1 S+ 0:00 \_ ./script 4871 pts/6 Ss+ 0:00 \_ bash -i $ kill -SIGSTOP 4871 and script session on another terminal: $ script Script started, file is typescript $  [1]+ Stopped ./script $ fg 1 ./script ... session again usable ... ^D Script done, file is typescript Signed-off-by: Karel Zak <kzak@redhat.com>
* lsblk: small man page change in return codes descriptionKarel Zak2017-09-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add -a that is short of --adjust to manual page and usageSami Kerola2017-09-052-3/+3
| | | | | | In same go use -V as return value of --version from getopts_long(). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* hwclock: update usage()J William Piggott2017-09-052-2/+2
| | | | | | Improve usage strings for debug and version. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* Merge branch '170825' of github.com:jwpi/util-linuxKarel Zak2017-09-053-52/+37Star
|\ | | | | | | | | | | | | * '170825' of github.com:jwpi/util-linux: hwclock: close hwaudit_fd unconditionally hwclock: don't always use hwclock_exit hwclock: remove sysexits.h
| * hwclock: close hwaudit_fd unconditionallyJ William Piggott2017-09-031-1/+1
| | | | | | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * hwclock: don't always use hwclock_exitJ William Piggott2017-09-031-7/+7
| | | | | | | | | | | | | | | | Special exit handling is not wanted for usage() or bad command syntax. For example we do not want to audit: hwclock --set --date foo Signed-off-by: J William Piggott <elseifthen@gmx.com>
| * hwclock: remove sysexits.hJ William Piggott2017-09-033-48/+33Star
| | | | | | | | | | | | | | | | | | | | | | | | | | sysexits.h was introduced in v2.11t prior to util-linux-ng, with the HISTORY entry: * hwclock: minor polishing. So there was no specific issue solved by adding it. Its use was never documented so it should be safe to remove. Also, fix return values being used for the exit status that were not magic constants (portability issue). Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | uuidgen: add more details to man pageKarel Zak2017-09-051-1/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | uuidgen: add support for hash-based UUIDsPhilip Prindeville2017-09-054-9/+197
| | | | | | | | Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* | misc: replace magic number 37 with UUID_STR_LENPhilip Prindeville2017-09-0514-20/+35
| | | | | | | | Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* | libuuid: add support for hash-based UUIDsPhilip Prindeville2017-09-0518-3/+666
|/ | | | | | | | | Adding V3 and V5 UUIDs per RFC-4122. [kzak@redhat.com: - fix symbols file] Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update sfdisk wipe testKarel Zak2017-09-011-2/+2
| | | | | | | Now command wipefs returns results in the order how superblocks has been detected on the device. Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: add NFC fallback for old headersKarel Zak2017-08-311-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wipefs: cleanup offsets list usage, fix -t filterKarel Zak2017-08-311-110/+99Star
| | | | | | | | | | | * move list with offsets specified by -o to the wipe_control struct * don't clone the list of offsets, just keep it simple and stupid * apply all filters (-o and -t) in get_desc_for_probe() * always return offset and len by get_desc_for_probe() and apply always use libblkid hide & step-back Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1486777 Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/match: make match_fstype() case insensitiveKarel Zak2017-08-311-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: add --disable-rfkillKarel Zak2017-08-311-1/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: cleanup returnsKarel Zak2017-08-311-20/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove unused rfkill.pyKarel Zak2017-08-311-150/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: add Sami to authorsKarel Zak2017-08-312-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rfkill: cleanup usage()Karel Zak2017-08-311-5/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'rfkill' of git://github.com/kerolasa/lelux-utiliteetit into rfkillKarel Zak2017-08-3111-0/+899
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'rfkill' of git://github.com/kerolasa/lelux-utiliteetit: (57 commits) rfkill: add systemd-rfkill(8) see also segment rfkill: check id number refers to a device that exists rfkill: use back and forward compatible test rfkill: add bash-completion file rfkill: inform in syslog when rfkill is invoked rfkill: use human readable timestamps in event output rfkill: use libsmartcols output rfkill: do not ignore read error rfkill: clarify 'all devices' handling rfkill: update manual page rfkill: make programming style to match util-linux project rfkill: make command to build in util-linux project rfkill: move files to appropriate locations add python module use uapi rfkill.h version 0.5 fix compiler warning Add NFC support version 0.4 Add rfkill type "fm" to the man page. ...
| * rfkill: add systemd-rfkill(8) see also segmentSami Kerola2017-08-301-1/+2
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: check id number refers to a device that existsSami Kerola2017-08-301-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier all commands happily accepted without detecting failure when none-existing id number was used. For example: $ rfkill block 2017; echo $? 0 The same input after this change looks following. $ rfkill block 2017; echo $? rfkill: invalid identifier: 2017 1 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: use back and forward compatible testSami Kerola2017-08-301-4/+4
| | | | | | | | | | | | | | | | The rfkill_event struct might grow in future, so ensure the read sizes are at least the minimum, and allow it to be more. Reference: https://github.com/torvalds/linux/blob/master/include/uapi/linux/rfkill.h#L90-L102 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: add bash-completion fileSami Kerola2017-08-302-0/+50
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: inform in syslog when rfkill is invokedSami Kerola2017-08-301-0/+10
| | | | | | | | | | | | | | | | | | This should help when trying to explain what or who is flicking wireles on or off. Notice that the change is not perfect - if rfkill command is setting a state that is already set the syslog entry is sent eventhough there was no effective change. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: use human readable timestamps in event outputSami Kerola2017-08-301-4/+11
| | | | | | | | | | | | | | The event command appears to be something what primarily a developers will to use when debugging. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: use libsmartcols outputSami Kerola2017-08-304-87/+234
| | | | | | | | | | | | | | This also makes the rfkill to output status when executed without arguments. That is believed ot be more useful than usage() output. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: do not ignore read errorSami Kerola2017-08-301-1/+5
| | | | | | | | | | | | | | | | Read error should be impossible, but when one does happen user certainly wants to know about that rather than see even more strange issue caused random data in name variable. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: clarify 'all devices' handlingSami Kerola2017-08-301-21/+22
| | | | | | | | | | | | | | | | Stop using RFKILL_IS_INVALID a marker when rfkill is iterating over all devices. Addition of RFKIL_IS_ALL should make this a lot easier to digest, especially if reading code in hurry. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: update manual pageSami Kerola2017-08-301-19/+63
| | | | | | | | | | | | Make the manual page style to match with util-linux project. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: make programming style to match util-linux projectSami Kerola2017-08-304-119/+148
| | | | | | | | | | | | | | | | Use the usual facilities, add translation strings, move global variables at the beginning of the file, make usage() look as expected, add standard command-line option parsing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: make command to build in util-linux projectSami Kerola2017-08-304-4/+17
| | | | | | | | | | | | | | After this commit the command merely builds, but does not confirm style used in util-linux project. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: move files to appropriate locationsSami Kerola2017-08-3011-232/+30Star
| | | | | | | | | | | | | | Also remove unnecessary items. Notice that the licence text from COPYING is moved to top of the command in comment section. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * rfkill: merge rfkill.8 project to util-linuxSami Kerola2017-08-3010-0/+788
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Projet merge discussion in maillists: http://www.spinics.net/lists/util-linux-ng/msg14289.html http://marc.info/?l=linux-wireless&m=149880885914076&w=2 Old-Remote: http://git.sipsolutions.net/rfkill.git/ Old-Remote: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/rfkill.git Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| | * add python moduleJohannes Berg2015-01-081-0/+150
| | |
| | * use uapi rfkill.hJohannes Berg2015-01-081-289/+6Star
| | |
| | * version 0.5Johannes Berg2013-05-031-1/+1
| | | | | | | | | | | | now with nfc support
| | * fix compiler warningJohannes Berg2013-05-031-3/+2Star
| | |
| | * Add NFC supportSamuel Ortiz2013-05-033-1/+6
| | | | | | | | | | | | | | | rfkill.h is synced with the kernel header, man page is updated and RFKILL_TYPE_NFC is mapped to "nfc".
| | * version 0.4Johannes Berg2010-02-061-1/+1
| | |
| | * Add rfkill type "fm" to the man page.Darren Salt2010-01-261-1/+1
| | |
| | * Help text: output rfkill type names from an array instead of a static string.Darren Salt2010-01-261-1/+6
| | |
| | * Tweak version handling to allow vendor-specific suffixes without patching.Darren Salt2010-01-262-1/+14
| | | | | | | | | | | | This overrides the "git describe" suffix for when the packaging is in git.