Sami Kerola [Sun, 28 Aug 2011 11:09:03 +0000 (13:09 +0200)]
ipcmk: remove useless code
Checking same return value twice does not make command any
better. Secondly the program_invocation_short_name is known to
work, so global progname variable does not add anything extra.
The current cpulist_parse() function ignores extra non-parsable characters at
the end of the to be parsed cpu list string. E.g. it would accept something
like "0bla" and just set bit 0 in the cpu set. Since such a string is invalid
implement stricter parsing that makes sure that everything of the string has
been succesfully parsed.
lib,cpuset: fix stride handling in cpulist_parse()
If cpulist_parse() gets passed a cpu list with a stride value of 0 it will be
stuck in an endless loop. E.g. the following cpu list will cause an endless
loop: "0-2:0". Fix this by causing a parse error if the stride value is 0.
lib,cpuset: fix odd placed braces in cpulist_parse()
The opening and closing braces for two following if statements within
cpulist_parse() are placed in an odd manner.
Just fix this to prevent broken code in the future.
lscpu only prints lines for online CPUs. At least for the human readable
list the offline CPUs are of interest as well. In order to distinguish
between online and offline CPUs introduce the "Online" column.
By default the human readable output now displays online and offline CPUs.
The parsable output is not changed. It will print only lines for online
CPUs as it used to do.
[kzak@redhat.com: - minor changes]
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Karel Zak <kzak@redhat.com>
CPUs may be in a configured or deconfigured state depending if the CPU resource
may be used by the guest. If a CPU is in configured state the guest may use it
(i.e. set it online). It it is in deconfigured state it cannot use it before
changing its state to configured. Display this CPU attribute as well.
Karel Zak [Fri, 9 Sep 2011 18:59:59 +0000 (20:59 +0200)]
lscpu: add human readable extended cpu table output
Based on patch from Heiko Carstens <heiko.carstens@de.ibm.com>:
lscpu currently only supports a parsable output which contains a row for
each cpu and its attributes. This output contains only comas as separators
and is hard to read for humans.
Therefore add a new option "-e | --extended" which outputs the rows in a
much more readable (and non-parsable) form. Just like for the -p option a
list of columns can be specified that shall be included in the output.
By default this option will print all columns that contain data.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu: allow read_cache() to be called for offline cpus
First check path before accessing files to be sure they actually exist. This is
necessary when also informations for offline CPUs will be printed. Since we do
not necessarily know if "cpu is offline" means the same as "path does not
exist" just check for it.
Simplify the logic to "always print a ',' for each cache except if it is the
last one. This is also a preparation patch for printing the cache column for
offline CPUs where it would print one colon too much because of the current
logic.
lscpu: fix cache output for extended parsable output
The extended parsable output prints a colon instead of comma between each
item. The case where a CPU doesn't belong to any cache was not converted.
Just fix this.
Davidlohr Bueso [Tue, 16 Aug 2011 13:20:07 +0000 (09:20 -0400)]
partx: support loop devices
Add support for loop devices to add partitions. For now we make use of the
max_part parameter from the loop kernel module, otherwise the feature is
disabled.
Below an example output:
root@offbook:~/projects/util-linux/partx# ./partx -a -n 1:5 images-pt/dos+bsd.img
root@offbook:~/projects/util-linux/partx# ls /dev/loop0* -ltr
brw-rw---- 1 root disk 7, 0 2011-08-15 00:07 /dev/loop0
brw-rw---- 1 root disk 7, 5 2011-08-15 00:07 /dev/loop0p5
brw-rw---- 1 root disk 7, 2 2011-08-15 00:07 /dev/loop0p2
brw-rw---- 1 root disk 7, 1 2011-08-15 00:07 /dev/loop0p1
Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 31 Aug 2011 09:04:15 +0000 (11:04 +0200)]
Merge branch 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit
* 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit:
docs: remove duplicated text
docs: require kernel support before accepting use of it
docs: note about independent super block structs
docs: add libmount & libblkid debug instructions
Documentation: add debugging doc
arch: start using arch as a usage() example
docs: new file Documentation/release-schedule.txt
docs: move setuid information from reame to hwclock.8
docs: clean up old readme files
docs: copy contributors from legacy files to AUTHORS
docs: new file Documentation/howto-man-page.txt
docs: new file Documentation/source-code-management.txt
docs: new file Documentation/howto-contribute.txt
docs: new file Documentation/howto-compilation.txt
docs: tell what the Documentation/ is about
docs: add usage() howto for contributors
docs: Documentation directory added
docs: remove README.clear
Sami Kerola [Tue, 30 Aug 2011 17:39:42 +0000 (19:39 +0200)]
docs: remove duplicated text
Duplicate text is dealt by referring to license files. The `pg'
command does not need separated license file because the source
file has same text at top of it.
Davidlohr Bueso [Fri, 12 Aug 2011 17:55:42 +0000 (13:55 -0400)]
whereis: search in path
Currently this tool only uses the hardcoded paths for looking up strings for
binaries, man pages and source code. Adding directories found in $PATH makes a
nice little enhancement to support a wider range of lookups.
This feature was also discussed previously here
(http://www.spinics.net/lists/util-linux-ng/msg03429.html)
This adds a welcome message with util-linux version number, information
about fdisk behaviour that doesn't write to disk after a command (unlike
gparted) and a warning about possible data loss.
The message appears just before the first command prompt.
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
docs: also uniformize headers and footers of troff-formatted man pages
Add two spaces as the required third argument of the date line to make
the specified date get used instead of today's date. Incorporate the
section number into the page title, then use an empty section number,
so that specifying an explicit section/volume name will work.
Sami Kerola [Fri, 12 Aug 2011 19:36:40 +0000 (21:36 +0200)]
docs: copy contributors from legacy files to AUTHORS
See bellow who where found to contribute to former packages that
has been merged to util-linux. The list is very likely to be
incomplete.
cfdisk
Kevin E. Martin <martin@cs.unc.edu>
getopt
Volker Kuhlmann <v.kuhlmann@elec.canterbury.ac.nz>
Bob Proulx <rwp@hprwp.fc.hp.com>
agetty
Peter Orbaek <poe@daimi.aau.dk>
mount/umount
Doug Quale <quale@saavik.cs.wisc.edu>
H.J. Lu <hlu@eecs.wsu.edu>
Rick Sladkey <jrs@world.std.com>
Stephen Tweedie <sct@dcs.ed.ac.uk>
pg
Gunnar Ritter <g-r@bigfoot.de>
init/getty/login
Erik Troan
Sander van Malssen <svm@kozmix.ow.nl>
Jesse Thilo <jesse.thilo@pobox.com>
David Holland <dholland@hcs.harvard.edu>
Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>
Randolph Bentson <bentson@grieg.seaslug.org>
Gerhard Schneider <gs@ilfb.tuwien.ac.at>
Gabriel M. Schuyler <schuyler@easiest.com>
Christoph Lameter <clameter@miriam.fuller.edu>
Steve Philp
Eric Rasmussen <ear@usfirst.org>
Alan Wendt <alan@ezlink.com>
Ron Sommeling <sommel@sci.kun.nl>
Juha Laiho <jlaiho@ichaos.nullnet.fi>
Rickard Faith <faith@cs.unc.edu>
Alvaro M. Echevarria
Daniel Quinlan <quinlan@yggdrasil.com>
Ross Biro <biro@yggdrasil.com>
Peter Tobias <tobias@server.et-inf.fho-emden.de>
Scott Telford <st@epcc.ed.ac.uk>
Jeremy Fitzhardinge <jeremy@suite.sw.oz.au>
Nicolai Langfeldt <janl@math.uio.no>
Jaakko Hyvätti <HYVATTI@cc.helsinki.fi>
Bill Reynolds <bill@goshawk.lanl.gov>
Christian von Roques <roques@juliet.ka.sub.org>
Mitchum DSouza
Daniel Thumim <dthumim@mit.edu>
Lars Wirzenius
John Paul Morrison <jmorriso@rflab.ee.ubc.ca>
Jun Hamano <junio@shadow.twinsun.com>
Werner Almesberger <almesber@bernina.ethz.ch>
Rick Sladkey <jrs@world.std.com>
Anthony Rumble <arumble@extro.ucc.su.OZ.AU>
Linus Torvalds
Steven S. Dick <ssd@nevets.oau.org>
Ed Carp
Miquel van Smoorenburg <miquels@maestro.htsa.aha.nl>
Humberto Zuazaga
Pietro Castelli
Douglas E. Quale
Stephen Gallimore
Tommy Thorn
Michael Glad <glad@daimi.aau.dk>
W.Z. Venema
Peter Orbaek <poe@daimi.aau.dk>
Giulio Orsero [Tue, 23 Aug 2011 10:19:38 +0000 (12:19 +0200)]
sfdisk: make some tests conditional to !Linux
This patch makes the following tests/actions conditional to "!Linux":
- Force cylinders as format instead of MB, even if user asked for MB.
This solves a bug where if you use "-L -uM", set 1 as starting MB
and the disk is larger than a certain size (about 1GB) the partition
would start at sector 1 instead of 1MB due to cyl rounding.
- Warn about partitions not starting/ending on cyl boundaries.
- Check if CHS is ok.
I used the "!Linux" notation since it was already used elsewhere in
the code.
Signed-off-by: Giulio Orsero <giulioo@pobox.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Heiko Carstens [Mon, 15 Aug 2011 05:52:49 +0000 (07:52 +0200)]
chcpu: new tool
chcpu can modify the logical state of CPUs. It can enable and disable CPUs,
scan for new CPUs, change the CPU dispatching mode of the underlying
hypervisor and request (configure) or give logical CPUs back (deconfigure)
to the the underlying hypervisor.
This is quite useful if you work a lot with virtual servers, since doing all
the configuration stuff directly via sysfs becomes a pain.