Commit Graph

4529 Commits

Author SHA1 Message Date
Bernhard Voelker d636d6d82a docs: clarify KiB vs. KB in man pages
Update the man pages of blkid, wipefs, fallocate, fstrim, losetup
and hexdump to clarify the suffixes for the numerical values of the
offset and size/length arguments regarding KiB=1024 vs KB=1000.
Also mention the ZiB/YiB and ZB/YB suffixes supported by strtosize().

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-03-30 15:23:32 +02:00
Karel Zak 916a743891 tools: improve ko-release-* scripts
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-30 13:44:11 +02:00
Karel Zak fab66da531 blkid: add note about variable tags and devices order.
Reported-by: Michael Conrad <mconrad@intellitree.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-29 15:09:54 +02:00
Karel Zak a36e9a9408 build-sys: move obsolete lib/fsprobe to mount/
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-27 12:23:07 +02:00
Karel Zak b5b2c388dc swapon: use directly blkid rather than fsprobe wrapper
* remove dependence on lib/fsprobe.c

 * reuse already read swap header for --fixpgsz (don't re-read the
   header by libblkid)

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-27 12:13:24 +02:00
Karel Zak d2efc7a944 tests: add swapon tests for --fixpgsz and fix signature
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-27 12:11:53 +02:00
Karel Zak 24d741d88a docs: mark udev and list blkid(8) output formats deprecated
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-26 13:09:27 +02:00
Karel Zak b24b8e296e tests: update
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-26 10:25:19 +02:00
Karel Zak 225b804b66 Revert "lib/canonicalize: always remove tailing slash"
It's overkill to modify unknown paths in a generic function like
canonicalize_path().

for example:

 mount -t fuse 'sshfs#marty@thee:/' /media/thee

will be canonicalized to

 mount -t fuse 'sshfs#marty@thee:' /media/thee

and this obvious bug.

Reported-by: Martin Panter <vadmium+floss@gmail.com>

This reverts commit 28074a0952.
2012-03-26 10:08:48 +02:00
Karel Zak 6ad533db97 hexdump: update man page for -n and -s
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-23 18:17:10 +01:00
Karel Zak 71cb4a4f00 tests: update iso tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-21 19:43:49 +01:00
Karel Zak 807e40c655 hexdump: use strtosize() for -n and -s
strtosize() is based on uintmax_t and supports all possible suffixes
(B,M,G,T ...)

Reported-by: Simon de Vlieger <simon@ikanobori.jp>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-21 19:35:22 +01:00
Andreas Vogel 05a9d5120c libblkid: generate pseudo-UUID for ISO9660 image file
The UUID is generated from the modification date in the ISO volume
descriptor. As GRUB 2 is using this definition for the pseudo UUID for
ISO9660 files libblkid would be perfectly compatible with GRUB 2.

Signed-off-by: Andreas Vogel <Andreas.Vogel@anvo-it.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-21 13:43:35 +01:00
Dong Hao c7b0af96bc mount: fix recursively propagation mounting
Provide the recursive flag of propagation mounting. Recursive flag could
be used together with propagation flag.

[kzak@redhat.com: - add MS_SILENT to acceptable propagation flags,
                  - fix new code in libmount too]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Dong Hao <haodong@linux.vnet.ibm.com>
2012-03-21 12:35:54 +01:00
Karel Zak 9895daca9c fsck: tiny coding style fix
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 0556def4cd fsck: use gettimeofday() for real elapsed time statistic
and use shorter "rss" rather than "maxrss" keyword in stats output

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Frank Mayhar 5a0da00aec fsck: Add a -r option to report memory and runtime statistics
This patch adds a "-r" option to report statistics for each fsck run.
It gathers the statistics via wait4() and rusage and reports exit
status, system and user CPU time, elapsed wall-clock time and the max
RSS.

[kzak@redhat.com: - rebase to the latest code,
                  - report all on one line,
                  - use "real" rather than "elapsed"]

Signed-off-by: Frank Mayhar <fmayhar@google.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak a7b585eac3 fsck: move to disk-utils directory
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak ac8f2843ff fsck: coding stype fixes (calloc, err, ...)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 7064679f57 fsck: don't try to call fsck for undefined fs type
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 5894bcd463 fsck: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 7ac166bf20 fsck: remove unnecessary fsck.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 67f09eae5b fsck: use libmount to check for mounted filesystems
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak ce22ccd08c libmount: improve mnt_tables_is_mounted
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 2a24e16e7c fsck: remove string_copy()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak e33b39a8c4 fsck: replace fsprobe with libmount utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:09 +01:00
Karel Zak 2b5051242e fsck: use libmount for filesystem list
libmount provides all necessary functionality required in fsck for
work with filesystems descriptions.

