summaryrefslogtreecommitdiffstats
path: root/sys-utils
Commit message (Collapse)AuthorAgeFilesLines
* blkdiscard: new commandKarel Zak2012-09-273-36/+194
| | | | | | | | | | | Add to fstrim(8) code to support new discard BLKDISCARD and BLKSECDISCARD ioctls for block devices. The new command is only symlink to fstrim(8) as the both utils share some code and the basic ideas. Based on patch from Lukas Czerner <lczerner@redhat.com>. Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: don't warp the systemtime if the RTC is in UTCTom Gundersen2012-09-212-6/+22
| | | | | | | | | | | | | | | | | A sideeffect of 839be2ba6b44fa9dc927f081d547ebadec9de19c is that we now warp the systemtime according to the timezone, on the first call of --systz. This is not always the correct thing to do, and causes a regression for us in Arch Linux. The behavior is correct if the RTC, and hence the systemtime, is in localtime. However, if the systemtime is already in UTC we don't want to touch it when we set the kernel timezone (which we still need to do as some filesystems use this information). An almost identical issue was also fixed in systemd commit 72edcff5db936e54cfc322d9392ec46e2428fd9b. Signed-off-by: Tom Gundersen <teg@jklm.no>
* hwclock: wait time in hwclock is not long enough for some ARM devicesKarel Zak2012-09-211-2/+2
| | | | | | | | | | | | | On Sun, Sep 16, 2012 at 02:11:48PM +0800, Queen Adam wrote: > I'm using Archlinux ARM for my Melo A100 box. > The hwclock always timeout when using select() in rtc.c. > > After I change the timeout from 5 to 10, the problem is solved. > > In fact the timeout in my ARM box seems only to be a little larger > than 5s. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: umount.8 syntax fix.Ville Skyttä2012-09-201-2/+2
| | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* rtcwake: doesn't reset wakealarmGiacomo2012-09-131-4/+19
| | | | | | | | Disable an alarm use the same logic used to enable it: first try RTC_WKALM_SET with the "enabled" flag set to false, if it fails fall back to RTC_AIE_OFF. Signed-off-by: Giacomo <giacomo.perale@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: losetup: remove obsolete encryption supportLudwig Nussel2012-09-114-96/+12Star
| | | | | | | | | | | | | | | kernel cryptoloop is deprecated since ages and support for cryptoloop in util-linux is incomplete/broken. - no password hashing - last 8 bit of key are always set to zero - no binary keys possible (stops reading key at \n and \0) In the past some Distros added the above features with patches. So remove cryptoloop support from util-linux completely to make sure people won't try using it. Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: add a new --compare optionOndrej Oprala2012-09-101-5/+77
| | | | | | | | | | The new option imitates adjtimex -c functionality and outputs the drift in 10 second intervals. [kzak@redhat.com: - coding style - print hw and system time columns too] Signed-off-by: Karel Zak <kzak@redhat.com>
* wdctl: add fallbacks for old kernel headersKarel Zak2012-09-071-1/+24
| | | | | Reported-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* eject: robust strings usage [coverity scan]Karel Zak2012-09-071-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* switch_root: check open() return value [coverity scan]Karel Zak2012-09-071-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tunelp: add missing break [coverity scan]Karel Zak2012-09-071-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix man pahe typo in quota mount option namesBjörn Jacke2012-09-051-3/+3
|
* wdctl: treat aligned translatable strings in a uniform mannerBenno Schulenberg2012-09-041-1/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* wdctl: gettextize one forgotten wordBenno Schulenberg2012-09-041-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: add missing comma and colon in some help textsBenno Schulenberg2012-09-041-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix typos in messagesYuri Chornoivan2012-09-041-1/+1
|
* libmount: document LIBMOUNT_DEBUG usersDavidlohr Bueso2012-09-043-0/+15
| | | | | | | Update the manpages of programs that use this environment variable for extra debugging information. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* dmesg: fix kmsg read if read returns EPIPEMilan Broz2012-08-131-3/+15
| | | | | | | | | | The /dev/kmsg can return EPIPE if current record has beed modified while reading. For init_kmsg, it cause switch to DMESG_METHOD_SYSLOG (which is not expected) and later it can truncate output. Signed-off-by: Milan Broz <mbroz@redhat.com>
* eject: return proper 0/1 from eject_cdrom()Dave Reisner2012-08-131-5/+5
| | | | | | | | main() expects this method to return 0 for failure and 1 for success, as the other eject_*() methods do. Add the missing comparison of ioctl() >= 0 Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: limit options --all, --online, --offline to parsable and extended outputHeiko Carstens2012-08-132-3/+18
| | | | | | | Passing the --all, --online or --offline options for the output summary doesn't make much sense. It should be limited to the two list output options. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* docs: add sys-utils/umount.8 manual pageSami Kerola2012-08-062-1/+176
| | | | | | | | | | The man page is almost exact copy of mount-deprecated/umount.8. This version mentions long options, and has the options in same order as they are mentioned in usage() output. Rest of the minor changes make groff slightly nicer e.g. use .PP instead of empty line for paragraph marker. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mount: replace control chars in mountpoint nameKarel Zak2012-08-062-8/+27
| | | | | | | | | | For compatibility with coreutils and to avoid complex solutions in mount output mount replaces control characters with '?'. Note that the listing mode in mount(8) is in maintenance mode -- findmnt(8) provides more robust and better solutions. Signed-off-by: Karel Zak <kzak@redhat.com>
* wdctl: tiny change to man pageKarel Zak2012-08-021-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* wdctl: add "--settimeout" to set the timeoutHarald Hoyer2012-08-022-10/+79
| | | | | | | [kzak@redhat.com: - fix usage() and man page] Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Harald Hoyer <harald@redhat.com>
* dmesg: fix kmsg usability detectionKarel Zak2012-08-021-12/+35
| | | | | | | | | On old kernels (<3.5) kernel allows to open read-only /dev/kmsg for root, but read() returns -EINVAL. It means that open() is not enough to detect /dev/kmsg usability. We have to call read() (or epoll). Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* util-linux: Document new FAT optionsSteven J. Magnani2012-07-301-0/+10
| | | | | | | Add man-page documentation for the new 'discard' and 'nfs' options available for vfat/msdos filesystems. Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
* mount: remove unnecessary free()Karel Zak2012-07-261-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: improve error messages for bad --pid invocationBernhard Voelker2012-07-261-2/+2
| | | | Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* dmesg: improve err handling codeKarel Zak2012-07-261-13/+12Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: inform user when klogctl() or read_buffer() failsSami Kerola2012-07-261-5/+8
| | | | | | | | Fix to small regression which made 'dmesg --clear' not to error when running without root privileges. Same happen with '-D' and few other options as well. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wdctl: fix conflicting types on old systemsSami Kerola2012-07-261-1/+1
| | | | | | | | | | | | | | | The program wants the userland version of declaration(s), not the kernel one. Problem occured with glibc-devel-2.5-34. /usr/include/stdint.h:41: error: conflicting types for 'int64_t' /usr/include/linux/types.h:98: error: previous declaration of 'int64_t' was here /usr/include/stdint.h:56: error: conflicting types for 'uint64_t' /usr/include/linux/types.h:96: error: previous declaration of 'uint64_t' was here In file included from /usr/include/stdlib.h:438, from ./include/c.h:13, from sys-utils/wdctl.c:30: Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lscpu: fix shadow declarationSami Kerola2012-07-261-9/+8Star
| | | | | | | | | | | | | sys-utils/lscpu.c:1084:8: warning: declaration of 'buf' shadows a previous local [-Wshadow] sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow] sys-utils/lscpu.c:1144:9: warning: declaration of 'buf' shadows a previous local [-Wshadow] sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow] sys-utils/lscpu.c:1196:8: warning: declaration of 'buf' shadows a previous local [-Wshadow] sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow] sys-utils/lscpu.c:1197:7: warning: declaration of 'i' shadows a previous local [-Wshadow] sys-utils/lscpu.c:1078:6: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* eject: fix shadow declarationSami Kerola2012-07-261-1/+0Star
| | | | | | | sys-utils/eject.c:529:11: warning: declaration of 'str' shadows a previous local [-Wshadow] sys-utils/eject.c:506:9: warning: shadowed declaration is here [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* wdctl: use err_exclusive_options()Karel Zak2012-07-261-9/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* prlimit: use err_exclusive_options()Karel Zak2012-07-261-10/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: use err_exclusive_options()Karel Zak2012-07-261-33/+14Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: use err_exclusive_options()Karel Zak2012-07-261-18/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* losetup: use err_exclusive_options()Karel Zak2012-07-261-19/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* hwclock: use err_exclusive_options()Karel Zak2012-07-261-58/+32Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: use err_exclusive_options()Karel Zak2012-07-261-20/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chcpu: use err_exclusive_options()Karel Zak2012-07-261-15/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: fix usage()Karel Zak2012-07-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: add --reltime to print human readable deltasKarel Zak2012-07-202-18/+75
| | | | | | | | | | | | | | | | | [Jul20 09:50] device vnet0 entered promiscuous mode [ +0.002248] virbr0: topology change detected, propagating [ +0.000017] virbr0: port 2(vnet0) entered forwarding state [ +0.000036] virbr0: port 2(vnet0) entered forwarding state [ +0.001663] ADDRCONF(NETDEV_CHANGE): virbr0: link becomes ready [ +10.480914] vnet0: no IPv6 routers present [Jul20 14:35] xhci_hcd 0000:0e:00.0: WARN Event TRB for slot 3 ep 5 with no TDs queued? [Jul20 19:23] EXT4-fs (sda2): re-mounted. Opts: (null) [ +6.052980] EXT4-fs (sda2): re-mounted. Opts: (null) Suggested by Linus: http://thread.gmane.org/gmane.linux.kernel/1290886/focus=1296138 Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg; cleanup time printing stuffKarel Zak2012-07-201-14/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: implement backwardly compatible --raw for /dev/kmsgKarel Zak2012-07-202-2/+25
| | | | | | .. and if you really want raw data from /dev/kmsg then use dd(1) ;-) Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: cleanup exclusive_option() usageKarel Zak2012-07-201-10/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: add --follow featureKarel Zak2012-07-202-5/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: support --clear for kmsgKarel Zak2012-07-201-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: read /dev/kmsg (since kernel 3.5.0)Karel Zak2012-07-201-28/+202
| | | | | | | | | | | kmsg advantages: - extendible format - tags for messages - one read() returns one complete record See kernel Documentation/ABI/testing/dev-kmsg. Signed-off-by: Karel Zak <kzak@redhat.com>
* dmesg: add --syslog to force to old syslog(2) interfaceKarel Zak2012-07-192-2/+14
| | | | | | | ... just for debugging or for people who somehow depends on syslog(2) behavior. Signed-off-by: Karel Zak <kzak@redhat.com>