Commit Graph

1228 Commits

Author SHA1 Message Date
Peter Breitenlohner a9808f775b mkfs.bfs.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner 281bb40d3b isosize.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner a37daa527e fsck.minix.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:09 +02:00
Peter Breitenlohner 0e83eb2fe4 fdformat.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:09 +02:00
Peter Breitenlohner d42f738783 elvtune.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:09 +02:00
Peter Breitenlohner feae57c9e5 blockdev.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:09 +02:00
Peter Breitenlohner 039f35318b mkfs.8: incomplete sentence and formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:04 +02:00
Karel Zak 30688dde55 build-sys: rename to _execdir
The variable name "usrlibexecdir" is very confusing (because we have
/usr/libexec). The "exec" prefix is required for user-defined
directories, see

   http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install

This patch renames all usr*execdir variables to usr*_execdir.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 01:23:41 +02:00
Karel Zak a08273192d raw: undeprecate raw
from Linux kernel:

	commit abd4aa5a97ebc0efb9a7fbc98ef0bcf39266fadf
	Author: Dave Jones <davej@redhat.com>
	Date:   Sun Jul 15 23:40:49 2007 -0700
	undeprecate raw driver

 :-(

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-02 13:39:28 +02:00
Jeff Mahoney b41f637c64 raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
The in-kernel ioctl code creates a raw# device on-demand. udev will create
the /dev/raw/raw# file when the device is created automatically.

The current raw userspace code wants to stat the file before using it,
which is unnecessary for setting up the raw device.

This patch stats the file only when query() is called as a singleton, and
it's doubtful it's needed even there. I modified as little code as I could,
though.

[kzak@redhat.com: - check properly fscanf() return code
                  - add NLS stuff]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-29 23:07:09 +02:00
Karel Zak 17afb0320c build-sys: cleanup libuuid stuff
Supported scenarios:

 * internal libuuid (--enable-libuuid, default)

 * external libuuid (--disable-libuuid)
   - systems without pkg-config
   - systems with pkg-config

 * systems without libuuid at all (the library is optional for u-l-ng)

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 8c0dc0719d build-sys: fix headers in mkswap and libblkid
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:15 +02:00
Karel Zak 18c3e24341 blockdev: fix possible buffer overflow
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-29 14:17:39 +02:00
Karel Zak d10056b34d mkswap: clean up man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-13 14:31:31 +01:00
Karel Zak ff3bed8068 mkswap: zap bootbits
/dev/sdb1 originally initialized by cryptsetup:

and OLD mkswap:

        # vol_id /dev/sdb1 | grep TYPE
        ID_FS_TYPE=swap

        # blkid -s TYPE /dev/sdb1
        /dev/sdb1: TYPE="crypt_LUKS"

So, we have two different *valid* signatures on the device now!

NEW mkswap:

        # blkid -s TYPE /dev/sdb1
        /dev/sdb1: TYPE="swap"

        # /lib/udev/vol_id /dev/sdb1 | grep TYPE
        ID_FS_TYPE=swap

the bootbits (first 1024 bytes) was erased.

We shouldn't zap disk labels (BSD, SUN, ...) and boot loaders (on whole
disk):

        # mkswap  /dev/sdb2
        mkswap: /dev/sdb2: warning: don't erase bootbits sectors
                (BSD partition table detected). Use -f to force.
        Setting up swapspace version 1, size = 4348 KiB
        no label, UUID=69d87cef-71ac-4fb0-a689-ce3e930dea17

        # mkswap  /dev/sdb
        mkswap: /dev/sdb: warning: don't erase bootbits sectors
                on whole disk. Use -f to force.
        Setting up swapspace version 1, size = 8188 KiB
        no label, UUID=97757ad7-8a84-43d9-bcb4-16fefd93a2ac

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-12 16:01:59 +01:00
Karel Zak 4c85aa3a4c mkswap: remove v0 swap space support
The kernel has not supported v0 swap space format since 2.5.22. The
new version v1 is supported since 2.1.117.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-11 15:23:16 +01:00
Hugh Dickins 99e6d5259e mkswap: handle 2^32 pages
mkswap (when built 32-bit) could not quite support the maximum size
of swap area (2^32 pages): change unsigned long pagecounts to unsigned
long long pagecounts, and fix maxpages for the case when more is asked.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
2009-02-27 15:26:48 +01:00
Karel Zak 010d0a4cca blockdev: add note that the StartSec is in 512-byte sectors
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-26 15:58:28 +01:00
Karel Zak 95356e8b74 mkfs.minix: remove local implementation of {set,clr}bit
We needn't to duplicate stuff from <sys/param.h>.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-05 15:47:30 +00:00
Karel Zak a6f72ab47e fsck.cramfs: segfault with INCLUDE_FS_TESTS and no -x option
The current implementation causes a segmentation fault if
INCLUDE_FS_TESTS is defined, but the -x option is not specified.

