Commit Graph

8073 Commits

Author SHA1 Message Date
Sami Kerola da27df2553 setterm: tell user when options does not effect
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:54:23 +01:00
Sami Kerola 16279cc2b4 setterm: improve perform_sequence() coding style
Delete pointless braces, new lines, and add spacing between operators.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:54:23 +01:00
Sami Kerola 253e5e7161 setterm: correct usage() bright color argument
This has been wrong since commit 2dc8716.  The bright is a prefix
attribute to other colors.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:54:17 +01:00
Ruediger Meier ae2f9c71ae mkfs.cramfs: fix crash when -b 0
Now -b 0 gives us the default (page size) like we do it in
fsck.cramfs.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:29 +02:00
Ruediger Meier dfd7dbb468 fsck.cramfs: update man page (--extract and --blocksize)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:26 +02:00
Ruediger Meier 2c972db424 tests: remove test_fsck.cramfs (reverts 6c32ae78)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:22 +02:00
Ruediger Meier 34731f89c7 fsck.cramfs: remove define INCLUDE_FS_TESTS
There is only one non-trivial issue where we now print a
warning instead of exit error.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:06 +02:00
Sami Kerola 917465831f setterm: make -msglevel 0 to work as is did earlier
Commit 3393c136 caused regression.  The klogctl() logging range is 1-8,
but the value 0 is special according to setterm.1 manual page.  It turns
on loging, same way as '-msg on' option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:39 +01:00
Sami Kerola 609d48534a setterm: remove devfs and /dev/vcsa0 support
The devfs files /dev/vcc/a* does not need to be supported, and vcsa0 has
not existed in years if ever.

Reference: http://lwn.net/Articles/65197/
Reference: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devices.txt?id=14186fea0cb06bc43181ce239efe0df6f1af260a#n260
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola 341566ff45 setterm: clean up screendump()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola dcc2fe2903 setterm: add init_terminal() to make main() shorter
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola d87d20b0fa setterm: add option control structure
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola 43f68f8fea setterm: remove usage comment segment
It is enough trouble to keep usage output aligned with getopt() parsing,
manual page, and bash-completion, so get rid of the unnecessary effort
duplication.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:38 +01:00
Sami Kerola c591be873b setterm: move show_tabs() and screendump() functions
Earlier the function was in the middle of option parsing code segment,
and screendump() required function prototype.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:37 +01:00
Sami Kerola 35b578a02a setterm: use string utils to numeric parsing
Check the input numbers are numbers, which makes also the code shorter,
and user experience better as half invalid imputs will error.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:45:36 +01:00
Sami Kerola fb27f91cac setterm: recommend long options with double hyphen
While the -version style options will work for next unknown number of
years start moving towards user interface that has way of invoking long
options as most of the other commands.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 22:21:14 +01:00
Sami Kerola 45c90b77e6 setterm: use getopt_long_only() for option parsing
The getopt_long_only() has advantage of allowing one and two hyphen
versions of options, for example -help and --help.  Secondly the getopt
function family from libc can ensure some options requiring arguments,
while other are optional, and some should not accept argument at all.
That makes option parsing more robust.

Unfortunately retiring the old option parsing makes this change greater
than preferred.  Assuming not mistakes happen the new code works
functionally exactly as the old did.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 21:58:01 +01:00
Sami Kerola 104ecc7e70 setterm: clean up includes
Use klogctl(2) from sys/klog.h just like dmesg(1).  The rest is just
reordering, and indenting.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-19 21:56:24 +01:00
Ruediger Meier 2d317f117b fsck.cramfs: refactor option -x/--extract
We want to clean it up to compile it later per default (not only
if defined INCLUDE_FS_TESTS).

- Rename option --destination to --extract.
- DIR argument is now optional because we want to keep the use
  case "test uncompression without writing files" ... but we
  don't want it always.
- Remove shortopt -x because shortopts with optional args are
  evil.

Changing the cmd interface is no compatibility issue here because
all affected options errored out per default in past.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 15:07:17 +02:00
Stephan Müller 4b8f83361b mount: fix tiny typo in man page
adjust command to use /dev/loop3 as described in text

