Commit Graph

88 Commits

Author SHA1 Message Date
Sami Kerola 58f0252a18 wipefs: use exclusive_option()
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-17 17:59:59 +02:00
Sami Kerola 4f0537374f wipefs: use symbolic value for markup mode
In case mode value is found to be out of bounds program will crash.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-11 22:06:05 +02:00
Karel Zak db41a4298f misc-utils: cleanup strtoxx_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-15 17:44:37 +02:00
Petr Uzel e12c9866b5 include: rename writeall.h to all-io.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15 11:32:27 +02:00
Sami Kerola c05a80ca63 misc-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:56:48 +02:00
Karel Zak 99727496ed wipefs: use strtosize_or_err()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-30 16:17:49 +02:00
Milan Broz 24df2633d3 wipefs: Fix mismatch if more -o options used.
If there are more offset options specified, some could be lost.

Try
pvcreate /dev/sd[bcde]
mdadm -C -l 5 -n4 /dev/md0 /dev/sd[bcde]
mdadm --stop /dev/md0

wipefs -n -o 0x1000 -o 0x218 /dev/sdb
- LVM2 signature remains there

wipefs -n -o 0x218 -o 0x1010 /dev/sdb
- no report about ignored signature

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-03-08 16:11:36 +01:00
Karel Zak 86ace3f407 wipefs: always print devname
It seems too smart to print devname according to number of devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-01 15:44:04 +01:00
Milan Broz c10695f8a4 wipefs: support more device arguments for wipefs
[kzak@redhat.com: - print devname only if more devices specified]

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-01 15:36:45 +01:00
Milan Broz 0fd93af697 wipefs: add quiet flag (-q)
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-01 15:24:05 +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 a2f5c22173 wipefs: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-12-16 12:42:40 +01:00
Karel Zak f126cd4694 wipefs: add -t <list> option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-15 15:19:28 +01:00
Karel Zak 44765fdd84 libblkid: export info about PT magic strings
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-13 21:25:12 +01:00
Karel Zak 6611a3dd78 wipefs: improve -a, use blkid_do_wipe()
Some filesystems (e.g. FAT) is possible to detect in many ways -- for
example if a magic string is stored on more places on the device. The
current implementation always removes from the device only the firstly
detected possibility.

 # wipefs /dev/sdb1
 offset               type
 ----------------------------------------------------------------
 0x36                 vfat   [filesystem]
                      UUID:  D203-A7F4

 # wipefs -a /dev/sdb1
 8 bytes [46 41 54 31 36 20 20 20] erased at offset 0x36 (vfat)

 # wipefs /dev/sdb1
 offset               type
 ----------------------------------------------------------------
 0x0                  vfat   [filesystem]
                      UUID:  D203-A7F4

This patch fixes this issue:

 # wipefs -a /dev/sdb1
 8 bytes were erased at offset 0x00000036 (vfat): 46 41 54 31 36 20 20 20
 1 bytes were erased at offset 0x00000000 (vfat): eb
 2 bytes were erased at offset 0x000001fe (vfat): 55 aa

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-11 12:48:38 +01:00
Karel Zak dcd16b0fb0 dmesg: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:02:00 +02:00
Benno Schulenberg 11295cd102 wipefs: change option -v to -V for --version; add it to man page
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-08 11:58:47 +02:00
Benno Schulenberg 340b3b0a68 wipefs: gettextize one sentence as a whole
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2011-08-02 14:13:44 +02:00
Sami Kerola 094678122e wipefs: add version printing & compiler warning
The --version option is added, and a storage type is fixed to
correct a compiler warnings.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:28:17 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Petr Uzel 0239ac01b0 wipefs: use write_all from include/writeall.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-02-08 15:43:38 +01:00
Milan Broz 6ebe8f630a wipefs: fail if more device arguments specified
Currently wipefs process only first device argument and silently ignores
remaining.  Print error instead because it can be quite confusing.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-30 23:14:55 +01:00
Karel Zak ecc264bc39 lib: [xalloc] add xstrdup()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-24 17:08:32 +01:00
Davidlohr Bueso 8abcf29002 lib: [strutils] general purpose string handling functions
This patch replaces a few functions used throughout the source:
* Renames getnum (from schedutils) to strtol_or_err
* Moves strtosize (from lib/strtosize.c)
* Moves xstrncpy (from include/xstrncpy.h)
* Adds strnlen, strnchr and strndup if not available (remove it from libmount utils)

A few Makefile.am files were modified to compile accordingly along with trivial renaming
in schedutils source code.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-23 21:06:49 +01:00
Davidlohr Bueso 87f3feac71 misc-utils: use new xmalloc() wrapper
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-10-21 10:31:50 +02:00
Karel Zak 770af396fa wipefs: fix memory leaks
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-16 23:41:33 +02:00
Karel Zak 9683e327ed wipefs: fix mem usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-16 23:40:46 +02:00
Benno Schulenberg d0bb6987a8 textual: fix typos, and rephrase some things for clarity
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-14 11:17:00 +02:00
Karel Zak 70601bb696 wipefs: print warning is PT detected
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-04-22 21:53:11 +02:00
Karel Zak 69cc2ec061 wipefs: support suffixes for --offset
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-30 14:45:29 +02:00
Karel Zak f5b1bab190 wipefs: cleanup usage() and man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-15 13:45:03 +01:00
Karel Zak bfbe29339d wipefs: fix license (GPL -> GPLv2+)
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-23 14:13:28 +01:00
Karel Zak 269c1a2a64 wipefs: ignore devices with partition table
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-04 21:18:34 +01:00
Karel Zak 04c944419d po: fix msgid bugs
Reported-by: Petr Pisar <petr.pisar@atlas.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-12-10 13:04:41 +01:00
Karel Zak 870768adb5 wipefs: remove obsolete comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-30 13:48:10 +01:00
Karel Zak f54a736f2f wipefs: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-07 00:04:08 +02:00
Karel Zak c49057d261 wipefs: new command
# ./wipefs /dev/sda4
 offset               type
 ----------------------------------------------------------------
 0xff6                swap   [other]
                      UUID:  da6c54ea-77d9-470a-82f1-e793fd5d9131

 0x36                 vfat   [filesystem]
                      UUID:  497F-3013

 # ./wipefs --offset 0x36 /dev/sda4
 8 bytes [46 41 54 31 32 20 20 20] erased at offset 0x36 (vfat)

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-06 23:56:23 +02:00