The error is caused by the extract_dir variable being null.

Reported-by: Roy Peled <the.roy.peled@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-04 23:36:39 +01:00
Roy Peled c17e59b4b3 mkfs.cramfs: lower memory requirements for layouts with duplicate files
mkfs.cramfs allocates memory based on a calculated upper-bound
of required filesystem size. If there are duplicate files
or hard links, the current implementation unnecessarily increases
the upper-bound per each copy of the file, even though cramfs does
not store copies of contents of identical files.

This patch improves the calculation of fslen_ub, the upper bound
of required filesystem size, by making the upper bound aware of
duplicate files.

This is very helpful for layouts that hold a lot of hard links,
which are seen as duplicate files by mkfs.cramfs. For example,
this drastically reduces the memory requirements for creating
a standard Busybox layout.

Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
2009-02-04 15:08:20 +01:00
Signed-off-by: Roy Peled fbaec83bc0 mkfs.cramfs: add endianness support to cramfs tools
cramfs is an endianness dependent file system.  So far, the cramfs
utilities did not support cramfs images of different endianness than
the host machine.

A separate utility, cramfsswap, was required in order to change the
endianness of the image before and after using cramfs utilities. The
extra utility introduced extra maintenance and an additional step in
the process.

This patch adds endianness support to mkfs.cramfs and fsck.cramfs.
fsck.cramfs now automatically detects the image endianness, and can
work on images of either endianness.  mkfs.cramfs now accepts a new
optional parameter (-N) that allows creating the cramfs image in
either endianness.

Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-04 14:56:54 +01:00
Karel Zak 6db4681802 raw: default to /dev/raw/rawctl
The raw devices are in the raw/ subdirectory. It makes sense to use
the same subdirectory also for the control file. The old /dev/rawctl
is also supported as a fallback.

The #ifdef OLD_RAW_DEVS (/dev/raw<N>) is unsupported from now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-26 01:13:03 +01:00
Karel Zak 727b3c2f26 mkfs.minix: (and fsck) rename bitops.h
This patch renames bitops.h to minix_bitops.h to avoid possible
collisions with global include/bitops.h file.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05 14:38:54 +01:00
Matthias Koenig d60819b36d include: move swapheader.h to include
[kzak@redhat.com: add ifndef _SWAPHEADER_H]

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05 11:51:40 +01:00
Matthias Koenig 943add2882 mkfs.minix: fix size detection
blkdev_get_size returns size in bytes, so BLOCKS has to be
calculated accordingly.
Use stat value for size if device is not a block device.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2008-11-13 23:56:32 +01:00
Pedro Ribeiro 5dd48fb28f raw: add NLS support
[kzak@redhat.com: - add setlocale(), ...
                  - remove tailing white spaces]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:46:36 +02:00
