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>
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>
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>
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>
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>
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>
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>
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>
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>
* '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
* '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
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>
* 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>
* 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>