]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
13 years agofdisk: dos: mark unused parameters
Karel Zak [Thu, 26 Jul 2012 16:03:10 +0000 (18:03 +0200)] 
fdisk: dos: mark unused parameters

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: mac: remove magic maclabel macro, mark unused parameters
Karel Zak [Thu, 26 Jul 2012 15:56:39 +0000 (17:56 +0200)] 
fdisk: mac: remove magic maclabel macro, mark unused parameters

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: bsd: mark unused parameters
Karel Zak [Thu, 26 Jul 2012 15:52:30 +0000 (17:52 +0200)] 
fdisk: bsd: mark unused parameters

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: aix: remove magic aixlabel macro, mark unused parameters
Karel Zak [Thu, 26 Jul 2012 15:47:08 +0000 (17:47 +0200)] 
fdisk: aix: remove magic aixlabel macro, mark unused parameters

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: fix menu
Davidlohr Bueso [Thu, 26 Jul 2012 14:16:57 +0000 (16:16 +0200)] 
fdisk: fix menu

Commit 79c8a145ddff98d9c5bc70e67c5a861f67c50484 changed the numerical values of
fdisk_labeltype and broke the menu functionality, mixing main and expert menus.
Revert this change along with the label comment regarding it matching labeltype.

This is no longer valid since the original patch that lead to this modification
assumed that __probe_labels() would use these indices when creating a default
DOS/SUN disklabel, see http://www.spinics.net/lists/util-linux-ng/msg06509.html

Reported-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agoprlimit: improve error messages for bad --pid invocation
Bernhard Voelker [Thu, 26 Jul 2012 14:10:23 +0000 (16:10 +0200)] 
prlimit: improve error messages for bad --pid invocation

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agotests: update fdisk test (default output format changed)
Petr Uzel [Thu, 26 Jul 2012 14:04:28 +0000 (16:04 +0200)] 
tests: update fdisk test (default output format changed)

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agofdisk: don't print CHS geometry unless DOS compatible mode is set
Petr Uzel [Thu, 26 Jul 2012 14:04:27 +0000 (16:04 +0200)] 
fdisk: don't print CHS geometry unless DOS compatible mode is set

References: http://marc.info/?l=util-linux-ng&m=134329693623430&w=2
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agofdisk: always print total number of sectors
Petr Uzel [Thu, 26 Jul 2012 14:04:26 +0000 (16:04 +0200)] 
fdisk: always print total number of sectors

Print it no regardless on units_per_sector.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agofdisk: fix typo
Petr Uzel [Thu, 26 Jul 2012 14:04:25 +0000 (16:04 +0200)] 
fdisk: fix typo

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agofdisk: make grain global variable part of fdisk_context()
Petr Uzel [Thu, 26 Jul 2012 14:04:24 +0000 (16:04 +0200)] 
fdisk: make grain global variable part of fdisk_context()

There is no reason for this to be global variable - it belongs
to the context.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: support -o +<attr> for adding attribute to output fields
Milan Broz [Thu, 26 Jul 2012 14:41:30 +0000 (16:41 +0200)] 
partx: support -o +<attr> for adding attribute to output fields

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: support -o +<attr> for adding attribute to output fields.
Milan Broz [Thu, 26 Jul 2012 13:52:05 +0000 (15:52 +0200)] 
lsblk: support -o +<attr> for adding attribute to output fields.

Signed-off-by: Milan Broz <mbroz@redhat.com>
13 years agolib/strutils: add string_add_to_idarray() - parse and add to id list
Milan Broz [Thu, 26 Jul 2012 13:52:04 +0000 (15:52 +0200)] 
lib/strutils: add string_add_to_idarray() - parse and add to id list

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: improve err handling code
Karel Zak [Thu, 26 Jul 2012 12:02:15 +0000 (14:02 +0200)] 
dmesg: improve err handling code

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodocs: tell about irc channel
Sami Kerola [Wed, 25 Jul 2012 19:15:45 +0000 (21:15 +0200)] 
docs: tell about irc channel

Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/3550
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodmesg: inform user when klogctl() or read_buffer() fails
Sami Kerola [Wed, 25 Jul 2012 19:15:44 +0000 (21:15 +0200)] 
dmesg: inform user when klogctl() or read_buffer() fails

