Commit Graph

13718 Commits

Author SHA1 Message Date
Karel Zak 4a4f4a6260 scriptreplay: add --summary
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 70c2cd9a60 script: add more information to timing log
Let's record also exit code, duration and start time.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak f923a59596 scriptreplay: check for EOF
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak fd42a45bea script: cleanup info logging
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 7c4a374f63 scriptreplay: print info and signals
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 3cecd17610 script: log additional information
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 23afadca57 include/strutils: add strrealloc() 2019-10-08 13:11:53 +02:00
Karel Zak 6646f9f896 scriptreplay: make sure timing file specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak fbed5507da script: write signals to timing file
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 7031577246 scriptreplay: add --stream to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 88b8e9bffd scriptreplay: add --cr-mode
The stdin log does not contain line breaks as command line uses CR
between commands. This makes scriptreplay for stdin very
user-unfriendly, because it overwrites still the same line.

The new option --cr-mode provides opportunity to control this
behavior. The default for stdin logs is replace CR with line-break.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak cf0609a3ea scriptreplay: (man) add missing --log-* oprions
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 4f4bac42d8 scriptreplay: fix error path
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 41ce6545d2 scriptreplay: add --stream
Let's allow to specify stream, default to entry type according to the
command line options.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak d628e9cf7c script: default to new format when new features expected
The old format should be the default for stdout only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 0d955cd8ac scriptreplay: add --log-{in,out,io} options
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 02a51ce1e3 scriptreplay: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak daee4d95ae script: add --logging-format
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 7d5617c409 script: add note about --log-in and passwords
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 65dc24abac script: make --help more readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 167a485172 scriptreplay: skip unwanted steps
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 36b1369bdf script: add multistream timing file initialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak fec06a063e scriptreplay: rewrite to support new timing file format
* add internal support for multiple log files
* add support for new timing file format (default is old format)

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 88025c74e3 script: remove unused variable
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak c1c2ee0b3a script: support multi-stream logging
* allow to use --log-in <infile> and --log-out <outfile> in the same time
* add --log-io <file> to log stdout and stdin to the one log file
* introduce a new timing file format with entry type identifirs

   I <delay> <size>   : info about input stream
   O <delay> <size>   : info about output stream

in the next commits it's possible to add 'S' for signals and 'H' for
extra (header) information.

* the new file format is optional and enabled only if multiple streams
  logging is requested.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 70062aad13 script: add --log-in
Let's allow to log input independently on output. So it's possible to

 script --log-in infile		          : logs only input
 script --log-out outfile	          : logs only output
 script --log-out outfile --log-in infile : logs both to separated files

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak fc58044f79 script: add option --log-timing
The current -t[=<file>] is pretty messy due to optional <file>
argument; and default is to output to stderr. The default output to
stderr is very unusual semantic. This path makes the old -t
deprecated.

The new option -T, --log-timing requires the file name.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak ddbdb79256 script: add option --log-out
Let's make script(1) command line more explicit about typescript file.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak c64963f87c script: cleanup usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 9f82264851 script: allow to use the same log for more streams
The plan (for the next commits) is to use for example timing file for
stdin as well as for stdout.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak d805688afc script: report also timing file, do it only once
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 4f7521d66c script: make optional argument more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak 596f42027d script: log file usage refactoring
This commit does not add any new feature. It just prepare code for
future extensions only.

* introduce two new structs: script_stream and script_log
* define two streams: 'stdout' and 'stdin'
* allow associate log files (type script or timing file) with the stream
* support more log file formats

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-08 13:11:53 +02:00
Karel Zak b3fc2a3c33 hwclock: report rtc open() errors on --verbose
Let's be more verbose and provide real open() error to make
debugging easier on --verbose.

For example:

$ hwclock --verbose
hwclock from util-linux 2.34.193-6bebea-dirty
System Time: 1570445823.701266
Trying to open: /dev/rtc0
hwclock: cannot open /dev/rtc0: Permission denied          <---
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.

Addresses: https://github.com/karelzak/util-linux/issues/879
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-07 12:57:43 +02:00
Karel Zak 6bebea1b13 Merge branch 'for-upstream/more-pseudofs' of https://github.com/dlitz/util-linux
* 'for-upstream/more-pseudofs' of https://github.com/dlitz/util-linux:
  libmount: Recognize more FUSE pseudofs (avfsd, lxcfs, vmware-vmblock)
