Commit Graph

336 Commits

Author SHA1 Message Date
Sami Kerola 82b7ef3671 raw: use libc error printing facilities
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 44e535353e raw: use symbolic exit numbers
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 1e0aef8257 raw: add long options and version printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 7c7c8bc53b raw: align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02: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 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
Sami Kerola 6f312c8957 xalloc: use xasprintf in all files
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:05 +01:00
Sami Kerola ba0c903004 docs: add deprecation comments
Markup deprecation to command header to avoid people wasting time in
fixing these utilities.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28:03 +01:00
Sami Kerola f06b43285d build-sys: enhance readability of the autotools files
Several horizontal lists are turned to vertical, and sorted to
alphabetical order. Additionally spaces are converted to tabs where
ever possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-28 13:29:35 +01:00
Sami Kerola 7cebf0bb4f docs: corrections to FSF license files, and postal address
The COPYING and Documentation/licenses/COPYING* files are being
replaced by files from GNU web site.

http://www.gnu.org/licenses/gpl-2.0.txt
http://www.gnu.org/licenses/lgpl-2.1.txt

Postal addresses to FSF in other files are updated to match with the
address in license files.

Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-24 14:13:35 +01:00
Davidlohr Bueso 88ffbf86e0 mkfs.bfs: add setlocale
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-02-22 11:51:57 +01:00
Sami Kerola 82cdf1b194 raw: remove unnecessary return [cppcheck]
[disk-utils/raw.c:171]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-08 12:52:46 +01:00
Sami Kerola 2e24868683 mkfs.cramfs: check blocksize user input [cppcheck]
Enhance user input checking and error messaging, while fixing
cppcheck warning.

[disk-utils/mkfs.cramfs.c:729]: (style) Checking if unsigned variable 'blksize' is less than zero.