Fix to small regression which made 'dmesg --clear' not to error
when running without root privileges.  Same happen with '-D' and
few other options as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agowdctl: fix conflicting types on old systems
Sami Kerola [Wed, 25 Jul 2012 19:15:43 +0000 (21:15 +0200)] 
wdctl: fix conflicting types on old systems

The program wants the userland version of declaration(s), not the
kernel one.  Problem occured with glibc-devel-2.5-34.

/usr/include/stdint.h:41: error: conflicting types for 'int64_t'
/usr/include/linux/types.h:98: error: previous declaration of 'int64_t' was here
/usr/include/stdint.h:56: error: conflicting types for 'uint64_t'
/usr/include/linux/types.h:96: error: previous declaration of 'uint64_t' was here
In file included from /usr/include/stdlib.h:438,
                 from ./include/c.h:13,
                 from sys-utils/wdctl.c:30:

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agodocs: clean up sulogin.8 manual
Sami Kerola [Wed, 25 Jul 2012 19:15:42 +0000 (21:15 +0200)] 
docs: clean up sulogin.8 manual

Align with Documentation/howto-man-page.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoddate: russian manual missing from package
Sami Kerola [Wed, 25 Jul 2012 19:15:41 +0000 (21:15 +0200)] 
ddate: russian manual missing from package

This manpage causes more trouble than its worth.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomore: add noreturn function attribute
Sami Kerola [Wed, 25 Jul 2012 19:15:40 +0000 (21:15 +0200)] 
more: add noreturn function attribute

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoscript: add noreturn function attributes
Sami Kerola [Wed, 25 Jul 2012 19:15:39 +0000 (21:15 +0200)] 
script: add noreturn function attributes

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agovipw: add noreturn function attribute
Sami Kerola [Wed, 25 Jul 2012 19:15:38 +0000 (21:15 +0200)] 
vipw: add noreturn function attribute

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibmount: add noreturn function attribute
Sami Kerola [Wed, 25 Jul 2012 19:15:37 +0000 (21:15 +0200)] 
libmount: add noreturn function attribute

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibblkid: add noreturn function attribute
Sami Kerola [Wed, 25 Jul 2012 19:15:36 +0000 (21:15 +0200)] 
libblkid: add noreturn function attribute

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agofdisk: add noreturn function attribute
Sami Kerola [Wed, 25 Jul 2012 19:15:35 +0000 (21:15 +0200)] 
fdisk: add noreturn function attribute

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoinclude: define format to be constant in xasprintf()
Sami Kerola [Wed, 25 Jul 2012 19:15:34 +0000 (21:15 +0200)] 
include: define format to be constant in xasprintf()

Add also format function attribute to add robustness.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agohexdump: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:33 +0000 (21:15 +0200)] 
hexdump: fix shadow declaration

text-utils/hexdump.h:84:5: warning: shadowed declaration is here [-Wshadow]
./include/xalloc.h:23:28: warning: declaration of 'size' shadows a global declaration [-Wshadow]
./include/xalloc.h:33:40: warning: declaration of 'size' shadows a global declaration [-Wshadow]
./include/xalloc.h:43:49: warning: declaration of 'size' shadows a global declaration [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoul: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:32 +0000 (21:15 +0200)] 
ul: fix shadow declaration

text-utils/ul.c:641:25: warning: declaration of 'col' shadows a global declaration [-Wshadow]
text-utils/ul.c:126:5: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomore: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:31 +0000 (21:15 +0200)] 
more: fix shadow declaration

text-utils/more.c:1123:13: warning: declaration of 'state' shadows a previous local [-Wshadow]
text-utils/more.c:1095:18: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosetterm: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:30 +0000 (21:15 +0200)] 
setterm: fix shadow declaration

term-utils/setterm.c:221:55: warning: declaration of 'opt_term' shadows a global declaration [-Wshadow]
term-utils/setterm.c:181:5: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:29 +0000 (21:15 +0200)] 
lscpu: fix shadow declaration

