Commit Graph

6331 Commits

Author SHA1 Message Date
Karel Zak 78c70e23b5 tests: update lscpu tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 15:26:10 +02:00
Karel Zak 983a43e08b libblkid: fix ZFS superblok offset for SBMAGIC
# wipefs /dev/sdd1

 offset               type
 ----------------------------------------------------------------
 0x65000              zfs_member   [raid]
                      LABEL: zm1
                      UUID:  18067835215330778964

 and "wipefs -o 0x65000 /dev/sdd1" seems to run in an endless loop.

Reported-by: Helmut Hullen <Hullen@t-online.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 15:13:02 +02:00
Bernhard Voelker 741fce3471 bash-completion: add swapoff
[kzak@redhat.com: remove short options]

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 14:35:49 +02:00
Karel Zak 1461094c14 lscpu: add Model name
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 14:29:53 +02:00
Karel Zak 49932ad8db su: remove '+' from getopt_long()
# /bin/su - -c 'echo test'
 su: user -c does not exist

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=950495
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10 14:24:54 +02:00
Jeff Mahoney 293714c0d1 loopdev: sync capacity after setting it
I recently tried to mount an hfsplus file system from an image file with
a partition table by using the loop offset and sizelimit options to specify
the location of the file system.

hfsplus stores some metadata at a set offset from the end of the partition,
so it's sensitive to the device size reported by the kernel.

It worked with this:

But failed with this:

/dev/loop0: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000
/dev/loop1: [0089]:2 (<imagefile>), offset 32768, sizelimit 102400000

/proc/partitions shows the correct number of blocks to match the sizelimit.

But if I set a breakpoint in mount before the mount syscall, I could see:
102400000
102432768

The kernel loop driver will set the gendisk capacity of the device at
LOOP_SET_STATUS64 but won't sync it to the block device until one of two
conditions are met: All open file descriptors referring to the device are
closed (and it will sync when re-opened) or if the LOOP_SET_CAPACITY ioctl
is called to sync it. Since mount opens the device and passes it directly
to the mount syscall after LOOP_SET_STATUS64 without closing and reopening
it, the sizelimit argument is effectively ignroed. The capacity needs to
be synced immediately for it to work as expected.

This patch adds the LOOP_SET_CAPACITY call to loopctx_setup_device since
the device isn't yet released to the user, so it's safe to sync the capacity
immediately.

[kzak@redhat.com: - port to the current git HEAD,
                  - use uint64_t]

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 14:32:50 +02:00
Karel Zak 310f672874 libblkid: export blkid_init_debug()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 13:12:55 +02:00
Karel Zak 35cf827870 libblkid: support LIBBLKID_DEBUG= only
... the BLKID_DEBUG= is not more supported.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 12:52:09 +02:00
Karel Zak 76041e708d libblkid: fix DBG()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 12:44:02 +02:00
Sami Kerola 9c4040b0ae docs: add fsck.cramfs manual page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:50 +02:00
Sami Kerola 0ad2bacd88 docs: add mkfs.cramfs manual page
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:49 +02:00
Sami Kerola eb7069693e tools: make checkmans.sh to find missing manuals
Finding missing manuals is loosely based on ideas in man-page-day-1.sh,
wrote by Peter Schiffer.

CC: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:48 +02:00
Sami Kerola f014c1c259 docs: remove repeated words [checkmans.sh]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:48 +02:00
Sami Kerola 9dd5ea6229 docs: col.1: fix manual page name section [checkmans.sh]
$ lexgrog text-utils/col.1
text-utils/col.1: parse failed

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:47 +02:00
Sami Kerola 49c6c4f1e9 docs: mount.8: make propagation flags adjustable [checkmans.sh]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:46 +02:00
Sami Kerola 12cc556bca tools: add checks to manual page test script
This change includes

- better way to detect manual page inclusion
- man -k header test, which uses lexgrog
- repeated word detection
- static declaration to known repeated words

Most of the  changes are based on man-page-day-1.sh, that is in use at
RedHat Quality Assurance, and wrote by Peter Schiffer.

CC: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:44 +02:00
Sami Kerola 604ba9734f libblkid: number of functions should not be declared extern [smatch scan]
These functions are already marked extern in header file.

