Commit Graph

40 Commits

Author SHA1 Message Date
Ruediger Meier 38141baff6 fsck.cramfs: rename variable page_size to blksize
... similar to mkfs.cramfs.c

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:44 +02:00
Ruediger Meier b7a7520692 fsck.cramfs: ifdef unused outbuffer and page_size
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:22:39 +02:00
Ruediger Meier f991dbd31f fsck.cramfs: allow smaller superblock sizes
We are already fine with checking for different endianess. Now we
also succeed if systems's page size does not match.

Note that page_size is only really used if INCLUDE_FS_TESTS is
defined, see followups.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 09:19:29 +02:00
Karel Zak 5d4ece6ea1 fsck.cramfs: add LC_CTYPE
Maybe it would be possible to use LC_ALL, but it requires to review
the code to check if there is no any sensitive code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-18 11:38:02 +02:00
Benno Schulenberg 47481cbd01 textual: standardize some "cannot read" and "seek failed" error messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-09 11:37:38 +02:00
Sami Kerola 83f210e8f9 fsck.cramfs: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:06 +02:00
Karel Zak b3f30f50ab fsck.cramfs: check returns [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27 14:12:23 +01:00
Karel Zak 52848780e3 fsck.cramfs: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-15 15:33:23 +01:00
Karel Zak 6bf463c54c fsck.cramfs: add dummy -a -y for compatibility
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-18 12:18:29 +01:00
Karel Zak aa71999827 fsck.cramfs: fix compiler warning [-Wpointer-arith]
disk-utils/fsck.cramfs.c: In function ‘test_crc’:
disk-utils/fsck.cramfs.c:231:32: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]
disk-utils/fsck.cramfs.c:233:24: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 16:49:28 +02:00
Karel Zak d63eb75eee fsck.cramfs: fix compiler warning [-Wmissing-prototypes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-16 18:55:01 +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
Sami Kerola de173766e0 fsck.cramfs: disallow unknown command line options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-17 17:59:59 +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
Sami Kerola 922ec175e5 fsck.cramfs: add long options
And align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +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
Sami Kerola 6f312c8957 xalloc: use xasprintf in all files
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18 14:28: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
Karel Zak e4a36b8bf4 fsck.cramfs: mark usage() as noreturn
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-31 21:20:55 +01:00
Sami Kerola 5d6fb944bf include: move fsck return values to exitcodes.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-22 00:34:12 +02:00
Sami Kerola 6de1396e6a fsck.cramfs: add missed strings to translation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 23:56:48 +02:00
Sami Kerola 6ffd9b03f2 fsck.cramfs: coding style
Lots of braces got to be removed, which can cause something to
break even everything is double checked.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 23:56:25 +02:00
Sami Kerola fc8dc41054 fsck.cramfs: use xalloc.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 23:50:13 +02:00
Sami Kerola 11b7698c27 fsck.cramfs: retire die function
Replaced with err{,x} from libc.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-21 23:50:13 +02:00
Sami Kerola d51f37a368 cramfs: use stdint.h instead of u{8,16,32}
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 22:49:48 +02:00
Davidlohr Bueso 06f2558508 cramfs: remove cramfs_common.h
We currently have cramfs.h and cramfs_common.h, this makes no sense, so remove
unite them and keep just cramfs.h

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-05-17 16:30:08 +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 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
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
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
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
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
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
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
Karel Zak 19922f22a1 Imported from util-linux-2.13-pre5 tarball. 2006-12-07 00:27:10 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak b22550fa15 Imported from util-linux-2.12k tarball. 2006-12-07 00:26:26 +01:00
Karel Zak 63cccae468 Imported from util-linux-2.11t tarball. 2006-12-07 00:25:58 +01:00