sys-utils/lscpu.c:1084:8: warning: declaration of 'buf' shadows a previous local [-Wshadow]
sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow]
sys-utils/lscpu.c:1144:9: warning: declaration of 'buf' shadows a previous local [-Wshadow]
sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow]
sys-utils/lscpu.c:1196:8: warning: declaration of 'buf' shadows a previous local [-Wshadow]
sys-utils/lscpu.c:1077:7: warning: shadowed declaration is here [-Wshadow]
sys-utils/lscpu.c:1197:7: warning: declaration of 'i' shadows a previous local [-Wshadow]
sys-utils/lscpu.c:1078:6: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agoeject: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:28 +0000 (21:15 +0200)] 
eject: fix shadow declaration

sys-utils/eject.c:529:11: warning: declaration of 'str' shadows a previous local [-Wshadow]
sys-utils/eject.c:506:9: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agowhereis: fix shadow declaration
Karel Zak [Wed, 25 Jul 2012 19:15:27 +0000 (21:15 +0200)] 
whereis: fix shadow declaration

misc-utils/whereis.c:191:7: warning: declaration of 'dirp' shadows a global declaration [-Wshadow]
misc-utils/whereis.c:134:42: warning: shadowed declaration is here [-Wshadow]

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolslocks: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:26 +0000 (21:15 +0200)] 
lslocks: fix shadow declaration

misc-utils/lslocks.c:157:49: warning: declaration of 'pid' shadows a global declaration [-Wshadow]
misc-utils/lslocks.c:80:14: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: add not about unstable default output
Karel Zak [Thu, 26 Jul 2012 09:44:59 +0000 (11:44 +0200)] 
lsblk: add not about unstable default output

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoblkid: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:25 +0000 (21:15 +0200)] 
blkid: fix shadow declaration

misc-utils/blkid.c:402:15: warning: declaration of 'usage' shadows a global declaration [-Wshadow]
misc-utils/blkid.c:63:13: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agosulogin: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:24 +0000 (21:15 +0200)] 
sulogin: fix shadow declaration

login-utils/sulogin.c:337:8: warning: declaration of 'sushell' shadows a global declaration [-Wshadow]
login-utils/sulogin.c:332:13: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolibmount: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:23 +0000 (21:15 +0200)] 
libmount: fix shadow declaration

libmount/src/tab_update.c:203:8: warning: declaration of 'rc' shadows a previous local [-Wshadow]
libmount/src/tab_update.c:159:6: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agomkswap: fix shadow declaration
Sami Kerola [Wed, 25 Jul 2012 19:15:22 +0000 (21:15 +0200)] 
mkswap: fix shadow declaration

disk-utils/mkswap.c:366:57: warning: declaration of 'is_blkdev' shadows a global declaration [-Wshadow]
./include/blkdev.h:92:5: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotests: look: add words file
Sami Kerola [Wed, 25 Jul 2012 19:15:20 +0000 (21:15 +0200)] 
tests: look: add words file

Archlinux words 2.0-4 package does not have 'apple-pie' in words file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agotests: partx changed default output format
Sami Kerola [Wed, 25 Jul 2012 19:15:19 +0000 (21:15 +0200)] 
tests: partx changed default output format

Reference: commit 7cfd1b26437acd45f1e2e75c9648afabb8f5b2da
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agolsblk: add read-ahead column.
Milan Broz [Tue, 24 Jul 2012 14:34:33 +0000 (16:34 +0200)] 
lsblk: add read-ahead column.

