Compare commits

...
This repository has been archived on 2026-09-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

18 commits

Author SHA1 Message Date
Karel Zak
21d35a521f 2.17.2-10: improve libblkid RAIDs detection
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-12 15:11:51 +01:00
Karel Zak
6d9addd153 2.17.2-9: fix #538551 - Dual-filesystem (ISO9660/HFS) not mounted
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-11 10:43:19 +02:00
Karel Zak
90527d853e 2.17.2-8: fix #620924
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-05 12:39:07 +02:00
Karel Zak
08e1e3ab3c * Mon Aug 2 2010 Karel Zak <kzak@redhat.com> 2.17.2-7
- fix #618957 - ISO images listed in fstab are mounted twice at boot

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-02 10:52:05 +02:00
Fedora Release Engineering
ba850c1743 dist-git conversion 2010-07-29 14:50:03 +00:00
053df7dad8 - fix #615719 - tmpfs mount fails with 'user' option.
- fix #598631 - shutdown, reboot, halt and C-A-D don't work
2010-07-20 08:38:50 +00:00
31dde6b9be - fix #592958 - whole disk raid members to not be identified
- fix #592061 - partx infinite loop
- add diffstat (by quilt refresh) to some old patches
2010-05-19 11:45:09 +00:00
6fafd00390 - #588668 - F13: don't probe for RAIDs on CD-ROMs
- #543749 - After upgrade from Fedora 11, RAID-1 mdraid assembles
    incorrectly
2010-05-04 09:06:38 +00:00
69cb29ad36 remove unused patches 2010-04-12 15:06:29 +00:00
71a078d8f8 - fix #581252 - remounting tmpfs fails because of hidden rootcontext= 2010-04-12 13:19:23 +00:00
5bfc4138b6 - fix #580296 - "rtcwake" does miss the "off" option 2010-04-08 07:48:10 +00:00
74dff73ae2 - upgrade to the bugfix release 2.17.2
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-Releas
    eNotes
    ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-Change
    Log
- remove: util-linux-ng-2.17-blkid-alignment-offset.patch
    util-linux-ng-2.17-blkid-minix.patch
    util-linux-ng-2.17-blkid-tinyflag.patch
- fix #575734 - use microsecond resolution for blkid cache entries
2010-03-22 09:54:39 +00:00
851a3a0950 - minor bugfix in the spec file 2010-03-10 12:12:17 +00:00
5b538ebb80 - fix #572121 - reset tiny flag in libblkid 2010-03-10 11:44:24 +00:00
cd762949f8 - fix #570606 - blkid (and related) should be a bit more robust 2010-03-08 13:17:10 +00:00
4f62fccdf2 - fix #570136 - RHEL6: libblkid: support alignment_offset=-1 2010-03-03 16:01:23 +00:00
5ddedddbbb - upgrade to the final 2.17.1
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-Releas
    eNotes
    ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-Change
    Log
2010-02-22 12:35:06 +00:00
Jesse Keating
c9de782155 Initialize branch F-13 for util-linux-ng 2010-02-17 03:23:59 +00:00
17 changed files with 2251 additions and 55 deletions

View file

@ -1,2 +0,0 @@
util-linux-ng-2.17.1-rc1.tar.bz2
floppy-0.16.tar.bz2

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
util-linux-ng-2.17.2.tar.bz2
floppy-0.16.tar.bz2

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: util-linux-ng
# $Id: Makefile,v 1.1 2007/08/17 21:07:02 wtogami Exp $
NAME := util-linux-ng
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View file

@ -18,11 +18,34 @@ case $1 in
;;
esac
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
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

View file

@ -1,2 +1,2 @@
2fb632d41d4bb47b02a41ced45e4649f util-linux-ng-2.17.1-rc1.tar.bz2
4635725a3eef1c57090bac8ea5e082e6 util-linux-ng-2.17.2.tar.bz2
7eeb9a6f7a258174bf0fa80f1370788d floppy-0.16.tar.bz2

View file

