Karel Zak
abb7b98ca3
wipefs: use err_exclusive_options()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 09:24:50 +02:00
Karel Zak
98f2dc7a2b
lsblk: use err_exclusive_options()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 09:24:36 +02:00
Karel Zak
f1622b5705
findmnt: use err_exclusive_options()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 09:24:21 +02:00
Karel Zak
a8e458b971
blkid: use err_exclusive_options()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 09:23:58 +02:00
Karel Zak
a29627cb29
partx: use err_exclusive_options()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26 09:23:40 +02:00
Karel Zak
217d20a73c
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>
2012-07-26 09:22:35 +02:00
Karel Zak
9e9bceeb50
lsblk: fix dm_name usage
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-25 18:04:10 +02:00
Mantas Mikulėnas
9002d6504a
agetty: remove unnecessary sleep(10)
...
I'm quite sure this is not supposed to be here (apparently added as part
of commit 783b08fc1c
).
Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
2012-07-25 16:13:11 +02:00
Karel Zak
de3d6c9379
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 e781864260
.
2012-07-24 14:15:08 +02:00
Bernhard Voelker
e781864260
fdisk: de-duplicate disk label strings
...
Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-07-24 14:10:57 +02:00
Petr Uzel
84edc8dde3
fdisk: return success from sgi_create_disklabel
...
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-07-24 14:09:59 +02:00
Petr Uzel
63906221b6
fdisk: fix compiler warning [-Werror=unused-variable]
...
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-07-24 14:09:52 +02:00
Karel Zak
9199f5cd0a
dmesg: add fileback for SEEK_DATA
...
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-24 14:06:25 +02:00
Karel Zak
594304d56d
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>
2012-07-24 12:28:35 +02:00
Karel Zak
685fe42e12
fdisk: remove unused variables
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-24 10:52:09 +02:00
Karel Zak
441afd481d
fdisk: make label API more robust
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-24 10:41:47 +02:00
Davidlohr Bueso
639f1d56b9
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>
2012-07-24 10:31:32 +02:00
Davidlohr Bueso
2ca61a61e1
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>
2012-07-24 09:54:52 +02:00
Davidlohr Bueso
0f639e54df
fdisk: API: add new partition to label operations
...
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-07-24 09:34:22 +02:00
Davidlohr Bueso
fae7b1bcb5
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>
2012-07-24 09:13:59 +02:00
Davidlohr Bueso
61c4cb8530
fdisk: API: add delete partition to label operations
...
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-23 18:15:57 +02:00
Karel Zak
ed21ffd347
fdisk: set label pointer in fdisk_create_default_disklabel()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-23 17:58:53 +02:00
Davidlohr Bueso
79c8a145dd
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>
2012-07-23 17:31:06 +02:00
Karel Zak
67987b4734
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>
2012-07-23 14:24:25 +02:00
Karel Zak
6718834075
fdisk: move label specific stuff to fdiskdoslabel.c
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-23 14:07:35 +02:00
Karel Zak
9a5e29e94b
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>
2012-07-23 13:57:58 +02:00
Karel Zak
6123d1dd13
tests: update oddinput test
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-23 11:46:27 +02:00
Karel Zak
ed3e0e3738
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>
2012-07-23 11:40:46 +02:00
Karel Zak
87a97832e1
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>
2012-07-23 11:17:35 +02:00
Karel Zak
84e18f7659
fdisk: get_boot() has to die (step II.)
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-23 11:08:26 +02:00
Karel Zak
a71601af27
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>
2012-07-23 10:56:06 +02:00
Karel Zak
759d093fae
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>
2012-07-23 10:11:08 +02:00
Karel Zak
81ddbc7140
dmesg: fix usage()
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-20 20:06:10 +02:00
Karel Zak
60464b1f1a
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>
2012-07-20 19:53:44 +02:00
Karel Zak
0d1b330071
dmesg; cleanup time printing stuff
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-20 17:43:50 +02:00
Karel Zak
37b04d6cce
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>
2012-07-20 14:41:25 +02:00
Karel Zak
30e0661830
dmesg: cleanup exclusive_option() usage
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-20 14:11:20 +02:00
Karel Zak
0fd12a9697
dmesg: add --follow feature
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-20 14:04:48 +02:00
Karel Zak
c677ffba97
dmesg: support --clear for kmsg
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-20 13:24:42 +02:00
Karel Zak
ddca870aa9
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>
2012-07-20 12:09:09 +02:00
Karel Zak
ed61acc254
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>
2012-07-19 18:35:20 +02:00
Karel Zak
7af230601a
dmesg: refactoring for kmsg support
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-19 18:33:20 +02:00
Karel Zak
7ff1f63f15
dmesg: unify internal APIs
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-19 17:25:22 +02:00
Karel Zak
e6471b9fc5
dmesg: cleanup, move more stuff to control struct
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-19 17:01:05 +02:00
Karel Zak
9b3a698427
dmesg: move filename to control struct
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-19 16:33:08 +02:00
Karel Zak
994871c59f
libmount: check VFS mount options in mnt_diff_tables()
...
after "-o remount,ro" in unshared namespace is the original VFS entry
still read-write:
original:
42 21 8:2 / /boot rw,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered
unshared + ro remount:
78 51 8:2 / /boot ro,relatime - ext4 /dev/sda2 ro,user_xattr,acl,barrier=1,data=ordered
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-18 22:09:24 +02:00
Karel Zak
955eac11a7
docs: update TODO
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-17 22:08:27 +02:00
Karel Zak
aedeaa40d1
mount: (new) add --source and --target
...
In some cases (for example if only one mount argument is given) may be
mount request ambivalent:
# mount /foo
and fstab:
/dev/sda5 /foo rw 0 0
/foo /bar bind 0 0
the new options allows to be more explicit
# mount --target /foo (mounts /dev/sda5)
# mount --source /foo (binds /foo to /bar)
It's possible to use the options together
# mount --source /dev/sda2 --target /home
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-17 22:02:35 +02:00
Karel Zak
e39cbb7603
libmount: allow to disable swap between source and target
...
In some cases (for example if only one mount argument is given) may be
mount request ambivalent:
# mount /foo
and fstab:
/dev/sda5 /foo rw 0 0
/foo /bar bind 0 0
The libmount allows to swap between source and target (if
source is not LABEL or UUID) by default. The new function
mnt_context_disable_swapmatch()
allows to disable this feature.
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-17 21:57:22 +02:00
Karel Zak
4633cc95a4
docs: update TODO file
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-17 15:22:51 +02:00