agetty: Fix implementation of option --nonewline. The flag F_NONL was never set.

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
agetty: Update help usage function

Signed-off-by: Benjamin Robin <dev@benjarobin.fr>
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>
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>
fsck.cramfs: ifdef unused outbuffer and page_size

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
fsck.cramfs: rename variable page_size to blksize

... similar to mkfs.cramfs.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
fsck.cramfs: add option --blocksize

.. similar to mkfs.cramfs

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: fix fsck.cramfs for systems with certain page sizes

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
agetty: update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
setterm: add option control structure

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: add init_terminal() to make main() shorter

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
setterm: clean up screendump()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>