Util-Linux package development
 help / color / mirror / Atom feed
* Re: [PATCH] sfdisk: make some tests conditional to !Linux
From: Karel Zak @ 2011-08-22  8:32 UTC (permalink / raw)
  To: giulioo; +Cc: util-linux
In-Reply-To: <20110818073019.B70AFF815@i3.golden.dom>

On Thu, Aug 18, 2011 at 09:30:30AM +0200, Giulio wrote:
> +	    if (!chs_ok(b, PNO(p), _("start")) && !Linux)
[...]
> +	    if (!chs_ok(b, PNO(p), _("end")) && !Linux)

would be better to use

    if (!Linux && chs_ok(b, PNO(p), ....)

so the chs_ok() will not called on Linux at all?

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: Subject: [PATCH] docs: update ReleaseNotes: fix typo in v2.20-ReleaseNotes
From: Karel Zak @ 2011-08-22  8:37 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux
In-Reply-To: <4E4D2FB6.7060001@bernhard-voelker.de>

On Thu, Aug 18, 2011 at 05:28:54PM +0200, Bernhard Voelker wrote:
>  docs/v2.20-ReleaseNotes |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: [patches] uniformizing the man page headers and footers
From: Karel Zak @ 2011-08-22  8:41 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Util-Linux
In-Reply-To: <1313833851.22309.140258131751361@webmail.messagingengine.com>

On Sat, Aug 20, 2011 at 11:50:51AM +0200, Benno Schulenberg wrote:
>  91 files changed, 143 insertions(+), 142 deletions(-)

 Applied, thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: PAM-only login(1)
From: Ludwig Nussel @ 2011-08-22 11:19 UTC (permalink / raw)
  To: util-linux; +Cc: Thorsten Kukuk
In-Reply-To: <20110812115758.GC1843@nb.net.home>

Karel Zak wrote:
>   I'd like to clean up login(1) code for v2.21. The current code is
>   mess with many #ifdef and support for some unused (and badly tested) 
>   features (e.g. non-PAM support for /etc/securetty and /etc/usertty).
> 
>   What about to finally create nice and readable PAM-only login(1) for
>   Linux?

+1

On openSUSE we already use a pam-only login program¹. It was forked
from util-linux > ten years ago AFAICT. It also includes features
from shadow-utils, like reading settings from /etc/login.defs.

cu
Ludwig

[1] https://build.opensuse.org/package/files?package=login&project=Base%3ASystem

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 

^ permalink raw reply

* Re: PAM-only login(1)
From: Karel Zak @ 2011-08-22 12:01 UTC (permalink / raw)
  To: Ludwig Nussel; +Cc: util-linux, Thorsten Kukuk
In-Reply-To: <4E523B50.8080204@suse.de>

On Mon, Aug 22, 2011 at 01:19:44PM +0200, Ludwig Nussel wrote:
> Karel Zak wrote:
> >   I'd like to clean up login(1) code for v2.21. The current code is
> >   mess with many #ifdef and support for some unused (and badly tested) 
> >   features (e.g. non-PAM support for /etc/securetty and /etc/usertty).
> > 
> >   What about to finally create nice and readable PAM-only login(1) for
> >   Linux?
> 
> +1
> 
> On openSUSE we already use a pam-only login program¹. It was forked

It would be nice to merge all back to util-linux and share the code
rather than maintain forks.

> from util-linux > ten years ago AFAICT. It also includes features
> from shadow-utils, like reading settings from /etc/login.defs.

Does make anything other than MAIL_DIR sense for login(1)?

(IMHO the MAIL_DIR could be also defined by pam_env.)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* [PATCH] new chcpu tool
From: Heiko Carstens @ 2011-08-22 12:06 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux
In-Reply-To: <20110815152453.052584040@de.ibm.com>

Hi Karel,

here is an updated version of the chcpu tool that includes all the features
I described in my previous mail.
Do you think it would be ok to have it in util-linux? Or should it live
somewhere else?

The rationale why I think it should be within util-linux is simply that
lscpu is already there. Parts of the tool are architecture/hypervisor
dependent, but some things are useful for most architectures, I think.
At least for those architectures that support virtualization quite a few
features are (or will be) common.

Another reason for trying to add it to util-linux is that we want to avoid
doing the same mistake we did already with the "lsmem" and "chmem" tools
which can configure hotplug memory. These tools are completely architecture
independent, but we put them into our "s390-tools" package.
I think both of them should live in util-linux instead... But that's
something we could address later anyway :)

Anyway, what do you think?

Thanks,
Heiko

----

Subject: [PATCH] chcpu: new tool

From: Heiko Carstens <heiko.carstens@de.ibm.com>

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.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

 sys-utils/.gitignore  |    1 
 sys-utils/Makefile.am |    3 
 sys-utils/chcpu.1     |   94 +++++++++++++
 sys-utils/chcpu.c     |  337 ++++++++++++++++++++++++++++++++++++++++++++++++++
 sys-utils/lscpu.1     |    2 
 5 files changed, 437 insertions(+)

diff --git a/sys-utils/.gitignore b/sys-utils/.gitignore
index 3ae7e4a..febeb38 100644
--- a/sys-utils/.gitignore
+++ b/sys-utils/.gitignore
@@ -41,3 +41,4 @@ switch_root
 tunelp
 unshare
 x86_64.8
+chcpu
diff --git a/sys-utils/Makefile.am b/sys-utils/Makefile.am
index feb5888..da05dac 100644
--- a/sys-utils/Makefile.am
+++ b/sys-utils/Makefile.am
@@ -21,6 +21,9 @@ if HAVE_CPU_SET_T
 usrbin_exec_PROGRAMS += lscpu
 lscpu_SOURCES = lscpu.c $(top_srcdir)/lib/cpuset.c $(top_srcdir)/lib/strutils.c
 dist_man_MANS += lscpu.1
+sbin_PROGRAMS += chcpu
+chcpu_SOURCES = chcpu.c $(top_srcdir)/lib/cpuset.c
+dist_man_MANS += chcpu.1
 endif
 
 endif