Signed-off-by: Milan Broz <mbroz@redhat.com>
13 years agofdisk: API: comment labels array
Davidlohr Bueso [Tue, 24 Jul 2012 12:40:30 +0000 (14:40 +0200)] 
fdisk: API: comment labels array

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: API: fix fdisk_add_partition comment style
Davidlohr Bueso [Tue, 24 Jul 2012 12:40:03 +0000 (14:40 +0200)] 
fdisk: API: fix fdisk_add_partition comment style

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agobuild-sys: add -Wall to warnings
Karel Zak [Thu, 26 Jul 2012 08:13:08 +0000 (10:13 +0200)] 
build-sys: add -Wall to warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoutmpdump: fix compiler warning [-Wunused-result]
Karel Zak [Thu, 26 Jul 2012 07:46:49 +0000 (09:46 +0200)] 
utmpdump: fix compiler warning [-Wunused-result]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibmount: fix compiler warning [-Wsign-compare]
Karel Zak [Thu, 26 Jul 2012 07:44:37 +0000 (09:44 +0200)] 
libmount: fix compiler warning [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolibblkid: fix compiler warning [-Wsign-compare]
Karel Zak [Thu, 26 Jul 2012 07:41:57 +0000 (09:41 +0200)] 
libblkid: fix compiler warning [-Wsign-compare]

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoinclude/optutils: remove unnecessary exclusive_option()
Karel Zak [Thu, 26 Jul 2012 07:27:42 +0000 (09:27 +0200)] 
include/optutils: remove unnecessary exclusive_option()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowdctl: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:26:51 +0000 (09:26 +0200)] 
wdctl: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoprlimit: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:26:34 +0000 (09:26 +0200)] 
prlimit: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agomount: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:26:21 +0000 (09:26 +0200)] 
mount: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolscpu: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:26:10 +0000 (09:26 +0200)] 
lscpu: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolosetup: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:25:59 +0000 (09:25 +0200)] 
losetup: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agohwclock: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:25:48 +0000 (09:25 +0200)] 
hwclock: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:25:35 +0000 (09:25 +0200)] 
dmesg: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agochcpu: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:25:19 +0000 (09:25 +0200)] 
chcpu: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agowipefs: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:24:50 +0000 (09:24 +0200)] 
wipefs: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:24:36 +0000 (09:24 +0200)] 
lsblk: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofindmnt: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:24:21 +0000 (09:24 +0200)] 
findmnt: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoblkid: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:23:58 +0000 (09:23 +0200)] 
blkid: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agopartx: use err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:23:40 +0000 (09:23 +0200)] 
partx: use err_exclusive_options()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoinclude/optutils: add err_exclusive_options()
Karel Zak [Thu, 26 Jul 2012 07:04:55 +0000 (09:04 +0200)] 
include/optutils: add err_exclusive_options()

This is improved implementation of exclusive_option(). The new
implementation:

  - uses regular struct option to compose error messages
  - relationships between options are described in one const static array
  - the current status is stored in one int array

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agolsblk: fix dm_name usage
Karel Zak [Wed, 25 Jul 2012 16:04:10 +0000 (18:04 +0200)] 
lsblk: fix dm_name usage

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agoagetty: remove unnecessary sleep(10)
Mantas Mikulėnas [Wed, 25 Jul 2012 14:07:16 +0000 (17:07 +0300)] 
agetty: remove unnecessary sleep(10)

I'm quite sure this is not supposed to be here (apparently added as part
of commit 783b08fc1c6e5c906e).

Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
13 years agoRevert "fdisk: de-duplicate disk label strings"
Karel Zak [Tue, 24 Jul 2012 12:15:08 +0000 (14:15 +0200)] 
Revert "fdisk: de-duplicate disk label strings"

 ... because it's not expected that fdisk_label will be exported by
API and accessible for applications (like fdisk.c). It's private
libfdisk stuff.

This reverts commit e7818642600d6cd573a8e1ed5363fce52def5821.

13 years agofdisk: de-duplicate disk label strings
Bernhard Voelker [Tue, 24 Jul 2012 11:18:16 +0000 (13:18 +0200)] 
fdisk: de-duplicate disk label strings

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
13 years agofdisk: return success from sgi_create_disklabel
Petr Uzel [Tue, 24 Jul 2012 11:52:32 +0000 (13:52 +0200)] 
fdisk: return success from sgi_create_disklabel

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agofdisk: fix compiler warning [-Werror=unused-variable]
Petr Uzel [Tue, 24 Jul 2012 11:52:31 +0000 (13:52 +0200)] 
fdisk: fix compiler warning [-Werror=unused-variable]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
13 years agodmesg: add fileback for SEEK_DATA
Karel Zak [Tue, 24 Jul 2012 12:06:25 +0000 (14:06 +0200)] 
dmesg: add fileback for SEEK_DATA

Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: don't ignore 1MiB granularity on 512-byte sector devices
Karel Zak [Mon, 23 Jul 2012 21:09:41 +0000 (23:09 +0200)] 
fdisk: don't ignore 1MiB granularity on 512-byte sector devices

Note that +10MB is 100000 (10^N) and relative values (+<size>
convention) should be be aligned to the default grain (= 1 MiB).