@ -1,8 +1,10 @@
Index: util-linux-ng-2.14.2-rc1/login-utils/login.c
===================================================================
--- util-linux-ng-2.14.2-rc1.orig/login-utils/login.c
+++ util-linux-ng-2.14.2-rc1/login-utils/login.c
@@ -1415,7 +1415,7 @@ dolastlog(int quiet) {
---
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;

View file

@ -1,7 +1,10 @@
diff -up util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c
--- util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak 2009-03-25 13:19:08.000000000 +0100
+++ util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c 2009-06-04 15:22:48.000000000 +0200
@@ -243,6 +243,26 @@ print_perms (int id, struct ipc_perm *ip
---
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);
}
@ -28,7 +31,7 @@ diff -up util-linux-ng-2.15.1-rc1/sys-utils/ipcs.c.kzak util-linux-ng-2.15.1-rc1
void do_shm (char format)
{
@@ -266,12 +286,12 @@ 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 */

View file

@ -1,6 +1,12 @@
diff -up util-linux-ng-2.17-git5e51568/misc-utils/blkid.8.kzak util-linux-ng-2.17-git5e51568/misc-utils/blkid.8
--- util-linux-ng-2.17-git5e51568/misc-utils/blkid.8.kzak 2009-10-16 22:50:03.000000000 +0200
+++ util-linux-ng-2.17-git5e51568/misc-utils/blkid.8 2009-10-19 14:31:10.000000000 +0200
---
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
@ -19,10 +25,9 @@ diff -up util-linux-ng-2.17-git5e51568/misc-utils/blkid.8.kzak util-linux-ng-2.1
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
diff -up util-linux-ng-2.17-git5e51568/misc-utils/blkid.c.kzak util-linux-ng-2.17-git5e51568/misc-utils/blkid.c
--- util-linux-ng-2.17-git5e51568/misc-utils/blkid.c.kzak 2009-10-16 22:50:03.000000000 +0200
+++ util-linux-ng-2.17-git5e51568/misc-utils/blkid.c 2009-10-19 14:31:10.000000000 +0200
@@ -62,7 +62,7 @@ static void usage(int error)
--- 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"
@ -31,9 +36,8 @@ diff -up util-linux-ng-2.17-git5e51568/misc-utils/blkid.c.kzak util-linux-ng-2.1
" -h print this usage message and exit\n"
" -g garbage collect the blkid cache\n"
" -o <format> output format; can be one of:\n"
diff -up util-linux-ng-2.17-git5e51568/shlibs/blkid/libblkid.3.kzak util-linux-ng-2.17-git5e51568/shlibs/blkid/libblkid.3
--- util-linux-ng-2.17-git5e51568/shlibs/blkid/libblkid.3.kzak 2009-10-16 22:50:03.000000000 +0200
+++ util-linux-ng-2.17-git5e51568/shlibs/blkid/libblkid.3 2009-10-19 14:31:10.000000000 +0200
--- 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
@ -61,10 +65,9 @@ diff -up util-linux-ng-2.17-git5e51568/shlibs/blkid/libblkid.3.kzak util-linux-n
caches data extracted from each recognized block device
.TP
.I /etc/blkid.conf
diff -up util-linux-ng-2.17-git5e51568/shlibs/blkid/src/blkidP.h.kzak util-linux-ng-2.17-git5e51568/shlibs/blkid/src/blkidP.h
--- util-linux-ng-2.17-git5e51568/shlibs/blkid/src/blkidP.h.kzak 2009-10-16 22:50:03.000000000 +0200
+++ util-linux-ng-2.17-git5e51568/shlibs/blkid/src/blkidP.h 2009-10-19 14:32:03.000000000 +0200
@@ -267,7 +267,7 @@ extern char *blkid_strconcat(const char
--- 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);

View 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

View 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 */

File diff suppressed because it is too large Load diff

View 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;

View 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;

View 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;

View 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

View 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

View file

@ -1,13 +1,13 @@
### Header
Summary: A collection of basic system utilities
Name: util-linux-ng
Version: 2.17.1
Release: 0.1%{?dist}
Version: 2.17.2
Release: 10%{?dist}
License: GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
%define upstream_version %{version}-rc1
%define upstream_version %{version}
### Features
%if 0%{?rhel}
@ -104,6 +104,26 @@ Patch7: util-linux-ng-2.13-login-lastlog.patch
# 231192 - ipcs is not printing correct values on pLinux
Patch8: util-linux-ng-2.15-ipcs-32bit.patch
### Upstream Patches
###
# 575734 - use microsecond resolution for blkid cache entries
Patch9: util-linux-ng-2.17-blkid-usec.patch
# 580296 - "rtcwake" does miss the "off" option
Patch10: util-linux-ng-2.17-rtcwake-off.patch
# 588668 - F13: don't probe for RAIDs on CD-ROMs
Patch11: util-linux-ng-2.17-blkid-cdrom.patch
# 543749 - After upgrade from Fedora 11, RAID-1 mdraid assembles incorrectly
# 592958 - whole disk raid members to not be identified
Patch12: util-linux-ng-2.17-blkid-raid.patch
# 592061 - partx infinite loop
Patch13: util-linux-ng-2.17-partx.patch
# 598631 - shutdown, reboot, halt and C-A-D don't work
Patch14: util-linux-ng-2.17-agetty-clocal.patch
# 618957 - ISO images listed in fstab are mounted twice at boot
Patch15: util-linux-ng-2.17-mount-loopdev.patch
# 538551 - Dual-filesystem (ISO9660/HFS) CD-ROMs not mounted automatically
Patch16: util-linux-ng-2.18-blkid-HFS.patch
%description
The util-linux-ng package contains a large variety of low-level system
utilities that are necessary for a Linux system to function. Among
@ -196,6 +216,14 @@ cp %{SOURCE8} %{SOURCE9} .
%patch5 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%build
unset LINGUAS || :
@ -715,6 +743,63 @@ fi
%changelog
* Wed Jan 12 2011 Karel Zak <kzak@redhat.com> 2.17.2-10
- improve libblkid RAIDs detection (#543749)
* Mon Oct 11 2010 Karel Zak <kzak@redhat.com> 2.17.2-9
* fix #538551 - Dual-filesystem (ISO9660/HFS) CD-ROMs not mounted automatically
* Thu Aug 5 2010 Karel Zak <kzak@redhat.com> 2.17.2-8
- fix #620924 - /sbin/mount.tmpfs uses not available /usr/bin/id
* Mon Aug 2 2010 Karel Zak <kzak@redhat.com> 2.17.2-7
- fix #618957 - ISO images listed in fstab are mounted twice at boot
* Tue Jul 20 2010 Karel Zak <kzak@redhat.com> 2.17.2-6
- fix #615719 - tmpfs mount fails with 'user' option.
- fix #598631 - shutdown, reboot, halt and C-A-D don't work
* Wed May 19 2010 Karel Zak <kzak@redhat.com> 2.17.2-5
- fix #592958 - whole disk raid members to not be identified
- fix #592061 - partx infinite loop
- add diffstat (by quilt refresh) to some old patches
* Tue May 4 2010 Karel Zak <kzak@redhat.com> 2.17.2-4
- fix #588668 - F13: don't probe for RAIDs on CD-ROMs
- fix #543749 - After upgrade from Fedora 11, RAID-1 mdraid assembles incorrectly
* Mon Apr 12 2010 Karel Zak <kzak@redhat.com> 2.17.2-3
- fix #581252 - remounting tmpfs fails because of hidden rootcontext=
* Thu Apr 8 2010 Karel Zak <kzak@redhat.com> 2.17.2-2
- fix #580296 - "rtcwake" does miss the "off" option
* Mon Mar 22 2010 Karel Zak <kzak@redhat.com> 2.17.2-1
- upgrade to the bugfix release 2.17.2
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-ReleaseNotes
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.2-ChangeLog
- remove: util-linux-ng-2.17-blkid-alignment-offset.patch
util-linux-ng-2.17-blkid-minix.patch
util-linux-ng-2.17-blkid-tinyflag.patch
- fix #575734 - use microsecond resolution for blkid cache entries
* Wed Mar 10 2010 Karel Zak <kzak@redhat.com> 2.17.1-5
- minor bugfix in the spec file
* Wed Mar 10 2010 Karel Zak <kzak@redhat.com> 2.17.1-4
- fix #572139 - reset tiny flag in libblkid
* Mon Mar 8 2010 Karel Zak <kzak@redhat.com> 2.17.1-3
- fix #570606 - blkid (and related) should be a bit more robust
* Wed Mar 3 2010 Karel Zak <kzak@redhat.com> 2.17.1-2
- fix #570136 - RHEL6: libblkid: support alignment_offset=-1
* Mon Feb 22 2010 Karel Zak <kzak@redhat.com> 2.17.1-1
- upgrade to the final 2.17.1
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-ReleaseNotes
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.17/v2.17.1-ChangeLog
* Tue Feb 16 2010 Karel Zak <kzak@redhat.com> 2.17.1-0.1
- upgrade to 2.17.1-rc1