diff --git a/sys-utils/chcpu.1 b/sys-utils/chcpu.1
new file mode 100644
index 0000000..9417a72
--- /dev/null
+++ b/sys-utils/chcpu.1
@@ -0,0 +1,94 @@
+.TH CHCPU 1 "August 2011" Linux "User Manuals"
+.SH NAME
+chcpu \- CPU configuration utility
+.SH SYNOPSIS
+.B chcpu
+\fB-c\fP|\fB\-d\fP|\fB\-e\fP|\fB\-g\fP
+.IR cpu-list
+.br
+.B
+\fBchcpu \-p\fP \fImode\fP
+.br
+.B chcpu
+.RB [ \-rhV\ ]
+.br
+.SH DESCRIPTION
+.B 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.
+
+Some options have a \fIcpu-list\fP argument. A \fIcpu-list\fP may specify
+multiple CPUs, separated by comma, and ranges.  For example,
+.BR 0,5,7,9-11 .
+.SH OPTIONS
+The --configure, --deconfigure, --disable, --dispatch, --enable and --rescan
+options are mutually exclusive.
+.TP
+.BR \-c , " \-\-configure " <\fIcpu-list\fP>
+Configure all CPUs specified with \fIcpu-list\fP. If
+.BR chcpu
+fails to configure a CPU specified in the \fIcpu-list\fP it will skip that
+CPU and continue with the next one until all specified CPUs have been
+processed.
+.br
+Configuring a CPU means that the underlying hypervisor is informed that
+a logical CPU within a guest should be used. If the hypervisor has enough
+resources the request will succeed.
+.TP
+.BR \-d , " \-\-disable " <\fIcpu-list\fP>
+Disable all CPUs specified with \fIcpu-list\fP. If
+.BR chcpu
+fails to disable a CPU specified in the \fIcpu-list\fP it will skip that
+CPU and continue with the next one until all specified CPUs have been
+processed.
+.br
+When a CPU has been disabled its state is offline.
+.TP
+.BR \-e , " \-\-enable " <\fIcpu-list\fP>
+Enable all CPUs specified with \fIcpu-list\fP. If
+.BR chcpu
+fails to enable a CPU specified in the \fIcpu-list\fP it will skip that
+CPU and continue with the next one until all specified CPUs have been
+processed.
+.br
+When a CPU has been enabled its state is online.
+.TP
+.BR \-g , " \-\-deconfigure " <\fIcpu-list\fP>
+Deconfigure all CPUs specified with \fIcpu-list\fP. If
+.BR chcpu
+fails to deconfigure a CPU specified in the \fIcpu-list\fP it will skip
+that CPU and continue with the next one until all specified CPUs have been
+processed. Only disabled (offline) CPUs can be deconfigured.
+.br
+Deconfiguring a CPU means that the underlying hypervisor is informed that
+the CPU will not be used anymore and that the hypervisor can add the CPU
+back to its CPU pool.
+.TP
+.BR \-h , " \-\-help"
+Print a help text and exit.
+.TP
+.BR \-p , " \-\-dispatch " <\fImode\fP>
+Set the CPU dispatching \fImode\fP if the underlying hypervisor supports this.
+\fImode\fP may be horizontal or vertical.
+.TP
+.BR \-r , " \-\-rescan"
+Trigger a rescan of CPUs. If new CPUs have been attached to the system the
+kernel will detect them. On some systems no event will be generated if a
+CPU gets attached. In that case a CPU rescan must be manually triggered.
+.TP
+.BR \-V , " \-\-version"
+Output version information and exit.
+.SH AUTHOR
+.nf
+Heiko Carstens <heiko.carstens@de.ibm.com>
+.fi
+.SH COPYRIGHT
+Copyright IBM Corp. 2011
+.br
+.SH "SEE ALSO"
+.BR lscpu (1)
+.SH AVAILABILITY
+The chcpu command is part of the util-linux package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
new file mode 100644
index 0000000..2d5725f
--- /dev/null
+++ b/sys-utils/chcpu.c
@@ -0,0 +1,337 @@
+/*
+ * chcpu - CPU configuration tool
+ *
+ * Copyright IBM Corp. 2011
+ * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>,
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "cpuset.h"
+#include "nls.h"
+#include "xalloc.h"
+#include "c.h"
+#include "strutils.h"
+#include "bitops.h"
+
+#define _PATH_SYS_CPU		"/sys/devices/system/cpu"
+#define _PATH_SYS_CPU_RESCAN	_PATH_SYS_CPU "/rescan"
+#define _PATH_SYS_CPU_DISPATCH	_PATH_SYS_CPU "/dispatching"
+
+static char pathbuf[PATH_MAX];
+
+enum {
+	CMD_CPU_ENABLE	= 0,
+	CMD_CPU_DISABLE,
+	CMD_CPU_CONFIGURE,
+	CMD_CPU_DECONFIGURE,
+	CMD_CPU_RESCAN,
+	CMD_CPU_DISPATCH_HORIZONTAL,
+	CMD_CPU_DISPATCH_VERTICAL,
+};
+
+static int path_open(mode_t mode, const char *path, ...)
+{
+	va_list ap;
+	int fd;
+
+	va_start(ap, path);
+	vsnprintf(pathbuf, sizeof(pathbuf), path, ap);
+	va_end(ap);
+	fd = open(pathbuf, mode);
+	if (fd == -1)
+		err(EXIT_FAILURE, "error: cannot open %s", pathbuf);
+	return fd;
+}
+
+static int path_exist(const char *path, ...)
+{
+	va_list ap;
+
+	va_start(ap, path);
+	vsnprintf(pathbuf, sizeof(pathbuf), path, ap);
+	va_end(ap);
+	return access(pathbuf, F_OK) == 0;
+}
+
+static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
+{
+	unsigned int cpu;
+	int fd, rc;
+	char c;
+
+	for (cpu = 0; cpu < setsize; cpu++) {
+		if (!CPU_ISSET(cpu, cpu_set))
+			continue;
+		if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
+			printf(_("CPU %d does not exist\n"), cpu);
+			continue;
+		}
+		if (!path_exist(_PATH_SYS_CPU "/cpu%d/online", cpu)) {
+			printf(_("CPU %d is not hot pluggable\n"), cpu);
+			continue;
+		}
+		fd = path_open(O_RDWR, _PATH_SYS_CPU "/cpu%d/online", cpu);
+		if (read(fd, &c, 1) == -1)
+			err(EXIT_FAILURE, "error: cannot read from %s", pathbuf);
+		if ((c == '1') && (enable == 1)) {
+			printf(_("CPU %d is already enabled\n"), cpu);
+			continue;
+		}
+		if ((c == '0') && (enable == 0)) {
+			printf(_("CPU %d is already disabled\n"), cpu);
+			continue;
+		}
+		if (enable) {
+			rc = write(fd, "1", 1);
+			if (rc == -1)
+				printf(_("CPU %d enable failed (%s)\n"), cpu,
+					strerror(errno));
+			else
+				printf(_("CPU %d enabled\n"), cpu);
+		} else {
+			rc = write(fd, "0", 1);
+			if (rc == -1)
+				printf(_("CPU %d disable failed (%s)\n"), cpu,
+					strerror(errno));
+			else
+				printf(_("CPU %d disabled\n"), cpu);
+		}
+		close(fd);
+	}
+	return EXIT_SUCCESS;
+}
+
+static int cpu_rescan(void)
+{
+	int fd;
+
+	if (!path_exist(_PATH_SYS_CPU_RESCAN))
+		errx(EXIT_FAILURE, _("This system does not support rescanning of CPUs"));
+	fd = path_open(O_WRONLY, _PATH_SYS_CPU_RESCAN);
+	if (write(fd, "1", 1) == -1)
+		err(EXIT_FAILURE, _("Failed to trigger rescan of CPUs"));
+	close(fd);
+	return EXIT_SUCCESS;
+}
+
+static int cpu_set_dispatch(int mode)
+{
+	int fd;
+
+	if (!path_exist(_PATH_SYS_CPU_DISPATCH))
+		errx(EXIT_FAILURE, _("This system does not support setting "
+				     "the dispatching mode of CPUs"));
+	fd = path_open(O_WRONLY, _PATH_SYS_CPU_DISPATCH);
+	if (mode == 0) {
+		if (write(fd, "0", 1) == -1)
+			err(EXIT_FAILURE, _("Failed to set horizontal dispatch mode"));
+		printf(_("Succesfully set horizontal dispatching mode\n"));
+	} else {
+		if (write(fd, "1", 1) == -1)
+			err(EXIT_FAILURE, _("Failed to set vertical dispatch mode"));
+		printf(_("Succesfully set vertical dispatching mode\n"));
+	}
+	close(fd);
+	return EXIT_SUCCESS;
+}
+
+static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure)
+{
+	unsigned int cpu;
+	int fd, rc;
+	char c;
+
+	for (cpu = 0; cpu < setsize; cpu++) {
+		if (!CPU_ISSET(cpu, cpu_set))
+			continue;
+		if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
+			printf(_("CPU %d does not exist\n"), cpu);
+			continue;
+		}
+		if (!path_exist(_PATH_SYS_CPU "/cpu%d/configure", cpu)) {
+			printf(_("CPU %d is not configurable\n"), cpu);
+			continue;
+		}
+		fd = path_open(O_RDWR, _PATH_SYS_CPU "/cpu%d/configure", cpu);
+		if (read(fd, &c, 1) == -1)
+			err(EXIT_FAILURE, "error: cannot read from %s", pathbuf);
+		if ((c == '1') && (configure == 1)) {
+			printf(_("CPU %d is already configured\n"), cpu);
+			continue;
+		}
+		if ((c == '0') && (configure == 0)) {
+			printf(_("CPU %d is already deconfigured\n"), cpu);
+			continue;
+		}
+		if (configure) {
+			rc = write(fd, "1", 1);
+			if (rc == -1)
+				printf(_("CPU %d configure failed (%s)\n"), cpu,
+					strerror(errno));
+			else
+				printf(_("CPU %d configured\n"), cpu);
+		} else {
+			rc = write(fd, "0", 1);
+			if (rc == -1)
+				printf(_("CPU %d deconfigure failed (%s)\n"), cpu,
+					strerror(errno));
+			else
+				printf(_("CPU %d deconfigured\n"), cpu);
+		}
+		close(fd);
+	}
+	return EXIT_SUCCESS;
+}
+
+static void __attribute__((__noreturn__)) usage(FILE *out)
+{
+	fprintf(out, _(
+		"\nUsage:\n"
+		" %s [options]\n"), program_invocation_short_name);
+
+	puts(_(	"\nOptions:\n"
+		"  -h, --help                    print this help\n"
+		"  -e, --enable <cpu-list>       enable cpus\n"
+		"  -d, --disable <cpu-list>      disable cpus\n"
+		"  -c, --configure <cpu-list>    configure cpus\n"
+		"  -g, --deconfigure <cpu-list>  deconfigure cpus\n"
+		"  -p, --dispatch <mode>         set dispatching mode\n"
+		"  -r, --rescan                  trigger rescan of cpus\n"
+		"  -V, --version                 output version information and exit\n"));
+
+	exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+
+int main(int argc, char *argv[])
+{
+	cpu_set_t *cpu_set;
+	unsigned int ncpus;
+	size_t setsize;
+	int cmd = -1;
+	int c;
+
+	static const struct option longopts[] = {
+		{ "configure",	required_argument, 0, 'c' },
+		{ "deconfigure",required_argument, 0, 'g' },
+		{ "disable",	required_argument, 0, 'd' },
+		{ "dispatch",	required_argument, 0, 'p' },
+		{ "enable",	required_argument, 0, 'e' },
+		{ "help",	no_argument,       0, 'h' },
+		{ "rescan",	no_argument,       0, 'r' },
+		{ "version",	no_argument,       0, 'V' },
+		{ NULL,		0, 0, 0 }
+	};
+
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
+	ncpus = get_max_number_of_cpus();
+	if (ncpus <= 0)
+		errx(EXIT_FAILURE, _("cannot determine NR_CPUS; aborting"));
+	setsize = CPU_ALLOC_SIZE(ncpus);
+	cpu_set = CPU_ALLOC(ncpus);
+	if (!cpu_set)
+		err(EXIT_FAILURE, _("cpuset_alloc failed"));
+
+	while ((c = getopt_long(argc, argv, "c:d:e:g:hp:rV", longopts, NULL)) != -1) {
+		if (cmd != -1 && strchr("cdegpr", c))
+			errx(EXIT_FAILURE,
+			     _("configure, deconfigure, disable, dispatch, enable "
+			       "and rescan are mutually exclusive"));
+		switch (c) {
+		case 'c':
+			cmd = CMD_CPU_CONFIGURE;
+			if (cpulist_parse(argv[optind - 1], cpu_set, setsize, 1))
+				errx(EXIT_FAILURE, _("failed to parse CPU list: %s"),
+				     argv[optind -1 ]);
+			break;
+		case 'd':
+			cmd = CMD_CPU_DISABLE;
+			if (cpulist_parse(argv[optind - 1], cpu_set, setsize, 1))
+				errx(EXIT_FAILURE, _("failed to parse CPU list: %s"),
+				     argv[optind -1 ]);
+			break;
+		case 'e':
+			cmd = CMD_CPU_ENABLE;
+			if (cpulist_parse(argv[optind - 1], cpu_set, setsize, 1))
+				errx(EXIT_FAILURE, _("failed to parse CPU list: %s"),
+				     argv[optind -1 ]);
+			break;
+		case 'g':
+			cmd = CMD_CPU_DECONFIGURE;
+			if (cpulist_parse(argv[optind - 1], cpu_set, setsize, 1))
+				errx(EXIT_FAILURE, _("failed to parse CPU list: %s"),
+				     argv[optind -1 ]);
+			break;
+		case 'h':
+			usage(stdout);
+		case 'p':
+			if (strcmp("horizontal", argv[optind - 1]) == 0)
+				cmd = CMD_CPU_DISPATCH_HORIZONTAL;
+			else if (strcmp("vertical", argv[optind - 1]) == 0)
+				cmd = CMD_CPU_DISPATCH_VERTICAL;
+			else
+				errx(EXIT_FAILURE, _("unsupported argument: %s"),
+				     argv[optind -1 ]);
+			break;
+		case 'r':
+			cmd = CMD_CPU_RESCAN;
+			break;
+		case 'V':
+			printf(_("%s from %s\n"), program_invocation_short_name,
+			       PACKAGE_STRING);
+			return EXIT_SUCCESS;
+		default:
+			usage(stderr);
+		}
+	}
+
+	if ((argc == 1) || (argc != optind))
+		usage(stderr);
+
+	switch (cmd) {
+	case CMD_CPU_ENABLE:
+		return cpu_enable(cpu_set, ncpus, 1);
+	case CMD_CPU_DISABLE:
+		return cpu_enable(cpu_set, ncpus, 0);
+	case CMD_CPU_CONFIGURE:
+		return cpu_configure(cpu_set, ncpus, 1);
+	case CMD_CPU_DECONFIGURE:
+		return cpu_configure(cpu_set, ncpus, 0);
+	case CMD_CPU_RESCAN:
+		return cpu_rescan();
+	case CMD_CPU_DISPATCH_HORIZONTAL:
+		return cpu_set_dispatch(0);
+	case CMD_CPU_DISPATCH_VERTICAL:
+		return cpu_set_dispatch(1);
+	}
+	return EXIT_SUCCESS;
+}
diff --git a/sys-utils/lscpu.1 b/sys-utils/lscpu.1
index 4795e91..39246c9 100644
--- a/sys-utils/lscpu.1
+++ b/sys-utils/lscpu.1
@@ -56,6 +56,8 @@ Sometimes in Xen Dom0 the kernel reports wrong data.
 Cai Qian <qcai@redhat.com>
 Karel Zak <kzak@redhat.com>
 .fi
+.SH "SEE ALSO"
+.BR chcpu (1)
 .SH AVAILABILITY
 The lscpu command is part of the util-linux package and is available from
 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.

^ permalink raw reply related

* Re: PAM-only login(1)
From: Ludwig Nussel @ 2011-08-22 12:34 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Thorsten Kukuk
In-Reply-To: <20110822120123.GC20457@nb.net.home>

Karel Zak wrote:
> On Mon, Aug 22, 2011 at 01:19:44PM +0200, Ludwig Nussel wrote:
>> Karel Zak wrote:
>>>   I'd like to clean up login(1) code for v2.21. The current code is
>>>   mess with many #ifdef and support for some unused (and badly tested) 
>>>   features (e.g. non-PAM support for /etc/securetty and /etc/usertty).
>>>
>>>   What about to finally create nice and readable PAM-only login(1) for
>>>   Linux?
>>
>> +1
>>
>> On openSUSE we already use a pam-only login program¹. It was forked
> 
> It would be nice to merge all back to util-linux and share the code
> rather than maintain forks.

Sure.

>> from util-linux > ten years ago AFAICT. It also includes features
>> from shadow-utils, like reading settings from /etc/login.defs.
> 
> Does make anything other than MAIL_DIR sense for login(1)?

That one isn't even used by our login. AFAICT the following settings are
honored:

DEFAULT_HOME
ENV_PATH
ENV_ROOTPATH
FAIL_DELAY
HUSHLOGIN_FILE
LOGIN_TIMEOUT
LOG_UNKFAIL_ENAB
MOTD_FILE
TTYGROUP
TTYPERM
TTYTYPE_FILE

I agree that most of them are either superfluous or could be handled by
pam modules. Probably interesting are LOGIN_TIMEOUT and
LOG_UNKFAIL_ENAB. The former is hard-coded in util-linux and the latter
feature is missing. It replaces unknown user names with "UNKNOWN" in the
logs.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) 

^ permalink raw reply

* Re: [PATCH] new chcpu tool
From: Karel Zak @ 2011-08-22 13:28 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: util-linux
In-Reply-To: <20110822120641.GA7549@osiris.boeblingen.de.ibm.com>

On Mon, Aug 22, 2011 at 02:06:41PM +0200, Heiko Carstens wrote:
> Do you think it would be ok to have it in util-linux? Or should it live
> somewhere else?

It makes sense to have it in util-linux. I'm going to merge it after
v2.20 release.

> Another reason for trying to add it to util-linux is that we want to avoid
> doing the same mistake we did already with the "lsmem" and "chmem" tools
> which can configure hotplug memory. These tools are completely architecture
> independent, but we put them into our "s390-tools" package.
> I think both of them should live in util-linux instead... But that's
> something we could address later anyway :)

 OK :-)

> +static int path_exist(const char *path, ...)

 It seems that we need to move the path_*() functions from lscpu(1) to
 lib/ and hare the stuff.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: [PATCH] sfdisk: make some tests conditional to !Linux
From: Giulio Orsero @ 2011-08-22 18:45 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux
In-Reply-To: <20110822083206.GA20457@nb.net.home>

On Mon, 22 Aug 2011 10:32:06 +0200, Karel Zak <kzak@redhat.com> wrote:

>On Thu, Aug 18, 2011 at 09:30:30AM +0200, Giulio wrote:
>> +	    if (!chs_ok(b, PNO(p), _("start")) && !Linux)
>[...]
>> +	    if (!chs_ok(b, PNO(p), _("end")) && !Linux)
>would be better to use
>    if (!Linux && chs_ok(b, PNO(p), ....)
>so the chs_ok() will not called on Linux at all?

Maybe the compiler reordered it since it didn't print those messages =
anymore
anyway; for clarity I redordered the tests.

^ permalink raw reply

* Re: [PATCH] sfdisk: make some tests conditional to !Linux
From: Giulio Orsero @ 2011-08-22 18:46 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux
In-Reply-To: <20110822083206.GA20457@nb.net.home>

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

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.

Sorry, I don't use git, hope this is ok.

Signed-off-by: Giulio Orsero <giulioo@pobox.com>
-- 
giulioo@pobox.com

[-- Attachment #2: sfdisk.linux-compat2.diff --]
[-- Type: application/octet-stream, Size: 1943 bytes --]

--- a/fdisk/sfdisk.c	2011-08-17 17:17:43.000000000 +0200
+++ b/fdisk/sfdisk.c	2011-08-22 14:59:26.000000000 +0200
@@ -1315,7 +1315,7 @@ partitions_ok(struct disk_desc *z) {
      * The first partition starts after MBR.
      * Logical partitions start slightly after the containing extended partn.
      */
