Commit Graph

67 Commits

Author SHA1 Message Date
Benno Schulenberg c2fcffd5ad mkfs.minix: properly pluralize four messages
Reported-by: Petr Písař <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08 15:27:31 +02:00
Benno Schulenberg 97b820bffd textual: improve clarity of some error messages
Reported-by: Petr Písař <petr.pisar@atlas.cz>
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-07 12:29:44 +02:00
Sami Kerola 616fbb3af8 mkfs.minix: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Karel Zak b4ee2cacca mkfs.minix: fix compiler warning [-Wformat]
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-01-09 14:44:59 +01:00
Karel Zak 248b8101a0 mkfs.minix: fsck:minix: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 20:01:35 +01:00
Sami Kerola 65ca6f8382 minix: replace magic constants with macro names
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:56 +01:00
Sami Kerola a180dc6c54 minix: use off_t, size_t, etc appropriate types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:53 +01:00
Sami Kerola f150ac37bc mkfs.minix: check numeric user inputs
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-15 16:01:42 +02:00
Sami Kerola 289dcc9023 translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Sami Kerola add1b8afd0 translation: unify stat error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +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 45ca68ece7 disk-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 20:04:39 +02: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
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 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 d9d88e3162 mkfs.minix: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 14:51:58 +02:00
Karel Zak 9ae45d23de Merge branch 'cramfs' of https://github.com/kerolasa/lelux-utiliteetit
* 'cramfs' of https://github.com/kerolasa/lelux-utiliteetit:
  include: move fsck return values to exitcodes.h
  include: move disk-utils/mkfs.h -> include/exitcodes.h
  mkfs.cramfs: coding style
  mkfs.cramfs: include-what-you-use header check
  mkfs.cramfs: error printing fixes
  mkfs.cramfs: convert spaces to tabs
  mkfs.cramfs: validate numeric user inputs
  mkfs.cramfs: few symbolic exit codes where missing
  md5: use symbolical digest length
  mkfs.cramfs: use program_invocation_short_name
  mkfs.cramfs: use xalloc.h
  fsck.cramfs: add missed strings to translation
  fsck.cramfs: coding style
  fsck.cramfs: use xalloc.h
  fsck.cramfs: retire die function
  cramfs.h: coding style
  cramfs: use stdint.h instead of u{8,16,32}
  cramfs_common: coding style

Conflicts:
	disk-utils/Makefile.am

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-26 14:41:28 +02:00
Sami Kerola b8f040cdd4 include: move disk-utils/mkfs.h -> include/exitcodes.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-22 00:30:04 +02:00
Karel Zak 0dca7bd54a minix: remove unnecessary initializations
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:41:25 +02:00
Karel Zak c1d26b1981 minix: add MINIX_ prefix to some global macros
... and remove some tailing whitespaces.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:23:01 +02:00
Karel Zak 058cda4c1d minix: cleanup global variables and macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:13:33 +02:00
Sami Kerola 7cc112d927 minix: move globals and inline functions to minix_programs.h
Global variables and inline functions are moved from minix.h to
minix_programs.h which is included in mkfs.minix and fsck.minix.
The minix.h will have only struct definitions etc generic
contents which is reasonable to share with utilities and
libraries.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:43:16 +02:00
Sami Kerola 63883af765 libblkid: use MINIX_BLOCK_SIZE from minix.h
In the minix.h two definitions where renamed, so that the single
definition is reusable in fsck.minix, mkfs.minix and libblkid.

BLOCK_SIZE_BITS -> MINIX_BLOCK_SIZE_BITS
BLOCK_SIZE      -> MINIX_BLOCK_SIZE

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:13:08 +02:00
Davidlohr Bueso 3ca43386bd minix: remove fs state
For v3 minix superblocks the state flag (s_state) has been removed, so drop it
from the structure in accordance with the kernel's representation.

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-07-14 11:15:55 +02:00
Davidlohr Bueso a2657ae3ff mkfs.minix: add minix v3 support
We can now create minix v3 filesystems. Support for this fs was added a few
years ago in the Linux kernel. One of the most important benefits is the
ability to handle file names up to 60 characters long.  With this change we
also introduce the -3 option which naturally indicates which version to create.
Version 1 is still left as the default one for backwards compatibility reasons.

[kzak@redhat.com: - fix gcc warnings:

	mkfs.minix.c: In function ‘super_set_state_ptr’:
	mkfs.minix.c:174:1: warning: no return statement in function returning non-void [-Wreturn-type]
	mkfs.minix.c: In function ‘write_tables’:
	mkfs.minix.c:182:7: warning: unused variable ‘state’ [-Wunused-variable]
	mkfs.minix.c: At top level:
	mkfs.minix.c:111:27: warning: ‘blksz’ defined but not used [-Wunused-variable]
]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-11 10:40:26 +02:00
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