Compare commits
18 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21d35a521f | ||
|
|
6d9addd153 | ||
|
|
90527d853e | ||
|
|
08e1e3ab3c | ||
|
|
ba850c1743 | ||
|
|
053df7dad8 | ||
|
|
31dde6b9be | ||
|
|
6fafd00390 | ||
|
|
69cb29ad36 | ||
|
|
71a078d8f8 | ||
|
|
5bfc4138b6 | ||
|
|
74dff73ae2 | ||
|
|
851a3a0950 | ||
|
|
5b538ebb80 | ||
|
|
cd762949f8 | ||
|
|
4f62fccdf2 | ||
|
|
5ddedddbbb | ||
|
|
c9de782155 |
27 changed files with 5026 additions and 6 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,5 +1,2 @@
|
|||
util-linux-ng-2.17.2.tar.bz2
|
||||
floppy-0.16.tar.bz2
|
||||
util-linux-ng-2.18.tar.bz2
|
||||
*~
|
||||
*.rpm
|
||||
*.log
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
util-linux-ng has been renamed to util-linux
|
||||
51
mount.tmpfs
Normal file
51
mount.tmpfs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#! /bin/bash
|
||||
#
|
||||
# Copyright (C) 2009 Eric Paris <eparis@redhat.com>
|
||||
# Daniel Walsh <dwalsh@redhat.com>
|
||||
# Karel Zak <kzak@redhat.com>
|
||||
#
|
||||
# http://bugzilla.redhat.com/show_bug.cgi?id=476964
|
||||
#
|
||||
# Usage:
|
||||
# /sbin/mount.tmpfs spec dir [-sfnv] [-o options]
|
||||
#
|
||||
|
||||
case $1 in
|
||||
-h|--help|-?)
|
||||
echo "mount.tmpfs is a private mount(8) wrapper for tmpfs."
|
||||
echo "Don't use it directly!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
restricted=1
|
||||
|
||||
if [ $UID -eq 0 ] && [ $UID -eq $EUID ]; then
|
||||
restricted=0
|
||||
fi
|
||||
|
||||
# mount(8) in restricted mode (for non-root users) does not allow to use any
|
||||
# mount options, types or so on command line. We have to call mount(8) with
|
||||
# mountpoint only. All necessary options have to be defined in /etc/fstab.
|
||||
#
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=615719
|
||||
#
|
||||
if [ $restricted -eq 1 ]; then
|
||||
exec /bin/mount -i "$2"
|
||||
fi
|
||||
|
||||
# Remount with context mount options is unsupported
|
||||
# http://bugzilla.redhat.com/show_bug.cgi?id=563267
|
||||
#
|
||||
if ! echo "$@" | grep -q -E '\-o.*remount'; then
|
||||
|
||||
if ! echo "$@" | grep -q -E '(fs|def|root)?context='; then
|
||||
con=$(ls --scontext -d "$2" | cut -f 1 -d ' ')
|
||||
if [ -n "$con" ] && [ "$con" != "?" ] && [ "$con" != "unlabeled" ]; then
|
||||
exec /bin/mount "$@" -o "rootcontext=\"$con\"" -i -t tmpfs
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exec /bin/mount "$@" -i -t tmpfs
|
||||
63
nologin.8
Normal file
63
nologin.8
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
.\" $OpenBSD: nologin.8,v 1.8 1999/06/04 02:45:19 aaron Exp $
|
||||
.\" $NetBSD: nologin.8,v 1.3 1995/03/18 14:59:09 cgd Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the University of
|
||||
.\" California, Berkeley and its contributors.
|
||||
.\" 4. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)nologin.8 8.1 (Berkeley) 6/19/93
|
||||
.\"
|
||||
.Dd February 15, 1997
|
||||
.Dt NOLOGIN 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm nologin
|
||||
.Nd politely refuse a login
|
||||
.Sh SYNOPSIS
|
||||
.Nm nologin
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
displays a message that an account is not available and
|
||||
exits non-zero.
|
||||
It is intended as a replacement shell field for accounts that
|
||||
have been disabled.
|
||||
.Pp
|
||||
If the file
|
||||
.Pa /etc/nologin.txt
|
||||
exists,
|
||||
.Nm
|
||||
displays its contents to the user instead of the default message.
|
||||
.Sh SEE ALSO
|
||||
.Xr login 1
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
command appeared in
|
||||
.Bx 4.4 .
|
||||
58
nologin.c
Normal file
58
nologin.c
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* $OpenBSD: nologin.c,v 1.2 1997/04/04 16:51:37 millert Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, Jason Downs. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Distinctly different from _PATH_NOLOGIN. */
|
||||
#define _PATH_NOLOGIN_TXT "/etc/nologin.txt"
|
||||
|
||||
#define DEFAULT_MESG "This account is currently not available.\n"
|
||||
|
||||
/*ARGSUSED*/
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int nfd, nrd;
|
||||
char nbuf[128];
|
||||
|
||||
nfd = open(_PATH_NOLOGIN_TXT, O_RDONLY);
|
||||
if (nfd < 0) {
|
||||
write(STDOUT_FILENO, DEFAULT_MESG, strlen(DEFAULT_MESG));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
while ((nrd = read(nfd, nbuf, sizeof(nbuf))) > 0)
|
||||
write(STDOUT_FILENO, nbuf, nrd);
|
||||
close (nfd);
|
||||
|
||||
exit (1);
|
||||
}
|
||||
2
sources
Normal file
2
sources
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
4635725a3eef1c57090bac8ea5e082e6 util-linux-ng-2.17.2.tar.bz2
|
||||
7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2
|
||||
10
util-linux-ng-2.13-ctrlaltdel-man.patch
Normal file
10
util-linux-ng-2.13-ctrlaltdel-man.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- util-linux-2.13-pre6/sys-utils/ctrlaltdel.8.kzak 2006-08-10 12:23:53.000000000 +0200
|
||||
+++ util-linux-2.13-pre6/sys-utils/ctrlaltdel.8 2006-08-10 12:24:08.000000000 +0200
|
||||
@@ -32,7 +32,6 @@
|
||||
.SH FILES
|
||||
.I /etc/rc.local
|
||||
.SH "SEE ALSO"
|
||||
-.BR simpleinit (8),
|
||||
.BR init (8)
|
||||
.SH AUTHOR
|
||||
Peter Orbaek (poe@daimi.aau.dk)
|
||||
23
util-linux-ng-2.13-fdformat-man-ide.patch
Normal file
23
util-linux-ng-2.13-fdformat-man-ide.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
--- util-linux-ng-2.13-rc3/disk-utils/fdformat.8.xxx 2007-07-03 01:56:04.000000000 +0200
|
||||
+++ util-linux-ng-2.13-rc3/disk-utils/fdformat.8 2007-08-13 12:07:58.000000000 +0200
|
||||
@@ -45,6 +45,10 @@
|
||||
.BR setfdprm (8)
|
||||
to load the disk parameters.
|
||||
|
||||
+For ATAPI IDE floppy driver (also known as LS-120 drives or "Superdisk"
|
||||
+drives) you have to use the
|
||||
+.BR floppy (8).
|
||||
+
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-n
|
||||
@@ -54,7 +58,8 @@
|
||||
.BR fd (4),
|
||||
.BR setfdprm (8),
|
||||
.BR mkfs (8),
|
||||
-.BR emkfs (8)
|
||||
+.BR emkfs (8),
|
||||
+.BR floppy (8)
|
||||
.SH AUTHOR
|
||||
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
|
||||
.SH AVAILABILITY
|
||||
102
util-linux-ng-2.13-floppy-generic.patch
Normal file
102
util-linux-ng-2.13-floppy-generic.patch
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
--- util-linux-2.12p/floppy-0.16/floppyfloppy.c.generic 2001-02-13 01:15:38.000000000 +0100
|
||||
+++ util-linux-2.12p/floppy-0.16/floppyfloppy.c 2005-09-30 15:38:08.000000000 +0200
|
||||
@@ -264,6 +264,33 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
+/* -1=error, 1=true, 0=false */
|
||||
+static int check_generic(const char *dev, int n)
|
||||
+{
|
||||
+ struct floppy_struct param;
|
||||
+ int fd;
|
||||
+
|
||||
+ if ((fd=open(dev, O_RDONLY)) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (ioctl(fd,FDGETPRM,(long) ¶m) < 0)
|
||||
+ {
|
||||
+ perror(dev);
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ close(fd);
|
||||
+
|
||||
+ if (param.sect==floppy_type[n].sectors &&
|
||||
+ param.head==floppy_type[n].heads &&
|
||||
+ param.track==floppy_type[n].tracks)
|
||||
+ /* generic device uses expected format */
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
static int do_format(const char *dev, int fmtnum,
|
||||
int (*fmt_func)(const char *, int), int flags)
|
||||
@@ -275,6 +302,7 @@
|
||||
struct format_descr curtrack;
|
||||
int pct;
|
||||
struct stat stat_buf;
|
||||
+ int gen = 0;
|
||||
|
||||
int i, j;
|
||||
char *devname;
|
||||
@@ -297,23 +325,52 @@
|
||||
|
||||
strcat(strcpy(devname, dev), floppy_type[fmtnum].dev);
|
||||
|
||||
+ if (stat(devname, &stat_buf)==-1 && errno==ENOENT)
|
||||
+ {
|
||||
+ /* /dev/fd0xxxxx doesn't exist ...try to use generic device
|
||||
+ *
|
||||
+ * Note: we needn't size specific device if the generic device uses
|
||||
+ * right floppy format (FDGETPRM). -- Karel Zak [30/09/2005]
|
||||
+ */
|
||||
+ if ((gen = check_generic(dev, fmtnum))==1) /* true */
|
||||
+ {
|
||||
+ fprintf(stderr, _("WARNING: size specific device %s doesn't exist, using generic device: %s\n"),
|
||||
+ devname, dev);
|
||||
+ strcpy(devname, dev);
|
||||
+ }
|
||||
+ else if (gen==0) /* false */
|
||||
+ {
|
||||
+ fprintf(stderr, _("ERROR: size specific device %1$s doesn't exist. Use \"MAKEDEV %1$s\" and try it again.\n"), devname);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ else /* error -- no floppy medium or device? */
|
||||
+ return(1);
|
||||
+ }
|
||||
fd=open(devname, O_WRONLY);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror(devname);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
- if (fstat(fd, &stat_buf) ||
|
||||
- !S_ISBLK(stat_buf.st_mode) ||
|
||||
- MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
+ if (fstat(fd, &stat_buf) < 0)
|
||||
+ {
|
||||
+ perror(devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (!S_ISBLK(stat_buf.st_mode))
|
||||
+ {
|
||||
+ fprintf(stderr,_("%s: not a block device\n"), devname);
|
||||
+ close(fd);
|
||||
+ return (1);
|
||||
+ }
|
||||
+ if (gen==0 && MINOR_DEV(stat_buf.st_rdev) != fmtnum)
|
||||
{
|
||||
errno=EINVAL;
|
||||
perror(devname);
|
||||
close(fd);
|
||||
return (1);
|
||||
}
|
||||
-
|
||||
if (ioctl(fd, FDGETPRM, &geo) < 0)
|
||||
{
|
||||
perror(devname);
|
||||
10
util-linux-ng-2.13-floppy-locale.patch
Normal file
10
util-linux-ng-2.13-floppy-locale.patch
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
--- util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c.kzak 2001-07-14 05:26:16.000000000 +0200
|
||||
+++ util-linux-ng-2.13-rc3/floppy-0.16/superfloppy.c 2007-08-13 13:14:53.000000000 +0200
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <errno.h>
|
||||
#include <popt.h>
|
||||
#include <libintl.h>
|
||||
+#include <locale.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
15
util-linux-ng-2.13-login-lastlog.patch
Normal file
15
util-linux-ng-2.13-login-lastlog.patch
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
login-utils/login.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/login-utils/login.c
|
||||
+++ util-linux-ng-2.17.2/login-utils/login.c
|
||||
@@ -1431,7 +1431,7 @@ dolastlog(int quiet) {
|
||||
struct lastlog ll;
|
||||
int fd;
|
||||
|
||||
- if ((fd = open(_PATH_LASTLOG, O_RDWR, 0)) >= 0) {
|
||||
+ if ((fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0)) >= 0) {
|
||||
lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
|
||||
if (!quiet) {
|
||||
if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) &&
|
||||
51
util-linux-ng-2.15-ipcs-32bit.patch
Normal file
51
util-linux-ng-2.15-ipcs-32bit.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
sys-utils/ipcs.c | 30 +++++++++++++++++++++++++-----
|
||||
1 file changed, 25 insertions(+), 5 deletions(-)
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/sys-utils/ipcs.c
|
||||
+++ util-linux-ng-2.17.2/sys-utils/ipcs.c
|
||||
@@ -239,6 +239,26 @@ print_perms (int id, struct ipc_perm *ip
|
||||
printf(" %-10d\n", ipcp->gid);
|
||||
}
|
||||
|
||||
+static unsigned long long
|
||||
+shminfo_from_proc(const char *name, unsigned long def)
|
||||
+{
|
||||
+ char path[256];
|
||||
+ char buf[64];
|
||||
+ FILE *f;
|
||||
+ unsigned long long res = def;
|
||||
+
|
||||
+ if (!name)
|
||||
+ return res;
|
||||
+
|
||||
+ snprintf(path, sizeof(path), "/proc/sys/kernel/%s", name);
|
||||
+
|
||||
+ if (!(f = fopen(path, "r")))
|
||||
+ return res;
|
||||
+ if (fgets(buf, sizeof(buf), f))
|
||||
+ res = atoll(buf);
|
||||
+ fclose(f);
|
||||
+ return res;
|
||||
+}
|
||||
|
||||
void do_shm (char format)
|
||||
{
|
||||
@@ -262,12 +282,12 @@ void do_shm (char format)
|
||||
return;
|
||||
/* glibc 2.1.3 and all earlier libc's have ints as fields
|
||||
of struct shminfo; glibc 2.1.91 has unsigned long; ach */
|
||||
- printf (_("max number of segments = %lu\n"),
|
||||
- (unsigned long) shminfo.shmmni);
|
||||
- printf (_("max seg size (kbytes) = %lu\n"),
|
||||
- (unsigned long) (shminfo.shmmax >> 10));
|
||||
+ printf (_("max number of segments = %llu\n"),
|
||||
+ shminfo_from_proc("shmmni", shminfo.shmmni));
|
||||
+ printf (_("max seg size (kbytes) = %llu\n"),
|
||||
+ (shminfo_from_proc("shmmax", shminfo.shmmax) >> 10));
|
||||
printf (_("max total shared memory (kbytes) = %llu\n"),
|
||||
- getpagesize() / 1024 * (unsigned long long) shminfo.shmall);
|
||||
+ getpagesize() / 1024 * shminfo_from_proc("shmall", shminfo.shmall));
|
||||
printf (_("min seg size (bytes) = %lu\n"),
|
||||
(unsigned long) shminfo.shmmin);
|
||||
return;
|
||||
78
util-linux-ng-2.16-blkid-cachefile.patch
Normal file
78
util-linux-ng-2.16-blkid-cachefile.patch
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
misc-utils/blkid.8 | 4 ++--
|
||||
misc-utils/blkid.c | 2 +-
|
||||
shlibs/blkid/libblkid.3 | 6 +++---
|
||||
shlibs/blkid/src/blkidP.h | 2 +-
|
||||
4 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/misc-utils/blkid.8
|
||||
+++ util-linux-ng-2.17.2/misc-utils/blkid.8
|
||||
@@ -67,7 +67,7 @@ more devices.
|
||||
Read from
|
||||
.I cachefile
|
||||
instead of reading from the default cache file
|
||||
-.IR /etc/blkid.tab .
|
||||
+.IR /etc/blkid/blkid.tab .
|
||||
If you want to start with a clean cache (i.e. don't report devices previously
|
||||
scanned but not necessarily available at this time), specify
|
||||
.IR /dev/null .
|
||||
@@ -190,7 +190,7 @@ Display version number and exit.
|
||||
Write the device cache to
|
||||
.I writecachefile
|
||||
instead of writing it to the default cache file
|
||||
-.IR /etc/blkid.tab .
|
||||
+.IR /etc/blkid/blkid.tab .
|
||||
If you don't want to save the cache to the default file, specify
|
||||
.IR /dev/null.
|
||||
If not specified it will be the same file as that given by the
|
||||
--- util-linux-ng-2.17.2.orig/misc-utils/blkid.c
|
||||
+++ util-linux-ng-2.17.2/misc-utils/blkid.c
|
||||
@@ -58,7 +58,7 @@ static void usage(int error)
|
||||
" [-t <token>] [-w <file>] [dev ...]\n\n"
|
||||
" %1$s -p [-O <offset>] [-S <size>] [-o format] <dev> [dev ...]\n\n"
|
||||
"Options:\n"
|
||||
- " -c <file> cache file (default: /etc/blkid.tab, /dev/null = none)\n"
|
||||
+ " -c <file> cache file (default: /etc/blkid/blkid.tab, /dev/null = none)\n"
|
||||
" -h print this usage message and exit\n"
|
||||
" -g garbage collect the blkid cache\n"
|
||||
" -o <format> output format; can be one of:\n"
|
||||
--- util-linux-ng-2.17.2.orig/shlibs/blkid/libblkid.3
|
||||
+++ util-linux-ng-2.17.2/shlibs/blkid/libblkid.3
|
||||
@@ -24,7 +24,7 @@ A common use is to allow use of LABEL= a
|
||||
specific block device names into configuration files.
|
||||
.P
|
||||
Block device information is normally kept in a cache file
|
||||
-.I /etc/blkid.tab
|
||||
+.I /etc/blkid/blkid.tab
|
||||
and is verified to still be valid before being returned to the user
|
||||
(if the user has read permission on the raw block device, otherwise not).
|
||||
The cache file also allows unprivileged users (normally anyone other
|
||||
@@ -59,7 +59,7 @@ symlink does not match with LABEL or UUI
|
||||
.I CACHE_FILE=<path>
|
||||
Overrides the standard location of the cache file. This setting can be
|
||||
overridden by the environment variable BLKID_FILE. Default is
|
||||
-.I /etc/blkid.tab.
|
||||
+.I /etc/blkid/blkid.tab.
|
||||
.TP
|
||||
.I EVALUATE=<methods>
|
||||
Defines LABEL and UUID evaluation method(s). Currently, the libblkid library
|
||||
@@ -77,7 +77,7 @@ from Ted Ts'o. The library was subseque
|
||||
The low-level probing code was rewritten by Karel Zak.
|
||||
.SH FILES
|
||||
.TP 18
|
||||
-.I /etc/blkid.tab
|
||||
+.I /etc/blkid/blkid.tab
|
||||
caches data extracted from each recognized block device
|
||||
.TP
|
||||
.I /etc/blkid.conf
|
||||
--- util-linux-ng-2.17.2.orig/shlibs/blkid/src/blkidP.h
|
||||
+++ util-linux-ng-2.17.2/shlibs/blkid/src/blkidP.h
|
||||
@@ -268,7 +268,7 @@ extern char *blkid_strconcat(const char
|
||||
extern int blkid_fstatat(DIR *dir, const char *dirname, const char *filename,
|
||||
struct stat *st, int nofollow);
|
||||
|
||||
-#define BLKID_CACHE_FILE "/etc/blkid.tab"
|
||||
+#define BLKID_CACHE_FILE "/etc/blkid/blkid.tab"
|
||||
#define BLKID_CONFIG_FILE "/etc/blkid.conf"
|
||||
|
||||
#define BLKID_ERR_IO 5
|
||||
30
util-linux-ng-2.17-agetty-clocal.patch
Normal file
30
util-linux-ng-2.17-agetty-clocal.patch
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
From 9fcaa8826c180273829cf03e5fe34e08daef721f Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Mon, 12 Jul 2010 11:57:55 +0200
|
||||
Subject: [PATCH] aggety: don't wipe CLOCAL flag
|
||||
|
||||
gettey should not clear the flag. It seems that the flag is
|
||||
automatically enabled for serial consoles tht don't use CD signal.
|
||||
|
||||
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=598631
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
login-utils/agetty.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/login-utils/agetty.c b/login-utils/agetty.c
|
||||
index 39a1fd3..0cb00db 100644
|
||||
--- a/login-utils/agetty.c
|
||||
+++ b/login-utils/agetty.c
|
||||
@@ -706,7 +706,7 @@ termio_init(tp, speed, op)
|
||||
/* flush input and output queues, important for modems! */
|
||||
(void) tcflush(0, TCIOFLUSH);
|
||||
|
||||
- tp->c_cflag = CS8 | HUPCL | CREAD;
|
||||
+ tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);
|
||||
cfsetispeed(tp, speed);
|
||||
cfsetospeed(tp, speed);
|
||||
if (op->flags & F_LOCAL) {
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
104
util-linux-ng-2.17-blkid-cdrom.patch
Normal file
104
util-linux-ng-2.17-blkid-cdrom.patch
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
based on upstream patch:
|
||||
|
||||
commit 55113b15afe5f61fc917c22a9d8d47f89b37c757
|
||||
Author: M.S.Colclough <m.s.colclough@bham.ac.uk>
|
||||
Date: Wed Mar 31 18:11:00 2010 +0200
|
||||
|
||||
libblkid: avoid probing CDs for RAID
|
||||
|
||||
RAID probing of CD/DVD can yield errors because of well-known problem
|
||||
in reading the end of the disk with some disk/drive combinations.
|
||||
Borrow CD detection method from udev and skip the RAID tests for
|
||||
these devices.
|
||||
|
||||
[kzak@redhat.com: - check for linux/cdrom.h in ./configure
|
||||
- add #ifdef around the ioctl call
|
||||
- call the ioctl for block devices only]
|
||||
|
||||
Signed-off-by: Mark Colclough <m.s.colclough@bham.ac.uk>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
|
||||
---
|
||||
shlibs/blkid/src/blkidP.h | 2 ++
|
||||
shlibs/blkid/src/probe.c | 14 ++++++++++++++
|
||||
shlibs/blkid/src/superblocks/superblocks.c | 5 +++++
|
||||
3 files changed, 21 insertions(+)
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/shlibs/blkid/src/blkidP.h
|
||||
+++ util-linux-ng-2.17.2/shlibs/blkid/src/blkidP.h
|
||||
@@ -209,6 +209,7 @@ struct blkid_struct_probe
|
||||
/* flags */
|
||||
#define BLKID_PRIVATE_FD (1 << 1) /* see blkid_new_probe_from_filename() */
|
||||
#define BLKID_TINY_DEV (1 << 2) /* <= 1.47MiB (floppy or so) */
|
||||
+#define BLKID_CDROM_DEV (1 << 3) /* is a CD/DVD drive */
|
||||
|
||||
/*
|
||||
* Evaluation methods (for blkid_eval_* API)
|
||||
@@ -363,6 +364,7 @@ extern void blkid_free_dev(blkid_dev dev
|
||||
|
||||
/* probe.c */
|
||||
extern int blkid_probe_is_tiny(blkid_probe pr);
|
||||
+extern int blkid_probe_is_cdrom(blkid_probe pr);
|
||||
extern unsigned char *blkid_probe_get_buffer(blkid_probe pr,
|
||||
blkid_loff_t off, blkid_loff_t len);
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/shlibs/blkid/src/probe.c
|
||||
+++ util-linux-ng-2.17.2/shlibs/blkid/src/probe.c
|
||||
@@ -77,6 +77,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
+#include <linux/cdrom.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
@@ -545,6 +546,14 @@ int blkid_probe_is_tiny(blkid_probe pr)
|
||||
return pr && (pr->flags & BLKID_TINY_DEV);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * CDROMs may fail when probed for RAID (last sector problem)
|
||||
+ */
|
||||
+int blkid_probe_is_cdrom(blkid_probe pr)
|
||||
+{
|
||||
+ return pr && (pr->flags & BLKID_CDROM_DEV);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* blkid_probe_set_device:
|
||||
* @pr: probe
|
||||
@@ -570,6 +579,7 @@ int blkid_probe_set_device(blkid_probe p
|
||||
|
||||
pr->flags &= ~BLKID_PRIVATE_FD;
|
||||
pr->flags &= ~BLKID_TINY_DEV;
|
||||
+ pr->flags &= ~BLKID_CDROM_DEV;
|
||||
pr->fd = fd;
|
||||
pr->off = off;
|
||||
pr->size = 0;
|
||||
@@ -615,6 +625,10 @@ int blkid_probe_set_device(blkid_probe p
|
||||
if (pr->size <= 1440 * 1024 && !S_ISCHR(pr->mode))
|
||||
pr->flags |= BLKID_TINY_DEV;
|
||||
|
||||
+#ifdef CDROM_GET_CAPABILITY
|
||||
+ if (S_ISBLK(pr->mode) && ioctl(fd, CDROM_GET_CAPABILITY, NULL) >= 0)
|
||||
+ pr->flags |= BLKID_CDROM_DEV;
|
||||
+#endif
|
||||
return 0;
|
||||
err:
|
||||
DBG(DEBUG_LOWPROBE,
|
||||
--- util-linux-ng-2.17.2.orig/shlibs/blkid/src/superblocks/superblocks.c
|
||||
+++ util-linux-ng-2.17.2/shlibs/blkid/src/superblocks/superblocks.c
|
||||
@@ -342,6 +342,11 @@ static int superblocks_probe(blkid_probe
|
||||
blkid_probe_is_tiny(pr))
|
||||
continue;
|
||||
|
||||
+ /* don't probe for RAIDs, swap or journal on floppies or CD/DVDs */
|
||||
+ if ((id->usage & (BLKID_USAGE_RAID | BLKID_USAGE_OTHER)) &&
|
||||
+ (blkid_probe_is_tiny(pr) || blkid_probe_is_cdrom(pr)))
|
||||
+ continue;
|
||||
+
|
||||
DBG(DEBUG_LOWPROBE, printf("[%d] %s:\n", i, id->name));
|
||||
|
||||
/* try to detect by magic string */
|
||||
1512
util-linux-ng-2.17-blkid-raid.patch
Normal file
1512
util-linux-ng-2.17-blkid-raid.patch
Normal file
File diff suppressed because it is too large
Load diff
221
util-linux-ng-2.17-blkid-usec.patch
Normal file
221
util-linux-ng-2.17-blkid-usec.patch
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
|
||||
This is backport from upstream, this version of the patch requires glibc and
|
||||
kernel >= 2.5.48. The stat.st_mtim availability is not checked to avoid changes
|
||||
to ./configure script. It should be fine for Fedora/RHEL. --kzak 18-Mar-2010
|
||||
|
||||
|
||||
commit message from the original patch:
|
||||
|
||||
commit 6c2f2b9d62b196296e827f8bb7336a39e80695a9
|
||||
Author: Karel Zak <kzak@redhat.com>
|
||||
Date: Wed Mar 17 14:49:14 2010 +0100
|
||||
|
||||
libblkid: add microsecond resolution for cache entries
|
||||
|
||||
The libblkid library uses stat.st_mtine to detect changes on the
|
||||
device. The last update time of of the device in the cache is stored
|
||||
as TIME= tag in the /etc/blkid.tab file.
|
||||
|
||||
Linux since 2.5.48 supports nanosecond resolution and more precise
|
||||
time is available in the stat.st_mtim timespec struct.
|
||||
|
||||
This patch add microsecond precision to TIME= tag in the cache file,
|
||||
old format:
|
||||
|
||||
TIME="<sec>"
|
||||
|
||||
the new format:
|
||||
|
||||
TIME="<sec>.<usec>"
|
||||
|
||||
This change is backwardly compatible.
|
||||
|
||||
Now, the blkid_verify() function checks stat.st_mtime and
|
||||
stat.st_mtim.tv_nsec/1000.
|
||||
|
||||
Test:
|
||||
|
||||
# e2label /dev/sdb1 AAAA
|
||||
|
||||
old version:
|
||||
|
||||
# blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1
|
||||
/dev/sdb1: LABEL="AAAA"
|
||||
/dev/sdb1: LABEL="AAAA"
|
||||
|
||||
new version:
|
||||
|
||||
# blkid -s LABEL /dev/sdb1; e2label /dev/sdb1 BBBB; blkid -s LABEL /dev/sdb1
|
||||
/dev/sdb1: LABEL="AAAA"
|
||||
/dev/sdb1: LABEL="BBBB"
|
||||
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
|
||||
diff -up util-linux-ng-2.17.1/shlibs/blkid/src/blkidP.h.kzak util-linux-ng-2.17.1/shlibs/blkid/src/blkidP.h
|
||||
--- util-linux-ng-2.17.1/shlibs/blkid/src/blkidP.h.kzak 2010-03-18 14:48:12.000000000 +0100
|
||||
+++ util-linux-ng-2.17.1/shlibs/blkid/src/blkidP.h 2010-03-18 15:01:36.000000000 +0100
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -28,6 +29,9 @@
|
||||
#include "blkid.h"
|
||||
#include "list.h"
|
||||
|
||||
+/* enable microsecond resolution for the cache */
|
||||
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
|
||||
+
|
||||
/*
|
||||
* This describes the attributes of a specific device.
|
||||
* We can traverse all of the tags by bid_tags (linking to the tag bit_names).
|
||||
@@ -44,6 +48,7 @@ struct blkid_struct_dev
|
||||
int bid_pri; /* Device priority */
|
||||
dev_t bid_devno; /* Device major/minor number */
|
||||
time_t bid_time; /* Last update time of device */
|
||||
+ suseconds_t bid_utime; /* Last update time (microseconds) */
|
||||
unsigned int bid_flags; /* Device status bitflags */
|
||||
char *bid_label; /* Shortcut to device LABEL */
|
||||
char *bid_uuid; /* Shortcut to binary UUID */
|
||||
diff -up util-linux-ng-2.17.1/shlibs/blkid/src/dev.c.kzak util-linux-ng-2.17.1/shlibs/blkid/src/dev.c
|
||||
--- util-linux-ng-2.17.1/shlibs/blkid/src/dev.c.kzak 2010-02-04 12:53:58.000000000 +0100
|
||||
+++ util-linux-ng-2.17.1/shlibs/blkid/src/dev.c 2010-03-18 14:58:23.000000000 +0100
|
||||
@@ -84,7 +84,7 @@ void blkid_debug_dump_dev(blkid_dev dev)
|
||||
|
||||
printf(" dev: name = %s\n", dev->bid_name);
|
||||
printf(" dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno);
|
||||
- printf(" dev: TIME=\"%ld\"\n", (long)dev->bid_time);
|
||||
+ printf(" dev: TIME=\"%ld.%ld\"\n", (long)dev->bid_time, (long)dev->bid_utime);
|
||||
printf(" dev: PRI=\"%d\"\n", dev->bid_pri);
|
||||
printf(" dev: flags = 0x%08X\n", dev->bid_flags);
|
||||
|
||||
diff -up util-linux-ng-2.17.1/shlibs/blkid/src/read.c.kzak util-linux-ng-2.17.1/shlibs/blkid/src/read.c
|
||||
--- util-linux-ng-2.17.1/shlibs/blkid/src/read.c.kzak 2010-02-04 12:53:58.000000000 +0100
|
||||
+++ util-linux-ng-2.17.1/shlibs/blkid/src/read.c 2010-03-18 14:58:23.000000000 +0100
|
||||
@@ -49,7 +49,8 @@ static void debug_dump_dev(blkid_dev dev
|
||||
*
|
||||
* The following tags are required for each entry:
|
||||
* <ID="id"> unique (within this file) ID number of this device
|
||||
- * <TIME="time"> (ascii time_t) time this entry was last read from disk
|
||||
+ * <TIME="sec.usec"> (time_t and suseconds_t) time this entry was last
|
||||
+ * read from disk
|
||||
* <TYPE="type"> (detected) type of filesystem/data for this partition
|
||||
*
|
||||
* The following tags may be present, depending on the device contents
|
||||
@@ -318,9 +319,12 @@ static int parse_tag(blkid_cache cache,
|
||||
dev->bid_devno = STRTOULL(value, 0, 0);
|
||||
else if (!strcmp(name, "PRI"))
|
||||
dev->bid_pri = strtol(value, 0, 0);
|
||||
- else if (!strcmp(name, "TIME"))
|
||||
- dev->bid_time = STRTOULL(value, 0, 0);
|
||||
- else
|
||||
+ else if (!strcmp(name, "TIME")) {
|
||||
+ char *end = NULL;
|
||||
+ dev->bid_time = STRTOULL(value, &end, 0);
|
||||
+ if (end && *end == '.')
|
||||
+ dev->bid_utime = STRTOULL(end + 1, 0, 0);
|
||||
+ } else
|
||||
ret = blkid_set_tag(dev, name, value, strlen(value));
|
||||
|
||||
DBG(DEBUG_READ, printf(" tag: %s=\"%s\"\n", name, value));
|
||||
@@ -455,7 +459,7 @@ static void debug_dump_dev(blkid_dev dev
|
||||
|
||||
printf(" dev: name = %s\n", dev->bid_name);
|
||||
printf(" dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno);
|
||||
- printf(" dev: TIME=\"%lld\"\n", (long long)dev->bid_time);
|
||||
+ printf(" dev: TIME=\"%ld.%ld\"\n", (long)dev->bid_time, (long)dev->bid_utime);
|
||||
printf(" dev: PRI=\"%d\"\n", dev->bid_pri);
|
||||
printf(" dev: flags = 0x%08X\n", dev->bid_flags);
|
||||
|
||||
diff -up util-linux-ng-2.17.1/shlibs/blkid/src/save.c.kzak util-linux-ng-2.17.1/shlibs/blkid/src/save.c
|
||||
--- util-linux-ng-2.17.1/shlibs/blkid/src/save.c.kzak 2010-02-22 09:41:12.000000000 +0100
|
||||
+++ util-linux-ng-2.17.1/shlibs/blkid/src/save.c 2010-03-18 14:58:23.000000000 +0100
|
||||
@@ -37,9 +37,11 @@ static int save_dev(blkid_dev dev, FILE
|
||||
printf("device %s, type %s\n", dev->bid_name, dev->bid_type ?
|
||||
dev->bid_type : "(null)"));
|
||||
|
||||
- fprintf(file,
|
||||
- "<device DEVNO=\"0x%04lx\" TIME=\"%ld\"",
|
||||
- (unsigned long) dev->bid_devno, (long) dev->bid_time);
|
||||
+ fprintf(file, "<device DEVNO=\"0x%04lx\" TIME=\"%ld.%ld\"",
|
||||
+ (unsigned long) dev->bid_devno,
|
||||
+ (long) dev->bid_time,
|
||||
+ (long) dev->bid_utime);
|
||||
+
|
||||
if (dev->bid_pri)
|
||||
fprintf(file, " PRI=\"%d\"", dev->bid_pri);
|
||||
list_for_each(p, &dev->bid_tags) {
|
||||
diff -up util-linux-ng-2.17.1/shlibs/blkid/src/verify.c.kzak util-linux-ng-2.17.1/shlibs/blkid/src/verify.c
|
||||
--- util-linux-ng-2.17.1/shlibs/blkid/src/verify.c.kzak 2010-02-04 12:53:58.000000000 +0100
|
||||
+++ util-linux-ng-2.17.1/shlibs/blkid/src/verify.c 2010-03-18 14:58:23.000000000 +0100
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
+#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
@@ -73,19 +74,34 @@ blkid_dev blkid_verify(blkid_cache cache
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- if ((now >= dev->bid_time) &&
|
||||
- (st.st_mtime <= dev->bid_time) &&
|
||||
- ((diff < BLKID_PROBE_MIN) ||
|
||||
- (dev->bid_flags & BLKID_BID_FL_VERIFIED &&
|
||||
- diff < BLKID_PROBE_INTERVAL)))
|
||||
+ if (now >= dev->bid_time &&
|
||||
+#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
+ (st.st_mtime < dev->bid_time ||
|
||||
+ (st.st_mtime == dev->bid_time &&
|
||||
+ st.st_mtim.tv_nsec / 1000 <= dev->bid_utime)) &&
|
||||
+#else
|
||||
+ st.st_mtime <= dev->bid_time &&
|
||||
+#endif
|
||||
+ (diff < BLKID_PROBE_MIN ||
|
||||
+ (dev->bid_flags & BLKID_BID_FL_VERIFIED &&
|
||||
+ diff < BLKID_PROBE_INTERVAL)))
|
||||
return dev;
|
||||
|
||||
+#ifndef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
DBG(DEBUG_PROBE,
|
||||
printf("need to revalidate %s (cache time %lu, stat time %lu,\n\t"
|
||||
"time since last check %lu)\n",
|
||||
dev->bid_name, (unsigned long)dev->bid_time,
|
||||
(unsigned long)st.st_mtime, (unsigned long)diff));
|
||||
-
|
||||
+#else
|
||||
+ DBG(DEBUG_PROBE,
|
||||
+ printf("need to revalidate %s (cache time %lu.%lu, stat time %lu.%lu,\n\t"
|
||||
+ "time since last check %lu)\n",
|
||||
+ dev->bid_name,
|
||||
+ (unsigned long)dev->bid_time, (unsigned long)dev->bid_utime,
|
||||
+ (unsigned long)st.st_mtime, (unsigned long)st.st_mtim.tv_nsec / 1000,
|
||||
+ (unsigned long)diff));
|
||||
+#endif
|
||||
|
||||
if (!cache->probe) {
|
||||
cache->probe = blkid_new_probe();
|
||||
@@ -156,8 +172,16 @@ blkid_dev blkid_verify(blkid_cache cache
|
||||
|
||||
found_type:
|
||||
if (dev) {
|
||||
+#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
|
||||
+ struct timeval tv;
|
||||
+ if (!gettimeofday(&tv, NULL)) {
|
||||
+ dev->bid_time = tv.tv_sec;
|
||||
+ dev->bid_utime = tv.tv_usec;
|
||||
+ } else
|
||||
+#endif
|
||||
+ dev->bid_time = time(0);
|
||||
+
|
||||
dev->bid_devno = st.st_rdev;
|
||||
- dev->bid_time = time(0);
|
||||
dev->bid_flags |= BLKID_BID_FL_VERIFIED;
|
||||
cache->bic_flags |= BLKID_BIC_FL_CHANGED;
|
||||
|
||||
83
util-linux-ng-2.17-mount-loopdev.patch
Normal file
83
util-linux-ng-2.17-mount-loopdev.patch
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
diff -up util-linux-ng-2.17.2/mount/mount.c.kzak util-linux-ng-2.17.2/mount/mount.c
|
||||
--- util-linux-ng-2.17.2/mount/mount.c.kzak 2010-03-22 09:10:56.000000000 +0100
|
||||
+++ util-linux-ng-2.17.2/mount/mount.c 2010-07-29 16:15:28.000000000 +0200
|
||||
@@ -1090,7 +1090,8 @@ loop_check(const char **spec, const char
|
||||
if (verbose)
|
||||
printf(_("mount: skipping the setup of a loop device\n"));
|
||||
} else {
|
||||
- int loop_opts = SETLOOP_AUTOCLEAR; /* always attempt autoclear */
|
||||
+ /* use autoclear loopdev on system without regular mtab only */
|
||||
+ int loop_opts = mtab_is_writable() ? 0 : SETLOOP_AUTOCLEAR;
|
||||
int res;
|
||||
|
||||
if (*flags & MS_RDONLY)
|
||||
@@ -1759,6 +1760,50 @@ mounted (const char *spec0, const char *
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/* returns 0 if not mounted, 1 if mounted and -1 in case of error */
|
||||
+static int
|
||||
+is_fstab_entry_mounted(struct mntentchn *mc, int verbose)
|
||||
+{
|
||||
+ struct stat st;
|
||||
+
|
||||
+ if (mounted(mc->m.mnt_fsname, mc->m.mnt_dir))
|
||||
+ goto yes;
|
||||
+
|
||||
+ /* extra care for loop devices */
|
||||
+ if ((strstr(mc->m.mnt_opts, "loop=") ||
|
||||
+ (stat(mc->m.mnt_fsname, &st) == 0 && S_ISREG(st.st_mode)))) {
|
||||
+
|
||||
+ char *p = strstr(mc->m.mnt_opts, "offset=");
|
||||
+ uintmax_t offset = 0;
|
||||
+
|
||||
+ if (p && *(p + 7)) {
|
||||
+ char *end = NULL;
|
||||
+
|
||||
+ p += 7;
|
||||
+ errno = 0;
|
||||
+ offset = strtoumax(p, &end, 0);
|
||||
+
|
||||
+ if (end == p || (errno != 0 &&
|
||||
+ (offset == UINTMAX_MAX || offset == 0))) {
|
||||
+ if (verbose)
|
||||
+ printf(_("mount: ignore %s "
|
||||
+ "(unparsable offset= option)\n"),
|
||||
+ mc->m.mnt_fsname);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ if (is_mounted_same_loopfile(mc->m.mnt_dir, mc->m.mnt_fsname, offset))
|
||||
+ goto yes;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+yes:
|
||||
+ if (verbose)
|
||||
+ printf(_("mount: %s already mounted on %s\n"),
|
||||
+ mc->m.mnt_fsname, mc->m.mnt_dir);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
/* avoid using stat() on things we are not going to mount anyway.. */
|
||||
static int
|
||||
has_noauto (const char *opts) {
|
||||
@@ -1804,16 +1849,8 @@ do_mount_all (char *types, char *options
|
||||
if (matching_type (mc->m.mnt_type, types)
|
||||
&& matching_opts (mc->m.mnt_opts, test_opts)
|
||||
&& !streq (mc->m.mnt_dir, "/")
|
||||
- && !streq (mc->m.mnt_dir, "root")) {
|
||||
-
|
||||
- if (mounted (mc->m.mnt_fsname, mc->m.mnt_dir)) {
|
||||
- if (verbose)
|
||||
- printf(_("mount: %s already mounted "
|
||||
- "on %s\n"),
|
||||
- mc->m.mnt_fsname,
|
||||
- mc->m.mnt_dir);
|
||||
- continue;
|
||||
- }
|
||||
+ && !streq (mc->m.mnt_dir, "root")
|
||||
+ && !is_fstab_entry_mounted(mc, verbose)) {
|
||||
|
||||
mtmp = (struct mntentchn *) xmalloc(sizeof(*mtmp));
|
||||
*mtmp = *mc;
|
||||
52
util-linux-ng-2.17-partx.patch
Normal file
52
util-linux-ng-2.17-partx.patch
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
Upstream patches:
|
||||
|
||||
From d6d9cc6ea158ef3b2525742ee3f80c4a3be8b049 Mon Sep 17 00:00:00 2001
|
||||
From: Phillip Susi <psusi@cfl.rr.com>
|
||||
Date: Wed, 31 Mar 2010 15:52:08 +0200
|
||||
Subject: [PATCH] partx: do not add nonexistent partitions
|
||||
|
||||
This simple patch fixes partx -a to not add nonexistent zero length
|
||||
partitions for unused primary partition slots to to the kernel. This
|
||||
makes partx conform to the usual kernel behavior.
|
||||
|
||||
Signed-off-by: Phillip Susi <psusi@cfl.rr.com>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
|
||||
From c86dda7b36e3a6cfc63b9c03f7d275d715d35fd0 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Wed, 31 Mar 2010 16:38:51 +0200
|
||||
Subject: [PATCH] partx: fix infinite loop
|
||||
|
||||
On Wed, Mar 24, 2010 at 04:39:35PM -0400, Phillip Susi wrote:
|
||||
> I noticed that running partx -d /dev/sda hangs so I looked into it
|
||||
> and it seems that it keeps trying to delete partitions forever.
|
||||
|
||||
Reported-By: Phillip Susi <psusi@cfl.rr.com>
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
|
||||
---
|
||||
partx/partx.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- util-linux-ng-2.17.2.orig/partx/partx.c
|
||||
+++ util-linux-ng-2.17.2/partx/partx.c
|
||||
@@ -178,6 +178,8 @@ main(int argc, char **argv){
|
||||
while (upper == 0 || lower <= upper) {
|
||||
int err;
|
||||
|
||||
+ if (lower > MAXSLICES)
|
||||
+ break;
|
||||
pt.pno = lower;
|
||||
pt.start = 0;
|
||||
pt.length = 0;
|
||||
@@ -295,6 +297,9 @@ main(int argc, char **argv){
|
||||
}
|
||||
}
|
||||
for (j=0; j<n; j++) {
|
||||
+ /* skip unused/empty partitions */
|
||||
+ if (slices[j].size == 0)
|
||||
+ continue;
|
||||
pt.pno = lower+j;
|
||||
pt.start = 512 * (long long) slices[j].start;
|
||||
pt.length = 512 * (long long) slices[j].size;
|
||||
71
util-linux-ng-2.17-rtcwake-off.patch
Normal file
71
util-linux-ng-2.17-rtcwake-off.patch
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
From ecd55f9647d139784857df994d0f5b965d164547 Mon Sep 17 00:00:00 2001
|
||||
From: Karel Zak <kzak@redhat.com>
|
||||
Date: Thu, 8 Apr 2010 08:51:00 +0200
|
||||
Subject: [PATCH 1/2] rtcwake: does miss the "off" option
|
||||
|
||||
Reported-by: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
|
||||
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=580296
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
sys-utils/rtcwake.c | 24 +++++++++++++++++++-----
|
||||
1 files changed, 19 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
|
||||
index 7b2df26..344fed7 100644
|
||||
--- a/sys-utils/rtcwake.c
|
||||
+++ b/sys-utils/rtcwake.c
|
||||
@@ -468,15 +468,19 @@ int main(int argc, char **argv)
|
||||
fflush(stdout);
|
||||
usleep(10 * 1000);
|
||||
|
||||
- if (strcmp(suspend, "no") == 0)
|
||||
+ if (strcmp(suspend, "no") == 0) {
|
||||
+ if (verbose)
|
||||
+ printf(_("suspend mode: no; leaving\n"));
|
||||
+ close(fd);
|
||||
exit(EXIT_SUCCESS);
|
||||
- else if (strcmp(suspend, "on") != 0) {
|
||||
- sync();
|
||||
- suspend_system(suspend);
|
||||
+
|
||||
} else if (strcmp(suspend, "off") == 0) {
|
||||
char *arg[4];
|
||||
int i = 0;
|
||||
|
||||
+ if (verbose)
|
||||
+ printf(_("suspend mode: off; executing %s\n"),
|
||||
+ _PATH_SHUTDOWN);
|
||||
arg[i++] = _PATH_SHUTDOWN;
|
||||
arg[i++] = "-P";
|
||||
arg[i++] = "now";
|
||||
@@ -487,9 +491,13 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, _("%s: unable to execute %s: %s\n"),
|
||||
progname, _PATH_SHUTDOWN, strerror(errno));
|
||||
rc = EXIT_FAILURE;
|
||||
- } else {
|
||||
+
|
||||
+ } else if (strcmp(suspend, "on") == 0) {
|
||||
unsigned long data;
|
||||
|
||||
+ if (verbose)
|
||||
+ printf(_("suspend mode: on; reading rtc\n"));
|
||||
+
|
||||
do {
|
||||
t = read(fd, &data, sizeof data);
|
||||
if (t < 0) {
|
||||
@@ -499,6 +507,12 @@ int main(int argc, char **argv)
|
||||
if (verbose)
|
||||
printf("... %s: %03lx\n", devname, data);
|
||||
} while (!(data & RTC_AF));
|
||||
+
|
||||
+ } else {
|
||||
+ if (verbose)
|
||||
+ printf(_("suspend mode: %s; suspending system\n"), suspend);
|
||||
+ sync();
|
||||
+ suspend_system(suspend);
|
||||
}
|
||||
|
||||
if (ioctl(fd, RTC_AIE_OFF, 0) < 0)
|
||||
--
|
||||
1.6.6
|
||||
|
||||
28
util-linux-ng-2.18-blkid-HFS.patch
Normal file
28
util-linux-ng-2.18-blkid-HFS.patch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
From 791a2fd67c118c3f07141e4cc95532fe908015a9 Mon Sep 17 00:00:00 2001
|
||||
From: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
|
||||
Date: Mon, 19 Jul 2010 18:04:33 -0500
|
||||
Subject: [PATCH] libblkid: set tolerant flag for HFS
|
||||
|
||||
An CDROM can contain both HFS and ISO9660 views on the same filesystem.
|
||||
This confuses mount/KDE/Gnome.
|
||||
|
||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||
---
|
||||
shlibs/blkid/src/superblocks/hfs.c | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/shlibs/blkid/src/superblocks/hfs.c b/shlibs/blkid/src/superblocks/hfs.c
|
||||
index 8ebff68..033a65d 100644
|
||||
--- a/shlibs/blkid/src/superblocks/hfs.c
|
||||
+++ b/shlibs/blkid/src/superblocks/hfs.c
|
||||
@@ -291,6 +291,7 @@ const struct blkid_idinfo hfs_idinfo =
|
||||
.name = "hfs",
|
||||
.usage = BLKID_USAGE_FILESYSTEM,
|
||||
.probefunc = probe_hfs,
|
||||
+ .flags = BLKID_IDINFO_TOLERANT,
|
||||
.magics =
|
||||
{
|
||||
{ .magic = "BD", .len = 2, .kboff = 1 },
|
||||
--
|
||||
1.7.2.3
|
||||
|
||||
11
util-linux-ng-60-raw.rules
Normal file
11
util-linux-ng-60-raw.rules
Normal 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.
|
||||
6
util-linux-ng-chsh-chfn.pamd
Normal file
6
util-linux-ng-chsh-chfn.pamd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#%PAM-1.0
|
||||
auth sufficient pam_rootok.so
|
||||
auth include system-auth
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
session include system-auth
|
||||
16
util-linux-ng-login.pamd
Normal file
16
util-linux-ng-login.pamd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#%PAM-1.0
|
||||
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
|
||||
auth include system-auth
|
||||
account required pam_nologin.so
|
||||
account include system-auth
|
||||
password include system-auth
|
||||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
session required pam_loginuid.so
|
||||
session optional pam_console.so
|
||||
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
||||
session required pam_selinux.so open
|
||||
session required pam_namespace.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include system-auth
|
||||
-session optional pam_ck_connector.so
|
||||
14
util-linux-ng-remote.pamd
Normal file
14
util-linux-ng-remote.pamd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#%PAM-1.0
|
||||
auth required pam_securetty.so
|
||||
auth include password-auth
|
||||
account required pam_nologin.so
|
||||
account include password-auth
|
||||
password include password-auth
|
||||
# pam_selinux.so close should be the first session rule
|
||||
session required pam_selinux.so close
|
||||
session required pam_loginuid.so
|
||||
# pam_selinux.so open should only be followed by sessions to be executed in the user context
|
||||
session required pam_selinux.so open
|
||||
session required pam_namespace.so
|
||||
session optional pam_keyinit.so force revoke
|
||||
session include password-auth
|
||||
2297
util-linux-ng.spec
Normal file
2297
util-linux-ng.spec
Normal file
File diff suppressed because it is too large
Load diff
117
uuidd.init
Executable file
117
uuidd.init
Executable file
|
|
@ -0,0 +1,117 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# uuidd uuidd daemon for unique time-based UUID generation
|
||||
#
|
||||
# Author: Eric Sandeen <sandeen@redhat.com>
|
||||
#
|
||||
# chkconfig: - 60 99
|
||||
#
|
||||
# description: uuidd is a helper daemon to guarantee uniqueness of \
|
||||
# time-based UUIDs when using libuuid.
|
||||
# processname: uuidd
|
||||
# pidfile: /var/lib/libuuid/uuidd.pid
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: uuidd
|
||||
# Required-Start: $time $local_fs
|
||||
# Required-Stop: $time $local_fs
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: UUID daemon
|
||||
# Description: Daemon which guarantees uniqueness of time-based UUIDS
|
||||
# when using libuuid.
|
||||
### END INIT INFO
|
||||
|
||||
# source function library
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
[ -e /etc/sysconfig/uuidd ] && . /etc/sysconfig/uuidd
|
||||
|
||||
DAEMON=uuidd
|
||||
exec=/usr/sbin/uuidd
|
||||
prog=uuidd
|
||||
user=uuidd
|
||||
lockfile=/var/lock/subsys/$DAEMON
|
||||
pidfile=/var/run/uuidd/uuidd.pid
|
||||
|
||||
check() {
|
||||
# Check that we're a privileged user
|
||||
[ $(id -u) -eq 0 ] || exit 4
|
||||
|
||||
# Check if daemon binary is executable
|
||||
[ -x $exec ] || exit 5
|
||||
}
|
||||
|
||||
start () {
|
||||
check
|
||||
echo -n $"Starting $prog: "
|
||||
daemon --user $user --pidfile $pidfile $DAEMON
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && touch $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
stop () {
|
||||
check
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $DAEMON
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && rm -f $lockfile
|
||||
return $retval
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
force_reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
rh_status() {
|
||||
status -p $pidfile $DAEMON
|
||||
}
|
||||
|
||||
rh_status_q() {
|
||||
rh_status >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
rh_status_q && exit 0
|
||||
$1
|
||||
;;
|
||||
stop)
|
||||
rh_status_q || exit 0
|
||||
$1
|
||||
;;
|
||||
restart)
|
||||
$1
|
||||
;;
|
||||
reload)
|
||||
rh_status_q || exit 7
|
||||
$1
|
||||
;;
|
||||
force-reload)
|
||||
force_reload
|
||||
;;
|
||||
status)
|
||||
rh_status
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
rh_status_q || exit 0
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
exit $?
|
||||
Loading…
Add table
Add a link
Reference in a new issue