libblkid/src/dev.c:70:19: warning: function 'blkid_dev_devname' with external linkage has definition
libblkid/src/dev.c:128:26: warning: function 'blkid_dev_iterate_begin' with external linkage has definition
libblkid/src/dev.c:148:12: warning: function 'blkid_dev_set_search' with external linkage has definition
libblkid/src/dev.c:175:12: warning: function 'blkid_dev_next' with external linkage has definition
libblkid/src/dev.c:196:13: warning: function 'blkid_dev_iterate_end' with external linkage has definition
libblkid/src/tag.c:84:12: warning: function 'blkid_dev_has_tag' with external linkage has definition
libblkid/src/tag.c:282:26: warning: function 'blkid_tag_iterate_begin' with external linkage has definition
libblkid/src/tag.c:303:12: warning: function 'blkid_tag_next' with external linkage has definition
libblkid/src/tag.c:322:13: warning: function 'blkid_tag_iterate_end' with external linkage has definition
libblkid/src/tag.c:336:18: warning: function 'blkid_find_dev_with_tag' with external linkage has definition

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:43 +02:00
Sami Kerola 9e01635e32 libmount, col: remove redundant null checks [smatch scan]
libmount/src/context_umount.c:174 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free()
libmount/src/context_umount.c:179 mnt_context_find_umount_fs() info: redundant null check on loopdev calling free()
text-utils/col.c:406 flush_lines() info: redundant null check on l->l_line calling free()

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:26:42 +02:00
Sami Kerola c9f63764dc various: fix shadow declarations [smatch scan]
libmount/src/tab.c:990:34: warning: symbol 'fs' shadows an earlier one
libmount/src/tab.c:970:26: originally declared here
misc-utils/findmnt.c:492:30: warning: symbol 'tmp' shadows an earlier one
misc-utils/findmnt.c:473:14: originally declared here
fdisks/fdiskdoslabel.c:211:36: warning: symbol 'pe' shadows an earlier one
fdisks/fdiskdoslabel.c:180:20: originally declared here
fdisks/fdiskdoslabel.c:639:34: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:578:16: originally declared here
fdisks/fdiskdoslabel.c:947:21: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:976:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here
fdisks/fdiskdoslabel.c:984:29: warning: symbol 'i' shadows an earlier one
fdisks/fdiskdoslabel.c:924:16: originally declared here

