summaryrefslogtreecommitdiffstats
path: root/disk-utils
Commit message (Collapse)AuthorAgeFilesLines
* mkswap: fix memory leaks, cleanup check_blocks()Karel Zak2009-09-071-5/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: unbreak -c ("check") option.Peter De Wachter2009-09-071-2/+2
| | | | | | | | | | | | In the check_blocks() loop, current_page is not incremented. Because of this bug, the loop does not end when the end of the device is reached. Instead it tries to continue reading, which of course fails, and eventually mkswap aborts ("too many bad pages"). Note that this can only be tested with swap partitions, mkswap ignores the -c option for swap files. Signed-off-by: Peter De Wachter <pdewacht@gmail.com>
* mkswap.8: formattingPeter Breitenlohner2009-08-171-6/+15
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* mkfs.minix.8: formattingPeter Breitenlohner2009-08-171-9/+10
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* mkfs.bfs.8: formattingPeter Breitenlohner2009-08-171-12/+9Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* isosize.8: formattingPeter Breitenlohner2009-08-171-8/+16
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* fsck.minix.8: formattingPeter Breitenlohner2009-08-171-3/+4
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* fdformat.8: formattingPeter Breitenlohner2009-08-171-2/+2
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* elvtune.8: formattingPeter Breitenlohner2009-08-171-22/+11Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* blockdev.8: formattingPeter Breitenlohner2009-08-171-1/+1
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* mkfs.8: incomplete sentence and formattingPeter Breitenlohner2009-08-171-17/+10Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* build-sys: rename to _execdirKarel Zak2009-07-041-3/+3
| | | | | | | | | | | | 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>
* raw: undeprecate rawKarel Zak2009-07-021-5/+0Star
| | | | | | | | | | | | | 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>
* raw: Use the RAW_SETBIND ioctl without stat'ing the raw# fileJeff Mahoney2009-06-291-26/+32
| | | | | | | | | | | | | | | | | | 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>
* build-sys: cleanup libuuid stuffKarel Zak2009-05-221-3/+10
| | | | | | | | | | | | | | 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>
* build-sys: fix headers in mkswap and libblkidKarel Zak2009-05-221-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* blockdev: fix possible buffer overflowKarel Zak2009-04-291-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: clean up man pageKarel Zak2009-03-131-73/+58Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: zap bootbitsKarel Zak2009-03-122-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /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>
* mkswap: remove v0 swap space supportKarel Zak2009-03-112-167/+33Star
| | | | | | | 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>
* mkswap: handle 2^32 pagesHugh Dickins2009-02-271-15/+17
| | | | | | | | 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>
* blockdev: add note that the StartSec is in 512-byte sectorsKarel Zak2009-02-261-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.minix: remove local implementation of {set,clr}bitKarel Zak2009-02-054-69/+8Star
| | | | | | We needn't to duplicate stuff from <sys/param.h>. Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: segfault with INCLUDE_FS_TESTS and no -x optionKarel Zak2009-02-041-2/+3
| | | | | | | | | | 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>
* mkfs.cramfs: lower memory requirements for layouts with duplicate filesRoy Peled2009-02-041-8/+9
| | | | | | | | | | | | | | | | | | | 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>
* mkfs.cramfs: add endianness support to cramfs toolsSigned-off-by: Roy Peled2009-02-045-18/+210
| | | | | | | | | | | | | | | | | | | | 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>
* raw: default to /dev/raw/rawctlKarel Zak2008-12-261-11/+9Star
| | | | | | | | | | 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>
* mkfs.minix: (and fsck) rename bitops.hKarel Zak2008-12-054-6/+6
| | | | | | | 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>
* include: move swapheader.h to includeMatthias Koenig2008-12-052-20/+1Star
| | | | | | | [kzak@redhat.com: add ifndef _SWAPHEADER_H] Signed-off-by: Matthias Koenig <mkoenig@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.minix: fix size detectionMatthias Koenig2008-11-131-2/+7
| | | | | | | | 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>
* raw: add NLS supportPedro Ribeiro2008-10-031-35/+40
| | | | | | | | [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>
* mkfs.cramfs: several strings without gettext callsPedro Ribeiro2008-10-031-2/+2
| | | | | Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: add NLS supportPedro Ribeiro2008-10-031-56/+60
| | | | | | | [kzak@redhat.com: - add setlocale(), ...] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* elvtune: add NLS supportPedro Ribeiro2008-10-031-5/+9
| | | | | | | [kzak@redhat.com: - add missing setlocale(), ...] Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.cramfs: fix compiler warningKarel Zak2008-09-291-1/+1
| | | | | | | 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>
* use getpagesize()maximilian attems2008-07-303-7/+3Star
| | | | | | | | | | | | 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>
* disk-utils: include fcntl.h directly (mkfs.cramfs, raw)maximilian attems2008-07-282-2/+2
| | | | | | helps klibc support, glibc compile tested. Signed-off-by: maximilian attems <max@stro.at>
* disk-utils: s/MOUNTED/_PATH_MOUNTED/maximilian attems2008-07-283-4/+7
| | | | | | | | | 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>
* disk-utils: clean up code, use blkdev_* functionsSamuel Thibault2008-07-244-56/+24Star
| | | | | | | [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>
* mkswap: non-linux supportSamuel Thibault2008-07-242-2/+10
| | | | | | | | | | 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>
* selinux: is_selinux_enabled() returns 0, 1 and -1Karel Zak2008-07-011-1/+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>
* mkswap: set errno=0 in write_all()Karel Zak2008-04-161-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: when writing the signature page, handle EINTR returnsKarel Zak2008-04-151-3/+22
| | | | | | | | | 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>
* build-sys: update .gitignore filesKarel Zak2008-04-141-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: ignore a bunch of generated files, mostly binariesJames Youngman2008-04-141-0/+10
| | | | | Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fsck.minix: reset the terminal state if we are killed by a fatal signalJames Youngman2008-04-081-2/+33
| | | | | | [kzak@redhat.com: remove unnecessary volatile type qualifier] Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* mkfs.cramfs: switch on localization.Benno Schulenberg2008-04-081-0/+4
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* fsck.minix: correct the error message given when we can't open the deviceJames Youngman2008-04-081-3/+13
| | | | | | | | | | 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>
* mkfs.minix: clean up gcc warningsKarel Zak2008-03-201-31/+0Star
| | | | | | mkfs.minix.c:199: warning: ‘count_blocks’ defined but not used Signed-off-by: Karel Zak <kzak@redhat.com>
* mkswap: fix compiler warningsKarel Zak2008-03-201-1/+1
| | | | | | | | 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>