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>
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>
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>
tests: remove test_fsck.cramfs (reverts 6c32ae78)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
fsck.cramfs: update man page (--extract and --blocksize)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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>
lib/canonicalize: make DM canonicalization more robust

The current code cares about filenames, but it's too fragile, we have
to check the path is really path to the block device.

Addresses: https://github.com/karelzak/util-linux/issues/83
Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'cramfs-blocksize' of https://github.com/rudimeier/util-linux

* 'cramfs-blocksize' of https://github.com/rudimeier/util-linux:
  mkfs.cramfs: fix crash when -b 0
  fsck.cramfs: update man page (--extract and --blocksize)
  tests: remove test_fsck.cramfs (reverts 6c32ae78)
  fsck.cramfs: remove define INCLUDE_FS_TESTS
  fsck.cramfs: refactor option -x/--extract
  tests: fix fsck.cramfs for systems with certain page sizes
  fsck.cramfs: add option --blocksize
  fsck.cramfs: rename variable page_size to blksize
  fsck.cramfs: ifdef unused outbuffer and page_size
  fsck.cramfs: allow smaller superblock sizes
  tests, fix cramfs for systems with certain page sizes
fsck.cramfs: cleanup usage() and warning messages

Signed-off-by: Karel Zak <kzak@redhat.com>