Signed-off-by: Stephan Mueller <fruktopus@gmail.com>
2014-05-19 11:10:49 +02:00
Karel Zak 0a8dacfe86 agetty: update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-19 10:59:54 +02:00
Ruediger Meier 62a49dde58 tests: fix fsck.cramfs for systems with certain page sizes
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:59 +02:00
Ruediger Meier 5cd50ebc96 fsck.cramfs: add option --blocksize
.. similar to mkfs.cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:48 +02:00
Ruediger Meier 38141baff6 fsck.cramfs: rename variable page_size to blksize
... similar to mkfs.cramfs.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:44 +02:00
Ruediger Meier b7a7520692 fsck.cramfs: ifdef unused outbuffer and page_size
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:39 +02:00
Ruediger Meier f991dbd31f fsck.cramfs: allow smaller superblock sizes
We are already fine with checking for different endianess. Now we
also succeed if systems's page size does not match.

Note that page_size is only really used if INCLUDE_FS_TESTS is
defined, see followups.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:19:29 +02:00
Ruediger Meier fa264ba584 tests, fix cramfs for systems with certain page sizes
This is only a partial fix to get comparable image md5sums.
fsck.cramfs still fails if system page size > 4096

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-18 14:07:33 +02:00
Benjamin Robin 584c07449c agetty: Update help usage function
Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
2014-05-18 02:48:14 +02:00
Benjamin Robin 6c77c7fac2 agetty: Fix implementation of option --nonewline. The flag F_NONL was never set.
Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
2014-05-18 02:47:42 +02:00
Karel Zak 1efded63df Merge branch 'tests-mount' of https://github.com/rudimeier/util-linux
* 'tests-mount' of https://github.com/rudimeier/util-linux:
  tests: use ts_mount for cramfs
  tests: ts_mount knows which fs is expected
  tests: ts_mount validates error message
  tests, add function ts_mount
2014-05-16 14:30:05 +02:00
Karel Zak 95efcd51d9 Merge branch 'tests-check-prog' of https://github.com/rudimeier/util-linux
* 'tests-check-prog' of https://github.com/rudimeier/util-linux:
  tests: check for mkfs.ext{2,3,4}
  tests: consolidate some checks for commands
  tests: add function ts_check_prog
2014-05-16 14:27:11 +02:00
Karel Zak 56c8f8af4c lslogins: add FAILED-LOGIN to pretty output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 14:14:02 +02:00
Karel Zak 512abd5694 lslogins: sync man page and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 14:04:54 +02:00
Karel Zak 10c74524e5 lslogins: improve pretty output
* use Yes/No
 * print all available information (columns)
 * cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 12:35:46 +02:00
Ruediger Meier cf6784deeb tests: use ts_mount for cramfs
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-16 12:07:36 +02:00
Ruediger Meier d2cc2ba722 tests: ts_mount knows which fs is expected
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-16 12:07:26 +02:00
Ruediger Meier a23c435ea2 tests: ts_mount validates error message
Skip only if mount reports a non-empty fs which is not available
in /proc/filesystems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-16 12:07:03 +02:00
Ruediger Meier 2f95494707 tests, add function ts_mount
We want to generalize mounts similar to how we do it already in
minix/mkfs. Currently most of our other checks just fail if
"fs not supported".

Note that the new function checks a bit stronger than before in
minix/mkfs. It respects mount's return value and stderr goes
to $TS_OUTPUT too.

It's a bit ugly that we write to $TS_OUTPUT from inside of the
function. But if the caller would do it then we couldn't
ts_skip and the whole function would be pointless.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-16 12:06:00 +02:00
Karel Zak 3e5cba73f1 lslogins: NLS for all messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 11:41:18 +02:00
Karel Zak 8b5e227978 lslogins: conding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 11:31:00 +02:00
Karel Zak 68657ea2e7 lslogins: improve supplementary groups code, add SUPP-GIDS
* don't build list, but directly create a string
 * don't mix IDs and group names on output
 * add SUPP-GIDS to print only IDs

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 11:14:32 +02:00
Karel Zak 07a4046f95 lslogins: align to right 0|1 columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-15 14:10:50 +02:00
Karel Zak a94baf36dc lslogins: cleanup status[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-15 14:01:51 +02:00
Karel Zak 5424d2a225 lslogins: cleanup fill_table()
* check xasprintf() return code is unnecessary
 * just check all scols_line_set_data() return codes on one place

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 3a016a536b lslogins: mention --time-format in usage
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 32badc3466 lslogins: fix option exclusivity
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala c20ffb8f69 lslogins: add option --time-format
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 969ee9e3ff lslogins: comment-in an expensive realloc
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 4ea7848b50 lslogins: add option --iso
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 384965928a lslogins: add support for multiple time formats
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00