umount: read mountinfo if --detach-loop given

Don't use the optimization not to read mountinfo from commit
6a52473ecd877227f6f7da2b95da0b51593ffec1 if --detach-loop was given
since we need the name of the loop device in that case and with the
optimization this is not present and thus the detach operation
obviously fails.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
libmount: only invoke loopcxt on linux

This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
libmount: only include context on linux

This is part of an attempt to make libmount buildable on non-linux.

The parts that need architecture specific porting is under
the context*.c files and the rest of libmount is useful/used
by for example fsck.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
build-sys: build libmount everywhere

This enables libmount to build on non-linux, which also
means we can build fsck on non-linux again.
(Since the context part of libmount still needs porting,
building the mount utility has instead been restricted
to only build on Linux.)

This has been build-tested on Debian GNU/kFreeBSD.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
logger: gettimeofday needs <sys/time.h>

Either works on linux, but kfreebsd build fails
if we don't use the <sys/time.h> include.

According to man gettimeofday the correct include is <sys/time.h>

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
swapon: split swapon-common.c

 swapon    - requires libmount and libblkid
 swapoff   - requires libmount
 swaplabel - requires libblkid

This patch add lib/swapprober.c with blkid stuff for swap. It allows
to use and link libblkid only when necessary.

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