This patch seems large and invasive, because removes fsck_fs struct,
changes:

  - use libmnt to parse fstab
  - use libmnt_fs from libmount
  - replace "fs->" with mnt_fs_* or fs_* functions

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:08 +01:00
Karel Zak 947558f53f fsck: don't duplicate exit code macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:08 +01:00
Karel Zak 70b604b827 include/exitcodes: clean up names, add _EX_ suffix
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:08 +01:00
Karel Zak e50ad21838 include/exitcodes: add FSCK_DESTRUCT alias
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:08 +01:00
Karel Zak 41e32d9f8b fsck: cosmetic changes in coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:22:08 +01:00
Karel Zak 96f3eef55e fdisk: don't print confusing warning on non-partitioned disks
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=740163
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:18:54 +01:00
Karel Zak 451d76463c misc: clenaup SIZE columns in lsblk and findmnt
Note that lib/tt.c will never truncate columns without TT_FL_TRUNC or
relative column width. So it's fine to set small width for columns
with SIZEs, the defined width is minimal width.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 11:04:48 +01:00
Karel Zak cd4ed46f98 findmnt: improve --df output
* don't print pseudo-filesystems (except tmpfs)
 * add --all to disable built-in filters
 * don't overwrite --df --output=<list> with default columns

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 10:52:13 +01:00
Karel Zak 1e1df43ca2 libmount: add configfs to pseudofs list
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 10:42:47 +01:00
Karel Zak a631868639 lib/tt: work more sensitive with large columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 10:42:03 +01:00
Karel Zak d7bcb2052e findmnt: use xasprintf()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:55:24 +01:00
Dave Reisner 0b6198ec07 include/ttyutils.h: add include guards
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:48 +01:00
Dave Reisner eda399b995 findmnt: add -D, --df option to imitate df(1)
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:47 +01:00
Dave Reisner cb493ccb66 tunelp: remove old, now unneeded header
malloc and friends are provided by stdlib.h.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:45 +01:00
Dave Reisner a85ef33b16 findmnt: add FS size, avail, used, and use% columns
Provide display of filesystem attributes from statvfs(3). These are all
displayed in human readable format.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-20 09:53:41 +01:00
Dave Reisner 99d618c0eb checkxalloc: nudge regex, fix newfound instances
Using the -w flag with grep actually fought against us here, and hid
some instances where xalloc functions weren't used. Discard it in
favor of an explicit word boundary as a prefix to the function name,
and extend our requirements on the trailing side of the pattern.

This also fixes the few new instances that were overlooked because of
the regex's deficiency.

[kzak@redhat.com: - fix also newfound in findmnt
                  - remove unnecessary checks after xallocs]

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:44:40 +01:00
Bill Pemberton 27b35a6d55 findmnt: add -P, --pairs to the man page
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
2012-03-20 09:30:21 +01:00
Karel Zak 7c3c355fae setsid: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:28:38 +01:00
Harald Hoyer 8a2f04ddca setsid: add option "-c" to set the controlling terminal
[kzak@redhat.com: - use STDIN_FILENO rather than 0]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:22:54 +01:00
Sebastian Andrzej Siewior d0202f1c5a build-sys: make the crosscompile path for scanf_cv_alloc_modifier clever
My earlier assumption was that scanf_cv_alloc_modifier is unused. This
is not true as pointed out by Karel since it used befoe checking for
libmount. Argh. So instead saying no I add a test to check for glibc
>= 2.7 which provides %m. As of uClibc v0.9.32-rc3 the situation looks
the following:
| git grep _M_SPEC__
|libc/stdio/_vfprintf.c:/* #define __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:# endif /* __UCLIBC_HAS_PRINTF_M_SPEC__ */
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/old_vfprintf.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__
|libc/stdio/perror.c:#ifdef __UCLIBC_HAS_PRINTF_M_SPEC__

And other libc user have to bring their own stuff.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
2012-03-20 09:14:27 +01:00
Karel Zak a5ebeca527 mount: (new) add missing xalloc.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:06:09 +01:00
Sami Kerola 7961acce46 fileutils: differentiate xmkstemp and xfmkstemp
Let developer to choose, case by case, what sort of return value is
best in her code.  The xmkstemp() is for users who want file
descriptor as return value of the function, xfmkstemp() will return
FILE pointer.

Proposed-By: Karel Zak <kzak@redhat.com>
CC: Davidlohr Bueso <dave@gnu.org>
Reference: http://marc.info/?l=util-linux-ng&m=133129570124003&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:29:38 +01:00
Sami Kerola fd2e8c693e lslocks: use xasprintf for safe allocation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:29:38 +01:00
Sami Kerola bb9da58e80 tools: add asprintf to checkxalloc script
Reported-By: Dave Reisner <d@falconindy.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:05 +01:00