Commit Graph

4698 Commits

Author SHA1 Message Date
Bernhard Voelker 455fe9a075 Fix typos found by misspellings
The tool misspellings (https://github.com/lyda/misspell-check)
detected several typos. Command used:

  $ git ls-files | grep -v ^po/ | misspellings -f -

* isosize: Fix typo in usage string.
* configure.ac: Fix typo in help string of --enable-most-builds option.
* fdisk: Fix typo in man page.
* libblkid, blkid, mount: Likewise.
* Fix various typos in docs and in source code comments.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-04-23 13:16:35 +02:00
Davidlohr Bueso 8d95e4ee61 fdisk: simplify device opening
This patch makes fdisk open(2) the device in only one place (get_boot), instead
of having to depend on user input (ie: listing -l).

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 13:07:16 +02:00
Davidlohr Bueso f45121dd46 fdisk: remove action enum
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 13:00:00 +02:00
Davidlohr Bueso 3813eb5ead fdisk: do not call sgi and sun code when creating a new dos label
When creating a new DOS label, SGI and SUN pt logic have no business being
there. Remove sun/sgi_nolabel(), since the default amount of partitions are
previously set to 4 and the sun/sgi magic nums are not used in this context.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:55:52 +02:00
Bernhard Voelker 13716cf306 sfdisk: improve F_MEGABYTE header
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-04-23 12:45:25 +02:00
Davidlohr Bueso 68c5a7ea7f fdisk: remove dead code
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:40:20 +02:00
Davidlohr Bueso c867a8e3b3 fdisk: kernel/bios sectors and heads need not be global
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:38:22 +02:00
Davidlohr Bueso a2482eb3d9 fdisk: standarize version output
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:15:15 +02:00
Davidlohr Bueso 9912f01b68 fdisk: make CHS user values more robust
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:12:32 +02:00
Davidlohr Bueso 3f1789ce5d prlimit: remove bogus instructions
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 12:05:25 +02:00
Sami Kerola 9146de0266 eject: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-23 12:02:07 +02:00
Karel Zak 505abd8434 lib/pager: fix compiler warnings
pager.c: In function ‘start_command’:
pager.c:82:7: warning: unused variable ‘err’ [-Wunused-variable]
pager.c:49:25: warning: unused variable ‘fderr’ [-Wunused-variable]
pager.c:49:15: warning: unused variable ‘fdout’ [-Wunused-variable]
pager.c:48:25: warning: unused variable ‘need_err’ [-Wunused-variable]
pager.c:48:15: warning: unused variable ‘need_out’ [-Wunused-variable]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-23 11:57:50 +02:00
Davidlohr Bueso 35717a57ac lib: add pager functionality
When some program' output exceeds the terminal's dimensions, it is a nice
feature to call a pager that acts as calling 'less' to allow better user
navigation. This patch adds this functionality, based on what perf and git
have (ie: git log).

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-23 11:52:39 +02:00
Karel Zak 89394013f6 namei: fix relative symlinks evaluation
Fedora 17 (/bin is symlink to /usr/bin):

	[root@intel ~]# /bin/namei /bin/namei
	f: /bin/namei
	 d /
	 l bin -> usr/bin
	usr - No such file or directory

Reported-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-20 15:06:57 +02:00
Karel Zak 3e90c89f95 docs: move fstab.5 to sys-utils (mount/ dir is deprecated)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:48:40 +02:00
Karel Zak 9f9d0f21c4 swapon: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:40:22 +02:00
Karel Zak eb0eb262cb mount: (new) add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:40:06 +02:00
Karel Zak aa0903e06b lsblk: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:39:44 +02:00
Karel Zak 090b5e84b2 findmnt: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:38:53 +02:00
Karel Zak 10b4d34dc0 blkid: add docs about PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:34:29 +02:00
Karel Zak cff632afc9 libmount: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:33:59 +02:00
Karel Zak fc387ee14c libblkid: add support for PARTUUID= and PARTLABEL=
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-19 14:33:49 +02:00
Karel Zak 21d1fa53f1 tests: tiny change in output header
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 13:14:43 +02:00
Karel Zak f947ae75b6 tests: remove LD_LIBRARY_PATH from swapon tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 13:05:55 +02:00
Karel Zak d335c9bd54 swapon: minor coding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:58:15 +02:00
Karel Zak 8b0d534155 swapon: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:52:13 +02:00
Karel Zak d9f07b100d swapon: cleanup main()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:44:14 +02:00
Karel Zak 7cf6a65476 swapoff: cleanup usage() and includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:38:03 +02:00
Karel Zak d5360e9250 mount: fix man page typo s/reatime/relatime/
Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:25:28 +02:00
Karel Zak e7b63bea04 swapoff: use libmount to parse fstab
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 12:22:11 +02:00
Karel Zak 6cf8d46cee swapoff: move code from swapon.c to swapoff.c
* multipurpose binaries (symlinks) suck when used with autotools
 * swapoff shares small subset of the code with swapon
 * usage() and 'struct option' is unnecessary complex when shared
 * shorter and simple code is easer to maintain...

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 11:43:42 +02:00
Karel Zak 0b0c231f64 swapon: move generic code to swapon-common.c
This will allow to use separate binary for swapon and swapoff.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 11:21:12 +02:00
Karel Zak 5072b90a65 swapon: use libmount for fstab parsing (for swapon --all)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 10:14:44 +02:00
Karel Zak d789077846 mount: (new) be more pedantic about --make-*
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 10:09:49 +02:00
Karel Zak 5d451abbbf libmount: add mnt_context_get_options()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 10:06:35 +02:00
Karel Zak e5157fc9f0 swapon: use only libmount for paths/tags evealuation
libmount provides very simple API for paths and tags canonicalizations,
let's use it, rather directly link to libblkid and lib/canonicalize.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-17 13:05:04 +02:00
Karel Zak 64b588814e swapon: use libmount for /proc/swaps parsing
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-17 12:49:11 +02:00
Karel Zak 58f108ef2b mount: (new) improve error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-17 11:39:49 +02:00
Karel Zak e01c731992 libmount: add mnt_context_fstab_applied()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-17 11:36:32 +02:00
Lennart Poettering 8fb6a2de79 wdctl: add watchdog status tool
For: util-linux

This patch adds a tiny tool "wdctl" which may be used to query the
status of Linux watchdog devices (/dev/watchdog).

This will simply query all fields that may be queried from the
device and print them nicely formatted.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
2012-04-16 14:24:49 +02:00
James Le Cuirot 69cabd7204 cal: Fix building under uClibc.
Commit fbc333fec0 broke building under uClibc because HAVE_DECL macros are set to 0, not undefined.

Signed-off-by: James Le Cuirot <chewi@aura-online.co.uk>
2012-04-16 11:13:13 +01:00
Karel Zak cd3d55ef20 fdisk: remove unused file
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-11 12:55:51 +02:00
Karel Zak 1b1af0c1d0 login-utils: add missing header, fix setpwnam.c fclose logic
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-11 12:52:36 +02:00
Karel Zak 6259c257d8 Merge branch 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit
* 'close_stream' of git://github.com/kerolasa/lelux-utiliteetit:
  disk-utils: verify writing to streams was successful
  fdisk: verify writing to streams was successful
  getopt: verify writing to streams was successful
  hwclock: verify writing to streams was successful
  login-utils: verify writing to streams was successful
  misc-utils: verify writing to streams was successful
  mount: verify writing to streams was successful
  partx: verify writing to streams was successful
  schedutils: verify writing to streams was successful
  sys-utils: verify writing to streams was successful
  term-utils: verify writing to streams was successful
  text-utils: verify writing to streams was successful
  include: add stream error checking facility

Conflicts:
	fdisk/fdisk.c
2012-04-11 12:37:59 +02:00
Davidlohr Bueso b2244df618 libuuid: use randutils
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-10 13:15:35 +02:00
Davidlohr Bueso 2a2319bbac fdisk: use randutils for mbr signature creation
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-04-10 13:15:32 +02:00
Davidlohr Bueso fe72459e41 lib: random utilities
Add a random number(s) generator specific file. The intial functions are based
on what libuuid provide. I did some modifications like avoid WIN32 checks - this
is util-LINUX.

[kzak@redhat.com: - move jrand_seed to lib/randutils.c
                  - use TLS for jrand_seed (like original code from libuuid)
                  - use size_t for buffer sizes
                  - add close() to random_get_bytes]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-10 13:12:43 +02:00
Karel Zak c344350948 lib/blkdev: fix compiler warning [-Wreturn-type]
../lib/blkdev.c: In function ‘blkdev_get_geometry’:
../lib/blkdev.c:287:1: warning: control reaches end of non-void function [-Wreturn-type]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-10 12:29:10 +02:00
Petr Uzel 9c45d49fe0 sfdisk: fix calculation due to type mismatch (ix86)
Instructing sfdisk to create one partition spanning
across entire disk (",,") on 32bit system, if the disk
is sufficiently large (~2TB) leads to wrong calculation
in compute_start_sect() due to type mismatch.

Can be reproduced as:

--------------------------
linux-3ln5:~ # modprobe scsi_debug virtual_gb=2000
linux-3ln5:~ # sfdisk /dev/sda <<< ',,'
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 261083 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
sfdisk:  /dev/sda: unrecognized partition table type

Old situation:
sfdisk: No partitions found

no room for partition descriptor
sfdisk: bad input
--------------------------

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=754789
Reported-by: Dan Mares <dan.mares@norcrossgroup.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-10 12:21:49 +02:00
Sami Kerola 0b66315a8e docs: eject.1: align with Documentation/howto-man-page.txt
* Add spaces after dots (English spacing).
* Add line break macros.
* Use URL and email macros where appropriate.
* Fix typo at the end of the manual (s/lsblk/eject/).

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-10 12:21:41 +02:00