Pedro Ribeiro 5044f6d7f0 mkfs.cramfs: several strings without gettext calls
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:35:16 +02:00
Pedro Ribeiro e56644ca45 fsck.cramfs: add NLS support
[kzak@redhat.com: - add setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:30:33 +02:00
Pedro Ribeiro 90d43eca4e elvtune: add NLS support
[kzak@redhat.com: - add missing setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 08:22:50 +02:00
Karel Zak 293889d084 fsck.cramfs: fix compiler warning
fsck.cramfs.c: In function ‘main’:
fsck.cramfs.c:676  warning: ‘length’ may be used uninitialized in this function

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 12:24:38 +02:00
maximilian attems d144727bc3 use getpagesize()
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE)
to anything Linux.

this patch helps klibc porting effort as the sysconf
multiplex API is not supported there.

also remove comment of the switch to sysconf in mkswap.c.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-30 13:26:58 +02:00
maximilian attems d5c28ebc32 disk-utils: include fcntl.h directly (mkfs.cramfs, raw)
helps klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:09:14 +02:00
maximilian attems fc68cd4973 disk-utils: s/MOUNTED/_PATH_MOUNTED/
no longer use deprecated alias.
helps compiling util-linux-ng against klibc.

add pathnames.h include, where _PATH_MOUNTED is defined.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:06:07 +02:00
Samuel Thibault 098fa6b120 disk-utils: clean up code, use blkdev_* functions
[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24 01:15:07 +02:00
Samuel Thibault ff035f67ed mkswap: non-linux support
GNU/Hurd uses linux-like swapspace, so mkswap makes sense on
non-linux platforms too.

[kzak@redhat.com: split the original patch to small patches]

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-24 00:52:13 +02:00
Karel Zak 4ba66edf82 selinux: is_selinux_enabled() returns 0, 1 and -1
Unfortunately, the current libselinux implementation of
is_selinux_enabled() returns -1 on error. This behavior is
undocumented.

The proper solution is to use "if (is_selinux_enabled() > 0)".

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-01 14:32:53 +02:00
Karel Zak 89fb9aeb55 mkswap: set errno=0 in write_all()
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 21:58:26 +02:00
Karel Zak db83e35c6a mkswap: when writing the signature page, handle EINTR returns
If the signature page write bumps into EINTR, it should finish the
write, instead of dying.

Addresses-Ubuntu-Bug: 206113
Signed-off-by: LaMont Jones <lamont@canonical.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-15 00:35:05 +02:00
Karel Zak 00077d4d53 build-sys: update .gitignore files
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:24:03 +02:00
James Youngman c4e1583799 build-sys: ignore a bunch of generated files, mostly binaries
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:08:00 +02:00
James Youngman 54a78201e1 fsck.minix: reset the terminal state if we are killed by a fatal signal
[kzak@redhat.com: remove unnecessary volatile type qualifier]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 02:16:20 +02:00
Benno Schulenberg 2d57c1f09e mkfs.cramfs: switch on localization.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-04-08 01:44:51 +02:00
James Youngman bb98388557 fsck.minix: correct the error message given when we can't open the device
Don't actually print %s in the error message, print the device name,
as was obviously intended.  Also, print the error message
corresponding to the errno value.

[kzak@redhat.com: add __attribute__, coding style cleanups]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 01:42:36 +02:00
Karel Zak db3e2da790 mkfs.minix: clean up gcc warnings
mkfs.minix.c:199: warning: ‘count_blocks’ defined but not used

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20 14:57:40 +01:00
Karel Zak 7b241808f1 mkswap: fix compiler warnings
mkswap.c:529: warning: pointer targets in assignment differ in signedness
mkswap.c:531: warning: pointer targets in assignment differ in signedness
mkswap.c:550: warning: pointer targets in passing argument 1 of `uuid_parse' differ in signedness

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20 14:54:06 +01:00
Karel Zak 70ae6e9525 fdformat: install to /usr/sbin instead to /usr/bin
It should be in usrsbinexecdir, since formatting is usually a
privileged util-linux operation (like mkfs).

Reported-By: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-04 12:36:55 +01:00
Martin Schulze 93bf0f285d mkswap: set UUID for swap space (add -U option)
A friend of mine is looking into the possibility of cloning Debian
(and other) systems automatically and stomped over swap partitions
getting assigned new UUIDs every time the new harddisk is partitioned
and swap is created.

It's essential when partitions are to be recognised by their uuid and
not by their old device path anymore.

Addresses-Ubuntu-Bug: #66637
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-02-15 01:31:50 +01:00
Stepan Kasal a3ca3a44c5 build-sys: use dist_man_MANS instead of man_MANS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:49 +01:00
Karel Zak 7dcca505f8 blockdev: add --getsz to blockdev.8
This patch also marks --getsize as deprecated option.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-28 20:55:45 +01:00
Karel Zak 3c1e47c61f build-sys: cleanup disk-utils/Makefile.am (use $utils_common)
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-21 02:38:25 +01:00
Matthias Koenig 16726585e3 mkfs.minix: device size cleanup
Use blkdev_get_size() function and some size related cleanup.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-11-21 02:35:09 +01:00
Matthias Koenig a28a3ad26d mkfs.minix: add sectorsize check
Minix filesystem until version 2 has a fixed blocksize of 1024 bytes.
If you try to create a filsystem on a device with a physical sectorsize
larger than 1024 bytes, this resulting minix fs cannot be mounted,
because the physical sectorsize must be smaller than the filesystem
blocksize.
This patch adds a check for this and will refuse to create a filesystem
if the sectorsize is bigger than the blocksize.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-11-21 02:35:00 +01:00
Samuel Thibault 3bbc932079 build-sys: non-linux support
Here is a patch that disables linux-specific tools on non-linux targets.

Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-Off-By: Karel Zak <kzak@redhat.com>
2007-11-08 02:26:36 +01:00
Karel Zak 8505ff35cf elvtune: use get_linux_version()
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 21:25:48 +01:00
Karel Zak bc8b63833e blockdev: use lib/blkdev.c, fix --report
This patch replaces duplicate code with blkdev_ functions from
lib/blkdev.c.

The patch also fix the output from "blockdev --report". The Size field
was in 512-byte sectors instead in real size in bytes.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 20:59:28 +01:00
Karel Zak b7188e932e mkswap: cleanup kB vs. KiB usage in error messages
mkswap(8) man page is talking about KiB (2^10), but the mkswap binary
uses kB (10^3) in error messages. That's strange. Let's use KiB
everywhere.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 13:46:34 +01:00
Karel Zak 54e377b386 mkswap: BLKGETSIZE cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-07 13:26:27 +01:00
Karel Zak 8023c83bd5 mkswap: linux_version() code consolidation
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-06 02:40:49 +01:00
lizf bbc9abce3f mkfs.cramfs: remove unused header file
Remove including of assert.h

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-11-06 01:09:04 +01:00
lizf 122db55d60 blockdev: fix: opened file leaving unclosed
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-10-26 01:02:45 +02:00
Benno Schulenberg 6557c51226 docs: tweak a few messages for clarity
Add a missing period, a missing space, a comma and a word for clarity,
plus a period and an uppercase letter to match surrounding messages.
Further add a missing call to gettext, and undo an unneeded linewrap.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2007-10-26 01:02:44 +02:00
KaiGai Kohei 71bf788444 mkswap: possible to crash with SELinux relabeling support
When fgetfilecon() is failed with -ENODATA, this process does not
exit.  However, "oldcontext" is not initialized in this case, so
context_new() will be called with uninitialized "oldcontext" at the
next.

Finally, it makes a segmentation fault, because context_new() have to
refer an incorrect memory region.

The attached patch fixes this matter using matchpathcon().  If we
cannot obtain actual file context due to -ENODATA, a context which is
returned by matchpathcon() is applied as oldcontext.  Then, the type
of the context is relabeled to "swapfile_t" explicitly.

Signed-off-by: KaiGai Kohei <kaigai@kaigai.gr.jp>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-25 21:50:36 +02:00
Randy Dunlap 3c7c38e1b3 mkfs.cramfs: clean up gcc warnings
* clean up code, gcc warnings
  (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2")

Builds cleanly on x86_32 and x86_64.

mkfs.cramfs.c:211: warning: pointer targets in passing argument 2 of 'MD5Update' differ in signedness
mkfs.cramfs.c:336: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'size_t'
mkfs.cramfs.c:355: warning: pointer targets in assignment differ in signedness
mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness
mkfs.cramfs.c:448: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness
mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__builtin___strncpy_chk' differ in signedness
mkfs.cramfs.c:450: warning: pointer targets in passing argument 1 of '__strncpy_ichk' differ in signedness
mkfs.cramfs.c:490: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
mkfs.cramfs.c:620: warning: pointer targets in passing argument 1 of 'compress' differ in signedness
mkfs.cramfs.c:620: warning: pointer targets in passing argument 3 of 'compress' differ in signedness
mkfs.cramfs.c:671: warning: pointer targets in passing argument 3 of 'do_compress' differ in signedness
mkfs.cramfs.c:824: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t'
mkfs.cramfs.c:872: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t'
mkfs.cramfs.c:880: warning: format '%d' expects type 'int', but argument 3 has type 'ssize_t'
mkfs.cramfs.c:885: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
mkfs.cramfs.c:889: warning: pointer targets in passing argument 2 of 'crc32' differ in signedness
mkfs.cramfs.c:896: warning: format '%Ld' expects type 'long long int', but argument 4 has type 'loff_t'
mkfs.cramfs.c:896: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t'
mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 4 has type 'ssize_t'
mkfs.cramfs.c:909: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t'

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11 01:22:14 +02:00
Randy Dunlap e30cb0ed72 mkfs.minix: clean up gcc warnings
* clean up code, gcc warnings
  (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2")

Builds cleanly on x86_32 and x86_64.

mkfs.minix.c:595: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-11 00:30:06 +02:00
Randy Dunlap 5f8416478d fsck.cramfs: clean up gcc warnings
* clean up code, gcc warnings
  (try compilation with "-Wall -Wp,-D_FORTIFY_SOURCE=2")

Builds cleanly on x86_32 and x86_64.

fsck.cramfs.c:235: warning: ignoring return value of 'read', declared with attribute warn_unused_result

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
2007-10-03 23:08:34 +02:00
Rajeev V. Pillai 2b00dd6d54 pg: fix segfault on search
Run pg(1) and type '/<CR>' which is supposed to forward search for the
previously remembered search string. pg(1) will segfault after printing
"No remembered search string:".

Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-03 22:39:27 +02:00
Karel Zak bf928360f2 build-sys: remove hardcoded _GNU_SOURCE
We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-09-20 00:57:01 +02:00
Li Zefan 45be3f7d8d blockdev: add missing description about option --report in manpage
The manpage does not mention the option --report.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
2007-09-19 23:14:09 +02:00
Benno Schulenberg 65b27d3669 po: gettextizing some overlooked messages.
Gettextize three new strings, make two strings indentical to two others,
and gettextize three strings that are already gettextized elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14 14:46:28 +02:00
Karel Zak a512390d92 mkfs: remove nonsense from man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-02 14:23:38 +02:00
Karel Zak 1dea05a811 blockdev: use LU and LLU for BLKGETSIZE and BLKGETSIZE64
The "blkockdev --getsize" returns negative numbers on i386
for 1Tb devices. The BLKGETSIZE and BLKGETSIZE64 have to
use unsigned long and unsigned long long.

$ blockdev --getsize /dev/mapper/huge
-2147483648

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-01 15:47:33 +02:00
Karel Zak 3281d4268a blockdev: fix "blockdev --getsz" for large devices
The "blockdev --getsz" command doesn't try to use BLKGETSIZE64 when
previous BLKGETSIZE failed with EFBIG. This patch fixes this problem.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-01 15:06:18 +02:00
Matthias Koenig 2018629905 disk-utils: let mkfs tools open with O_EXCL
Let mkswap, mkfs.bfs, mkfs.minix open with O_EXCL if
used on block devices to prevent writing to the device
even if they are busy (mounted).

Unfortunately, O_EXCL has zero effect for 2.4 kernels where
in-kernel code doesn't use O_EXCL-like access locks. (Tested
on RHEL3.)

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-27 13:39:29 +02:00
Karel Zak 8e522bb7e9 remove hardcoded package name from some utils
We have PACKAGE_STRING in config.h that includes package name and
version. It's better to use this macro that hardcoded strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-27 12:12:00 +02:00
Karel Zak f88c89db4f mkswap: fix signedness problems and remove obsolete code
The UUID is unsigned char *

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-25 17:18:57 +02:00
Matthias Koenig 30294a2fe8 mkswap: default to V1 in any case
mkswap(8) enforces to use v0 swap format when pagesize > 16kB.
(use case might be ppc64 with CONFIG_PPC_64K_PAGES).

As version 0 swap is not supported anymore by recent kernels, the
behaviour in this case is rather strange.

Here is a testcase:

for i in 4 8 16 32 64; do mkswap -p `expr $i \* 1024` ./swap.file; done
Setting up swapspace version 1, size = 4294963 kB

Using user-specified page size 8192, instead of the system values
4096/4096
Setting up swapspace version 1, size = 4294959 kB

Using user-specified page size 16384, instead of the system values
4096/4096
Setting up swapspace version 1, size = 4294950 kB

Using user-specified page size 32768, instead of the system values
4096/4096
Setting up swapspace version 0, size = 4294934 kB

Using user-specified page size 65536, instead of the system values
4096/4096
Setting up swapspace version 0, size = 4294901 kB

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-24 14:59:32 +02:00
Karel Zak 86d62711a9 man pages: add "AVAILABILITY" section
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-03 01:17:04 +02:00
Karel Zak a424171cd1 blockdev: cleanup usage() and update man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-29 12:06:58 +02:00
Karel Zak c2a1e78808 blockdev: add BLKFRAGET/BLKFRASET ioctls
In Linux 2.6 the BLKRASET ioctl has the desired effect for mounted
file-systems.  In Linux 2.4 it appears to set the number of blocks to
read-ahead on the *device* as opposed to within a *file*, and the
maximum value of this number is 255.  As a result the invocation of
blockdev will fail on Linux 2.4 for any usefully large value of
READAHEAD, and will not in any case have the desired affect for
fragmented files.

(Based on the blockdev-getfra-setfra.patch Debian patch.)

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-29 11:38:54 +02:00
Karel Zak 94ed908c8d mkfs.cramfs: cleanup HAVE_ macros usage
It's bad to use any HAVE_* macros for anything other than
for build-system (autotools) stuff.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-14 13:55:37 +02:00
Matthias Koenig 766dd75716 disk-utils: fix libuuid usage in mkswap
Fix libuuid usage in mkswap.

Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2007-05-16 23:55:23 +02:00
Stepan Kasal 2984313a46 build-sys: do not build convenience libraries in lib/
Build lib/*.c individually for each project which uses it, so that the
right set of flags is applied each time.

Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-05-16 11:43:29 +02:00
Karel Zak 2bfcd20b8d mkfs.cramfs: fix a way how mkfs works with empty files
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-27 16:49:25 +01:00
Karel Zak 3e52b13e91 mkfs.cramfs: remove hardcoded limit for directories
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-27 16:31:21 +01:00
Karel Zak 3e18b040af mkswap: automatically add selinux label to swapfile
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-08 15:22:37 +01:00
Karel Zak 8abb4c2e00 mkswap: avoid mkswap usage on already mounted device
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-07 10:32:02 +01:00
Karel Zak 6b9a290adf mkswap: gcc happy: unsigned long usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-07 10:10:22 +01:00
Karel Zak 7ac3b5b8e3 Clean up pagesize/PAGE_SIZE usage.
Now all code in util-linux uses sysconf(_SC_PAGESIZE) that is standardized and
preferred way of querying page size. The asm/page.h file is not included to the
code anymore. (This patch doesn't change mount's FS detection code which will
be removed later).

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-06 11:35:15 +01:00
Karel Zak 3f88ee9731 raw: move the raw command to /sbin
The raw command could be used from udev scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-26 20:01:39 +01:00
Karel Zak 34ab1590bd raw: don't accept raw0 as a target name
The raw0 is rawctl and cannot be used as a normal raw device. The patch
also enlarge range of <N> for raw<N> and improve the query mode.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-26 19:55:41 +01:00
Karel Zak 69616d88d4 raw: update man page (about dd and O_DIRECT)
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-25 11:22:42 +01:00
Karel Zak 562218e6ea build-sys: add missing files
This patch add all missing headers, man pages and README files to automake
stuff and "make dist-gzip" produces useful tarball now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04 11:57:07 +01:00
Karel Zak 8eeb575c0d build-sys: remove generated autotools stuff from git
The generated autotools stuff shouldn't be maintained by SCM. After check out
from git use ./autogen.sh. For more details see README.devel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-03 22:20:44 +01:00
Karel Zak cf6d7faebb Imported from util-linux-2.13-pre6 tarball. 2006-12-07 00:27:13 +01:00
Karel Zak 19922f22a1 Imported from util-linux-2.13-pre5 tarball. 2006-12-07 00:27:10 +01:00
Karel Zak ca3ea756e7 Imported from util-linux-2.13-pre4 tarball. 2006-12-07 00:27:06 +01:00
Karel Zak 9cb689775c Imported from util-linux-2.13-pre3 tarball. 2006-12-07 00:27:03 +01:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak bf3baa9907 Imported from util-linux-2.12p tarball. 2006-12-07 00:26:33 +01:00
Karel Zak 756bfd018e Imported from util-linux-2.12o tarball. 2006-12-07 00:26:31 +01:00
Karel Zak b22550fa15 Imported from util-linux-2.12k tarball. 2006-12-07 00:26:26 +01:00
Karel Zak d26aa358f4 Imported from util-linux-2.12h tarball. 2006-12-07 00:26:19 +01:00
Karel Zak 2cccd0ff2b Imported from util-linux-2.12d tarball. 2006-12-07 00:26:18 +01:00
Karel Zak c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak d03dd60840 Imported from util-linux-2.12a tarball. 2006-12-07 00:26:14 +01:00
Karel Zak df1dddf9ff Imported from util-linux-2.12 tarball. 2006-12-07 00:26:12 +01:00
Karel Zak 95f1bdeee4 Imported from util-linux-2.11x tarball. 2006-12-07 00:26:05 +01:00
Karel Zak 0e6f4a203d Imported from util-linux-2.11v tarball. 2006-12-07 00:26:02 +01:00
Karel Zak f0c8eda12c Imported from util-linux-2.11u tarball. 2006-12-07 00:26:00 +01:00
Karel Zak 63cccae468 Imported from util-linux-2.11t tarball. 2006-12-07 00:25:58 +01:00
Karel Zak a2c5f3cadc Imported from util-linux-2.11r tarball. 2006-12-07 00:25:56 +01:00
Karel Zak 1d4ad1decc Imported from util-linux-2.11q tarball. 2006-12-07 00:25:54 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak 612721dba8 Imported from util-linux-2.11n tarball. 2006-12-07 00:25:52 +01:00
Karel Zak e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +01:00
Karel Zak 364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +01:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak 66ee8158b6 Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
Karel Zak 22853e4a82 Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
Karel Zak eb63b9b8f4 Imported from util-linux-2.10f tarball. 2006-12-07 00:25:41 +01:00
Karel Zak 7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak 5c36a0eb7c Imported from util-linux-2.9i tarball. 2006-12-07 00:25:37 +01:00
Karel Zak 2b6fc908bc Imported from util-linux-2.8 tarball. 2006-12-07 00:25:35 +01:00
Karel Zak fd6b7a7ffc Imported from util-linux-2.7.1 tarball. 2006-12-07 00:25:34 +01:00
Karel Zak 726f69e29c Imported from util-linux-2.5 tarball. 2006-12-07 00:25:33 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00