- use ncurses only

- fix #218915 - fdisk -b 4K
- upgrade to -pre7 release
- fix building problem with raw0 patch
- fix #217186 - /bin/sh: @MKINSTALLDIRS@: No such file or directory (port
    po/Makefile.in.in from gettext-0.16)
- sync with FC6 and RHEL5:
- fix #216489 - SCHED_BATCH option missing in chrt
- fix #216712 - issues with raw device support ("raw0" is wrong device
    name)
- fix #216760 - mount with context or fscontext option fails (temporarily
    disabled the support for additional contexts -- not supported by kernel
    yet)
- fix #211827 - Can't mount with additional contexts
- fix #213127 - mount --make-unbindable does not work
- fix #211749 - add -r option to losetup to create a read-only loop
- Resolves: rhbz#218915 rhbz#217186 rhbz#216489 rhbz#216712 rhbz#216760
    rhbz#211827 rhbz#213127 rhbz#211749
This commit is contained in:
kzak 2006-12-14 12:42:01 +00:00
parent 04e2fdeac1
commit 894b42f522
13 changed files with 514 additions and 71 deletions

View File

@ -1,2 +1,2 @@
floppy-0.12.tar.gz
util-linux-2.13-pre6.tar.bz2
util-linux-2.13-pre7.tar.bz2

View File

@ -1,2 +1,2 @@
7d3ac81855e26687dada6a31d2677875 floppy-0.12.tar.gz
1db1249029439e5e965c2c7178149616 util-linux-2.13-pre6.tar.bz2
13cdf4b76533e8421dc49de188f85291 util-linux-2.13-pre7.tar.bz2

View File

@ -1,16 +1,5 @@
--- util-linux-2.12a/mount/mount.8.cifs 2005-11-23 16:34:34.000000000 +0100
+++ util-linux-2.12a/mount/mount.8 2005-11-23 16:38:37.000000000 +0100
@@ -413,8 +413,8 @@
program has to do is issue a simple
.IR mount (2)
system call, and no detailed knowledge of the filesystem type is required.
-For a few types however (like nfs, nfs4, smbfs, ncpfs) ad hoc code is
-necessary. The nfs ad hoc code is built in, but smbfs and ncpfs
+For a few types however (like nfs, nfs4, smbfs, ncpfs, cifs) ad hoc code is
+necessary. The nfs ad hoc code is built in, but smbfs, ncpfs and cifs
have a separate mount program. In order to make it possible to
treat all types in a uniform way, mount will execute the program
.I /sbin/mount.TYPE
@@ -720,6 +720,16 @@
(However, quota utilities may react to such strings in
.IR /etc/fstab .)

View File

@ -0,0 +1,15 @@
The "-b" option allows to manually define size of sector size. We need to support
4096 bytes for really huge disks. [kzak 12/14/2006]
--- util-linux-2.13-pre7/fdisk/fdisk.c.kzak 2006-12-14 10:21:57.000000000 +0100
+++ util-linux-2.13-pre7/fdisk/fdisk.c 2006-12-14 10:22:21.000000000 +0100
@@ -2491,7 +2491,7 @@
*/
sector_size = atoi(optarg);
if (sector_size != 512 && sector_size != 1024 &&
- sector_size != 2048)
+ sector_size != 2048 && sector_size != 4096)
fatal(usage);
sector_offset = 2;
user_set_sector_size = 1;

View File