[kzak@redhat.com: - don't use local 'tmp' in findmnt.c]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-09 12:19:25 +02:00
Sami Kerola 3acc206d39 various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:20 +02:00
Sami Kerola a6f5836264 bash-completion: swapon: add options and fix argument
The initial bash-completion missed swapon options -L and -U.  Use of
block device was proposed to be more appropriate than a path to a file.

Requested-by: Karel Zak <kzak@redhat.com>
References: http://marc.info/?l=util-linux-ng&m=136517310727426&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:15 +02:00
Sami Kerola 6ad488cca9 bash-completion: setarch: use correct list for architectures
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:10 +02:00
Sami Kerola 69d00b75df setarch: clean up usage()
Requested-by: Karel Zak <kzak@redhat.com>
References: http://marc.info/?l=util-linux-ng&m=136516351523680&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:05 +02:00
Karel Zak 0540ea544d libblkid: clean up DBG()
- use stderr only
 - use BLKID_ prefix for debug masks
 - don't use \n in in messages and don't use printf(),
   but use generic blkid_debug().

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08 18:22:13 +02:00
Ville Skyttä e6d2618786 bash-completion: Symlink runuser symlink to su so it gets loaded on demand.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>

[kzak@redhat.com: - use '-runuser' in the install hook
		  - use the hook only if runuser is enabled]
2013-04-08 17:10:33 +02:00
Ville Skyttä 0d5b9b8ab1 bash-completion: Don't offer short options where corresponding long one exists.
Users who know the short options can just hit the short option instead
of tab, and it's not likely that it would be helpful to present a list
of single character options to users who don't know them, doing so
just unnecessarily trashes the list of suggestions.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:56 +02:00
Ville Skyttä 58c41e15b3 Spelling fixes.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:55 +02:00
Ville Skyttä 0e85c43dd8 uuidd.8: Document --debug and --quiet long options.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:54 +02:00
Ville Skyttä d6b975ef44 bash-completion: Avoid some unnecessary subshells.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:53 +02:00
Ville Skyttä d4f9b8d74c bash-completion: Don't offer any more completions after help or version.
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2013-04-08 17:06:52 +02:00
Karel Zak 2885c533fd logger: make socket initialization in main() more readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08 16:39:59 +02:00
Sami Kerola 68265d070d logger: allow to log using tcp transport protocol
This commit fixes error in usage() text, which claimed TCP is default
transport protocol.  That was not true, and neither it should be.  The
syslog messages has traditionally sent using UDP.

For the logger remains using UDP as first transport, but if it fails a
TCP connection is attempted.  If an user wishes remote logging can be
forced to use either UDP or TCP.  The service port for UDP is familiar
'syslog', for TCP the port 'syslog-conn' seems like reasonable default.

[kzak@redhat.com: - rename myopenlog to unix_socket(),
                  - always reset st to -1]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08 16:31:28 +02:00
Karel Zak e442ab76b5 fsfreeze: add note about atime to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-08 13:32:16 +02:00
Karel Zak ece777e9de build-sys: add --disable-bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 15:54:31 +02:00
Karel Zak 20da58084a bash-completion: rename shell-completion -> bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 14:58:07 +02:00
Karel Zak aead7c7e69 Merge branch 'shell-completion' of git://github.com/kerolasa/lelux-utiliteetit
* 'shell-completion' of git://github.com/kerolasa/lelux-utiliteetit:
  bash-completion: add completion files to Makefile.am
  bash-completion: text-utils
  bash-completion: term-utils
  bash-completion: sys-utils
  bash-completion: schedutils
  bash-completion: misc-utils
  bash-completion: login-utils
  bash-completion: fdisks
  bash-completion: disk-utils
  bash-completion: add bash completetion configure option
2013-04-05 14:14:28 +02:00
Sami Kerola fe6999da0a logger: make local sockets to try both stream and datagram
When journald, from systemd, is in use logger gave following error.

$ logger --socket /dev/log test logger: connect /dev/log: Protocol wrong
type for socket

The journald supports only AF_DGRAM, and nothing else.  Support for
AF_STREAM sockets was dropped because it messed up message ordering.

From an users point of view necessity to add --udp (UNIX(TM) Datagram
Protocol?) option when talking to syslog via unix socket felt confusing
and wrong.  The command should know what is the socket type, and silently
use the correct one, unless the type is explicitely defined.

CC: Karel Zak <kzak@redhat.com>
Adviced-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 14:05:24 +02:00
Sami Kerola 5d1607e260 setarch: add option to list settable architectures
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 14:03:07 +02:00
Sami Kerola fdf8fb1cc0 chrt: make command syntax easier to understand in usage()
And mention in manual that the default is referring to the internal
default of this command, not the Linux system default.  Manual page
example also tries to be a little more complete how to use the command.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:17 +02:00
Sami Kerola cc8e993401 vipw: add usage() function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:14 +02:00
Sami Kerola 2dc87166a7 setterm: fix various color option argument lists
The lists did not have correct colors in usage().  Because the usage()
had to be fixed, it is best to make the output easy for translators to
work with.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:12 +02:00
Sami Kerola f059bdf608 partx: remove deprecated option from usage()
The fact that -l, --list is deprecated will remain in manual page till
unforeseeable future.  Meanwhile the usage() can be made shorter.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:09 +02:00
Sami Kerola ac56e5558e lscpu: fix error message
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:06 +02:00
Sami Kerola 114ade3d1b losetup: allow -j option argument to be relative path
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:03 +02:00
Sami Kerola 5543aaad23 fsfreeze: tell user when mandatory option is not specified
This commit also removes use of internal magic values by replacing them
with a enum definition.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:00 +02:00
Sami Kerola 963ac50734 dmesg: fix usage() output consistancy
Possible facilities and levels are meant to be printed to same file as
the rest of the usage output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:55:57 +02:00
Sami Kerola 86ad1432e8 agetty: the command does not have -h and -V options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:55:54 +02:00
Sami Kerola 5fb01f4331 newgrp: use xstrdup to check allocation succeeded
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:55:50 +02:00
Karel Zak 8d8ea18ea7 docs: remove repeated words
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 13:35:30 +02:00
Karel Zak 49ebda9b89 rtcwake: add --auto to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 13:19:13 +02:00