2019-10-07 12:41:32 +02:00
Jan Chren (rindeal) a7f9588745 po/update-potfiles: fallback to `find` when git doesn't work
It allows to run po/update-potfiles not only in tarballs
and git repositories, but in git snapshots as well.
2019-10-04 16:40:49 +02:00
Darsey Litzenberger e7305e4ea3 libmount: Recognize more FUSE pseudofs (avfsd, lxcfs, vmware-vmblock)
General info about these filesystems:

* fuse.avfsd: https://sourceforge.net/projects/avf/
* fuse.lxcfs: https://linuxcontainers.org/lxcfs/
* fuse.vmware-vmblock: https://github.com/vmware/open-vm-tools

Signed-off-by: Darsey Litzenberger <dlitz@dlitz.net>
2019-10-02 17:29:05 -07:00
Karel Zak 7b41ae5b4e docs: add sfdisk --dump and --backup improvements to TODO
Addresses: https://github.com/karelzak/util-linux/issues/850
Addresses: https://github.com/karelzak/util-linux/issues/852
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-01 13:17:03 +02:00
Elliott Mitchell 2bb3aa36b2 cleanup: Remove some spurious spaces
Sorry detail-oriented people tend to wipe these out if they notice them.
Add in automated tools and lots of excess end-of-line spaces get wiped
out.

Addresses: https://github.com/karelzak/util-linux/pull/849
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-01 13:01:43 +02:00
Karel Zak 1d84470388 libfdisk: (gpt) fix hybrid MBR detection, fix 'w'
* current code overwrites hybrid MBR because EE partition
  is expected from fist sector, this is not true for hybrid MBR

* print "The partition table has been altered." message also for
  nested contexts

* remove "You have to sync the MBR manually" message

Addresses: https://github.com/karelzak/util-linux/issues/851
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-01 12:51:04 +02:00
Elliott Mitchell eb913f6b98 fdisk: Correct handling of hybrid MBR
The traditional MBR has pretty well NO limitations on slices.  They can
be a single misaligned sector if desired.  While this is undesireable
for most real world uses, for the few places they're still used extra
limitations cause breakage not safety.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-01 12:04:02 +02:00
Karel Zak 5c1c594ee5 fdisk: use 'r' to return from MBR to GPT
The current code uses 'M' to switch between MBR and GPT, but it's not
intuitive to "go back" by 'M'. It seems more user-friendly to use 'r'
as in another places (for example when go from expert menu or from BRD
menu).

The 'M' to return to GPT is still supported for backward compatibility.

Addresses: https://github.com/karelzak/util-linux/pull/849
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-30 13:11:17 +02:00
Karel Zak 980a25f9c4 sfdisk: (move-data) improve MiB/s progress bar
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-30 12:25:17 +02:00
Karel Zak 52a1f767c0 Merge branch 'master' of https://github.com/dsd/util-linux
* 'master' of https://github.com/dsd/util-linux:
  libblkid: improve handling of ISO files with partition tables
2019-09-30 11:15:57 +02:00
Karel Zak 8e4d8767fd Merge branch 'nproc' of https://github.com/mator/util-linux
* 'nproc' of https://github.com/mator/util-linux:
  Don't use `nproc --all` for getting cpu number. For example below, sparc64 is reporting 128 as a total, but only 32 is online. So use only online cpus for tests parallel runs.
2019-09-30 11:12:35 +02:00
Karel Zak 1c07615932 Merge branch 'non-canonical-completion' of https://github.com/kevinoid/util-linux
* 'non-canonical-completion' of https://github.com/kevinoid/util-linux:
  bash-completion: Add non-canonical device fallback
  bash-completion: Add fallback for symlinks/images
  bash-completion: Standardize fsck/mkfs file/device
2019-09-30 11:06:09 +02:00
Andrius Štikonas 2ebc944fa4 docs: fix mixtyped constant.
Signed-off-by: Andrius Štikonas <andrius@stikonas.eu>
2019-09-26 15:55:48 +02:00
Quentin Rameau 83db544dda chsh: replace getpw unsafe functions with xgetpw 2019-09-26 15:55:41 +02:00
Quentin Rameau cd083615b4 lib/pwdutils: add xgetpwuid 2019-09-26 15:55:39 +02:00
Karel Zak 135e03892b sfdisk: (man) add note about interactive mode)
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-26 15:20:47 +02:00