@ -0,0 +1,47 @@
--- util-linux-2.13-pre6/mount/lomount.c.ronly 2006-11-01 14:14:14.000000000 +0100
+++ util-linux-2.13-pre6/mount/lomount.c 2006-11-01 15:01:52.000000000 +0100
@@ -444,7 +444,8 @@
" %1$s -d loop_device # delete\n"
" %1$s -f # find unused\n"
" %1$s -a # list all used\n"
- " %1$s [-e encryption] [-o offset] {-f|loop_device} file # setup\n"),
+ " %1$s -r # read-only loop\n"
+ " %1$s [-e encryption] [-o offset] [-r] {-f|loop_device} file # setup\n"),
progname);
exit(1);
}
@@ -497,11 +498,14 @@
if ((p = strrchr(progname, '/')) != NULL)
progname = p+1;
- while ((c = getopt(argc, argv, "ade:E:fo:p:v")) != -1) {
+ while ((c = getopt(argc, argv, "ade:E:fo:p:vr")) != -1) {
switch (c) {
case 'a':
all = 1;
break;
+ case 'r':
+ ro = 1;
+ break;
case 'd':
delete = 1;
break;
--- util-linux-2.13-pre6/mount/losetup.8.ronly 2006-11-01 14:49:14.000000000 +0100
+++ util-linux-2.13-pre6/mount/losetup.8 2006-11-01 15:06:21.000000000 +0100
@@ -35,6 +35,7 @@
.IR offset ]
.RB [ \-p
.IR pfd ]
+.RB [ \-r ]
.in +8
.RB { \-f | \fIloop_device\fP }
.I file
@@ -87,6 +88,8 @@
Read the passphrase from file descriptor with number
.I num
instead of from the terminal.
+.IP \fB\-r\fP
+Setup read-only loop device.
.SH RETURN VALUE
.B losetup
returns 0 on success, nonzero on failure. When

View File

@ -0,0 +1,122 @@
--- util-linux-2.13-pre6/po/Makefile.in.in.mkdir_p 2005-10-14 22:22:14.000000000 +0200
+++ util-linux-2.13-pre6/po/Makefile.in.in 2006-10-24 22:48:30.000000000 +0200
@@ -1,5 +1,5 @@
# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU General Public
@@ -8,7 +8,7 @@
# Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain.
#
-# Origin: gettext-0.14.4
+# Origin: gettext-0.16
PACKAGE = @PACKAGE@
VERSION = @VERSION@
@@ -23,18 +23,38 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
-datadir = $(prefix)/usr/share
-localedir = $(datadir)/locale
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
gettextsrcdir = $(datadir)/gettext/po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
MSGMERGE = msgmerge
MSGMERGE_UPDATE = @MSGMERGE@ --update
MSGINIT = msginit
@@ -158,7 +178,7 @@
install-exec:
install-data: install-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext-tools"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
for file in $(DISTFILES.common) Makevars.template; do \
$(INSTALL_DATA) $(srcdir)/$$file \
$(DESTDIR)$(gettextsrcdir)/$$file; \
@@ -171,13 +191,13 @@
fi
install-data-no: all
install-data-yes: all
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
@@ -217,19 +237,19 @@
installdirs-exec:
installdirs-data: installdirs-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext-tools"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
else \
: ; \
fi
installdirs-data-no:
installdirs-data-yes:
- $(mkinstalldirs) $(DESTDIR)$(datadir)
+ $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
if test -n "$$lc"; then \
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
@@ -374,8 +394,7 @@
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
force:

View File

@ -0,0 +1,14 @@
The original MS_COMMENT is in conflict with MS_UNBINDABLE.
--- util-linux-2.13-pre6/mount/mount.c.comment 2006-11-01 13:31:45.000000000 +0100
+++ util-linux-2.13-pre6/mount/mount.c 2006-11-01 13:31:38.000000000 +0100
@@ -106,7 +106,7 @@
#define MS_OWNER 0x10000000
#define MS_GROUP 0x08000000
#define MS_PAMCONSOLE 0x04000000
-#define MS_COMMENT 0x00020000
+#define MS_COMMENT 0x02000000
#define MS_LOOP 0x00010000

View File

@ -1,10 +1,17 @@
This patch adds to the mount man page docs about context, fscontext and
defcontext mount options and translate context options from human to raw
selinux context format. -- 03/30/2006 Karel Zak <kzak@redhat.com>
--- util-linux-2.13-pre6/mount/mount.c.kzak 2006-08-21 11:51:50.000000000 +0200
+++ util-linux-2.13-pre6/mount/mount.c 2006-08-21 11:51:50.000000000 +0200
--- util-linux-2.13-pre6/mount/Makefile.am.context 2005-09-12 22:41:11.000000000 +0200
+++ util-linux-2.13-pre6/mount/Makefile.am 2006-11-01 11:31:46.000000000 +0100
@@ -37,6 +37,9 @@
man_MANS += pivot_root.8
endif
+if HAVE_SELINUX
+mount_LDADD += -lselinux
+endif
swapon.c: swapargs.h
--- util-linux-2.13-pre6/mount/mount.c.context 2006-11-01 11:31:46.000000000 +0100
+++ util-linux-2.13-pre6/mount/mount.c 2006-11-01 11:36:17.000000000 +0100
@@ -21,6 +21,11 @@
#include <sys/wait.h>
#include <sys/mount.h>
@ -17,20 +24,40 @@
#include "mount_blkid.h"
#include "mount_constants.h"
#include "sundries.h"
@@ -255,6 +260,49 @@
@@ -255,13 +260,79 @@
free((void *) s);
}
+#ifdef HAVE_LIBSELINUX
+/* strip quotes from a "string"
+ * Warning: This function modify the "str" argument.
+ */
+static char *
+strip_quotes(char *str)
+{
+ char *end = NULL;
+
+ if (*str != '"')
+ return str;
+
+ end = strrchr(str, '"');
+ if (end == NULL || end == str)
+ die (EX_USAGE, _("mount: improperly quoted option string '%s'"), str);
+
+ *end = '\0';
+ return str+1;
+}
+
+/* translates SELinux context from human to raw format and
+ * appends it to the mount extra options.
+ *
+ * returns -1 on error and 0 on success
+ */
+static int
+append_context(const char *optname, const char *optdata, char *extra_opts, int *len)
+append_context(const char *optname, char *optdata, char *extra_opts, int *len)
+{
+ security_context_t raw = NULL;
+ char *data = NULL;
+ char *buf = NULL;
+ int bufsz;
+
@ -41,19 +68,22 @@
+ if (optdata==NULL || *optdata=='\0' || optname==NULL)
+ return -1;
+
+ /* TODO: use strip_quotes() for all mount options? */
+ data = *optdata =='"' ? strip_quotes(optdata) : optdata;
+
+ if (selinux_trans_to_raw_context(
+ (security_context_t) optdata, &raw)==-1 ||
+ raw==NULL)
+ (security_context_t) data, &raw)==-1 ||
+ raw==NULL)
+ return -1;
+
+ if (verbose)
+ printf(_("mount: translated %s '%s' to '%s'\n"),
+ optname, optdata, (char *) raw);
+
+ bufsz = strlen(optname) + strlen(raw) + 2; /* 2 is \0 and '=' */
+ optname, data, (char *) raw);
+ // TODO 2.6.19: context options with commans are unsupported by kernel now ;-(
+ bufsz = strlen(optname) + strlen(raw) + 2; // bufsz = strlen(optname) + strlen(raw) + 4; /* 4 is \0, '=' and 2x '"' */
+ buf = xmalloc(bufsz);
+
+ snprintf(buf, bufsz, "%s=%s", optname, (char *) raw);
+ snprintf(buf, bufsz, "%s=%s", optname, (char *) raw); // snprintf(buf, bufsz, "%s=\"%s\"", optname, (char *) raw);
+ freecon(raw);
+
+ if ((*len -= bufsz-1) > 0)
@ -67,7 +97,15 @@
/*
* Look for OPT in opt_map table and return mask value.
* If OPT isn't found, tack it onto extra_opts (which is non-NULL).
@@ -313,7 +361,20 @@
* For the options uid= and gid= replace user or group name by its value.
*/
static inline void
-parse_opt(const char *opt, int *mask, char *extra_opts, int len) {
+parse_opt(char *opt, int *mask, char *extra_opts, int len) {
const struct opt_map *om;
for (om = opt_map; om->opt != NULL; om++)
@@ -313,7 +384,20 @@
return;
}
}
@ -89,17 +127,44 @@
if ((len -= strlen(opt)) > 0)
strcat(extra_opts, opt);
}
@@ -330,7 +391,7 @@
@@ -329,16 +413,29 @@
if (options != NULL) {
char *opts = xstrdup(options);
char *opt;
- char *opt;
- int len = strlen(opts) + 20;
+ int len = strlen(opts) + 256;
+ int open_quote = 0;
+ char *opt, *p;
*extra_opts = xmalloc(len);
**extra_opts = '\0';
--- util-linux-2.13-pre6/mount/mount.8.kzak 2006-08-21 11:51:50.000000000 +0200
+++ util-linux-2.13-pre6/mount/mount.8 2006-08-21 11:51:50.000000000 +0200
- for (opt = strtok(opts, ","); opt; opt = strtok(NULL, ","))
- if (!parse_string_opt(opt))
- parse_opt(opt, flags, *extra_opts, len);
-
+ for (p=opts, opt=NULL; p && *p; p++) {
+ if (!opt)
+ opt = p; /* begin of the option item */
+ if (*p == '"')
+ open_quote ^= 1; /* reverse the status */
+ if (open_quote)
+ continue; /* still in quoted block */
+ if (*p == ',')
+ *p = '\0'; /* terminate the option item */
+ /* end of option item or last item */
+ if (*p == '\0' || *(p+1) == '\0') {
+ if (!parse_string_opt(opt))
+ parse_opt(opt, flags, *extra_opts, len);
+ opt = NULL;
+ }
+ }
free(opts);
}
--- util-linux-2.13-pre6/mount/mount.8.context 2006-11-01 11:31:46.000000000 +0100
+++ util-linux-2.13-pre6/mount/mount.8 2006-11-01 11:31:46.000000000 +0100
@@ -660,6 +660,50 @@
.BR noexec ", " nosuid ", and " nodev
(unless overridden by subsequent options, as in the option line
@ -151,15 +216,3 @@
.RE
.TP
.B \-\-bind
--- util-linux-2.13-pre6/mount/Makefile.am.kzak 2006-08-21 12:13:10.000000000 +0200
+++ util-linux-2.13-pre6/mount/Makefile.am 2006-08-21 12:13:03.000000000 +0200
@@ -37,6 +37,9 @@
man_MANS += pivot_root.8
endif
+if HAVE_SELINUX
+mount_LDADD += -lselinux
+endif
swapon.c: swapargs.h

View File

@ -1,6 +1,6 @@
--- util-linux-2.13-pre2/mount/mount.8.nfsv4 2005-08-02 19:34:16.000000000 +0200
+++ util-linux-2.13-pre2/mount/mount.8 2005-08-17 10:44:06.000000000 +0200
@@ -384,6 +384,7 @@
--- util-linux-2.13-pre7/mount/mount.8.man-nfs4 2006-03-06 00:04:37.000000000 +0100
+++ util-linux-2.13-pre7/mount/mount.8 2006-12-14 00:30:33.000000000 +0100
@@ -385,6 +385,7 @@
.IR msdos ,
.IR ncpfs ,
.IR nfs ,
@ -8,16 +8,16 @@
.IR ntfs ,
.IR proc ,
.IR qnx4 ,
@@ -421,7 +422,7 @@
@@ -422,7 +423,7 @@
program has to do is issue a simple
.IR mount (2)
system call, and no detailed knowledge of the filesystem type is required.
-For a few types however (like nfs, smbfs, ncpfs) ad hoc code is
+For a few types however (like nfs, nfs4, smbfs, ncpfs) ad hoc code is
necessary. The nfs ad hoc code is built in, but smbfs and ncpfs
-For a few types however (like nfs, cifs, smbfs, ncpfs) ad hoc code is
+For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) ad hoc code is
necessary. The nfs ad hoc code is built in, but cifs, smbfs, and ncpfs
have a separate mount program. In order to make it possible to
treat all types in a uniform way, mount will execute the program
@@ -449,9 +450,10 @@
@@ -450,9 +451,10 @@
All of the filesystem types listed there will be tried,
except for those that are labeled "nodev" (e.g.,
.IR devpts ,
@ -30,7 +30,7 @@
If
.I /etc/filesystems
ends in a line with a single * only, mount will read
@@ -1373,6 +1375,73 @@
@@ -1368,6 +1370,73 @@
.B nolock
Do not use locking. Do not start lockd.

View File

@ -0,0 +1,45 @@
--- util-linux-2.13-pre6/disk-utils/raw.c.kzak 2006-11-21 21:56:40.000000000 +0100
+++ util-linux-2.13-pre6/disk-utils/raw.c 2006-11-21 22:35:11.000000000 +0100
@@ -66,6 +66,7 @@
int err;
int block_major, block_minor;
int i;
+ int rc;
struct stat statbuf;
@@ -108,19 +109,23 @@
usage(1);
raw_name = argv[optind++];
+ rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
+ if (rc != 1) {
+ fprintf (stderr,
+ "Unsupported raw device name '%s' (format is " RAWDEVDIR "rawN))\n",
+ raw_name);
+ exit(2);
+ }
+ if (raw_minor == 0) {
+ fprintf (stderr,
+ "Unsupported raw device name '%s' (minor number cannot be zero)\n",
+ raw_name);
+ exit(2);
+ }
+
err = stat(raw_name, &statbuf);
- if (err) {
- int rc;
-
- rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
- if (rc != 1) {
- fprintf (stderr,
- "Cannot locate raw device '%s' (%s)\n",
- raw_name, strerror(errno));
- exit(2);
- }
+ if (err)
goto skip_test_rawdev;
- }
if (!S_ISCHR(statbuf.st_mode)) {
fprintf (stderr, "raw device '%s' is not a character dev\n",

View File

@ -0,0 +1,102 @@
--- util-linux-2.13-pre6/schedutils/chrt.1.batch 2006-11-10 13:23:37.000000000 -0500
+++ util-linux-2.13-pre6/schedutils/chrt.1 2006-11-10 13:27:23.000000000 -0500
@@ -36,10 +36,11 @@
.BR chrt (1)
sets or retrieves the real-time scheduling attributes of an existing PID or
runs COMMAND with the given attributes. Both policy (one of
+.BR SCHED_OTHER ,
.BR SCHED_FIFO ,
.BR SCHED_RR ,
or
-.BR SCHED_OTHER )
+.BR SCHED_BATCH )
and priority can be set and retrieved.
.SH OPTIONS
.TP
@@ -48,6 +49,10 @@
.TP
.TP
+.B -b, --batch
+set scheduling policy to
+.BR SCHED_BATCH
+.TP
.B -f, --fifo
set scheduling policy to
.BR SCHED_FIFO
--- util-linux-2.13-pre6/schedutils/chrt.c.batch 2005-08-14 11:18:54.000000000 -0400
+++ util-linux-2.13-pre6/schedutils/chrt.c 2006-11-10 13:27:52.000000000 -0500
@@ -36,6 +36,8 @@
fprintf(stderr, "usage: %s [options] [prio] [pid | cmd [args...]]\n",
cmd);
fprintf(stderr, "manipulate real-time attributes of a process\n");
+ fprintf(stderr, " -b, --batch "
+ "set policy to SCHED_BATCH\n");
fprintf(stderr, " -f, --fifo "
"set policy to SCHED_FF\n");
fprintf(stderr, " -p, --pid "
@@ -83,6 +85,9 @@
case SCHED_RR:
printf("SCHED_RR\n");
break;
+ case SCHED_BATCH:
+ printf("SCHED_BATCH\n");
+ break;
default:
printf("unknown\n");
}
@@ -101,6 +106,13 @@
{
int max, min;
+ max = sched_get_priority_max(SCHED_OTHER);
+ min = sched_get_priority_min(SCHED_OTHER);
+ if (max >= 0 && min >= 0)
+ printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
+ else
+ printf("SCHED_OTHER not supported?\n");
+
max = sched_get_priority_max(SCHED_FIFO);
min = sched_get_priority_min(SCHED_FIFO);
if (max >= 0 && min >= 0)
@@ -115,12 +127,12 @@
else
printf("SCHED_RR not supported?\n");
- max = sched_get_priority_max(SCHED_OTHER);
- min = sched_get_priority_min(SCHED_OTHER);
+ max = sched_get_priority_max(SCHED_BATCH);
+ min = sched_get_priority_min(SCHED_BATCH);
if (max >= 0 && min >= 0)
- printf("SCHED_OTHER min/max priority\t: %d/%d\n", min, max);
+ printf("SCHED_BATCH min/max priority\t: %d/%d\n", min, max);
else
- printf("SCHED_OTHER not supported?\n");
+ printf("SCHED_BATCH not supported?\n");
}
int main(int argc, char *argv[])
@@ -130,6 +142,7 @@
pid_t pid = 0;
struct option longopts[] = {
+ { "batch", 0, NULL, 'b' },
{ "fifo", 0, NULL, 'f' },
{ "pid", 0, NULL, 'p' },
{ "help", 0, NULL, 'h' },
@@ -141,11 +154,14 @@
{ NULL, 0, NULL, 0 }
};
- while((i = getopt_long(argc, argv, "+fphmorvV", longopts, NULL)) != -1)
+ while((i = getopt_long(argc, argv, "+bfphmorvV", longopts, NULL)) != -1)
{
int ret = 1;
switch (i) {
+ case 'b':
+ policy = SCHED_BATCH;
+ break;
case 'f':
policy = SCHED_FIFO;
break;

11
util-linux-60-raw.rules Normal file
View File

@ -0,0 +1,11 @@
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
#
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.

View File

@ -9,7 +9,7 @@
Summary: A collection of basic system utilities.
Name: util-linux
Version: 2.13
Release: 0.44%{?dist}
Release: 0.45%{?dist}
License: distributable
Group: System Environment/Base
@ -36,7 +36,8 @@ BuildRequires: automake
BuildRequires: e2fsprogs-devel >= 1.36
BuildRequires: gettext-devel
BuildRequires: libselinux-devel
BuildRequires: libtermcap-devel
# ncurses is the right way now [kzak, 12/14/2006]
#BuildRequires: libtermcap-devel
BuildRequires: ncurses-devel
BuildRequires: pam-devel
BuildRequires: sed
@ -45,11 +46,12 @@ BuildRequires: texinfo
BuildRequires: zlib-devel
### Sources
# TODO [stable]: s/2.13-pre6/%{version}/
Source0: ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/util-linux-2.13-pre6.tar.bz2
# TODO [stable]: s/2.13-pre7/%{version}/
Source0: ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/util-linux-2.13-pre7.tar.bz2
Source1: util-linux-login.pamd
Source2: util-linux-remote.pamd
Source3: util-linux-chsh-chfn.pamd
Source4: util-linux-60-raw.rules
Source8: nologin.c
Source9: nologin.8
Source11: http://download.sourceforge.net/floppyutil/floppy-%{floppyver}.tar.gz
@ -68,6 +70,9 @@ Conflicts: kernel < 2.2.12-7,
Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info
Requires(post): coreutils
%if %{include_raw}
Requires: udev
%endif
Provides: mount = %{version}
Provides: losetup = %{version}
@ -182,6 +187,7 @@ Patch233: util-linux-2.13-mount-uuid.patch
Patch234: util-linux-2.13-cal-wide.patch
# 186915 - mount does not translate SELIinux context options though libselinux
# 185500 - Need man page entry for -o context= mount option
# 211827 - Can't mount with additional contexts
Patch235: util-linux-2.13-mount-context.patch
# 152579 - missing info about /etc/mtab and /proc/mounts mismatch
# 183890 - missing info about possible ioctl() and fcntl() problems on NFS filesystem
@ -217,6 +223,18 @@ Patch251: util-linux-2.13-mount-nonfs.patch
Patch252: util-linux-2.13-losetup-deprecated.patch
# 208634 - mkswap "works" without warning on a mounted device
Patch253: util-linux-2.13-mkswap-mounted.patch
# 213127 - mount --make-unbindable does not work
Patch254: util-linux-2.13-mount-comment.patch
# 211749 - add -r option to losetup to create a read-only loop
Patch255: util-linux-2.13-losetup-rdonly.patch
# 216489 - SCHED_BATCH option missing in chrt
Patch256: util-linux-2.13-schedutils-SCHED_BATCH.patch
# 216712 - issues with raw device support ("raw0" is wrong device name)
Patch257: util-linux-2.13-raw-raw0.patch
# 217186 - /bin/sh: @MKINSTALLDIRS@: No such file or directory
Patch258: util-linux-2.13-mkdir_p.patch
# 218915 - fdisk -b 4K
Patch259: util-linux-2.13-fdisk-b-4096.patch
# When adding patches, please make sure that it is easy to find out what bug # the
# patch fixes.
@ -230,18 +248,19 @@ program.
%prep
# TODO [stable]: remove -n
%setup -q -a 11 -n util-linux-2.13-pre6
%setup -q -a 11 -n util-linux-2.13-pre7
# ncurses vs. termcap for the more command
#%patch1 -p1
%patch1 -p1
%patch70 -p1
# nologin
cp %{SOURCE8} %{SOURCE9} .
%patch100 -p1
%patch106 -p1
%patch107 -p1
%if %{include_raw}
%patch109 -p1
%endif
%patch113 -p1
%patch120 -p1
%patch126 -p1
@ -254,11 +273,8 @@ cp %{SOURCE8} %{SOURCE9} .
%patch153 -p1
%patch157 -p1
%patch159 -p1
%if %{include_raw}
%patch160 -p1
%endif
%patch164 -p1
%patch170 -p1
%patch180 -p1
%patch181 -p1
@ -310,7 +326,13 @@ cp %{SOURCE8} %{SOURCE9} .
%patch250 -p1
%patch251 -p1
%patch252 -p1
%patch253 -p1 -b .kzak
%patch253 -p1
%patch254 -p1
%patch255 -p1
%patch256 -p1
%patch257 -p1
%patch258 -p1
%patch259 -p1
%build
unset LINGUAS || :
@ -392,6 +414,13 @@ install -m 644 nologin.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
%if %{include_raw}
echo '.so man8/raw.8' > $RPM_BUILD_ROOT%{_mandir}/man8/rawdevices.8
{
# see RH bugzilla #216664
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
pushd ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d
install -m 644 %{SOURCE4} ./60-raw.rules
popd
}
%endif
# Correct mail spool path.
@ -489,7 +518,7 @@ for I in addpart delpart partx; do
done
# /usr/bin -> /bin
for I in taskset; do
for I in taskset raw; do
if [ -e $RPM_BUILD_ROOT/usr/bin/$I ]; then
mv $RPM_BUILD_ROOT/usr/bin/$I $RPM_BUILD_ROOT/bin/$I
fi
@ -539,6 +568,10 @@ exit 0
/bin/more
/bin/kill
/bin/taskset
%if %{include_raw}
/bin/raw
%config %{_sysconfdir}/udev/rules.d/60-raw.rules
%endif
%config %{_sysconfdir}/pam.d/chfn
%config %{_sysconfdir}/pam.d/chsh
@ -607,10 +640,6 @@ exit 0
%{_mandir}/man8/floppy.8*
%endif
%{_bindir}/namei
%if %{include_raw}
%{_bindir}/raw
%endif
%{_bindir}/rename
%{_bindir}/renice
%{_bindir}/rev
@ -714,6 +743,22 @@ exit 0
/sbin/losetup
%changelog
* Wed Dec 13 2006 Karel Zak <kzak@redhat.com> 2.13-0.45
- use ncurses only
- fix #218915 - fdisk -b 4K
- upgrade to -pre7 release
- fix building problem with raw0 patch
- fix #217186 - /bin/sh: @MKINSTALLDIRS@: No such file or directory
(port po/Makefile.in.in from gettext-0.16)
- sync with FC6 and RHEL5:
- fix #216489 - SCHED_BATCH option missing in chrt
- fix #216712 - issues with raw device support ("raw0" is wrong device name)
- fix #216760 - mount with context or fscontext option fails
(temporarily disabled the support for additional contexts -- not supported by kernel yet)
- fix #211827 - Can't mount with additional contexts
- fix #213127 - mount --make-unbindable does not work
- fix #211749 - add -r option to losetup to create a read-only loop
* Thu Oct 12 2006 Karel Zak <kzak@redhat.com> 2.13-0.44
- fix #209911 - losetup.8 updated (use dm-crypt rather than deprecated cryptoloop)
- fix #210338 - spurious error from '/bin/login -h $PHONENUMBER' (bug in IPv6 patch)