Commit Graph

36 Commits

Author SHA1 Message Date
Davidlohr Bueso 4f1384353e mkfs.minix: check for misalignment
Produce a warning if the device is misaligned.

[kzak@redhat.com: - use it for block devices only]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-27 16:13:02 +02:00
Karel Zak c2e05a498c lib: [blkdev.c] remove kernel version check from blkdev_get_sector_size()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-27 16:09:56 +02:00
Davidlohr Bueso 4bc4653e2a mkfs.minix: add fs version options
Like the original minix mkfs, add the -1 and -2 argument options to specify the
version of the filesystem to create.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-06-14 16:39:13 +02:00
Davidlohr Bueso 7a173d7f5c mkfs.minix: standardize superblock attribute settings
Because of the dependence of fs_version, some superblock attributes will vary,
so simplify the logic of assigning values to maxsize and the amount of zones
related to each filesystem, thus making setup_tables() more readable.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-06-14 16:39:04 +02:00
Davidlohr Bueso 37ebb48be0 mkfs.minix: use inode wrappers
Use a common function for creating the root and bad inode, without worring
about the fs version.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-06-08 13:38:50 +02:00
Davidlohr Bueso 50758d0e40 mkfs.minix: use common functionality
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-06-02 13:27:22 +02:00
Davidlohr Bueso 9fae6c27d3 mkfs.minix: remove die()
Get rid of this function and use errx(3) instead. This patch also
introduces a mkfs.h header and defines general purpose mkfs related
exit codes.

[kzak@redhat.com: - fix "warning: too many arguments for format" errors]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-04 14:56:41 +02:00
Davidlohr Bueso c80790440e mkfs.minix: general cleanups
This patch provides some minor code fixes: add/remove some macros and close the device after usage.
Also modifies usage() and changes main()'s indentation to 8-characters.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-02-14 14:41:35 +01:00
Benno Schulenberg e6b0611b46 messages: gettextize a few skipped or forgotten ones
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-14 11:19:19 +02:00
Karel Zak dfea25692c mkfs.minix: fix strict-aliasing bugs
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-17 00:19:23 +02:00
Karel Zak e98754d6bb fsck.minix: fix broken zone checking
This bug has been introduced by commit
95356e8b74.

The fsck.minix code assumes that isset() macro returns boolean,
unfortunately the generic implementation from libc returns integer.

This patch also add a fallback for the bitmap macros to include/bitops.h.

Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-15 14:14:32 +02:00
Guillem Jover cef0ccd580 Remove now unused <sys/ioctl.h> includes
Those became unused with the switch to the blkdev functions.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2009-10-09 15:17:54 +02: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 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 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
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
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
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
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
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 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 c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak 95f1bdeee4 Imported from util-linux-2.11x tarball. 2006-12-07 00:26:05 +01:00
Karel Zak ffc4374869 Imported from util-linux-2.11o tarball. 2006-12-07 00:25:53 +01:00
Karel Zak e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +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