Old version:

  Last sector, +sectors or +size{K,M,G} (2048-2047999, default 2047999): +10MB
  Partition 1 of type Linux and of size 9.5 MiB is set
  ...
  /dev/loop0p1            2048       21578        9765+  83  Linux
  /dev/loop0p2           21579       43062       10742   83  Linux

New version:
  Last sector, +sectors or +size{K,M,G} (2048-2047999, default 2047999): +10MB
  Partition 1 of type Linux and of size 10 MiB is set
  ...
  /dev/loop0p1            2048       22527       10240   83  Linux
  /dev/loop0p2           22528       43007       10240   83  Linux

Addresses: http://thread.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/5913/focus=5929
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: remove unused variables
Karel Zak [Tue, 24 Jul 2012 08:52:09 +0000 (10:52 +0200)] 
fdisk: remove unused variables

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: make label API more robust
Karel Zak [Tue, 24 Jul 2012 08:41:47 +0000 (10:41 +0200)] 
fdisk: make label API more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: API: add fdisk_label_change
Davidlohr Bueso [Tue, 24 Jul 2012 08:31:32 +0000 (10:31 +0200)] 
fdisk: API: add fdisk_label_change

[kzak@redhat.com: - rename function
                  - remove fdisk_create_default_disklabel()]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: API: add verify to label operations
Davidlohr Bueso [Tue, 24 Jul 2012 07:54:52 +0000 (09:54 +0200)] 
fdisk: API: add verify to label operations

[kzak@redhat.com: - rename some functions]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: API: add new partition to label operations
Davidlohr Bueso [Tue, 24 Jul 2012 07:34:22 +0000 (09:34 +0200)] 
fdisk: API: add new partition to label operations

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: API: add write to label operations
Davidlohr Bueso [Mon, 23 Jul 2012 16:47:42 +0000 (18:47 +0200)] 
fdisk: API: add write to label operations

[kzak@redhat.com: - rename functions
                  - use errno]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: API: add delete partition to label operations
Davidlohr Bueso [Mon, 23 Jul 2012 16:15:57 +0000 (18:15 +0200)] 
fdisk: API: add delete partition to label operations

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: set label pointer in fdisk_create_default_disklabel()
Karel Zak [Mon, 23 Jul 2012 15:58:53 +0000 (17:58 +0200)] 
fdisk: set label pointer in fdisk_create_default_disklabel()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: API: add to label operations to context
Davidlohr Bueso [Sun, 22 Jul 2012 17:05:01 +0000 (19:05 +0200)] 
fdisk: API: add to label operations to context

The context structure is the fdisk API's main data type as it keeps all data
together. Add the label structure to it, so that the pt-specific operations can
be called from the context.