-    if (B.cylindersize) {
+    if (B.cylindersize && !Linux) {
 	for (p = partitions; p < partitions + partno; p++)
 	    if (p->size) {
 		if (p->start % B.cylindersize != 0
@@ -1325,14 +1325,12 @@ partitions_ok(struct disk_desc *z) {
 		    && (p->p.start_sect >= B.cylindersize)) {
 		    my_warn(_("Warning: partition %s does not start "
 			      "at a cylinder boundary\n"), PNO(p));
-		    if (!Linux)
-			return 0;
+		    return 0;
 		}
 		if ((p->start + p->size) % B.cylindersize) {
 		    my_warn(_("Warning: partition %s does not end "
 			      "at a cylinder boundary\n"), PNO(p));
-		    if (!Linux)
-			return 0;
+		    return 0;
 		}
 	    }
     }
@@ -1378,7 +1376,7 @@ partitions_ok(struct disk_desc *z) {
 	    b = p->p.begin_chs;
 	    aa = chs_to_longchs(a);
 	    bb = chs_to_longchs(b);
-	    if (!chs_ok(b, PNO(p), _("start")))
+	    if (!Linux && !chs_ok(b, PNO(p), _("start")))
 		return 0;
 	    if (a.s && !is_equal_chs(a, b))
 		my_warn(_
@@ -1388,7 +1386,7 @@ partitions_ok(struct disk_desc *z) {
 	    b = p->p.end_chs;
 	    aa = chs_to_longchs(a);
 	    bb = chs_to_longchs(b);
-	    if (!chs_ok(b, PNO(p), _("end")))
+	    if (!Linux && !chs_ok(b, PNO(p), _("end")))
 		return 0;
 	    if (a.s && !is_equal_chs(a, b))
 		my_warn(_
@@ -2087,7 +2085,7 @@ read_line(int pno, struct part_desc *ep,
 
     /* use specified format, but round to cylinders if F_MEGABYTE specified */
     format = 0;
-    if (B.cylindersize && specified_format == F_MEGABYTE)
+    if (B.cylindersize && specified_format == F_MEGABYTE && !Linux)
 	format = F_CYLINDER;
 
     orig = (one_only ? &(oldp.partitions[pno]) : 0);

^ permalink raw reply

* Re: man-pages and usage() howto
From: Sami Kerola @ 2011-08-22 18:53 UTC (permalink / raw)
  To: Karel Zak; +Cc: Benno Schulenberg, util-linux
In-Reply-To: <20110822081654.GH699@nb.net.home>

On Mon, Aug 22, 2011 at 10:16, Karel Zak <kzak@redhat.com> wrote:
>> IMHO the following looks quite ok, and not too different to
>> usage().
>>
>> .TP
>> \fB\-n\fR, \fB\-\-no\-argument\fR
>> This option does not use argument.
>> .TP
>> \fB\-o\fR, \fB\-\-optional\fR[=3D<\fIarg\fR>]
>> This option uses optional argument.
>> .TP
>> \fB\-r\fR, \fB\-\-required\fR <\fIarg\fR>
>> This option requires an argument.
>
> =A0I have no strong opinion about it. Benno is probably right that
> =A0italics for the arguments is enough.
>
> =A0We already use option arguments without diamond brackets in our man
> =A0pages, so let's continue with this convention to minimize number of
> =A0changes in the man pages ;-)

The howto-man-page.txt now has arguments underlined without diamond
brackets. Optional argument has square brackets surrounding it.

Is the patch set ready now? Have a look, and in absence of comments
merge might be reasonable thing to do after few days.

https://github.com/kerolasa/lelux-utiliteetit/tree/docs-dir/Documentation

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/

^ permalink raw reply

* Re: man-pages and usage() howto
From: Benno Schulenberg @ 2011-08-22 20:38 UTC (permalink / raw)
  To: kerolasa; +Cc: Karel Zak, util-linux
In-Reply-To: <CAG27Bk0m45JFtP2MNz27tgJ=-f5XZDHUtd1C9O4X0ALO52-BVA@mail.gmail.com>


On Sat, 20 Aug 2011 21:08 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
> On Sat, Aug 20, 2011 at 11:10, Benno Schulenberg <bensberg@justemail.net> wrote:
> > On Wed, 17 Aug 2011 15:07 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
> >> Having also definition for OPTION_HELP && OPTION_VERSION would be
> >> good.
> >
> > That won't work -- the amount of indentation for the option description
> > is not the same for all utilities.  And to make it the same for all would
> > create ugly and unneeded wide open text spaces for some tools.
> 
> To me it does not sound a big deal if --help and --version
> description begins from different indent than rest of lines. I
> wrote example output that way, so that you can judge how that
> will look.

When --help and --version are always the last two options of the
usage help text, a differing indentation is acceptable.  But if --help
is ordered alphabetically, it will look broken.

> \fB\-o\fR, \fB\-\-optional\fR[=<\fIarg\fR>]
> This option uses optional argument.

As Karel said, the majority convention now is to not use pointy brackets
for arguments in man pages.  The italics/underlining is enough to make
them stand out.

I would also suggest to not use "arg" but the full word "argument", so as
to encourage writers to not unnecessarily abbreviate the argument name,
to use for example "seconds" and not "secs", use "number" and not "num".

A thing about the formatting: why us \fB and \fR and \fB and \fR?
Why not use the macro .BR at the start of the line instead?
(I do not understand your comment about some macros not being
visually different from plain .B or .I.)

Another thing: the man page formatter itself puts a double space after a
period when in the man page source the next sentence begins on a new
line.  So when in the source a new sentence begins somewhere midline,
it should use a double space before its initial letter.

>From your usage howto:
>  -n, --no-argument option requires no_argument
>  -o, --optional[=<arg>] option has optional_argument
>  -r, --required <arg> option requires required_argument

Why the underscores?  I would suggest the following:

  -n, --no-argument       option takes no argument
  -o, --optional[=<arg>]  option takes optional argument
  -r, --required <arg>    option requires an argument

(As in a usage text space is limited, abbreviations are okay.)

Regards,

Benno

-- 
http://www.fastmail.fm - Access your email from home and the web

^ permalink raw reply

* [PATCH] lomount: correct qsort compare function
From: Andreas Schwab @ 2011-08-22 21:15 UTC (permalink / raw)
  To: util-linux

Return the correct value from comparing the operands.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 mount/lomount.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mount/lomount.c b/mount/lomount.c
index 34d151a..fad58d5 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -285,7 +285,7 @@ name2minor(int hasprefix, const char *name)
 static int
 cmpnum(const void *p1, const void *p2)
 {
-	return (* (int *) p1) > (* (int *) p2);
+	return (*(int *) p1 > *(int *) p2) - (*(int *) p1 < *(int *) p2);
 }
 
 /*
-- 
1.7.6


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply related

* Re: man-pages and usage() howto
From: Sami Kerola @ 2011-08-23  8:15 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Karel Zak, util-linux
In-Reply-To: <1314045499.25233.140258132498281@webmail.messagingengine.com>

On Mon, Aug 22, 2011 at 22:38, Benno Schulenberg <bensberg@justemail.net> w=
rote:
> On Sat, 20 Aug 2011 21:08 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
>> To me it does not sound a big deal if --help and --version
>> description begins from different indent than rest of lines. I
>> wrote example output that way, so that you can judge how that
>> will look.
>
> When --help and --version are always the last two options of the
> usage help text, a differing indentation is acceptable. =A0But if --help
> is ordered alphabetically, it will look broken.

True, and that's why I wrote they should be last entries.

>> \fB\-o\fR, \fB\-\-optional\fR[=3D<\fIarg\fR>]
>> This option uses optional argument.
>
> As Karel said, the majority convention now is to not use pointy brackets
> for arguments in man pages. =A0The italics/underlining is enough to make
> them stand out.

I guess you did not read from git the section.

.SH OPTIONS
.TP
\fB\-n\fR, \fB\-\-no\-argument\fR
This option does not use argument.
.TP
\fB\-o\fR, \fB\-\-optional\fR [\fIarg\fR]
Tell in description an
.I arg
is optional, and what happens when is or is not given.
.TP
\fB\-r\fR, \fB\-\-required\fR \fIarg\fR
Tell in description option
.I arg
is required.

As you can see no diamond brackets there.

> I would also suggest to not use "arg" but the full word "argument", so as
> to encourage writers to not unnecessarily abbreviate the argument name,
> to use for example "seconds" and not "secs", use "number" and not "num".

Good point. I will fix that when I'm at home again.

> A thing about the formatting: why us \fB and \fR and \fB and \fR?
> Why not use the macro .BR at the start of the line instead?

No matter how I tried to use various .B, .BR

> (I do not understand your comment about some macros not being
> visually different from plain .B or .I.)

Either my term, groff or pager is/are broken, or I have wooden eyes or
the different highlights do not stand out, see yourself:

http://ut3.org/~kerolasa/groff-highlight.png

What I tried to say; Do not get fooled that different macros will look
different so that you can refer visually in between different text
elements. For example in the screen shot on top the required argument
has same appearance when it is next to switch & in text. I think that
sort of consistency in style makes things more understandable.

> Another thing: the man page formatter itself puts a double space after a
> period when in the man page source the next sentence begins on a new
> line. =A0So when in the source a new sentence begins somewhere midline,
> it should use a double space before its initial letter.

Are you sure it does that? See the screenshot notes section third
paragraph line two, words `macros. See' has only single space in
between them. Even there would be two spaces I do not agree that groff
input writer should imitate output. It should be enough that words and
sentences are white space separated, groff will take care the rest.

> From your usage howto:
>> =A0-n, --no-argument option requires no_argument
>> =A0-o, --optional[=3D<arg>] option has optional_argument
>> =A0-r, --required <arg> option requires required_argument
>
> Why the underscores? =A0I would suggest the following:
>
> =A0-n, --no-argument =A0 =A0 =A0 option takes no argument
> =A0-o, --optional[=3D<arg>] =A0option takes optional argument
> =A0-r, --required <arg> =A0 =A0option requires an argument
>
> (As in a usage text space is limited, abbreviations are okay.)

The weird underscores are used in option structure. Now when you
mention that I think having such unexplained reference is not good.
I'll write the description using ordinary text.

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/

^ permalink raw reply

* Re: [PATCH] new chcpu tool
From: Heiko Carstens @ 2011-08-23  8:45 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux
In-Reply-To: <20110822132817.GD20457@nb.net.home>

On Mon, Aug 22, 2011 at 03:28:17PM +0200, Karel Zak wrote:
> On Mon, Aug 22, 2011 at 02:06:41PM +0200, Heiko Carstens wrote:
> > Do you think it would be ok to have it in util-linux? Or should it live
> > somewhere else?
> 
> It makes sense to have it in util-linux. I'm going to merge it after
> v2.20 release.

Ok, great!

I set up a chcpu git branch where you could pull the chcpu stuff easily:

  git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux.git chcpu

It contains just the two patches posted here and doesn't interfer with the
lscpu branch that is also there.

Heiko Carstens (2):
      cpuset: add option to allow cpulist_parse() to fail
      chcpu: new tool

 include/cpuset.h      |    2 +-
 lib/cpuset.c          |    7 +-
 schedutils/taskset.c  |    2 +-
 sys-utils/.gitignore  |    1 +
 sys-utils/Makefile.am |    3 +
 sys-utils/chcpu.1     |   94 ++++++++++++++
 sys-utils/chcpu.c     |  337 +++++++++++++++++++++++++++++++++++++++++++++++++
 sys-utils/lscpu.1     |    2 +
 sys-utils/lscpu.c     |    2 +-
 9 files changed, 445 insertions(+), 5 deletions(-)
 create mode 100644 sys-utils/chcpu.1
 create mode 100644 sys-utils/chcpu.c

> > +static int path_exist(const char *path, ...)
> 
>  It seems that we need to move the path_*() functions from lscpu(1) to
>  lib/ and hare the stuff.

Yes, I thought so as well. But laziness won ;)

Thanks,
Heiko

^ permalink raw reply

* Re: [PATCH] sfdisk: make some tests conditional to !Linux
From: Karel Zak @ 2011-08-23 10:21 UTC (permalink / raw)
  To: giulioo; +Cc: util-linux
In-Reply-To: <20110818073019.B70AFF815@i3.golden.dom>

On Thu, Aug 18, 2011 at 09:30:30AM +0200, Giulio wrote:
> --- a/fdisk/sfdisk.c	2011-08-17 17:17:43.000000000 +0200
> +++ b/fdisk/sfdisk.c	2011-08-17 22:48:52.000000000 +0200

 Applied, thanks.
 
-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: [PATCH] lomount: correct qsort compare function
From: Karel Zak @ 2011-08-23 10:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: util-linux
In-Reply-To: <m2obzhywq0.fsf@igel.home>

On Mon, Aug 22, 2011 at 11:15:03PM +0200, Andreas Schwab wrote:
> ---
>  mount/lomount.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

 Very good catch! Applied, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: [PATCH] Documentation: add debugging doc
From: Karel Zak @ 2011-08-23 10:47 UTC (permalink / raw)
  To: Davidlohr Bueso, Sami Kerola; +Cc: util-linux
In-Reply-To: <1312678772.3408.3.camel@offbook>


 Semi, could you add howto-debug to your docs branch?

    Karel

On Sat, Aug 06, 2011 at 08:59:32PM -0400, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
> 
> Layout the base for tips on debugging util-linux programs/wrappers.
> 
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
>  Documentation/README.debug |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/README.debug
> 
> diff --git a/Documentation/README.debug b/Documentation/README.debug
> new file mode 100644
> index 0000000..7ead12f
> --- /dev/null
> +++ b/Documentation/README.debug
> @@ -0,0 +1,30 @@
> +Debugging util-linux programs
> +-----------------------------
> +
> +There are considerations to be made when profiling or debugging some programs found
> +in the util-linux package. Because wrapper scripts are used for the binaries to make
> +sure all library dependencies are met, you cannot use tools such as gdb or valgrind
> +directly with them.
> +
> +Let's take for example the mount command:
> +
> +$> file /path/util-linux/mount/mount
> +mount: Bourne-Again shell script text executable
> +
> +The binary itself is located in the .libs/ dir:
> +
> +$> file /path/util-linux/mount/.libs/mount
> +mount: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
> +
> +When this command is run, there's a library dependency error:
> +./mount: /lib/x86_64-linux-gnu/libblkid.so.1: version `BLKID_2.20' not found (required by ./mount)
> +
> +To overcome this we need set the LD_LIBRARY_PATH variable to read the path of the shared lib found in
> +the sources, and not system-wide:
> +
> +$> export LD_LIBRARY_PATH=/path/util-linux/libblkid/src/.libs/:$LD_LIBRARY_PATH
> +
> +Now external debugging tools can be run on the binary.
> +
> +Happy hacking!
> +Davidlohr Bueso, August 2011
> -- 
> 1.7.4.1
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply

* Re: man-pages and usage() howto
From: Benno Schulenberg @ 2011-08-23 18:55 UTC (permalink / raw)
  To: kerolasa; +Cc: Karel Zak, util-linux
In-Reply-To: <CAG27Bk2NS7-tRH4Acp-_WFhAmxELm4cCZ79mwgbXWnDJ7gFAfw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]


On Tue, 23 Aug 2011 10:15 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
> On Mon, Aug 22, 2011 at 22:38, Benno Schulenberg <bensberg@justemail.net> wrote:
> > (I do not understand your comment about some macros not being
> > visually different from plain .B or .I.)
> 
> Either my term, groff or pager is/are broken, or I have wooden eyes or
> the different highlights do not stand out, see yourself:
> 
> http://ut3.org/~kerolasa/groff-highlight.png
> 
> What I tried to say; Do not get fooled that different macros will look
> different so that you can refer visually in between different text
> elements.

Hmm, maybe you misunderstand what for example the .BI macro does?
It does not mean "bold _plus_ italic" but "alternate bold and italic".  And it
does that perfectly.  See for example the attached example file.

> > Another thing: the man page formatter itself puts a double space after a
> > period when in the man page source the next sentence begins on a new
> > line.  So when in the source a new sentence begins somewhere midline,
> > it should use a double space before its initial letter.
> 
> Are you sure it does that?

Yes, it does that here, on Ubuntu Lucid 10.10, with man 2.5.7.

> See the screenshot notes section third
> paragraph line two, words `macros. See' has only single space in
> between them.

Yes, but in the source it says "appropriate groff macros. See" on a single
line.  When you put the "See" on a line by itself, you wil see two spaces
appear before it.  See the attached example file.

> Even there would be two spaces I do not agree that groff
> input writer should imitate output. It should be enough that words and
> sentences are white space separated, groff will take care the rest.

Well, being a doublespacer myself, I notice it when some sentences are
single-spaced and others double; it irks.  But never mind.

Regards,

Benno

-- 
http://www.fastmail.fm - A fast, anti-spam email service.


[-- Attachment #2: junk.1 --]
[-- Type: application/octet-stream, Size: 549 bytes --]

.TH JUNK 1 "Today" "Example" "Spaciousness"
.SH NAME
junk \- do nothing
.SH DESCRIPTION
.B junk
does nothing.
Just show.
That.
After.
.PP
Each period.
Plus newline.
Follow two spaces.
.SH FORMATTING
.PP
.BR \.BR\  alternate\  bold\  and\  normal\  and\  so\  on\  and\  so\  on
.PP
.BI \.BI\  alternate\  bold\  and\  italic
.PP
.IB \.IB\  alternate\  italic\  and\  bold
.PP
.IR \.IR\  alternate\  italic\  and\  normal
.PP
.RB \.RB\  alternate\  normal\  and\  bold
.PP
.RI \.RI\  alternate\  normal\  and\  italic\  and\  so\  on\  and\  so\  on

^ permalink raw reply

* Re: man-pages and usage() howto
From: Sami Kerola @ 2011-08-23 19:34 UTC (permalink / raw)
  To: Benno Schulenberg; +Cc: Karel Zak, util-linux
In-Reply-To: <1314125747.31287.140258132893109@webmail.messagingengine.com>

On Tue, Aug 23, 2011 at 20:55, Benno Schulenberg <bensberg@justemail.net> w=
rote:
> On Tue, 23 Aug 2011 10:15 +0200, "Sami Kerola" <kerolasa@iki.fi> wrote:
>> On Mon, Aug 22, 2011 at 22:38, Benno Schulenberg <bensberg@justemail.net=
> wrote:
>> > (I do not understand your comment about some macros not being
>> > visually different from plain .B or .I.)
>>
>> Either my term, groff or pager is/are broken, or I have wooden eyes or
>> the different highlights do not stand out, see yourself:
>>
>> http://ut3.org/~kerolasa/groff-highlight.png
>>
>> What I tried to say; Do not get fooled that different macros will look
>> different so that you can refer visually in between different text
>> elements.
>
> Hmm, maybe you misunderstand what for example the .BI macro does?
> It does not mean "bold _plus_ italic" but "alternate bold and italic". =
=A0And it
> does that perfectly. =A0See for example the attached example file.

Indeed I have. Thank you clarifying that, and as obvious the strange
(wrong) instruction in howto-man-page.txt is gone.

>> > Another thing: the man page formatter itself puts a double space after=
 a
>> > period when in the man page source the next sentence begins on a new
>> > line. =A0So when in the source a new sentence begins somewhere midline=
,
>> > it should use a double space before its initial letter.
>>
>> Are you sure it does that?
>
> Yes, it does that here, on Ubuntu Lucid 10.10, with man 2.5.7.
>
>> See the screenshot notes section third
>> paragraph line two, words `macros. See' has only single space in
>> between them.
>
> Yes, but in the source it says "appropriate groff macros. See" on a singl=
e
> line. =A0When you put the "See" on a line by itself, you wil see two spac=
es
> appear before it. =A0See the attached example file.

I'm quite near to say groff is a stupid program. Well, it seems that
the instructions should indeed tell to use french spacing e.g. two
spaces after a dot. After all it would be even more ridiculous to ask
people to use dot only at middle of line so that groff will never add
two spaces.

>> Even there would be two spaces I do not agree that groff
>> input writer should imitate output. It should be enough that words and
>> sentences are white space separated, groff will take care the rest.
>
> Well, being a doublespacer myself, I notice it when some sentences are
> single-spaced and others double; it irks. =A0But never mind.

Quite the opposite, I did not know I where talking. Thanks again
pointing out how wrong I where.

p.s. The usage() option thing is fixed as well.

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/

^ permalink raw reply

* Re: [PATCH] Documentation: add debugging doc
From: Sami Kerola @ 2011-08-23 19:41 UTC (permalink / raw)
  To: Karel Zak; +Cc: Davidlohr Bueso, util-linux
In-Reply-To: <20110823104732.GE20457@nb.net.home>

On Tue, Aug 23, 2011 at 12:47, Karel Zak <kzak@redhat.com> wrote:
> =A0Semi, could you add howto-debug to your docs branch?

I could. I also modestly edit the patch; see addition in commit
message what I did & how the file looks in general.

https://github.com/kerolasa/lelux-utiliteetit/commit/1b1ea43afb0c0d6c3bf386=
e85e03c03b975194a5

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/

^ permalink raw reply

* Re: [PATCH] Documentation: add debugging doc
From: Davidlohr Bueso @ 2011-08-23 21:46 UTC (permalink / raw)
  To: kerolasa; +Cc: Karel Zak, util-linux
In-Reply-To: <CAG27Bk16rT3vJYy0N=fYaBFd6RX1HvoD5_TbO5uLhby+=bnBWg@mail.gmail.com>

On Tue, 2011-08-23 at 21:41 +0200, Sami Kerola wrote:
> On Tue, Aug 23, 2011 at 12:47, Karel Zak <kzak@redhat.com> wrote:
> >  Semi, could you add howto-debug to your docs branch?
> 
> I could. I also modestly edit the patch; see addition in commit
> message what I did & how the file looks in general.

Changes look good, thanks. BTW I had no idea I had a github account :)

> 
> https://github.com/kerolasa/lelux-utiliteetit/commit/1b1ea43afb0c0d6c3bf386e85e03c03b975194a5
> 

^ permalink raw reply

* example in flock manpage still not useful.
From: Pierre Gaston @ 2011-08-25 12:26 UTC (permalink / raw)
  To: util-linux

I can see why the following change has been made but, as it is, it
doesn't work at all

http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=commitdiff;h=c348d9346ae60b78a03d6dcd964e23fb40a625df

(
   flock -n 9
   # ... commands executed under lock ...

) 9>/var/lock/mylockfile\fP

flock -n 9 does nothing here besides testing the lock.

I suggest to revert to flock -s 9...or rather to just flock 9, since a
shared lock doesn't indeed seems very useful either here.

The example can be fixed using {   ;} instead of a subshell and adding
flock -n 9 || exit 1, but I think it doesn't match
the intention of the committer which was to show a way to avoid 2
concurrent executions of a script.

If  you want an example exiting the script, I suggest adding an example like:

exec 9>/var/lock/mylockfile  # open the file descriptor for the
duration of the script
flock -n 9 || exit 1                 # exit if the lock can't be acquire.

Pierre

^ permalink raw reply

* [patches] man page window cleaning
From: Benno Schulenberg @ 2011-08-28  9:34 UTC (permalink / raw)
  To: Util-Linux

[-- Attachment #1: Type: text/plain, Size: 911 bytes --]


Hi,

Attached bunch of patches does some minor cleaning up of
several of the man pages, mainly in wording and formatting.

The first patch uniformizes the headers and footers also of
the troff-formatted pages, by using some empty arguments to
achieve the desired result.  The third patch does the same
for the forgotten vipw page.

The fifth patch, apart from rewording and reformatting, removes
a superfluous pair of brackets and a superfluous argument from
the first synopsis line on the ionice man page, and indicates
for the --pid option that multiple PIDs are allowed.

The sixth patch normalizes the formatting of several pages,
but also fixes some significant typos: it corrects for example
"swapinfo" to "swaplabel" on the swaplabel man page, and
corrects the "blocks" argument to "size" on the mkfs page.

Regards,

Benno

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-docs-also-uniformize-headers-and-footers-of-troff-fo.patch --]
[-- Type: text/x-patch; name="0001-docs-also-uniformize-headers-and-footers-of-troff-fo.patch", Size: 4822 bytes --]

From 4d2afd6c4c74604253ddfd94a7986d205fb6ced1 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 23 Aug 2011 22:10:49 +0200
Subject: [PATCH 1/6] 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.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 misc-utils/logger.1  |    4 ++--
 sys-utils/renice.1   |    4 ++--
 term-utils/script.1  |    4 ++--
 term-utils/wall.1    |    4 ++--
 text-utils/col.1     |    4 ++--
 text-utils/colcrt.1  |    4 ++--
 text-utils/colrm.1   |    4 ++--
 text-utils/hexdump.1 |    4 ++--
 text-utils/more.1    |    4 ++--
 text-utils/rev.1     |    4 ++--
 text-utils/ul.1      |    4 ++--
 11 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/misc-utils/logger.1 b/misc-utils/logger.1
index 98a1a06..08f3705 100644
--- a/misc-utils/logger.1
+++ b/misc-utils/logger.1
@@ -33,8 +33,8 @@
 .\"
 .\" Section on valid facility and level strings added by
 .\" and1000@debian.org, 26 Oct 1997.
-.Dd August 2011
-.Dt LOGGER 1
+.Dd August 2011 "  "
+.Dt LOGGER(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm logger
diff --git a/sys-utils/renice.1 b/sys-utils/renice.1
index f283645..6b9d01a 100644
--- a/sys-utils/renice.1
+++ b/sys-utils/renice.1
@@ -31,8 +31,8 @@
 .\"
 .\"     @(#)renice.8   8.1 (Berkeley) 6/9/93
 .\"
-.Dd November 2010
-.Dt RENICE 1
+.Dd November 2010 "  "
+.Dt RENICE(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm renice
diff --git a/term-utils/script.1 b/term-utils/script.1
index e111d08..dd1fdc5 100644
--- a/term-utils/script.1
+++ b/term-utils/script.1
@@ -31,8 +31,8 @@
 .\"
 .\"	@(#)script.1	6.5 (Berkeley) 7/27/91
 .\"
-.Dd February 2011
-.Dt SCRIPT 1
+.Dd February 2011 "  "
+.Dt SCRIPT(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm script
diff --git a/term-utils/wall.1 b/term-utils/wall.1
index 541a8d0..24f81c5 100644
--- a/term-utils/wall.1
+++ b/term-utils/wall.1
@@ -33,8 +33,8 @@
 .\"
 .\" Modified for Linux, Mon Mar  8 18:07:38 1993, faith@cs.unc.edu
 .\"
-.Dd April 2011
-.Dt WALL 1
+.Dd April 2011 "  "
+.Dt WALL(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm wall
diff --git a/text-utils/col.1 b/text-utils/col.1
index d9879d5..7f3e413 100644
--- a/text-utils/col.1
+++ b/text-utils/col.1
@@ -34,8 +34,8 @@
 .\"
 .\"     @(#)col.1	6.8 (Berkeley) 6/17/91
 .\"
-.Dd May 2011
-.Dt COL 1
+.Dd May 2011 "  "
+.Dt COL(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm col
diff --git a/text-utils/colcrt.1 b/text-utils/colcrt.1
index e65c8e9..b7650c6 100644
--- a/text-utils/colcrt.1
+++ b/text-utils/colcrt.1
@@ -31,8 +31,8 @@
 .\"
 .\"     @(#)colcrt.1	8.1 (Berkeley) 6/30/93
 .\"
-.Dd May 2011
-.Dt COLCRT 1
+.Dd May 2011 "  "
+.Dt COLCRT(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm colcrt
diff --git a/text-utils/colrm.1 b/text-utils/colrm.1
index 38c4f4e..f81e363 100644
--- a/text-utils/colrm.1
+++ b/text-utils/colrm.1
@@ -31,8 +31,8 @@
 .\"
 .\"     @(#)colrm.1	6.6 (Berkeley) 3/14/91
 .\"
-.Dd May 2011
-.Dt COLRM 1
+.Dd May 2011 "  "
+.Dt COLRM(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm colrm
diff --git a/text-utils/hexdump.1 b/text-utils/hexdump.1
index 20dbad2..4ae6565 100644
--- a/text-utils/hexdump.1
+++ b/text-utils/hexdump.1
@@ -31,8 +31,8 @@
 .\"
 .\"	from: @(#)hexdump.1	8.2 (Berkeley) 4/18/94
 .\"
-.Dd July 2009
-.Dt HEXDUMP 1
+.Dd July 2009 "  "
+.Dt HEXDUMP(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm hexdump
diff --git a/text-utils/more.1 b/text-utils/more.1
index 73f65a0..1ef71ec 100644
--- a/text-utils/more.1
+++ b/text-utils/more.1
@@ -37,8 +37,8 @@
 .\" conform with the more 5.19 currently in use by the Linux community.
 .\"
 .\" .Dd July 29, 1991 (Modified December 25, 1992)
-.Dd February 2011
-.Dt MORE 1
+.Dd February 2011 "  "
+.Dt MORE(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm more
diff --git a/text-utils/rev.1 b/text-utils/rev.1
index 7dc6804..6ae4a86 100644
--- a/text-utils/rev.1
+++ b/text-utils/rev.1
@@ -33,8 +33,8 @@
 .\"     Modified for Linux by Charles Hannum (mycroft@gnu.ai.mit.edu)
 .\"                       and Brian Koehmstedt (bpk@gnu.ai.mit.edu)
 .\"
-.Dd April 2011
-.Dt REV 1
+.Dd April 2011 "  "
+.Dt REV(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm rev
diff --git a/text-utils/ul.1 b/text-utils/ul.1
index 6d93531..5827bf7 100644
--- a/text-utils/ul.1
+++ b/text-utils/ul.1
@@ -31,8 +31,8 @@
 .\"
 .\"     @(#)ul.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd August 2011
-.Dt UL 1
+.Dd August 2011 "  "
+.Dt UL(1) "" "User Commands"
 .Os util-linux
 .Sh NAME
 .Nm ul
-- 
1.7.0.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-docs-tweak-the-formatting-and-wording-of-some-text-u.patch --]
[-- Type: text/x-patch; name="0002-docs-tweak-the-formatting-and-wording-of-some-text-u.patch", Size: 9746 bytes --]

From a2ba81910b0ddcd92da0f0b88efd75fc5adbfa9d Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Thu, 25 Aug 2011 22:26:13 +0200
Subject: [PATCH 2/6] docs: tweak the formatting and wording of some text-utils man pages

Highlight the program name, use proper lowercase, remove
unneeded commas and articles, and add helpful hyphenation.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 text-utils/col.1     |   12 ++++++------
 text-utils/colcrt.1  |    2 +-
 text-utils/colrm.1   |    2 +-
 text-utils/hexdump.1 |   43 +++++++++++++++++++++++++------------------
 text-utils/more.1    |    9 +++++----
 text-utils/rev.1     |    4 ++--
 text-utils/ul.1      |    4 ++--
 7 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/text-utils/col.1 b/text-utils/col.1
index 7f3e413..bbec8fe 100644
--- a/text-utils/col.1
+++ b/text-utils/col.1
@@ -45,16 +45,16 @@
 .Op Fl bfphx
 .Op Fl l Ar num
 .Sh DESCRIPTION
-.Nm Col
-filters out reverse (and half reverse) line feeds so the output is
-in the correct order with only forward and half forward line
+.Nm
+filters out reverse (and half-reverse) line feeds so the output is
+in the correct order with only forward and half-forward line
 feeds, and replaces white-space characters with tabs where possible.
 This can be useful in processing the output of
 .Xr nroff 1
 and
 .Xr tbl  1 .
 .Pp
-.Nm Col
+.Nm
 reads from standard input and writes to standard output.
 .Pp
 The options are as follows:
@@ -64,7 +64,7 @@ Do not output any backspaces, printing only the last character
 written to each column position.
 .It Fl f, Fl Fl fine
 Forward half line feeds are permitted (``fine'' mode).
-Normally characters printed on a half line boundary are printed
+Normally characters printed on a half-line boundary are printed
 on the following line.
 .It Fl p, Fl Fl pass
 Force unknown control sequences to be passed through unchanged.
@@ -120,7 +120,7 @@ reverse line feed (11)
 All unrecognized control characters and escape sequences are
 discarded.
 .Pp
-.Nm Col
+.Nm
 keeps track of the character set as characters are read and makes
 sure the character set is correct when they are output.
 .Pp
diff --git a/text-utils/colcrt.1 b/text-utils/colcrt.1
index b7650c6..fb4535b 100644
--- a/text-utils/colcrt.1
+++ b/text-utils/colcrt.1
@@ -43,7 +43,7 @@
 .Op Fl \&2
 .Op Ar
 .Sh DESCRIPTION
-.Nm Colcrt
+.Nm
 provides virtual half-line and reverse line feed sequences
 for terminals without such capability, and on which overstriking
 is destructive.
diff --git a/text-utils/colrm.1 b/text-utils/colrm.1
index f81e363..3bc214d 100644
--- a/text-utils/colrm.1
+++ b/text-utils/colrm.1
@@ -41,7 +41,7 @@
 .Nm colrm
 .Op Ar startcol Op Ar endcol
 .Sh DESCRIPTION
-.Nm Colrm
+.Nm
 removes selected columns from a file.  Input is taken from standard input.
 Output is sent to standard output.
 .Pp
diff --git a/text-utils/hexdump.1 b/text-utils/hexdump.1
index 4ae6565..ce783c1 100644
--- a/text-utils/hexdump.1
+++ b/text-utils/hexdump.1
@@ -36,7 +36,7 @@
 .Os util-linux
 .Sh NAME
 .Nm hexdump
-.Nd ascii, decimal, hexadecimal, octal dump
+.Nd display file contents in ascii, decimal, hexadecimal, or octal
 .Sh SYNOPSIS
 .Nm
 .Op Fl bcCdovx
@@ -54,8 +54,10 @@
 .Ek
 .Ar file ...
 .Sh DESCRIPTION
-The hexdump utility is a filter which displays the specified files, or
-the standard input, if no files are specified, in a user specified
+The
+.Nm
+utility is a filter which displays the specified files, or
+standard input if no files are specified, in a user-specified
 format.
 .Pp
 The options are as follows:
@@ -63,22 +65,22 @@ The options are as follows:
 .It Fl b
 .Em One-byte octal display .
 Display the input offset in hexadecimal, followed by sixteen
-space-separated, three column, zero-filled, bytes of input data,
+space-separated, three-column, zero-filled bytes of input data,
 in octal, per line.
 .It Fl c
 .Em One-byte character display .
 Display the input offset in hexadecimal, followed by sixteen
-space-separated, three column, space-filled, characters of input
+space-separated, three-column, space-filled characters of input
 data per line.
 .It Fl C
 .Em Canonical hex+ASCII display .
 Display the input offset in hexadecimal, followed by sixteen
-space-separated, two column, hexadecimal bytes, followed by the
+space-separated, two-column, hexadecimal bytes, followed by the
 same sixteen bytes in %_p format enclosed in ``|'' characters.
 .It Fl d
 .Em Two-byte decimal display .
 Display the input offset in hexadecimal, followed by eight
-space-separated, five column, zero-filled, two-byte units
+space-separated, five-column, zero-filled, two-byte units
 of input data, in unsigned decimal, per line.
 .It Fl e Ar format_string
 Specify a format string to be used for displaying data.
@@ -94,7 +96,7 @@ bytes of input.
 .It Fl o
 .Em Two-byte octal display .
 Display the input offset in hexadecimal, followed by eight
-space-separated, six column, zero-filled, two byte quantities of
+space-separated, six-column, zero-filled, two-byte quantities of
 input data, in octal, per line.
 .It Fl s Ar offset
 Skip
@@ -129,18 +131,20 @@ respectively.
 .It Fl v
 The
 .Fl v
-option causes hexdump to display all input data.
+option causes
+.Nm
+to display all input data.
 Without the
 .Fl v
-option, any number of groups of output lines, which would be
+option, any number of groups of output lines which would be
 identical to the immediately preceding group of output lines (except
 for the input offsets), are replaced with a line comprised of a
 single asterisk.
 .It Fl x
 .Em Two-byte hexadecimal display .
-Display the input offset in hexadecimal, followed by eight, space
-separated, four column, zero-filled, two-byte quantities of input
-data, in hexadecimal, per line.
+Display the input offset in hexadecimal, followed by eight
+space-separated, four-column, zero-filled, two-byte quantities of
+input data, in hexadecimal, per line.
 .El
 .Pp
 For each input file,
@@ -206,7 +210,9 @@ described in the C standard are supported:
 .Ed
 .El
 .Pp
-Hexdump also supports the following additional conversion strings:
+The
+.Nm
+utility also supports the following additional conversion strings:
 .Bl -tag -width Fl
 .It Cm \&_a Ns Op Cm dox
 Display the input offset, cumulative across input files, of the
@@ -225,10 +231,10 @@ conversion string except that it is only performed
 once, when all of the input data has been processed.
 .It Cm \&_c
 Output characters in the default character set.
-Nonprinting characters are displayed in three character, zero-padded
+Nonprinting characters are displayed in three-character, zero-padded
 octal, except for those representable by standard escape notation
 (see above),
-which are displayed as two character strings.
+which are displayed as two-character strings.
 .It Cm _p
 Output characters in the default character set.
 Nonprinting characters are displayed as a single
@@ -278,8 +284,9 @@ not have a specified iteration count, have the iteration count
 incremented until the entire input block has been processed or there
 is not enough data remaining in the block to satisfy the format string.
 .Pp
-If, either as a result of user specification or hexdump modifying
-the iteration count as described above, an iteration count is
+If, either as a result of user specification or
+.Nm
+modifying the iteration count as described above, an iteration count is
 greater than one, no trailing whitespace characters are output
 during the last iteration.
 .Pp
diff --git a/text-utils/more.1 b/text-utils/more.1
index 1ef71ec..480b558 100644
--- a/text-utils/more.1
+++ b/text-utils/more.1
@@ -51,15 +51,15 @@
 .Op +\fIlinenum\fP
 .Op Ar
 .Sh DESCRIPTION
-.Nm More
+.Nm
 is a filter for paging through text one screenful at a time.  This version
 is especially primitive.  Users should realize that
 .Xr less 1
 provides
 .Xr more 1
-emulation and extensive enhancements.
+emulation plus extensive enhancements.
 .Sh OPTIONS
-Command line options are described below.
+Command-line options are described below.
 Options are also taken from the environment variable
 .Ev MORE
 (make sure to precede them with a dash (``-'')) but command
@@ -88,7 +88,8 @@ folded).
 .It Fl p
 Do not scroll.  Instead, clear the whole screen and then display the text.
 .Pp
-Notice that this option is switched automatically on if executable is named to `page'.
+Notice that this option is switched on automatically if the executable is named
+.Nm page .
 .It Fl c
 Do not scroll.  Instead, paint each screen from the top, clearing the
 remainder of each line as it is displayed.
diff --git a/text-utils/rev.1 b/text-utils/rev.1
index 6ae4a86..f8850e0 100644
--- a/text-utils/rev.1
+++ b/text-utils/rev.1
@@ -47,9 +47,9 @@
 .Sh DESCRIPTION
 The
 .Nm rev
-utility copies the specified files to the standard output, reversing the
+utility copies the specified files to standard output, reversing the
 order of characters in every line.
-If no files are specified, the standard input is read.
+If no files are specified, standard input is read.
 .Bl -tag -width Ds
 .It Fl V, Fl Fl version
 Output version information and exit.
diff --git a/text-utils/ul.1 b/text-utils/ul.1
index 5827bf7..dd1764e 100644
--- a/text-utils/ul.1
+++ b/text-utils/ul.1
@@ -52,8 +52,8 @@ by the environment variable
 The
 .Pa terminfo
 database is read to determine the appropriate sequences for underlining.
-If the terminal is incapable of underlining, but is capable of
-a standout mode then that is used instead.
+If the terminal is incapable of underlining but is capable of
+a standout mode, then that is used instead.
 If the terminal can overstrike,
 or handles underlining automatically,
 .Nm ul
-- 
1.7.0.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-vipw-man-page-uniformize-header-and-footer-tweak-the.patch --]
[-- Type: text/x-patch; name="0003-vipw-man-page-uniformize-header-and-footer-tweak-the.patch", Size: 1694 bytes --]

From 98d74975151f1fcb002bafc31542cb7c454ee416 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 26 Aug 2011 10:54:03 +0200
Subject: [PATCH 3/6] vipw: (man page) uniformize header and footer, tweak the formatting

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 login-utils/vipw.8 |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/login-utils/vipw.8 b/login-utils/vipw.8
index 6ed482d..eacf2c1 100644
--- a/login-utils/vipw.8
+++ b/login-utils/vipw.8
@@ -31,12 +31,12 @@
 .\"
 .\"     from: @(#)vipw.8	6.7 (Berkeley) 3/16/91
 .\"
-.Dd 7 July 1996
-.Dt VIPW 8
-.Os Util-Linux 2.6
+.Dd July 1996 "  "
+.Dt VIPW(8) "" "System Administration"
+.Os util-linux
 .Sh NAME
 .Nm vipw, vigr
-.Nd edit the password or group files
+.Nd edit the password or group file
 .Sh SYNOPSIS
 .Nm vipw
 .Op Fl V
@@ -45,22 +45,27 @@
 .Op Fl V
 .Op Fl -version
 .Sh DESCRIPTION
-.Nm Vipw
+.Nm vipw
 edits the password file after setting the appropriate locks,
 and does any necessary processing after the password file is unlocked.
 If the password file is already locked for editing by another user,
 .Nm vipw
 will ask you
-to try again later. The default editor for
+to try again later.  The default editor for
 .Nm vipw
+and
+.Nm vigr
 is
 .Xr vi 1 .
-.br
-.Nm Vigr
-edits the group file in the same manner as vipw.
+.Nm vigr
+edits the group file in the same manner as
+.Nm vipw
+does the passwd file.
 .Sh ENVIRONMENT
 If the following environment variable exists it will be utilized by
-.Nm vipw :
+.Nm vipw
+and
+.Nm vigr :
 .Bl -tag -width EDITOR
 .It Ev EDITOR
 The editor specified by the string
-- 
1.7.0.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-look-adjust-the-formatting-and-some-wording-of-the-m.patch --]
[-- Type: text/x-patch; name="0004-look-adjust-the-formatting-and-some-wording-of-the-m.patch", Size: 3563 bytes --]

From 98318ea9c7134a94fe39cb156de5517ab528d8db Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 26 Aug 2011 15:48:44 +0200
Subject: [PATCH 4/6] look: adjust the formatting and some wording of the man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 misc-utils/look.1 |   48 ++++++++++++++++++++++++++----------------------
 1 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/misc-utils/look.1 b/misc-utils/look.1
index bed3d24..fe8d8fd 100644
--- a/misc-utils/look.1
+++ b/misc-utils/look.1
@@ -36,20 +36,20 @@
 look \- display lines beginning with a given string
 .SH SYNOPSIS
 .B look
-[\fIoptions\fR] \fIstring \fR[\fIfile\fR]
+.RI [ options ] " string " [ file ]
 .SH DESCRIPTION
 The 
 .B look
 utility displays any lines in
 .I file
 which contain
-.I string
+.IR string .
 As
 .B look
 performs a binary search, the lines in
 .I file
-must be sorted (where sort(1) got the same options \-d and/or \-f
-that
+must be sorted (where sort(1) got the same options
+.BR "\-d " and/or " \-f " that
 .B look
 is invoked with).
 .PP
@@ -61,51 +61,55 @@ is used, only alphanumeric characters are compared and the case of
 alphabetic characters is ignored.
 .SH OPTIONS
 .TP
-\fB\-a\fR, \fB\-\-alternative\fR
-Use alternative dictionary file.
+.BR \-a , " \-\-alternative"
+Use the alternative dictionary file.
 .TP
-\fB\-d\fR, \fB\-\-alphanum\fR
-Dictionary character set and order, i.e. only alphanumeric characters are
-compared. (On by default if no file is specified).
+.BR \-d , " \-\-alphanum"
+Use normal dictionary character set and order, i.e. only alphanumeric characters
+are compared.  (This is on by default if no file is specified.)
 .TP
-\fB\-f\fR, \fB\-\-ignore\-case\fR
-Ignore the case of alphabetic characters. (On by default if no file is
-specified).
+.BR \-f , " \-\-ignore\-case"
+Ignore the case of alphabetic characters.  (This is on by default if no file is
+specified.)
 .TP
-\fB\-t\fR, \fB\-\-terminate\fR=\fIC\fR
+.BR \-t , " \-\-terminate " \fIcharacter\fR
 Specify a string termination character, i.e. only the characters
-in string up to and including the first occurrence of termchar
+in \fIstring\fR up to and including the first occurrence of \fIcharacter\fR
 are compared.
 .TP
-\fB\-V\fR, \fB\-\-version\fR
-Output version information and exit.
+.BR \-h , " \-\-help"
+Display help text and exit.
 .TP
-\fB\-h\fR, \fB\-\-help\fR
-Display help screen and exit.
+.BR \-V , " \-\-version"
+Output version information and exit.
 .PP
-The look utility exits 0 if one or more lines were found and displayed, 1 if
+The
+.B look
+utility exits 0 if one or more lines were found and displayed, 1 if
 no lines were found, and >1 if an error occurred.
 .SH EXAMPLE
+.RS
 .nf
 sort -d /etc/passwd -o /tmp/look.dict
 look -t: root:foobar /tmp/look.dict
 .nf
+.RE
 .SH FILES
 .IX Header "FILES"
 .IP "\fB/usr/share/dict/words\fR" 4
 the dictionary
 .IP "\fB/usr/share/dict/web2\fR" 4
-the alternate dictionary
+the alternative dictionary
 .SH "SEE ALSO"
 .BR grep (1),
 .BR sort (1)
 .SH COMPATIBILITY
 The original manual page stated that tabs and blank characters participated
-in comparisons when the alphanum option was specified. This was incorrect
+in comparisons when the alphanum option was specified.  This was incorrect,
 and the current man page matches the historic implementation.
 .SH HISTORY
 The
-look
+.B look
 utility appeared in Version 7 AT&T Unix.
 .SH AVAILABILITY
 The look command is part of the util-linux package and is available from
-- 
1.7.0.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-ionice-adjust-synopsis-and-wording-and-formatting-on.patch --]
[-- Type: text/x-patch; name="0005-ionice-adjust-synopsis-and-wording-and-formatting-on.patch", Size: 3506 bytes --]

From 4ba60add954baa3eb43772ea1df5b4462b19b519 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 26 Aug 2011 16:40:36 +0200
Subject: [PATCH 5/6] ionice: adjust synopsis and wording and formatting on the man page

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 schedutils/ionice.1 |   56 ++++++++++++++++++++++++++------------------------
 1 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/schedutils/ionice.1 b/schedutils/ionice.1
index acf6c92..163df1d 100644
--- a/schedutils/ionice.1
+++ b/schedutils/ionice.1
@@ -3,32 +3,33 @@
 ionice \- set or get process I/O scheduling class and priority
 .SH SYNOPSIS
 .B ionice
-[[ \fB\-c\fR
+.RB [ \-c
 .IR class ]
-.RB [ \fB-n\fR
+.RB [ \-n
 .IR level ]
-.RB [ \fB-t\fR ]]
-.BI \fB-p\fR
-PID
-.RI [ PID  ]...
+.RB [ \-t ]
+.B \-p
+.IR PID ...
 .br
 .B ionice
-.RB [ \fB-c\fR
+.RB [ \-c
 .IR class ]
-.RB [ \fB-n\fR
+.RB [ \-n
 .IR level ]
-.RB [ \fB-t\fR ]
-.IR COMMAND
-[ ARG ]...
+.RB [ \-t ]
+.IR "command " [ argument ...]
 .SH DESCRIPTION
 This program sets or gets the I/O scheduling class and priority for a program.
 If no arguments or just \fB\-p\fR is given, \fBionice\fR will query the current
 I/O scheduling class and priority for that process.
 
-If no class is given, then
-.I COMMAND
+When \fIcommand\fR is given,
+.B ionice
+will run this command with the given arguments.
+If no \fIclass\fR is specified, then
+.I command
 will be executed with the "best-effort" scheduling class.  The default
-priority argument is 4.
+priority level is 4.
 
 As of this writing, a process can be in one of three scheduling classes:
 .IP "\fBIdle\fP"
@@ -63,27 +64,28 @@ will receive on each scheduling window.  This scheduling class is not
 permitted for an ordinary (i.e., non-root) user.
 .SH OPTIONS
 .TP
-\fB\-c\fR, \fB\-\-class\fR \fICLASS\fR
-The scheduling class name or number; \fI0\fR for none, \fI1\fR for realtime, \fI2\fR for
-best-effort, \fI3\fR for idle.
+.BR \-c , " \-\-class " \fIclass\fR
+Specify the name or number of the scheduling class to use; \fI0\fR for none,
+\fI1\fR for realtime, \fI2\fR for best-effort, \fI3\fR for idle.
 .TP
-\fB\-n\fR, \fB\-\-classdata\fR \fINUM\fR
-The scheduling class data.  This defines the class data, if the class
-accepts an argument.  For realtime and best-effort, \fI0-7\fR is valid data.
+.BR \-n , " \-\-classdata " \fIlevel\fR
+Specify the scheduling class data.  This only has an effect if the class
+accepts an argument.  For realtime and best-effort, \fI0-7\fR are valid data
+(priority levels).
 .TP
-\fB\-p\fR, \fB\-\-pid\fR \fIPID\fR
-Pass in process PID(s) to view or change already running processes.  If this argument
-is not given, \fBionice\fP will run the listed program with the given parameters.
+.BR \-p , " \-\-pid " \fIPID\fR...
+Specify the process IDs of running processes for which to get or set the
+scheduling parameters.
 .TP
-\fB\-t\fR, \fB\-\-ignore\fR
-Ignore failure to set the requested priority.  If COMMAND or PID(s) is specified,
+.BR \-t , " \-\-ignore"
+Ignore failure to set the requested priority.  If \fIcommand\fR was specified,
 run it even in case it was not possible to set the desired scheduling priority,
 which can happen due to insufficient privileges or an old kernel version.
 .TP
-\fB\-h\fR, \fB\-\-help\fR
+.BR \-h , " \-\-help"
 Display help and exit.
 .TP
-\fB\-V\fR, \fB\-\-version\fR
+.BR \-V , " \-\-version"
 Display version information and exit.
 .SH EXAMPLES
 .LP
-- 
1.7.0.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: 0006-docs-tweak-the-formatting-and-wording-of-several-dis.patch --]
[-- Type: text/x-patch; name="0006-docs-tweak-the-formatting-and-wording-of-several-dis.patch", Size: 24713 bytes --]

From 3cd7c5408bfe3129056bbc60b0b1b59a1f25a022 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 28 Aug 2011 11:14:42 +0200
Subject: [PATCH 6/6] docs: tweak the formatting and wording of several disk-utils man pages

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
 disk-utils/elvtune.8    |   30 +++++++++++++------------
 disk-utils/fdformat.8   |    9 +++----
 disk-utils/fsck.minix.8 |   36 +++++++++++++++---------------
 disk-utils/isosize.8    |   14 ++++++------
 disk-utils/mkfs.8       |   22 ++++++++++--------
 disk-utils/mkfs.bfs.8   |   40 ++++++++++++++++++---------------
 disk-utils/mkfs.minix.8 |   12 +++++-----
 disk-utils/mkswap.8     |   55 +++++++++++++++++++++++++---------------------
 disk-utils/raw.8        |   20 +++++++---------
 disk-utils/swaplabel.8  |   35 +++++++++++++++--------------
 misc-utils/rename.1     |   12 +++++-----
 misc-utils/uuidgen.1    |   19 +++++++--------
 12 files changed, 157 insertions(+), 147 deletions(-)

diff --git a/disk-utils/elvtune.8 b/disk-utils/elvtune.8
index 6321ee1..f71b1d4 100644
--- a/disk-utils/elvtune.8
+++ b/disk-utils/elvtune.8
@@ -17,42 +17,44 @@ elvtune \- I/O elevator tuner
 .B elvtune \-v
 .SH DESCRIPTION
 .B elvtune
-allows to tune the I/O elevator per blockdevice queue basis. The
-tuning can be safely done at runtime. Tuning the elevator means
-being able to change disk performance and interactiveness. In the
-output of elvtune the address of the queue tuned will be shown
-and it can be considered as a queue ID.
-For example multiple partitions in the same harddisk will
+allows to tune the I/O elevator per blockdevice queue.  The
+tuning can be safely done at runtime.  Tuning the elevator means
+being able to change disk performance and interactiveness.
+In the output of
+.B elvtune
+the address of the queue tuned will be shown;
+it can be considered as a queue ID.
+Multiple partitions on the same harddisk will
 share the same queue and so tuning one partition will be
 like tuning the whole HD.
 .SH OPTIONS
 .TP
 .BI -r \ r_lat
-set the max latency that the I/O scheduler will provide on
+Set the maximum latency that the I/O scheduler will provide on
 each read.
 .TP
 .BI -w \ w_lat
-set the max latency that the I/O scheduler will provide on
+Set the maximum latency that the I/O scheduler will provide on
 each write.
 .TP
 .BI -b \ b_max
-max coalescing factor allowed on writes when there are reads
+Set the maximum coalescing factor allowed on writes when there are reads
 pending in the queue.
 .TP
 .BI -h
-help.
+Display help text and exit.
 .TP
 .BI -v
-version.
+Display version version information and exit.
 .SH NOTE
-Actually the only fields tunable are those relative
-to the IO scheduler. It's not possible to select
+Actually, the only fields tunable are those relative
+to the IO scheduler.  It's not possible to select
 a one-way or two-way elevator yet.
 .PP
 For logical blockdevices like LVM the tuning has to
 be done on the
 .I physical
-devices. Tuning the queue of the LVM logical device
+devices.  Tuning the queue of the LVM logical device
 is useless.
 .SH RETURN VALUE
 0 on success and 1 on failure.
diff --git a/disk-utils/fdformat.8 b/disk-utils/fdformat.8
index 67c5d03..d02241e 100644
--- a/disk-utils/fdformat.8
+++ b/disk-utils/fdformat.8
@@ -5,12 +5,12 @@
 fdformat \- low-level format a floppy disk
 .SH SYNOPSIS
 .B fdformat
-[\fIoptions\fR] \fIdevice\fR
+.RI [ options ] " device"
 .SH DESCRIPTION
 .B fdformat
-does a low level format on a floppy disk.
+does a low-level format on a floppy disk.
 .I device
-is usually one of the following (for floppy devices, the major = 2, and the
+is usually one of the following (for floppy devices the major = 2, and the
 minor is shown for informational purposes only):
 .sp
 .nf
@@ -46,8 +46,7 @@ to load the disk parameters.
 .SH OPTIONS
 .TP
 \fB\-n\fR, \fB\-\-no\-verify\fR
-No verify.  This option will disable the verification that is performed
-after the format.
+Skip the verification that is normally performed after the formatting.
 .TP
 \fB\-V\fR, \fB\-\-version\fR
 Output version information and exit.
diff --git a/disk-utils/fsck.minix.8 b/disk-utils/fsck.minix.8
index 8f25b0b..e84b82b 100644
--- a/disk-utils/fsck.minix.8
+++ b/disk-utils/fsck.minix.8
@@ -14,13 +14,13 @@ performs a consistency check for the Linux MINIX filesystem.  The current
 version supports the 14 character and 30 character filename options.
 
 The program
-assumes the file system is quiescent.
+assumes the filesystem is quiescent.
 .B fsck.minix
 should not be used on a mounted device unless you can be sure nobody is
 writing to it (and remember that the kernel can write to it when it
 searches for files).
 
-The device will usually have the following form:
+The \fIdevice\fR name will usually have the following form:
 .nf
 .RS
 /dev/hda[1-63] (IDE disk 1)
@@ -30,7 +30,7 @@ The device will usually have the following form:
 .RE
 .fi
 
-If the file system was changed (i.e., repaired), then
+If the filesystem was changed (i.e., repaired), then
 .B fsck.minix
 will print "FILE SYSTEM HAS CHANGED" and will
 .BR sync (2)
@@ -53,30 +53,30 @@ writing to the disk, and that no files are "zombies" waiting for deletion.
 .SH OPTIONS
 .TP
 .B \-l
-Lists all filenames
+List all filenames.
 .TP
 .B \-r
-Performs interactive repairs
+Perform interactive repairs.
 .TP
 .B \-a
-Performs automatic repairs (this option implies
-.BR \-r ),
-and serves to answer all of the questions asked with the default.  Note
-that this can be extremely dangerous in the case of extensive file system
+Perform automatic repairs.  (This option implies
+.B \-r
+and serves to answer all of the questions asked with the default.)  Note
+that this can be extremely dangerous in the case of extensive filesystem
 damage.
 .TP
 .B \-v
-Verbose
+Be verbose.
 .TP
 .B \-s
-Outputs super-block information
+Output super-block information.
 .TP
 .B \-m
-Activates MINIX-like "mode not cleared" warnings
+Activate MINIX-like "mode not cleared" warnings.
 .TP
 .B \-f
-Force file system check even if the file system was marked as valid (this
-marking is done by the kernel when the file system is unmounted).
+Force a filesystem check even if the filesystem was marked as valid (this
+marking is done by the kernel when the filesystem is unmounted).
 .SH "SEE ALSO"
 .BR fsck (8),
 .BR fsck.ext (8),
@@ -95,7 +95,7 @@ most commonly seen in normal usage.
 If the device does not exist,
 .B fsck.minix
 will print "unable to read super block".  If the device exists, but is not
-a MINIX file system,
+a MINIX filesystem,
 .B fsck.minix
 will print "bad magic number in super-block".
 .SH "EXIT CODES"
@@ -105,10 +105,10 @@ is the sum of the following:
 .IP 0
 No errors
 .IP 3
-File system errors corrected, system should be rebooted if file system was
+Filesystem errors corrected, system should be rebooted if filesystem was
 mounted
 .IP 4
-File system errors left uncorrected
+Filesystem errors left uncorrected
 .IP 8
 Operational error
 .IP 16
@@ -120,7 +120,7 @@ Linus Torvalds (torvalds@cs.helsinki.fi)
 .br
 Error code values by Rik Faith (faith@cs.unc.edu)
 .br
-Added support for file system valid flag: Dr. Wettstein
+Added support for filesystem valid flag: Dr. Wettstein
 (greg%wind.uucp@plains.nodak.edu)
 .br
 Check to prevent fsck of mounted filesystem added by Daniel Quinlan
diff --git a/disk-utils/isosize.8 b/disk-utils/isosize.8
index 678fd80..6cbc1ff 100644
--- a/disk-utils/isosize.8
+++ b/disk-utils/isosize.8
@@ -3,7 +3,7 @@
 isosize \- output the length of an iso9660 filesystem
 .SH SYNOPSIS
 .B isosize
-[\fIoptions\fR] \fIiso9660_image_file\fR
+.RI [ options ] " iso9660_image_file"
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
@@ -14,19 +14,19 @@ any switches (and errors) it will output the size of the iso9660
 filesystem in bytes.  This can now be a large number (>> 4 GB).
 .SH OPTIONS
 .TP
-\fB\-x\fR, \fB\-\-sectors\fR
+.BR \-x , " \-\-sectors"
 Show the block count and block size in human-readable form.
 The output uses the term "sectors" for "blocks".
 .TP
-\fB\-d\fR, \fB\-\-divisor\fR=\fINUM\fR
+.BR \-d , " \-\-divisor " \fInumber\fR
 Only has an effect when
 .B \-x
-is not given.  The number shown (if no errors)
+is not given.  The value shown (if no errors)
 is the iso9660 file size in bytes divided by
-.IR NUM .
+.IR number .
 So if
-.I NUM
-is the block size then the shown number will be the block count.
+.I number
+is the block size then the shown value will be the block count.
 .PP
 The size of the file (or block device) holding an iso9660
 filesystem can be marginally larger than the actual size of the
diff --git a/disk-utils/mkfs.8 b/disk-utils/mkfs.8
index 02d8b06..af9304b 100644
--- a/disk-utils/mkfs.8
+++ b/disk-utils/mkfs.8
@@ -5,7 +5,9 @@ mkfs \- build a Linux filesystem
 .SH SYNOPSIS
 .SH SYNOPSIS
 .B mkfs
-[\fIoptions\fR] [\fB-t\fR \fItype fs-options\fR] \fIdevice\fR [\fIsize\fR]
+.RI [ options ]
+.RB [ \-t
+.IR "type fs-options" ] " device " [ size ]
 .SH DESCRIPTION
 .B mkfs
 is used to build a Linux filesystem on a device, usually
@@ -28,7 +30,7 @@ is simply a front-end for the various filesystem builders
 (\fBmkfs.\fIfstype\fR)
 available under Linux.
 The filesystem-specific builder is searched for in a number
-of directories like perhaps
+of directories, like perhaps
 .IR /sbin ,
 .IR /sbin/fs ,
 .IR /sbin/fs.d ,
@@ -45,8 +47,8 @@ Please see the filesystem-specific builder manual pages for
 further details.
 .SH OPTIONS
 .TP
-\fB\-t\fR, \fB\-\-type\fR=\fITYPE\fR
-Specifies the type of filesystem to be built.
+.BR \-t , " \-\-type " \fItype\fR
+Specify the \fItype\fR of filesystem to be built.
 If not specified, the default filesystem type
 (currently ext2) is used.
 .TP
@@ -55,19 +57,19 @@ Filesystem-specific options to be passed to the real filesystem builder.
 Although not guaranteed, the following options are supported
 by most filesystem builders.
 .TP
-\fB\-V\fR, \fB\-\-verbose\fR
+.BR \-V , " \-\-verbose"
 Produce verbose output, including all filesystem-specific commands
 that are executed.
 Specifying this option more than once inhibits execution of any
 filesystem-specific commands.
 This is really only useful for testing.
 .TP
-\fB\-V\fR, \fB\-\-version\fR
-Display version information and exit.  Option \fB\-V\fR will display
+.BR \-V , " \-\-version"
+Display version information and exit.  (Option \fB\-V\fR will display
 version information only when it is the only parameter, otherwise it
-will work as \fB\-\-verbose\fR.
+will work as \fB\-\-verbose\fR.)
 .TP
-\fB\-h\fR, \fB\-\-help\fR
+.BR \-h , " \-\-help"
 Display help and exit.
 .SH BUGS
 All generic options must precede and not be combined with
@@ -77,7 +79,7 @@ Some filesystem-specific programs do not support the
 (verbose) option, nor return meaningful exit codes.
 Also, some filesystem-specific programs do not automatically
 detect the device size and require the
-.I blocks
+.I size
 parameter to be specified.
 .SH AUTHORS
 David Engel (david@ods.com)
diff --git a/disk-utils/mkfs.bfs.8 b/disk-utils/mkfs.bfs.8
index 466d640..c1794e5 100644
--- a/disk-utils/mkfs.bfs.8
+++ b/disk-utils/mkfs.bfs.8
@@ -5,44 +5,48 @@
 mkfs.bfs \- make an SCO bfs filesystem
 .SH SYNOPSIS
 .B mkfs.bfs
-[\fIoptions\fR] \fIdevice \fR[\fIblock-count\fR]
+.RI [ options ] " device " [ block-count ]
 .SH DESCRIPTION
 .B mkfs.bfs
-creates an SCO bfs file-system on a block device
+creates an SCO bfs filesystem on a block device
 (usually a disk partition or a file accessed via the loop device).
 .PP
 The
 .I block-count
-parameter is the desired size of the file system, in blocks.
+parameter is the desired size of the filesystem, in blocks.
 If nothing is specified, the entire partition will be used.
 .SH OPTIONS
 .TP
-\fB\-N\fR, \fB\-\-inodes\fR=\fINUM\fR
-Specify the desired number of inodes (at most 512).
-If nothing is specified some default number in the range 48-512 is picked
+.BR \-N , " \-\-inodes " \fInumber\fR
+Specify the desired \fInumber\fR of inodes (at most 512).
+If nothing is specified, some default number in the range 48-512 is picked
 depending on the size of the partition.
 .TP
-\fB\-V\fR, \fB\-\-vname\fR=\fINAME\fR
-Specify the volume label. I have no idea if/where this is used.
+.BR \-V , " \-\-vname " \fIlabel\fR
+Specify the volume \fIlabel\fR.  I have no idea if/where this is used.
 .TP
-\fB\-F\fR, \fB\-\-fname\fR=\fINAME\fR
-Specify the fsname. I have no idea if/where this is used.
+.BR \-F , " \-\-fname " \fIname\fR
+Specify the filesystem \fIname\fR.  I have no idea if/where this is used.
 .TP
-\fB\-v\fR, \fB\-\-verbose\fR
+.BR \-v , " \-\-verbose"
 Explain what is being done.
 .TP
-\fB\-c\fR
+.B \-c
 This option is silently ignored.
 .TP
-\fB\-l\fR
+.B \-l
 This option is silently ignored.
 .TP
-\fB\-V\fR, \fB\-\-version\fR
-Output version information and exit.
-\fB\-V\fR works only when specified as an only option.
+.BR \-h , " \-\-help"
+Display help text and exit.
 .TP
-\fB\-h\fR, \fB\-\-help\fR
-Display help and exit.
+.BR \-V , " \-\-version"
+Output version information and exit.
+Option
+.B \-V
+only works as
+.B \-\-version
+when it is the only option.
 .SH "EXIT CODES"
 The exit code returned by
 .B mkfs.bfs
diff --git a/disk-utils/mkfs.minix.8 b/disk-utils/mkfs.minix.8
index 4ee0e81..a65a711 100644
--- a/disk-utils/mkfs.minix.8
+++ b/disk-utils/mkfs.minix.8
@@ -16,7 +16,7 @@ mkfs.minix \- make a Minix filesystem
 .RI [ size-in-blocks ]
 .SH DESCRIPTION
 .B mkfs.minix
-creates a Linux MINIX file-system on a device (usually a disk partition).
+creates a Linux MINIX filesystem on a device (usually a disk partition).
 
 The
 .I device
@@ -41,28 +41,28 @@ Only block counts strictly greater than 10 and strictly less than
 .SH OPTIONS
 .TP
 .B \-c
-Check the device for bad blocks before creating the file system.  If any
+Check the device for bad blocks before creating the filesystem.  If any
 are found, the count is printed.
 .TP
 .BI \-n " namelength"
 Specify the maximum length of filenames.
 Currently, the only allowable values are 14 and 30.
-The default is 30. Note that kernels older than 0.99p7
+The default is 30.  Note that kernels older than 0.99p7
 only accept namelength 14.
 .TP
 .BI \-i " inodecount"
 Specify the number of inodes for the filesystem.
 .TP
 .BI \-l " filename"
-Read the bad blocks list from
+Read the list of bad blocks from
 .IR filename .
-The file has one bad block number per line.  The count of bad blocks read
+The file has one bad-block number per line.  The count of bad blocks read
 is printed.
 .TP
 .B \-1
 Make a Minix version 1 filesystem.
 .TP
-.B  \-2,\-v
+.BR \-2 , " \-v"
 Make a Minix version 2 filesystem.
 .TP
 .B \-3
diff --git a/disk-utils/mkswap.8 b/disk-utils/mkswap.8
index 59a93dc..c653171 100644
--- a/disk-utils/mkswap.8
+++ b/disk-utils/mkswap.8
@@ -8,9 +8,9 @@
 mkswap \- set up a Linux swap area
 .SH SYNOPSIS
 .B mkswap
-.RB [ options ]
-.IR device
-.RB [ size ]
+.RI [ options ]
+.I device
+.RI [ size ]
 .SH DESCRIPTION
 .B mkswap
 sets up a Linux swap area on a device or in a file.
@@ -47,54 +47,59 @@ The swap header does not touch the first block.  A boot loader or disk label
 can be there, but it is not a recommended setup.  The recommended setup is to
 use a separate partition for a Linux swap area.
 
-.B mkswap, like many others mkfs-like utils, erases the first block to remove
-.B old on-disk filesystems.
+.BR mkswap ,
+like many others mkfs-like utils,
+.B erases the first partition block to make any previous filesystem invisible.
 
+However,
 .B mkswap
 refuses to erase the first block on a device with a disk
-label (SUN, BSD, ...) or on a whole disk (e.g. /dev/sda).
+label (SUN, BSD, ...) and on a whole disk (e.g. /dev/sda).
 
 .SH OPTIONS
 .TP
 .BR \-c , " \-\-check"
 Check the device (if it is a block device) for bad blocks
 before creating the swap area.
-If any are found, the count is printed.
+If any bad blocks are found, the count is printed.
 .TP
 .BR \-f , " \-\-force"
-Force -- go ahead even if the command is stupid.
+Go ahead even if the command is stupid.
 This allows the creation of a swap area larger than the file
 or partition it resides on.
 
-Without this option,
+Also, without this option,
 .B mkswap
-will refuse to erase the first block on a device with a partition table or on
+will refuse to erase the first block on a device with a partition table and on
 a whole disk (e.g. /dev/sda).
 .TP
-.BR \-L , " \-\-label" \ device-label
-Specify a label, to allow
+.BR \-L , " \-\-label " \fIlabel\fR
+Specify a \fIlabel\fR for the device, to allow
 .B swapon
 by label.
 .TP
-.BR \-p , " \-\-pagesize" \ SIZE
-Specify the page size (in bytes) to use.  This option is usually unnecessary,
+.BR \-p , " \-\-pagesize " \fIsize\fR
+Specify the page \fIsize\fR (in bytes) to use.  This option is usually unnecessary;
 .B mkswap
 reads the size from the kernel.
 .TP
-.BR \-U , " \-\-uuid" \ UUID
-Specify the uuid to use.  The default is to generate a UUID.
+.BR \-U , " \-\-uuid " \fIUUID\fR
+Specify the \fIUUID\fR to use.  The default is to generate a UUID.
 .TP
-.BR \-v , " \-\-swapversion" \ 1
-Specify the swap-space version.  The old \-v 0 option has become obsolete
-and now only \-v 1 is supported.
-
-The kernel has not supported v0 swap-space format since 2.5.22 (Jun 2002).
-The new version v1 is supported since 2.1.117 (Aug 1998).
+.BR \-v , " \-\-swapversion 1"
+Specify the swap-space version.  (This option is currently pointless, as the old
+.B \-v 0
+option has become obsolete and now only
+.B \-v 1
+is supported.
+The kernel has not supported v0 swap-space format since 2.5.22 (June 2002).
+The new version v1 is supported since 2.1.117 (August 1998).)
 .TP
-.BR \-V , " \-\-version"
-Output version information and exit.
 .BR \-h , " \-\-help"
-Output help screen and exit.
+Display help text and exit.
+.TP
+.BR \-V , " \-\-version"
+Display version information and exit.
 
 .SH NOTES
 The maximum useful size of a swap area depends on the architecture and
diff --git a/disk-utils/raw.8 b/disk-utils/raw.8
index b85080a..0e47843 100644
--- a/disk-utils/raw.8
+++ b/disk-utils/raw.8
@@ -9,12 +9,10 @@ raw \- bind a Linux raw character device
 .B raw
 .I /dev/raw/raw<N> /dev/<blockdev>
 .PP
-.B raw
-.B \-q
+.B raw \-q
 .I /dev/raw/raw<N>
 .PP
-.B raw
-.B \-qa
+.B raw \-qa
 .SH DESCRIPTION
 .B raw
 is used to bind a Linux raw character device to a block device.  Any
@@ -38,7 +36,7 @@ to an existing block device file.
 .PP
 The bindings already in existence can be queried with the 
 .I \-q
-option, with is used either with a raw device filename to query that one
+option, which is used either with a raw device filename to query that one
 device, or with the 
 .I \-a
 option to query all bound raw devices.
@@ -70,16 +68,16 @@ will query an existing binding instead of setting a new one.
 .B -a
 With
 .B -q
-, specifies that all bound raw devices should be queried.
+, specify that all bound raw devices should be queried.
 .TP
 .B -h
-provides a usage summary.
+Provide a usage summary.
 .SH BUGS
 The Linux
-.B dd
-(1) command should be used without bs= option or the blocksize needs to be a
-multiple of the sector size of the device (512 bytes usually) otherwise it
-will fail with "Invalid Argument" messages (EINVAL).
+.BR dd (1)
+command should be used without the \fBbs=\fR option, or the blocksize
+needs to be a multiple of the sector size of the device (512 bytes usually),
+otherwise it will fail with "Invalid Argument" messages (EINVAL).
 
 .PP
 Raw I/O devices do not maintain cache coherency with the Linux block
diff --git a/disk-utils/swaplabel.8 b/disk-utils/swaplabel.8
index 327a65f..0d47456 100644
--- a/disk-utils/swaplabel.8
+++ b/disk-utils/swaplabel.8
@@ -22,35 +22,36 @@ If the optional arguments
 .B \-L 
 and
 .B \-U 
-are not present,
+are not given,
 .B swaplabel
-will simply display the swap area label and UUID of
+will simply display the current swap-area label and UUID of
 .IR device .
 .PP
 If an optional argument is present, then
 .B swaplabel
-will change the appropriate value of
+will change the appropriate value on
 .IR device .
 These values can also be set during swap creation using
 .BR mkswap (8).
 The
 .B swaplabel
-utility allows to change the label or UUID on actively used swap device.
+utility allows to change the label or UUID on an actively used swap device.
 .SH OPTIONS
-.IP "\fB\-h, \-\-help\fP"
-Print help and exit.
-.IP "\fB\-L, \-\-label\fP \fIlabel\fP"
-Specify a new label for
-.IR device .
+.TP
+.BR \-h , " \-\-help"
+Display help text and exit.
+.TP
+.BR \-L , " \-\-label " \fIlabel\fR
+Specify a new \fIlabel\fR for the device.
 Swap partition labels can be at most 16 characters long.  If
-.IR label
+.I label
 is longer than 16 characters,
-.B swapinfo
+.B swaplabel
 will truncate it and print a warning message.
-.IP "\fB\-U, \-\-uuid\fP \fIuuid\fP"
-Specify a new UUID for
-.IR device .
-.IR UUID
+.TP
+.BR \-U , " \-\-uuid " \fIUUID\fR
+Specify a new \fIUUID\fR for the device.
+The \fI UUID\fR
 must be in the standard 8-4-4-4-12 character format, such as is output by
 .BR uuidgen (1) .
 .PP
@@ -58,8 +59,8 @@ must be in the standard 8-4-4-4-12 character format, such as is output by
 .B swaplabel
 was written by Jason Borden <jborden@bluehost.com> and Karel Zak <kzak@redhat.com>.
 .SH AVAILABILITY
-.B swaplabel
-is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
+The swaplabel command is part of the util-linux package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
 .SH SEE ALSO
 .BR mkswap (8),
 .BR swapon (8),
diff --git a/misc-utils/rename.1 b/misc-utils/rename.1
index 0cfe381..5f86b23 100644
--- a/misc-utils/rename.1
+++ b/misc-utils/rename.1
@@ -6,7 +6,7 @@
 rename \- rename files
 .SH SYNOPSIS
 .B rename
-[\fIoptions\fR] \fIexpression replacement file\fR...
+.RI [ options ] " expression replacement file" ...
 .SH DESCRIPTION
 .B rename
 will rename the specified files by replacing the first occurrence of
@@ -22,7 +22,7 @@ Give visual feedback which files where renamed, if any.
 Display version information and exit.
 .TP
 \fB\-h\fR, \fB\-\-help\fR
-Display help screen and exit.
+Display help text and exit.
 .SH EXAMPLES
 Given the files
 .IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278 ,
@@ -47,10 +47,10 @@ rename .htm .html *.htm
 .RE
 will fix the extension of your html files.
 .SH WARNING
-The rename has no safeguards. If user has permission to rewrite file names
-the command will perform the action without any questions. For example
-result can be quite drastic when the command is ran as root in /lib
-directory. Make always a backup before running the command, unless you truly
+The renaming has no safeguards.  If the user has permission to rewrite file names,
+the command will perform the action without any questions.  For example, the
+result can be quite drastic when the command is run as root in the /lib
+directory.  Always make a backup before running the command, unless you truly
 know what you are doing.
 .SH "SEE ALSO"
 .BR mmv (1),
diff --git a/misc-utils/uuidgen.1 b/misc-utils/uuidgen.1
index 6349b3a..ad409b9 100644
--- a/misc-utils/uuidgen.1
+++ b/misc-utils/uuidgen.1
@@ -24,12 +24,11 @@ and in the future.
 .PP
 There are two types of UUIDs which
 .B uuidgen
-can generate: time-based UUIDs and random-based UUIDs.  By
-default
+can generate: time-based UUIDs and random-based UUIDs.  By default
 .B uuidgen
 will generate a random-based UUID if a high-quality random number
-generator is present.  Otherwise, it will chose a time-based UUID.  It
-is possible to force the generation of one of these two
+generator is present.  Otherwise, it will choose a time-based UUID.
+It is possible to force the generation of one of these two
 UUID types by using the
 .B \-r
 or
@@ -37,21 +36,21 @@ or
 options.
 .SH OPTIONS
 .TP
-\fB\-r\fR, \fB\-\-random\fR
+.BR \-r , " \-\-random"
 Generate a random-based UUID.  This method creates a UUID consisting mostly
 of random bits.  It requires that the operating system have a high
 quality random number generator, such as
 .IR /dev/random .
 .TP
-\fB\-t\fR, \fB\-\-time\fR
+.BR \-t , " \-\-time"
 Generate a time-based UUID.  This method creates a UUID based on the system
 clock plus the system's ethernet hardware address, if present.
 .TP
-\fB\-V\fR, \fB\-\-version\fR
-Output version information and exit.
+.BR \-h , " \-\-help"
+Display help text and exit.
 .TP
-\fB\-h\fR, \fB\-\-help\fR
-Output help screen and exit.
+.BR \-V , " \-\-version"
+Display version information and exit.
 .SH "CONFORMING TO"
 OSF DCE 1.1
 .SH AUTHOR
-- 
1.7.0.4


^ permalink raw reply related

* Re: example in flock manpage still not useful.
From: Karel Zak @ 2011-08-29  9:18 UTC (permalink / raw)
  To: Pierre Gaston; +Cc: util-linux
In-Reply-To: <CAPSX3sTRT7zOZALF2CHUdgRuz3Gz4PyXtxmDB6nhVa7VwK7RDQ@mail.gmail.com>

On Thu, Aug 25, 2011 at 03:26:14PM +0300, Pierre Gaston wrote:
> flock -n 9 || exit 1                 # exit if the lock can't be acquire.

 Fixed. Thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox