mount: supports paths canonicalization for alternative fstabs

 # mount --fstab /path/my.fstab

has to support standard operations with paths.

Signed-off-by: Karel Zak <kzak@redhat.com>
runuser: add -u to not execute shell

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: move runuser(1) to sbin dir

Signed-off-by: Karel Zak <kzak@redhat.com>
su: fix stupid typo

Signed-off-by: Karel Zak <kzak@redhat.com>
sfdisk: fix formatting typo in man page

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: cleanup cpu_set_t usage

 - make taskset depend on cpu_set_t
 - make cpuset.c optional for libcommon and lib/path.c

Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk: gpt: write entire first sector

We were writing only 1 byte in LBA0, and GPT requires dealing with an entire
sector. This bug wasn't affecting when dealing with already existing devices
with GPT as we weren't writing an important part of the first sector, thus
leaving it unchanged. Also use write_all() wrapper from all-io.h

Acked-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
gpt: create empty disklabels

This patch enables creating a new, empty, GPT disklabel from either
an empty disk or one that already has a disklabel. For this
purpose, a 'g' option is added to the main menu and is visible to all
labels. Here's an example for a scsi_debug device (/dev/sdb):

...
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x20a614c8.
3696: fdisk:  CONTEXT: zeroize in-memory first sector buffer

Command (m for help): g
3696: fdisk:    LABEL: changing to gpt label

3696: fdisk:  CONTEXT: zeroize in-memory first sector buffer
3696: fdisk:    LABEL: created new empty GPT disklabel (GUID: D4EA0706-F011-46DC-B7DE-6A72C7090AF8)

Command (m for help): w
The partition table has been altered!
...

Acked-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
agetty: fix autodetection for TERM

open_tty() autodetects whether to set TERM to "linux" or "vt102", but it
can apply the result only if op->term is still NULL.
lsblk: Add revision column

Signed-off-by: Milan Broz <mbroz@redhat.com>
lsblk: Add vendor column

Signed-off-by: Milan Broz <mbroz@redhat.com>
lsblk: Add --scsi switch

The --scsi switch prints similar information to lsscsi command.

Signed-off-by: Milan Broz <mbroz@redhat.com>
lsblk: don't ignore disk device

Signed-off-by: Karel Zak <kzak@redhat.com>
lsblk: add TRANsport to --scsi output

Signed-off-by: Karel Zak <kzak@redhat.com>
lsblk: fix and update man page about --scsi

Signed-off-by: Karel Zak <kzak@redhat.com>
su: fix "COMMAND not specified" error

 # su
 su: COMMAND not specified

This error message make sense for "runuser -u <user> <command>" only.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=872787
Signed-off-by: Karel Zak <kzak@redhat.com>
docs: update TODO file

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: add private mnt_get_kernel_cmdline_option()

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount: convert /dev/root from mountinfo to the device name

Signed-off-by: Karel Zak <kzak@redhat.com>
script: do not try to close stderr twice

The commit cdd2a8c360c70d16804ace7cc923a6c6bb7c9ca9 broke script(1)
return value.

$ script -e -c "echo"; echo $?
1

The reason, as Daniel it reported, was that the script will close stderr
twice, once as timing file and atexit() in function close_stdout().  This
commit fixes the problem.

Reported-by: Daniel Narvaez <dwnarvaez@gmail.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>