[kzak@redhat.com: fix coding style]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-08 12:46:11 +01:00
Sami Kerola 33f28cd7a7 mkfs.cramfs: close open file after usage [cppcheck]
[disk-utils/mkfs.cramfs.c:913]: (error) Resource leak: fd

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-08 12:39:10 +01:00
Karel Zak 15705de0ed blockdev: make the code more readable for static analysers
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-02 12:49:13 +01:00
Karel Zak e4a36b8bf4 fsck.cramfs: mark usage() as noreturn
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-31 21:20:55 +01:00
Karel Zak c596a05450 mkswap: check blkid_probe_lookup_values() return [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-31 13:10:58 +01:00
Karel Zak 16bd802561 blockdev: remove non-ANSI function declaration [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-17 17:23:01 +01:00
Karel Zak 9206b23863 test: refresh build-sys tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-17 15:35:10 +01:00
Wanlong Gao f61a097bec blockdev: make functions static
make the functions in blockdev to statics.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-01-05 17:09:27 +01:00
Karel Zak 5018dc3d86 Merge branch 'master' of https://github.com/maurizio-lombardi/util-linux
* 'master' of https://github.com/maurizio-lombardi/util-linux:
  mkfs.minix: The total number of zones is limited to 65536 only on V1 filesystems
  mkfs.minix: Some bug fixes:
  mkfs.minix: The s_blocksize field of the MinixV3 superblock must be initialized with a valid block size, not the total number of blocks of the device!
  mkfs.minix: inode numbers are 32-bit wide in V3 filesystems
  mkfs.minix: In Minix V3 filesystems the maximum filename lenght is 60 chars and the dirsize is 64 bytes.
  mkfs.minix: Fix super_set_nzones()
  mkfs.minix: remove redundant code
2011-11-28 10:23:04 +01:00
Arnaud Mouiche 8b472bfa73 small bug in mkfs.cramfs + patch
mkfs.cramfs on version v2.17.2 has a small bug when dealing with very small
filesystems.  look at upstream code on git, and the issue is still here.
ex:

         $ cd /tmp
         $ mkdir content
         $ echo hello > content/a
         $ echo hello > content/b
         $ mkfs.cramfs content content.cramfs
         not enough space allocated for ROM image (4090 allocated, 4096 used)

Here is a patch for fixing (simply rounding to page size AFTER eleminating
doubles).

Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-23 13:29:32 +01:00
Maurizio Lombardi 57ba4027a5 mkfs.minix: The total number of zones is limited to 65536 only on V1 filesystems 2011-11-21 20:30:40 +01:00
Maurizio Lombardi de5326095a mkfs.minix: Some bug fixes:
- Fix root inode initialization
- In V3 filesystems the maximum number of inodes is not 65536 but 2^32.
2011-11-21 20:16:57 +01:00
Maurizio Lombardi a54d258f8c mkfs.minix: The s_blocksize field of the MinixV3 superblock must be
initialized with a valid block size, not the total number of blocks
of the device!
2011-11-21 20:00:48 +01:00
Maurizio Lombardi caa9cc8613 mkfs.minix: inode numbers are 32-bit wide in V3 filesystems 2011-11-21 19:52:03 +01:00
Maurizio Lombardi 3c5075e37b mkfs.minix: In Minix V3 filesystems the maximum filename lenght is 60
chars and the dirsize is 64 bytes.
2011-11-21 19:46:26 +01:00
Maurizio Lombardi 75ab0b36a3 mkfs.minix: Fix super_set_nzones()
Write the total number of zones in Super3.n_zones when
dealing with v3 filesystems.
2011-11-21 19:42:42 +01:00
Maurizio Lombardi 01a1fcc85e mkfs.minix: remove redundant code 2011-11-21 19:35:40 +01:00
Karel Zak 979f1dd5fe mkswap: wipe all old signatures
mkswap(8) zaps the begin of the device (1024 bytes) only. This is not
enough, because for example ReiserFS superblock is outside this area.

This patch add blkid_do_wipe() call to mkswap(8) and all block device
is scanned and all signature are removed.

Reported-by: Martin Pitt <martin.pitt@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-11 13:33:51 +01:00
Francesco Cosoleto f8209a0f66 fsck.minix: fix zone_map memory allocation failure check
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-11-10 12:58:31 +01:00
Francesco Cosoleto d73af2ac4b fsck.minix: remove unnecessary memset calls
The program aborts without using this unintialized allocated memory,
setting to zero doesn't look needed.

memset calls with sizeof() of pointer as argument (reported by clang).

[kzak@redhat.com: - replace malloc with calloc for {zone,inode}_count
                    to make code more robust]

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-09 10:03:07 +01:00
Karel Zak d81b5a5217 build-sys: cleanup BUILD_CRAMFS
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-03 12:32:50 +01:00
Karel Zak 16ba8d5893 build-sys: cleanup BUILD_RAW
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-03 12:32:49 +01:00
Petr Uzel 960cf5737e misc: use %m in format string instead of %s and strerror(errno)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-09-27 15:46:07 +02:00
Francesco Cosoleto 8c40f48195 fdformat: fix uninitialized variable
Spotted by EKOPath compiler.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-09-12 12:45:57 +02:00
maximilian attems 89c5005380 raw: fix shadowing of minor function
Noticed while compiling against klibc:
raw.c: In function ‘query’:
raw.c:219:16: error: called object ‘minor’ is not a function

Rename variable from minor to minor_raw.
While at it mark the functions as static and small whitespace fixes
as asked by checkpatch.

[kzak@redhat.com: - rename variable at line 241 too]

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-30 11:52:03 +02:00
Benno Schulenberg 449a215fc5 docs: tweak the formatting and wording of several disk-utils man pages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-29 11:24:47 +02:00
Benno Schulenberg 232dc924c4 docs: uniformize the header and footer lines in man pages
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.

Also improve here and there the one-line program description.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-22 10:39:21 +02:00
Karel Zak 832410da7b mkfs.minix: fix write_all() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-17 00:29:39 +02:00
Karel Zak 637775c798 blockdev: indent usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 10:20:45 +02:00
Benno Schulenberg f770a404bf mkfs.cramfs: clearer error message, "cannot close" instead of "closing"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-15 15:49:18 +02:00
Benno Schulenberg c181c31dd9 mkfs: fix small formatting issues in man page
Also spell "filesystem" consistently as one word -- this makes
things clearer when the word is used as an adjective.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:55 +02:00
Benno Schulenberg 3b683597ca isosize: improve style, grammar and spacing of man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:53 +02:00
maximilian attems 086752639d mkswap: Use c.h
Fixes mkswap compilation against klibc.

Signed-off-by: maximilian attems <max@stro.at>
2011-08-02 13:58:54 +02:00
Karel Zak ae7ec06b7f swaplabel: fix compiler warnings [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 14:54:45 +02:00
Karel Zak d9d88e3162 mkfs.minix: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 14:51:58 +02:00