[kzak@redhat.com: - merge with latest changes
                  - don't allocate the label, use const pointer]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
13 years agofdisk: rename cxt->mbr buffer to cxt->firstsector
Karel Zak [Mon, 23 Jul 2012 12:24:25 +0000 (14:24 +0200)] 
fdisk: rename cxt->mbr buffer to cxt->firstsector

MBR is regular name for DOS partition table, let use less confusing
name for the buffer.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: move label specific stuff to fdiskdoslabel.c
Karel Zak [Mon, 23 Jul 2012 12:07:35 +0000 (14:07 +0200)] 
fdisk: move label specific stuff to fdiskdoslabel.c

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: move DOS geometry code from generic part to label specific
Karel Zak [Mon, 23 Jul 2012 11:57:58 +0000 (13:57 +0200)] 
fdisk: move DOS geometry code from generic part to label specific

 get_partition_table_geometry() should be called from DOS code

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agotests: update oddinput test
Karel Zak [Mon, 23 Jul 2012 09:46:27 +0000 (11:46 +0200)] 
tests: update oddinput test

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: fix error message for too small devices
Karel Zak [Mon, 23 Jul 2012 09:40:46 +0000 (11:40 +0200)] 
fdisk: fix error message for too small devices

 # touch ~/a
 # fdisk -l ~/a
 # fdisk: cannot open /root/a: Success

should be (at least):
 fdisk: cannot open /root/a: Invalid argument

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: (dos) cleanup function names
Karel Zak [Mon, 23 Jul 2012 09:17:35 +0000 (11:17 +0200)] 
fdisk: (dos) cleanup function names

 - use 'write' in name for functions that really touch devices
 - use 'set' in name for functions that modify in-memory stuff

... otherwise it's unreadable mess

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: get_boot() has to die (step II.)
Karel Zak [Mon, 23 Jul 2012 09:08:26 +0000 (11:08 +0200)] 
fdisk: get_boot() has to die (step II.)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: get_boot() has to die (step I.)
Karel Zak [Mon, 23 Jul 2012 08:56:06 +0000 (10:56 +0200)] 
fdisk: get_boot() has to die (step I.)

 - move generic stuff around "create disklabel" operation to API

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agofdisk: move user geometry setting from fdisk.c to API
Karel Zak [Mon, 23 Jul 2012 08:11:08 +0000 (10:11 +0200)] 
fdisk: move user geometry setting from fdisk.c to API

 - to avoid duplicate code
 - to remove fdisk_geom_set_cyls() from API

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: fix usage()
Karel Zak [Fri, 20 Jul 2012 18:06:10 +0000 (20:06 +0200)] 
dmesg: fix usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: add --reltime to print human readable deltas
Karel Zak [Fri, 20 Jul 2012 17:45:36 +0000 (19:45 +0200)] 
dmesg: add --reltime to print human readable deltas

[Jul20 09:50] device vnet0 entered promiscuous mode
[  +0.002248] virbr0: topology change detected, propagating
[  +0.000017] virbr0: port 2(vnet0) entered forwarding state
[  +0.000036] virbr0: port 2(vnet0) entered forwarding state
[  +0.001663] ADDRCONF(NETDEV_CHANGE): virbr0: link becomes ready
[ +10.480914] vnet0: no IPv6 routers present
[Jul20 14:35] xhci_hcd 0000:0e:00.0: WARN Event TRB for slot 3 ep 5 with no TDs queued?
[Jul20 19:23] EXT4-fs (sda2): re-mounted. Opts: (null)
[  +6.052980] EXT4-fs (sda2): re-mounted. Opts: (null)

Suggested by Linus:
http://thread.gmane.org/gmane.linux.kernel/1290886/focus=1296138

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg; cleanup time printing stuff
Karel Zak [Fri, 20 Jul 2012 15:43:50 +0000 (17:43 +0200)] 
dmesg; cleanup time printing stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: implement backwardly compatible --raw for /dev/kmsg
Karel Zak [Fri, 20 Jul 2012 12:41:25 +0000 (14:41 +0200)] 
dmesg: implement backwardly compatible --raw for /dev/kmsg

.. and if you really want raw data from /dev/kmsg then use dd(1) ;-)

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: cleanup exclusive_option() usage
Karel Zak [Fri, 20 Jul 2012 12:11:20 +0000 (14:11 +0200)] 
dmesg: cleanup exclusive_option() usage

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: add --follow feature
Karel Zak [Fri, 20 Jul 2012 12:04:48 +0000 (14:04 +0200)] 
dmesg: add --follow feature

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: support --clear for kmsg
Karel Zak [Fri, 20 Jul 2012 11:24:42 +0000 (13:24 +0200)] 
dmesg: support --clear for kmsg

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: read /dev/kmsg (since kernel 3.5.0)
Karel Zak [Fri, 20 Jul 2012 10:09:09 +0000 (12:09 +0200)] 
dmesg: read /dev/kmsg (since kernel 3.5.0)

kmsg advantages:
  - extendible format
  - tags for messages
  - one read() returns one complete record

See kernel Documentation/ABI/testing/dev-kmsg.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: add --syslog to force to old syslog(2) interface
Karel Zak [Thu, 19 Jul 2012 16:35:20 +0000 (18:35 +0200)] 
dmesg: add --syslog to force to old syslog(2) interface

... just for debugging or for people who somehow depends on syslog(2)
behavior.

Signed-off-by: Karel Zak <kzak@redhat.com>
13 years agodmesg: refactoring for kmsg support
Karel Zak [Thu, 19 Jul 2012 16:33:20 +0000 (18:33 +0200)] 
dmesg: refactoring for kmsg support

Signed-off-by: Karel Zak <kzak@redhat.com>