forked from pool/util-linux
This commit is contained in:
parent
2d968d2588
commit
e5c2fcfe9a
File diff suppressed because it is too large
Load Diff
@ -1,11 +0,0 @@
|
||||
loop-AES patch in util-linux
|
||||
============================
|
||||
|
||||
To enhance the feature of mount, umount, losetup, swapon and swapoff we have
|
||||
included the patch to util-linux from Jari Ruusu's loop-AES package
|
||||
(http://loop-aes.sourceforge.net/). More details about this patch can be found
|
||||
in /usr/share/doc/packages/util-linux/README.loop-AES-*
|
||||
Please note, that we have only used the patch to util-linux and not the ones
|
||||
for gpg or the new kernel loop driver.
|
||||
|
||||
Your SuSE team <feedback@suse.de>
|
5
etc_filesystems
Normal file
5
etc_filesystems
Normal file
@ -0,0 +1,5 @@
|
||||
vfat
|
||||
hfs
|
||||
minix
|
||||
reiserfs
|
||||
*
|
@ -1,13 +0,0 @@
|
||||
.\" Michal Svec <msvec@suse.cz>
|
||||
.TH GUESSFSTYPE 8 "25 January 2002" "Linux 2.4" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
guessfstype \- guess the device file system type
|
||||
.SH SYNOPSIS
|
||||
.BI guessfstype " device"
|
||||
.SH DESCRIPTION
|
||||
.B guessfstype
|
||||
guess the device file system type from the device super block
|
||||
.SH "SEE ALSO"
|
||||
.BR mount (8)
|
||||
.SH AUTHOR
|
||||
Michal Svec <msvec@suse.cz>
|
@ -1,48 +0,0 @@
|
||||
--- util-linux-2.12q/mount/guessfstype.c
|
||||
+++ util-linux-2.12q/mount/guessfstype.c
|
||||
@@ -0,0 +1,22 @@
|
||||
+#include <stdio.h>
|
||||
+#include "mount_guess_fstype.h"
|
||||
+
|
||||
+int verbose = 0;
|
||||
+int mount_quiet=0;
|
||||
+int sloppy = 0;
|
||||
+
|
||||
+char *progname;
|
||||
+
|
||||
+int main(int argc, char *argv[]) {
|
||||
+ char *device, *type;
|
||||
+
|
||||
+ if(argc != 2) return 1;
|
||||
+
|
||||
+ progname = argv[0];
|
||||
+ device = argv[1];
|
||||
+
|
||||
+ type = do_guess_fstype(device);
|
||||
+ printf("%s *appears* to be: %s\n", device, type);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
--- util-linux-2.12q/mount/Makefile
|
||||
+++ util-linux-2.12q/mount/Makefile
|
||||
@@ -11,7 +11,7 @@
|
||||
LINK = $(CC) $(LDFLAGS)
|
||||
|
||||
SUID_PROGS = mount umount
|
||||
-NOSUID_PROGS = swapon losetup
|
||||
+NOSUID_PROGS = swapon losetup guessfstype
|
||||
MAN5 = fstab.5 nfs.5
|
||||
MAN8 = mount.8 swapoff.8 swapon.8 umount.8 losetup.8
|
||||
|
||||
@@ -57,6 +57,11 @@
|
||||
version.o $(LIB)/env.o loumount.o
|
||||
$(LINK) $^ -o $@ $(BLKID_LIB)
|
||||
|
||||
+guessfstype: guessfstype.o mount_guess_fstype.o sundries.o realpath.o \
|
||||
+ fstab.o mntent.o get_label_uuid.o mount_blkid.o mount_by_label.o \
|
||||
+ xmalloc.o
|
||||
+ $(LINK) $^ -o $@
|
||||
+
|
||||
swapon: swapon.o version.o xmalloc.o \
|
||||
get_label_uuid.o mount_by_label.o mount_blkid.o loop.o sha512.o $(LIB)/xstrncpy.o
|
||||
$(LINK) $^ -o $@ $(BLKID_LIB)
|
File diff suppressed because it is too large
Load Diff
@ -1,61 +0,0 @@
|
||||
diff -u util-linux-2.11z/mount/nfsmount.c-o util-linux-2.11z/mount/nfsmount.c
|
||||
--- util-linux-2.11z/mount/nfsmount.c-o 2003-06-18 15:23:06.000000000 +0200
|
||||
+++ util-linux-2.11z/mount/nfsmount.c 2003-06-18 15:25:35.000000000 +0200
|
||||
@@ -215,7 +215,7 @@
|
||||
} status;
|
||||
struct stat statbuf;
|
||||
char *s;
|
||||
- int port, mountport, proto, bg, soft, intr;
|
||||
+ int port, mountport, proto, bg, soft, intr, nonreserved;
|
||||
int posix, nocto, noac, nolock, broken_suid, noacl;
|
||||
int retry, tcp;
|
||||
int mountprog, mountvers, nfsprog, nfsvers;
|
||||
@@ -320,6 +320,7 @@
|
||||
noac = 0;
|
||||
retry = 10000; /* 10000 minutes ~ 1 week */
|
||||
tcp = 0;
|
||||
+ nonreserved = 0;
|
||||
|
||||
mountprog = MOUNTPROG;
|
||||
mountvers = 0;
|
||||
@@ -411,6 +412,8 @@
|
||||
soft = !val;
|
||||
else if (!strcmp(opt, "intr"))
|
||||
intr = val;
|
||||
+ else if (!strcmp(opt, "reserved"))
|
||||
+ nonreserved = !val;
|
||||
else if (!strcmp(opt, "posix"))
|
||||
posix = val;
|
||||
else if (!strcmp(opt, "cto"))
|
||||
@@ -445,7 +448,8 @@
|
||||
| (intr ? NFS_MOUNT_INTR : 0)
|
||||
| (posix ? NFS_MOUNT_POSIX : 0)
|
||||
| (nocto ? NFS_MOUNT_NOCTO : 0)
|
||||
- | (noac ? NFS_MOUNT_NOAC : 0);
|
||||
+ | (noac ? NFS_MOUNT_NOAC : 0)
|
||||
+ | (nonreserved ? NFS_MOUNT_NONRESERVED : 0);
|
||||
#if NFS_MOUNT_VERSION >= 2
|
||||
if (nfs_mount_version >= 2)
|
||||
data.flags |= (tcp ? NFS_MOUNT_TCP : 0);
|
||||
diff -u util-linux-2.11z/mount/nfs_mount4.h-o util-linux-2.11z/mount/nfs_mount4.h
|
||||
--- util-linux-2.11z/mount/nfs_mount4.h-o 2003-06-18 15:23:06.000000000 +0200
|
||||
+++ util-linux-2.11z/mount/nfs_mount4.h 2003-06-18 15:26:04.000000000 +0200
|
||||
@@ -52,3 +52,4 @@
|
||||
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
|
||||
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
|
||||
#define NFS_MOUNT_NOACL 0x0800 /* 4 */
|
||||
+#define NFS_MOUNT_NONRESERVED 0x1000
|
||||
--- util-linux-2.11z/mount/nfs.5-o 2003-06-18 07:10:54.000000000 -0700
|
||||
+++ util-linux-2.11z/mount/nfs.5 2003-06-18 07:14:05.000000000 -0700
|
||||
@@ -213,6 +213,11 @@
|
||||
NFS version 3. (On NFS version 2 filesystems this option has no effect.)
|
||||
This option also deactivates the GETACL and SETACL remote procedure calls
|
||||
which are otherwise used to manipulate ACLs.
|
||||
+.TP 1.5i
|
||||
+.I noreserved
|
||||
+Don't use a reserved source port. This usually requires special options
|
||||
+on the NFS server (insecure for linux knfsd), but allows more than 1024
|
||||
+mounts from a single IP address.
|
||||
.P
|
||||
All of the non-value options have corresponding nooption forms.
|
||||
For example, nointr means don't allow file operations to be
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:84038ab2b3ea6ff4b31b46638b9ceae56aebc95742e9b75276c6e6f5465f05b1
|
||||
size 15930
|
@ -1,38 +0,0 @@
|
||||
--- disk-utils/fsck.cramfs.c
|
||||
+++ disk-utils/fsck.cramfs.c
|
||||
@@ -76,16 +76,7 @@
|
||||
|
||||
#define PAD_SIZE 512
|
||||
|
||||
-#include <asm/page.h>
|
||||
-#ifdef PAGE_SIZE
|
||||
-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
|
||||
-#elif defined __ia64__
|
||||
-#define PAGE_CACHE_SIZE (16384)
|
||||
-#elif defined __alpha__
|
||||
-#define PAGE_CACHE_SIZE (8192)
|
||||
-#else
|
||||
-#define PAGE_CACHE_SIZE (4096)
|
||||
-#endif
|
||||
+#define PAGE_CACHE_SIZE getpagesize() /* Stupid programmer */
|
||||
|
||||
/* Guarantee access to at least 8kB at a time */
|
||||
#define ROMBUFFER_BITS 13
|
||||
@@ -95,7 +86,7 @@
|
||||
static unsigned long read_buffer_block = ~0UL;
|
||||
|
||||
/* Uncompressing data structures... */
|
||||
-static char outbuffer[PAGE_CACHE_SIZE*2];
|
||||
+static char *outbuffer; /* Stupid programmer */
|
||||
z_stream stream;
|
||||
|
||||
#endif /* INCLUDE_FS_TESTS */
|
||||
@@ -464,6 +455,8 @@
|
||||
int c; /* for getopt */
|
||||
int start = 0;
|
||||
|
||||
+ outbuffer = malloc(PAGE_CACHE_SIZE); /* Stupid programmer */
|
||||
+
|
||||
if (argc)
|
||||
progname = argv[0];
|
||||
|
@ -1,5 +1,7 @@
|
||||
--- util-linux-2.12q/fdisk/fdiskmaclabel.c
|
||||
+++ util-linux-2.12q/fdisk/fdiskmaclabel.c
|
||||
Index: util-linux-ng-2.12r+git20070330/fdisk/fdiskmaclabel.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/fdisk/fdiskmaclabel.c
|
||||
@@ -0,0 +1,87 @@
|
||||
+/*
|
||||
+ Changes:
|
||||
@ -88,8 +90,10 @@
|
||||
+ mac_label = 1; /* %% */
|
||||
+ return 1;
|
||||
+}
|
||||
--- util-linux-2.12q/fdisk/fdiskmaclabel.h
|
||||
+++ util-linux-2.12q/fdisk/fdiskmaclabel.h
|
||||
Index: util-linux-ng-2.12r+git20070330/fdisk/fdiskmaclabel.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/fdisk/fdiskmaclabel.h
|
||||
@@ -0,0 +1,40 @@
|
||||
+#include <linux/types.h> /* for __u32 etc */
|
||||
+/*
|
||||
@ -131,50 +135,19 @@
|
||||
+extern struct systypes mac_sys_types[];
|
||||
+extern void mac_nolabel( void );
|
||||
+extern int check_mac_label( void );
|
||||
--- util-linux-2.12q/fdisk/Makefile
|
||||
+++ util-linux-2.12q/fdisk/Makefile
|
||||
@@ -39,7 +39,7 @@
|
||||
endif
|
||||
endif
|
||||
|
||||
-cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
||||
+cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
||||
ifeq "$(HAVE_SLANG)" "yes"
|
||||
$(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
|
||||
else
|
||||
@@ -55,15 +55,17 @@
|
||||
rm -f activate
|
||||
ln -s sfdisk activate
|
||||
|
||||
-fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o \
|
||||
- fdisksunlabel.o fdiskaixlabel.o i386_sys_types.o partname.o
|
||||
+fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o fdisksunlabel.o \
|
||||
+ fdiskmaclabel.o fdiskaixlabel.o i386_sys_types.o partname.o
|
||||
fdisk.o: fdisk.c fdisk.h
|
||||
fdiskbsdlabel.o: fdiskbsdlabel.c fdisk.h fdiskbsdlabel.h
|
||||
fdisksunlabel.o: fdisksunlabel.c fdisksunlabel.h fdisk.h
|
||||
fdiskaixlabel.o: fdiskaixlabel.c fdiskaixlabel.h fdisk.h
|
||||
+fdiskmaclabel.o: fdiskmaclabel.c fdiskmaclabel.h fdisk.h
|
||||
+
|
||||
fdisk.o cfdisk.o sfdisk.o fdiskbsdlabel.o fdisksunlabel.o \
|
||||
- fdisksgilabel.o fdiskaixlabel.o i386_sys_types.o partname.o: common.h
|
||||
-sfdisk: sfdisk.o disksize.o i386_sys_types.o partname.o
|
||||
+ fdisksgilabel.o fdiskaixlabel.o fdiskmaclabel.o i386_sys_types.o partname.o: common.h
|
||||
+sfdisk: sfdisk.o disksize.o i386_sys_types.o partname.o
|
||||
|
||||
install: all
|
||||
$(INSTALLDIR) $(SBINDIR)
|
||||
--- util-linux-2.12q/fdisk/fdisk.c
|
||||
+++ util-linux-2.12q/fdisk/fdisk.c
|
||||
Index: util-linux-ng-2.12r+git20070330/fdisk/fdisk.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/fdisk/fdisk.c
|
||||
+++ util-linux-ng-2.12r+git20070330/fdisk/fdisk.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "fdisksunlabel.h"
|
||||
#include "fdisksgilabel.h"
|
||||
#include "fdiskaixlabel.h"
|
||||
+#include "fdiskmaclabel.h"
|
||||
|
||||
#include "../defines.h"
|
||||
#ifdef HAVE_blkpg_h
|
||||
@@ -165,11 +166,12 @@
|
||||
#ifdef HAVE_LINUX_COMPILER_H
|
||||
#include <linux/compiler.h>
|
||||
@@ -167,11 +168,12 @@ unsigned int heads,
|
||||
|
||||
unsigned long long total_number_of_sectors;
|
||||
|
||||
@ -188,7 +161,7 @@
|
||||
int possibly_osf_label = 0;
|
||||
|
||||
jmp_buf listingbuf;
|
||||
@@ -363,6 +365,10 @@
|
||||
@@ -365,6 +367,10 @@ menu(void) {
|
||||
puts(_(" v verify the partition table"));
|
||||
puts(_(" w write table to disk and exit"));
|
||||
}
|
||||
@ -199,7 +172,7 @@
|
||||
else if (aix_label) {
|
||||
puts(_("Command action"));
|
||||
puts(_(" m print this menu"));
|
||||
@@ -443,6 +449,9 @@
|
||||
@@ -445,6 +451,9 @@ xmenu(void) {
|
||||
puts(_(" v verify the partition table"));
|
||||
puts(_(" w write table to disk and exit"));
|
||||
}
|
||||
@ -209,7 +182,7 @@
|
||||
else {
|
||||
puts(_("Command action"));
|
||||
puts(_(" b move beginning of data in a partition")); /* !sun */
|
||||
@@ -943,6 +952,9 @@
|
||||
@@ -945,6 +954,9 @@ get_boot(enum action what) {
|
||||
if (check_aix_label())
|
||||
return 0;
|
||||
|
||||
@ -219,11 +192,10 @@
|
||||
if (check_osf_label()) {
|
||||
possibly_osf_label = 1;
|
||||
if (!valid_part_table_flag(MBRbuffer)) {
|
||||
@@ -2074,6 +2086,15 @@
|
||||
"This will destroy the present disk contents.\n"));
|
||||
@@ -2077,6 +2089,15 @@ new_partition(void) {
|
||||
return;
|
||||
}
|
||||
+
|
||||
|
||||
+ if (mac_label) {
|
||||
+ printf(_("\tSorry - this fdisk cannot handle Mac disk labels."
|
||||
+ "\n\tIf you want to add DOS-type partitions, create"
|
||||
@ -232,10 +204,11 @@
|
||||
+ "This will destroy the present disk contents.\n"));
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
+
|
||||
for (i = 0; i < 4; i++)
|
||||
free_primary += !ptes[i].part_table->sys_ind;
|
||||
@@ -2404,7 +2425,11 @@
|
||||
|
||||
@@ -2406,7 +2427,11 @@ try(char *device, int user_specified) {
|
||||
if (gb > 0) { /* I/O error */
|
||||
} else if (gb < 0) { /* no DOS signature */
|
||||
list_disk_geometry();
|
||||
@ -248,3 +221,15 @@
|
||||
fprintf(stderr,
|
||||
_("Disk %s doesn't contain a valid "
|
||||
"partition table\n"), device);
|
||||
Index: util-linux-ng-2.12r+git20070330/fdisk/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/fdisk/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/fdisk/Makefile.am
|
||||
@@ -8,6 +8,7 @@ sbin_PROGRAMS = fdisk
|
||||
man_MANS = fdisk.8
|
||||
fdisk_SOURCES = fdisk.c disksize.c fdiskbsdlabel.c fdisksgilabel.c \
|
||||
fdisksunlabel.c fdiskaixlabel.c i386_sys_types.c partname.c \
|
||||
+ fdiskmaclabel.c \
|
||||
common.h fdisk.h fdisksunlabel.h fdisksgilabel.h fdiskaixlabel.h \
|
||||
fdiskbsdlabel.h
|
||||
|
@ -5,9 +5,11 @@ change has been discussed and accepted by Trond Myklebust
|
||||
-- Andreas Gruenbacher <agruen@suse.de>
|
||||
|
||||
================================================================================
|
||||
--- util-linux-2.12q/mount/mount.8
|
||||
+++ util-linux-2.12q/mount/mount.8
|
||||
@@ -1335,7 +1335,8 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/mount.8
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/mount.8
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/mount.8
|
||||
@@ -1335,7 +1335,8 @@ are recognized:
|
||||
.BR ac ,
|
||||
.BR tcp ,
|
||||
.BR udp ,
|
||||
@ -17,9 +19,11 @@ change has been discussed and accepted by Trond Myklebust
|
||||
For details, see
|
||||
.BR nfs (5).
|
||||
|
||||
--- util-linux-2.12q/mount/nfs.5
|
||||
+++ util-linux-2.12q/mount/nfs.5
|
||||
@@ -204,6 +204,15 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
@@ -204,6 +204,15 @@ default UDP protocol. Many NFS servers
|
||||
.I udp
|
||||
Mount the NFS filesystem using the UDP protocol. This
|
||||
is the default.
|
||||
@ -35,17 +39,21 @@ change has been discussed and accepted by Trond Myklebust
|
||||
.P
|
||||
All of the non-value options have corresponding nooption forms.
|
||||
For example, nointr means don't allow file operations to be
|
||||
--- util-linux-2.12q/mount/nfs_mount4.h
|
||||
+++ util-linux-2.12q/mount/nfs_mount4.h
|
||||
@@ -51,4 +51,4 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs_mount4.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs_mount4.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs_mount4.h
|
||||
@@ -51,4 +51,4 @@ struct nfs_mount_data {
|
||||
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
|
||||
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
|
||||
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
|
||||
-
|
||||
+#define NFS_MOUNT_NOACL 0x0800 /* 4 */
|
||||
--- util-linux-2.12q/mount/nfsmount.c
|
||||
+++ util-linux-2.12q/mount/nfsmount.c
|
||||
@@ -216,7 +216,7 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -214,7 +214,7 @@ int nfsmount(const char *spec, const cha
|
||||
struct stat statbuf;
|
||||
char *s;
|
||||
int port, mountport, proto, bg, soft, intr;
|
||||
@ -54,7 +62,7 @@ change has been discussed and accepted by Trond Myklebust
|
||||
int retry, tcp;
|
||||
int mountprog, mountvers, nfsprog, nfsvers;
|
||||
int retval;
|
||||
@@ -316,6 +316,7 @@
|
||||
@@ -314,6 +314,7 @@ int nfsmount(const char *spec, const cha
|
||||
nocto = 0;
|
||||
nolock = 0;
|
||||
broken_suid = 0;
|
||||
@ -62,7 +70,7 @@ change has been discussed and accepted by Trond Myklebust
|
||||
noac = 0;
|
||||
retry = 10000; /* 10000 minutes ~ 1 week */
|
||||
tcp = 0;
|
||||
@@ -427,6 +428,8 @@
|
||||
@@ -425,6 +426,8 @@ int nfsmount(const char *spec, const cha
|
||||
printf(_("Warning: option nolock is not supported.\n"));
|
||||
} else if (!strcmp(opt, "broken_suid")) {
|
||||
broken_suid = val;
|
||||
@ -71,7 +79,7 @@ change has been discussed and accepted by Trond Myklebust
|
||||
} else {
|
||||
if (!sloppy) {
|
||||
printf(_("unknown nfs mount option: "
|
||||
@@ -452,8 +455,10 @@
|
||||
@@ -450,8 +453,10 @@ int nfsmount(const char *spec, const cha
|
||||
data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
|
||||
#endif
|
||||
#if NFS_MOUNT_VERSION >= 4
|
@ -1,6 +1,8 @@
|
||||
--- hwclock/hwclock.c
|
||||
Index: hwclock/hwclock.c
|
||||
===================================================================
|
||||
--- hwclock/hwclock.c.orig
|
||||
+++ hwclock/hwclock.c
|
||||
@@ -1446,7 +1446,7 @@
|
||||
@@ -1480,7 +1480,7 @@ main(int argc, char **argv) {
|
||||
show = 1; /* default to show */
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
--- misc-utils/Makefile
|
||||
+++ misc-utils/Makefile
|
||||
@@ -12,7 +12,7 @@
|
||||
# Where to put man pages?
|
||||
|
||||
MAN1= cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
|
||||
- namei.1 rename.1 script.1 whereis.1 hostid.1
|
||||
+ namei.1 rename.1 script.1 whereis.1 hostid.1 scriptreplay.1
|
||||
|
||||
# Where to put binaries?
|
||||
# See the "install" rule for the links. . .
|
||||
@@ -20,7 +20,7 @@
|
||||
BIN=
|
||||
|
||||
USRBIN= cal chkdupexe ddate hostid logger look mcookie \
|
||||
- namei rename script whereis
|
||||
+ namei rename script scriptreplay whereis
|
||||
|
||||
MAYBE= reset setterm
|
||||
|
@ -1,5 +1,7 @@
|
||||
--- util-linux-2.12q/misc-utils/hostid.1
|
||||
+++ util-linux-2.12q/misc-utils/hostid.1
|
||||
Index: util-linux-ng-2.12r+git20070330/misc-utils/hostid.1
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/misc-utils/hostid.1
|
||||
@@ -0,0 +1,24 @@
|
||||
+.TH hostid 1
|
||||
+.SH NAME
|
||||
@ -25,8 +27,10 @@
|
||||
+.SH SEE ALSO
|
||||
+gethostid(2), sethostid(2)
|
||||
+
|
||||
--- util-linux-2.12q/misc-utils/hostid.c
|
||||
+++ util-linux-2.12q/misc-utils/hostid.c
|
||||
Index: util-linux-ng-2.12r+git20070330/misc-utils/hostid.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/misc-utils/hostid.c
|
||||
@@ -0,0 +1,88 @@
|
||||
+/* Program hostid. Changed on 7.10.1997 <ms@suse.de>
|
||||
+ New: - Hostid 0 is not permitted.
|
||||
@ -116,22 +120,25 @@
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
--- util-linux-2.12q/misc-utils/Makefile
|
||||
+++ util-linux-2.12q/misc-utils/Makefile
|
||||
@@ -12,14 +12,14 @@
|
||||
# Where to put man pages?
|
||||
Index: util-linux-ng-2.12r+git20070330/misc-utils/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/misc-utils/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/misc-utils/Makefile.am
|
||||
@@ -9,7 +9,7 @@ EXTRA_DIST = README.* \
|
||||
bin_PROGRAMS =
|
||||
|
||||
MAN1= cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
|
||||
- namei.1 rename.1 script.1 whereis.1
|
||||
+ namei.1 rename.1 script.1 whereis.1 hostid.1
|
||||
usrbinexec_PROGRAMS = cal ddate logger look mcookie \
|
||||
- namei script whereis
|
||||
+ namei script whereis hostid
|
||||
|
||||
# Where to put binaries?
|
||||
# See the "install" rule for the links. . .
|
||||
mcookie_LDADD = $(top_srcdir)/lib/libmd5.a
|
||||
|
||||
BIN=
|
||||
@@ -24,7 +24,7 @@ scriptreplay: scriptreplay.pl
|
||||
CLEANFILES = chkdupexe scriptreplay
|
||||
|
||||
-USRBIN= cal chkdupexe ddate logger look mcookie \
|
||||
+USRBIN= cal chkdupexe ddate hostid logger look mcookie \
|
||||
namei rename script whereis
|
||||
man_MANS = cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
|
||||
- namei.1 script.1 whereis.1
|
||||
+ namei.1 script.1 whereis.1 hostid.1
|
||||
|
||||
MAYBE= reset setterm
|
||||
if HAVE_NCURSES
|
||||
cal_LDADD = -lncurses
|
859
util-linux-2.12-mount_base_nfsv4.patch
Normal file
859
util-linux-2.12-mount_base_nfsv4.patch
Normal file
@ -0,0 +1,859 @@
|
||||
|
||||
Add basic nfsv4 support
|
||||
|
||||
---
|
||||
|
||||
util-linux-2.12-bfields/mount/Makefile | 2
|
||||
util-linux-2.12-bfields/mount/fstab.5 | 1
|
||||
util-linux-2.12-bfields/mount/mount.8 | 75 ++++++
|
||||
util-linux-2.12-bfields/mount/mount.c | 13 +
|
||||
util-linux-2.12-bfields/mount/nfs.5 | 200 +++++++++++++++++
|
||||
util-linux-2.12-bfields/mount/nfs4_mount.h | 82 +++++++
|
||||
util-linux-2.12-bfields/mount/nfs4mount.c | 335 +++++++++++++++++++++++++++++
|
||||
util-linux-2.12-bfields/mount/nfsmount.c | 5
|
||||
util-linux-2.12-bfields/mount/sundries.h | 2
|
||||
util-linux-2.12-bfields/mount/umount.c | 3
|
||||
10 files changed, 710 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/fstab.5
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.5
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/fstab.5
|
||||
@@ -115,6 +115,7 @@ of filesystem types, such as
|
||||
.IR msdos ,
|
||||
.IR ncpfs ,
|
||||
.IR nfs ,
|
||||
+.IR nfs4 ,
|
||||
.IR ntfs ,
|
||||
.IR proc ,
|
||||
.IR qnx4 ,
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.8
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.8
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.8
|
||||
@@ -385,6 +385,7 @@ currently supported include:
|
||||
.IR msdos ,
|
||||
.IR ncpfs ,
|
||||
.IR nfs ,
|
||||
+.IR nfs4 ,
|
||||
.IR ntfs ,
|
||||
.IR proc ,
|
||||
.IR qnx4 ,
|
||||
@@ -422,7 +423,7 @@ For most types all the
|
||||
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, 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
|
||||
@@ -450,9 +451,10 @@ or, if that does not exist,
|
||||
All of the filesystem types listed there will be tried,
|
||||
except for those that are labeled "nodev" (e.g.,
|
||||
.IR devpts ,
|
||||
-.I proc
|
||||
+.IR proc ,
|
||||
+.IR nfs ,
|
||||
and
|
||||
-.IR nfs ).
|
||||
+.IR nfs4 ).
|
||||
If
|
||||
.I /etc/filesystems
|
||||
ends in a line with a single * only, mount will read
|
||||
@@ -1380,6 +1382,73 @@ Usually it just causes lots of trouble.
|
||||
.B nolock
|
||||
Do not use locking. Do not start lockd.
|
||||
|
||||
+.SH "Mount options for nfs4"
|
||||
+Instead of a textual option string, parsed by the kernel, the
|
||||
+.I nfs4
|
||||
+file system expects a binary argument of type
|
||||
+.IR "struct nfs4_mount_data" .
|
||||
+The program
|
||||
+.B mount
|
||||
+itself parses the following options of the form `tag=value',
|
||||
+and puts them in the structure mentioned:
|
||||
+.BI rsize= n,
|
||||
+.BI wsize= n,
|
||||
+.BI timeo= n,
|
||||
+.BI retrans= n,
|
||||
+.BI acregmin= n,
|
||||
+.BI acregmax= n,
|
||||
+.BI acdirmin= n,
|
||||
+.BI acdirmax= n,
|
||||
+.BI actimeo= n,
|
||||
+.BI retry= n,
|
||||
+.BI port= n,
|
||||
+.BI proto= n,
|
||||
+.BI clientaddr= n,
|
||||
+.BI sec= n.
|
||||
+The option
|
||||
+.BI addr= n
|
||||
+is accepted but ignored.
|
||||
+Also the following Boolean options, possibly preceded by
|
||||
+.B no
|
||||
+are recognized:
|
||||
+.BR bg ,
|
||||
+.BR fg ,
|
||||
+.BR soft ,
|
||||
+.BR hard ,
|
||||
+.BR intr ,
|
||||
+.BR cto ,
|
||||
+.BR ac ,
|
||||
+For details, see
|
||||
+.BR nfs (5).
|
||||
+
|
||||
+Especially useful options include
|
||||
+.TP
|
||||
+.B rsize=32768,wsize=32768
|
||||
+This will make your NFS connection faster than with the default
|
||||
+buffer size of 4096.
|
||||
+.TP
|
||||
+.B hard
|
||||
+The program accessing a file on a NFS mounted file system will hang
|
||||
+when the server crashes. The process cannot be interrupted or
|
||||
+killed unless you also specify
|
||||
+.BR intr .
|
||||
+When the NFS server is back online the program will continue undisturbed
|
||||
+from where it was. This is probably what you want.
|
||||
+.TP
|
||||
+.B soft
|
||||
+This option allows the kernel to time out if the NFS server is not
|
||||
+responding for some time. The time can be
|
||||
+specified with
|
||||
+.BR timeo=time .
|
||||
+This timeout value is expressed in tenths of a second.
|
||||
+The
|
||||
+.BR soft
|
||||
+option might be useful if your NFS server sometimes doesn't respond
|
||||
+or will be rebooted while some process tries to get a file from the server.
|
||||
+Avoid using this option with
|
||||
+.BR proto=udp
|
||||
+or with a short timeout.
|
||||
+
|
||||
.SH "Mount options for ntfs"
|
||||
.TP
|
||||
.BI iocharset= name
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
@@ -860,6 +860,19 @@ try_mount_one (const char *spec0, const
|
||||
if (res)
|
||||
goto out;
|
||||
}
|
||||
+#ifdef HAVE_NFS
|
||||
+ /*
|
||||
+ * NFSv4 support
|
||||
+ */
|
||||
+ if (!fake && types && streq (types, "nfs4")) {
|
||||
+ mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
|
||||
+ if (mnt_err)
|
||||
+ return mnt_err;
|
||||
+#else
|
||||
+ die (EX_SOFTWARE, _("mount: this version was compiled "
|
||||
+ "without support for the type `nfs4'"));
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
/*
|
||||
* Call mount.TYPE for types that require a separate mount program.
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/nfs4mount.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/nfs4mount.c
|
||||
@@ -0,0 +1,335 @@
|
||||
+/*
|
||||
+ * nfs4mount.c -- Linux NFS mount
|
||||
+ * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Note: this file based on the original nfsmount.c
|
||||
+ */
|
||||
+
|
||||
+#include "../config.h"
|
||||
+
|
||||
+#include <linux/posix_types.h>
|
||||
+#include <asm/posix_types.h>
|
||||
+#undef __FD_CLR
|
||||
+#undef __FD_SET
|
||||
+#undef __FD_ISSET
|
||||
+#undef __FD_ZERO
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <errno.h>
|
||||
+#include <netdb.h>
|
||||
+#include <time.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/time.h>
|
||||
+#include <sys/utsname.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
+
|
||||
+#include "sundries.h"
|
||||
+
|
||||
+#include "mount_constants.h"
|
||||
+#include "nfs4_mount.h"
|
||||
+
|
||||
+#include "nls.h"
|
||||
+
|
||||
+#ifndef NFS_PORT
|
||||
+#define NFS_PORT 2049
|
||||
+#endif
|
||||
+
|
||||
+static int parse_devname(char *hostdir, char **hostname, char **dirname)
|
||||
+{
|
||||
+ char *s;
|
||||
+
|
||||
+ if (!(s = strchr(hostdir, ':'))) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: "
|
||||
+ "directory to mount not in host:dir format\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *hostname = hostdir;
|
||||
+ *dirname = s + 1;
|
||||
+ *s = '\0';
|
||||
+ /* Ignore all but first hostname in replicated mounts
|
||||
+ until they can be fully supported. (mack@sgi.com) */
|
||||
+ if ((s = strchr(hostdir, ','))) {
|
||||
+ *s = '\0';
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: warning: "
|
||||
+ "multiple hostnames not supported\n"));
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
|
||||
+{
|
||||
+ struct hostent *hp;
|
||||
+ addr->sin_family = AF_INET;
|
||||
+
|
||||
+ if (inet_aton(hostname, &addr->sin_addr))
|
||||
+ return 0;
|
||||
+ if ((hp = gethostbyname(hostname)) == NULL) {
|
||||
+ fprintf(stderr, _("mount: can't get address for %s\n"),
|
||||
+ hostname);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (hp->h_length > sizeof(struct in_addr)) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: got bad hp->h_length\n"));
|
||||
+ hp->h_length = sizeof(struct in_addr);
|
||||
+ }
|
||||
+ memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int get_my_ipv4addr(char *ip_addr, int len)
|
||||
+{
|
||||
+ char myname[1024];
|
||||
+ struct sockaddr_in myaddr;
|
||||
+
|
||||
+ if (gethostname(myname, sizeof(myname))) {
|
||||
+ fprintf(stderr, _("mount: can't determine client address\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (fill_ipv4_sockaddr(myname, &myaddr))
|
||||
+ return -1;
|
||||
+ snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
|
||||
+ ip_addr[len-1] = '\0';
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int nfs4mount(const char *spec, const char *node, int *flags,
|
||||
+ char **extra_opts, char **mount_opts,
|
||||
+ int running_bg)
|
||||
+{
|
||||
+ static struct nfs4_mount_data data;
|
||||
+ static char hostdir[1024];
|
||||
+ static char ip_addr[16] = "127.0.0.1";
|
||||
+ static struct sockaddr_in server_addr;
|
||||
+ static int pseudoflavour = 0;
|
||||
+
|
||||
+ char *hostname, *dirname, *old_opts;
|
||||
+ char new_opts[1024];
|
||||
+ char *opt, *opteq;
|
||||
+ char *s;
|
||||
+ int val;
|
||||
+ int bg, soft, intr;
|
||||
+ int nocto, noac;
|
||||
+ int retry;
|
||||
+ int retval;
|
||||
+
|
||||
+ retval = EX_FAIL;
|
||||
+ if (strlen(spec) >= sizeof(hostdir)) {
|
||||
+ fprintf(stderr, _("mount: "
|
||||
+ "excessively long host:dir argument\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ strcpy(hostdir, spec);
|
||||
+ if (parse_devname(hostdir, &hostname, &dirname))
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (fill_ipv4_sockaddr(hostname, &server_addr))
|
||||
+ goto fail;
|
||||
+ if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
|
||||
+ goto fail;
|
||||
+
|
||||
+ /* add IP address to mtab options for use when unmounting */
|
||||
+ s = inet_ntoa(server_addr.sin_addr);
|
||||
+ old_opts = *extra_opts;
|
||||
+ if (!old_opts)
|
||||
+ old_opts = "";
|
||||
+ if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
|
||||
+ fprintf(stderr, _("mount: "
|
||||
+ "excessively long option argument\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
|
||||
+ old_opts, *old_opts ? "," : "", s);
|
||||
+ *extra_opts = xstrdup(new_opts);
|
||||
+
|
||||
+ /* Set default options.
|
||||
+ * rsize/wsize and timeo are left 0 in order to
|
||||
+ * let the kernel decide.
|
||||
+ */
|
||||
+ memset(&data, 0, sizeof(data));
|
||||
+ data.retrans = 3;
|
||||
+ data.acregmin = 3;
|
||||
+ data.acregmax = 60;
|
||||
+ data.acdirmin = 30;
|
||||
+ data.acdirmax = 60;
|
||||
+ data.proto = IPPROTO_TCP;
|
||||
+
|
||||
+ bg = 0;
|
||||
+ soft = 0;
|
||||
+ intr = 0;
|
||||
+ nocto = 0;
|
||||
+ noac = 0;
|
||||
+ retry = 10000; /* 10000 minutes ~ 1 week */
|
||||
+
|
||||
+ /*
|
||||
+ * NFSv4 specifies that the default port should be 2049
|
||||
+ */
|
||||
+ server_addr.sin_port = htons(NFS_PORT);
|
||||
+
|
||||
+ /* parse options */
|
||||
+
|
||||
+ for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
|
||||
+ if ((opteq = strchr(opt, '='))) {
|
||||
+ val = atoi(opteq + 1);
|
||||
+ *opteq = '\0';
|
||||
+ if (!strcmp(opt, "rsize"))
|
||||
+ data.rsize = val;
|
||||
+ else if (!strcmp(opt, "wsize"))
|
||||
+ data.wsize = val;
|
||||
+ else if (!strcmp(opt, "timeo"))
|
||||
+ data.timeo = val;
|
||||
+ else if (!strcmp(opt, "retrans"))
|
||||
+ data.retrans = val;
|
||||
+ else if (!strcmp(opt, "acregmin"))
|
||||
+ data.acregmin = val;
|
||||
+ else if (!strcmp(opt, "acregmax"))
|
||||
+ data.acregmax = val;
|
||||
+ else if (!strcmp(opt, "acdirmin"))
|
||||
+ data.acdirmin = val;
|
||||
+ else if (!strcmp(opt, "acdirmax"))
|
||||
+ data.acdirmax = val;
|
||||
+ else if (!strcmp(opt, "actimeo")) {
|
||||
+ data.acregmin = val;
|
||||
+ data.acregmax = val;
|
||||
+ data.acdirmin = val;
|
||||
+ data.acdirmax = val;
|
||||
+ }
|
||||
+ else if (!strcmp(opt, "retry"))
|
||||
+ retry = val;
|
||||
+ else if (!strcmp(opt, "port"))
|
||||
+ server_addr.sin_port = htons(val);
|
||||
+ else if (!strcmp(opt, "proto")) {
|
||||
+ if (!strncmp(opteq+1, "tcp", 3))
|
||||
+ data.proto = IPPROTO_TCP;
|
||||
+ else if (!strncmp(opteq+1, "udp", 3))
|
||||
+ data.proto = IPPROTO_UDP;
|
||||
+ else
|
||||
+ printf(_("Warning: Unrecognized proto= option.\n"));
|
||||
+ } else if (!strcmp(opt, "clientaddr")) {
|
||||
+ if (strlen(opteq+1) >= sizeof(ip_addr))
|
||||
+ printf(_("Invalid client address %s"),
|
||||
+ opteq+1);
|
||||
+ strncpy(ip_addr,opteq+1, sizeof(ip_addr));
|
||||
+ ip_addr[sizeof(ip_addr)-1] = '\0';
|
||||
+ } else if (!strcmp(opt, "sec")) {
|
||||
+ if (!strcmp(opteq+1, "krb5"))
|
||||
+ pseudoflavour = 390003;
|
||||
+ else if (!strcmp(opteq+1, "krb5i"))
|
||||
+ pseudoflavour = 390004;
|
||||
+ else if (!strcmp(opteq+1, "krb5p"))
|
||||
+ pseudoflavour = 390005;
|
||||
+ else if (!strcmp(opteq+1, "lipkey"))
|
||||
+ pseudoflavour = 390006;
|
||||
+ else if (!strcmp(opteq+1, "lipkey-i"))
|
||||
+ pseudoflavour = 390007;
|
||||
+ else if (!strcmp(opteq+1, "lipkey-p"))
|
||||
+ pseudoflavour = 390008;
|
||||
+ else if (!strcmp(opteq+1, "spkm3"))
|
||||
+ pseudoflavour = 390009;
|
||||
+ else if (!strcmp(opteq+1, "spkm3i"))
|
||||
+ pseudoflavour = 390010;
|
||||
+ else if (!strcmp(opteq+1, "spkm3p"))
|
||||
+ pseudoflavour = 390011;
|
||||
+ else {
|
||||
+ printf(_("unknown security type %s\n"),
|
||||
+ opteq+1);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ } else if (!strcmp(opt, "addr")) {
|
||||
+ /* ignore */;
|
||||
+ } else {
|
||||
+ printf(_("unknown nfs mount parameter: "
|
||||
+ "%s=%d\n"), opt, val);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ } else {
|
||||
+ val = 1;
|
||||
+ if (!strncmp(opt, "no", 2)) {
|
||||
+ val = 0;
|
||||
+ opt += 2;
|
||||
+ }
|
||||
+ if (!strcmp(opt, "bg"))
|
||||
+ bg = val;
|
||||
+ else if (!strcmp(opt, "fg"))
|
||||
+ bg = !val;
|
||||
+ else if (!strcmp(opt, "soft"))
|
||||
+ soft = val;
|
||||
+ else if (!strcmp(opt, "hard"))
|
||||
+ soft = !val;
|
||||
+ else if (!strcmp(opt, "intr"))
|
||||
+ intr = val;
|
||||
+ else if (!strcmp(opt, "cto"))
|
||||
+ nocto = !val;
|
||||
+ else if (!strcmp(opt, "ac"))
|
||||
+ noac = !val;
|
||||
+ else {
|
||||
+ if (!sloppy) {
|
||||
+ printf(_("unknown nfs mount option: "
|
||||
+ "%s%s\n"), val ? "" : "no", opt);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
|
||||
+ | (intr ? NFS4_MOUNT_INTR : 0)
|
||||
+ | (nocto ? NFS4_MOUNT_NOCTO : 0)
|
||||
+ | (noac ? NFS4_MOUNT_NOAC : 0);
|
||||
+
|
||||
+ if (pseudoflavour != 0) {
|
||||
+ data.auth_flavourlen = 1;
|
||||
+ data.auth_flavours = &pseudoflavour;
|
||||
+ }
|
||||
+
|
||||
+ data.client_addr.data = ip_addr;
|
||||
+ data.client_addr.len = strlen(ip_addr);
|
||||
+
|
||||
+ data.mnt_path.data = dirname;
|
||||
+ data.mnt_path.len = strlen(dirname);
|
||||
+
|
||||
+ data.hostname.data = hostname;
|
||||
+ data.hostname.len = strlen(hostname);
|
||||
+ data.host_addr = (struct sockaddr *)&server_addr;
|
||||
+ data.host_addrlen = sizeof(server_addr);
|
||||
+
|
||||
+#ifdef NFS_MOUNT_DEBUG
|
||||
+ printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
|
||||
+ data.rsize, data.wsize, data.timeo, data.retrans);
|
||||
+ printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
|
||||
+ data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
|
||||
+ printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
|
||||
+ ntohs(server_addr.sin_port), bg, retry, data.flags);
|
||||
+ printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
|
||||
+ (data.flags & NFS4_MOUNT_SOFT) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_INTR) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_NOCTO) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_NOAC) != 0);
|
||||
+ printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
|
||||
+#endif
|
||||
+
|
||||
+ data.version = NFS4_MOUNT_VERSION;
|
||||
+
|
||||
+ *mount_opts = (char *) &data;
|
||||
+ /* clean up */
|
||||
+ return 0;
|
||||
+
|
||||
+fail:
|
||||
+ return retval;
|
||||
+}
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/nfs4_mount.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/nfs4_mount.h
|
||||
@@ -0,0 +1,82 @@
|
||||
+#ifndef _LINUX_NFS4_MOUNT_H
|
||||
+#define _LINUX_NFS4_MOUNT_H
|
||||
+
|
||||
+/*
|
||||
+ * linux/include/linux/nfs4_mount.h
|
||||
+ *
|
||||
+ * Copyright (C) 2002 Trond Myklebust
|
||||
+ *
|
||||
+ * structure passed from user-space to kernel-space during an nfsv4 mount
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * WARNING! Do not delete or change the order of these fields. If
|
||||
+ * a new field is required then add it to the end. The version field
|
||||
+ * tracks which fields are present. This will ensure some measure of
|
||||
+ * mount-to-kernel version compatibility. Some of these aren't used yet
|
||||
+ * but here they are anyway.
|
||||
+ */
|
||||
+#define NFS4_MOUNT_VERSION 1
|
||||
+
|
||||
+struct nfs_string {
|
||||
+ unsigned int len;
|
||||
+ const char* data;
|
||||
+};
|
||||
+
|
||||
+struct nfs4_mount_data {
|
||||
+ int version; /* 1 */
|
||||
+ int flags; /* 1 */
|
||||
+ int rsize; /* 1 */
|
||||
+ int wsize; /* 1 */
|
||||
+ int timeo; /* 1 */
|
||||
+ int retrans; /* 1 */
|
||||
+ int acregmin; /* 1 */
|
||||
+ int acregmax; /* 1 */
|
||||
+ int acdirmin; /* 1 */
|
||||
+ int acdirmax; /* 1 */
|
||||
+
|
||||
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
|
||||
+ struct nfs_string client_addr; /* 1 */
|
||||
+
|
||||
+ /* Mount path */
|
||||
+ struct nfs_string mnt_path; /* 1 */
|
||||
+
|
||||
+ /* Server details */
|
||||
+ struct nfs_string hostname; /* 1 */
|
||||
+ /* Server IP address */
|
||||
+ unsigned int host_addrlen; /* 1 */
|
||||
+ struct sockaddr* host_addr; /* 1 */
|
||||
+
|
||||
+ /* Transport protocol to use */
|
||||
+ int proto; /* 1 */
|
||||
+
|
||||
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
|
||||
+ int auth_flavourlen; /* 1 */
|
||||
+ int *auth_flavours; /* 1 */
|
||||
+};
|
||||
+
|
||||
+/* bits in the flags field */
|
||||
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
|
||||
+ * should mirror the values from include/linux/nfs_mount.h
|
||||
+ */
|
||||
+
|
||||
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
|
||||
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
|
||||
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
|
||||
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
|
||||
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
|
||||
+#define NFS4_MOUNT_FLAGMASK 0xFFFF
|
||||
+
|
||||
+/* pseudoflavors: */
|
||||
+
|
||||
+#define RPC_AUTH_GSS_KRB5 390003
|
||||
+#define RPC_AUTH_GSS_KRB5I 390004
|
||||
+#define RPC_AUTH_GSS_KRB5P 390005
|
||||
+#define RPC_AUTH_GSS_LKEY 390006
|
||||
+#define RPC_AUTH_GSS_LKEYI 390007
|
||||
+#define RPC_AUTH_GSS_LKEYP 390008
|
||||
+#define RPC_AUTH_GSS_SPKM 390009
|
||||
+#define RPC_AUTH_GSS_SPKMI 390010
|
||||
+#define RPC_AUTH_GSS_SPKMP 390011
|
||||
+
|
||||
+#endif
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/nfs.5
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/nfs.5
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/nfs.5
|
||||
@@ -3,7 +3,7 @@
|
||||
.\" patches. "
|
||||
.TH NFS 5 "20 November 1993" "Linux 0.99" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
-nfs \- nfs fstab format and options
|
||||
+nfs \- nfs and nfs4 fstab format and options
|
||||
.SH SYNOPSIS
|
||||
.B /etc/fstab
|
||||
.SH DESCRIPTION
|
||||
@@ -17,14 +17,51 @@ the local directory that is the mount po
|
||||
and the NFS specific options that control
|
||||
the way the filesystem is mounted.
|
||||
.P
|
||||
-Here is an example from an \fI/etc/fstab\fP file from an NFS mount.
|
||||
+Three different versions of the NFS protocol are
|
||||
+supported by the Linux NFS client:
|
||||
+NFS version 2, NFS version 3, and NFS version 4.
|
||||
+To mount via NFS version 2, use the
|
||||
+.BR nfs
|
||||
+file system type and specify
|
||||
+.BR nfsvers=2 .
|
||||
+Version 2 is the default protocol version for the
|
||||
+.BR nfs
|
||||
+file system type when
|
||||
+.BR nfsvers=
|
||||
+is not specified on the mount command.
|
||||
+To mount via NFS version 3, use the
|
||||
+.BR nfs
|
||||
+file system type and specify
|
||||
+.BR nfsvers=3 .
|
||||
+To mount via NFS version 4, use the
|
||||
+.BR nfs4
|
||||
+file system type.
|
||||
+The
|
||||
+.BR nfsvers=
|
||||
+keyword is not supported for the
|
||||
+.BR nfs4
|
||||
+file system type.
|
||||
+.P
|
||||
+These file system types share similar mount options;
|
||||
+the differences are listed below.
|
||||
+.P
|
||||
+Here is an example from an \fI/etc/fstab\fP file for an NFSv2 mount
|
||||
+over UDP.
|
||||
.sp
|
||||
.nf
|
||||
.ta 2.5i +0.75i +0.75i +1.0i
|
||||
server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr
|
||||
.fi
|
||||
+.P
|
||||
+Here is an example for an NFSv4 mount over TCP using Kerberos
|
||||
+5 mutual authentication.
|
||||
+.sp
|
||||
+.nf
|
||||
+.ta 2.5i +0.75i +0.75i +1.0i
|
||||
+server:/usr/local/pub /pub nfs4 proto=tcp,sec=krb5,hard,intr
|
||||
+.fi
|
||||
.DT
|
||||
-.SS Options
|
||||
+.SS Options for the nfs file system type
|
||||
.TP 1.5i
|
||||
.I rsize=n
|
||||
The number of bytes NFS uses when reading files from an NFS server.
|
||||
@@ -217,6 +254,163 @@ which are otherwise used to manipulate A
|
||||
All of the non-value options have corresponding nooption forms.
|
||||
For example, nointr means don't allow file operations to be
|
||||
interrupted.
|
||||
+.SS Options for the nfs4 file system type
|
||||
+.TP 1.5i
|
||||
+.I rsize=n
|
||||
+The number of bytes NFS uses when reading files from an NFS server.
|
||||
+The default value is dependent on the kernel, currently 4096 bytes.
|
||||
+(However, throughput is improved greatly by asking for
|
||||
+.IR rsize=32768 .)
|
||||
+This value is negotiated with the server.
|
||||
+.TP 1.5i
|
||||
+.I wsize=n
|
||||
+The number of bytes NFS uses when writing files to an NFS server.
|
||||
+The default value is dependent on the kernel, currently 4096 bytes.
|
||||
+(However, throughput is improved greatly by asking for
|
||||
+.IR wsize=32768 .)
|
||||
+This value is negotiated with the server.
|
||||
+.TP 1.5i
|
||||
+.I timeo=n
|
||||
+The value in tenths of a second before sending the
|
||||
+first retransmission after an RPC timeout.
|
||||
+The default value depends on whether
|
||||
+.IR proto=udp
|
||||
+or
|
||||
+.IR proto=tcp
|
||||
+is in effect (see below).
|
||||
+The default value for UDP is 7 tenths of a second.
|
||||
+The default value for TCP is 60 seconds.
|
||||
+After the first timeout,
|
||||
+the timeout is doubled after each successive timeout until a maximum
|
||||
+timeout of 60 seconds is reached or the enough retransmissions
|
||||
+have occured to cause a major timeout. Then, if the filesystem
|
||||
+is hard mounted, each new timeout cascade restarts at twice the
|
||||
+initial value of the previous cascade, again doubling at each
|
||||
+retransmission. The maximum timeout is always 60 seconds.
|
||||
+.TP 1.5i
|
||||
+.I retrans=n
|
||||
+The number of minor timeouts and retransmissions that must occur before
|
||||
+a major timeout occurs. The default is 5 timeouts for
|
||||
+.IR proto=udp
|
||||
+and 2 timeouts for
|
||||
+.IR proto=tcp .
|
||||
+When a major timeout
|
||||
+occurs, the file operation is either aborted or a "server not responding"
|
||||
+message is printed on the console.
|
||||
+.TP 1.5i
|
||||
+.I acregmin=n
|
||||
+The minimum time in seconds that attributes of a regular file should
|
||||
+be cached before requesting fresh information from a server.
|
||||
+The default is 3 seconds.
|
||||
+.TP 1.5i
|
||||
+.I acregmax=n
|
||||
+The maximum time in seconds that attributes of a regular file can
|
||||
+be cached before requesting fresh information from a server.
|
||||
+The default is 60 seconds.
|
||||
+.TP 1.5i
|
||||
+.I acdirmin=n
|
||||
+The minimum time in seconds that attributes of a directory should
|
||||
+be cached before requesting fresh information from a server.
|
||||
+The default is 30 seconds.
|
||||
+.TP 1.5i
|
||||
+.I acdirmax=n
|
||||
+The maximum time in seconds that attributes of a directory can
|
||||
+be cached before requesting fresh information from a server.
|
||||
+The default is 60 seconds.
|
||||
+.TP 1.5i
|
||||
+.I actimeo=n
|
||||
+Using actimeo sets all of
|
||||
+.I acregmin,
|
||||
+.I acregmax,
|
||||
+.I acdirmin,
|
||||
+and
|
||||
+.I acdirmax
|
||||
+to the same value.
|
||||
+There is no default value.
|
||||
+.TP 1.5i
|
||||
+.I retry=n
|
||||
+The number of minutes to retry an NFS mount operation
|
||||
+in the foreground or background before giving up.
|
||||
+The default value is 10000 minutes, which is roughly one week.
|
||||
+.TP 1.5i
|
||||
+.I port=n
|
||||
+The numeric value of the port to connect to the NFS server on.
|
||||
+If the port number is 0 (the default) then query the
|
||||
+remote host's portmapper for the port number to use.
|
||||
+If the remote host's NFS daemon is not registered with
|
||||
+its portmapper, the standard NFS port number 2049 is
|
||||
+used instead.
|
||||
+.TP 1.5i
|
||||
+.I proto=n
|
||||
+Mount the NFS filesystem using a specific network protocol
|
||||
+instead of the default UDP protocol.
|
||||
+Many NFS version 4 servers only support TCP.
|
||||
+Valid protocol types are
|
||||
+.IR udp
|
||||
+and
|
||||
+.IR tcp .
|
||||
+.TP 1.5i
|
||||
+.I clientaddr=n
|
||||
+On a multi-homed client, this
|
||||
+causes the client to use a specific callback address when
|
||||
+communicating with an NFS version 4 server.
|
||||
+This option is currently ignored.
|
||||
+.TP 1.5i
|
||||
+.I sec=n
|
||||
+Specify an advanced security mechanism for this file system.
|
||||
+To use Kerberos 5 mutual authentication, specify
|
||||
+.IR krb5 .
|
||||
+Kerberos 5 integrity checking is specified with
|
||||
+.IR krb5i ,
|
||||
+and Kerberos 5 privacy is specified with
|
||||
+.IR krb5p .
|
||||
+Other security mechanisms may become available in the future.
|
||||
+.TP 1.5i
|
||||
+.I bg
|
||||
+If an NFS mount attempt times out, retry the mount
|
||||
+in the background.
|
||||
+After a mount operation is backgrounded, all subsequent mounts
|
||||
+on the same NFS server will be backgrounded immediately, without
|
||||
+first attempting the mount.
|
||||
+A missing mount point is treated as a timeout,
|
||||
+to allow for nested NFS mounts.
|
||||
+.TP 1.5i
|
||||
+.I fg
|
||||
+If the first NFS mount attempt times out, retry the mount
|
||||
+in the foreground.
|
||||
+This is the complement of the
|
||||
+.I bg
|
||||
+option, and also the default behavior.
|
||||
+.TP 1.5i
|
||||
+.I soft
|
||||
+If an NFS file operation has a major timeout then report an I/O error to
|
||||
+the calling program.
|
||||
+The default is to continue retrying NFS file operations indefinitely.
|
||||
+.TP 1.5i
|
||||
+.I hard
|
||||
+If an NFS file operation has a major timeout then report
|
||||
+"server not responding" on the console and continue retrying indefinitely.
|
||||
+This is the default.
|
||||
+.TP 1.5i
|
||||
+.I intr
|
||||
+If an NFS file operation has a major timeout and it is hard mounted,
|
||||
+then allow signals to interupt the file operation and cause it to
|
||||
+return EINTR to the calling program. The default is to not
|
||||
+allow file operations to be interrupted.
|
||||
+.TP 1.5i
|
||||
+.I nocto
|
||||
+Suppress the retrieval of new attributes when creating a file.
|
||||
+.TP 1.5i
|
||||
+.I noac
|
||||
+Disable attribute caching, and force synchronous writes.
|
||||
+This extracts a
|
||||
+server performance penalty but it allows two different NFS clients
|
||||
+to get reasonable good results when both clients are actively
|
||||
+writing to common filesystem on the server.
|
||||
+.P
|
||||
+All of the non-value options have corresponding nooption forms.
|
||||
+For example, nointr means don't allow file operations to be
|
||||
+interrupted.
|
||||
.SH FILES
|
||||
.I /etc/fstab
|
||||
.SH "SEE ALSO"
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/sundries.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/sundries.h
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/sundries.h
|
||||
@@ -40,6 +40,8 @@ void die (int errcode, const char *fmt,
|
||||
|
||||
int nfsmount (const char *spec, const char *node, int *flags,
|
||||
char **orig_opts, char **opt_args, int *version, int running_bg);
|
||||
+int nfs4mount (const char *spec, const char *node, int *flags,
|
||||
+ char **orig_opts, char **opt_args, int running_bg);
|
||||
|
||||
/* exit status - bits below are ORed */
|
||||
#define EX_USAGE 1 /* incorrect invocation or permission */
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/umount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/umount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/umount.c
|
||||
@@ -88,6 +88,9 @@ int verbose = 0;
|
||||
/* True if ruid != euid. */
|
||||
int suid = 0;
|
||||
|
||||
+/* Needed by nfs4mount.c */
|
||||
+int sloppy = 0;
|
||||
+
|
||||
/*
|
||||
* check_special_umountprog()
|
||||
* If there is a special umount program for this type, exec it.
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
@@ -17,7 +17,7 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
|
||||
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
|
||||
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
|
||||
getusername.c \
|
||||
- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \
|
||||
+ nfsmount.c nfsmount_xdr.c nfsmount_clnt.c nfs4mount.c \
|
||||
lomount.c \
|
||||
$(MNTHDRS)
|
||||
|
@ -1,183 +0,0 @@
|
||||
--- util-linux-2.12q/configure
|
||||
+++ util-linux-2.12q/configure
|
||||
@@ -190,6 +190,7 @@
|
||||
|
||||
#
|
||||
# H9. For raw.c: do we have <linux/raw.h>?
|
||||
+# H10. For guessfstype of CD-Extra, do we have <linux/cdrom.h>?
|
||||
#
|
||||
if ./testincl "linux/raw.h"; then
|
||||
echo "HAVE_RAW_H=yes" >> make_include
|
||||
@@ -552,6 +553,12 @@
|
||||
echo "HAVE_XGETTEXT=no" >> make_include
|
||||
fi
|
||||
|
||||
+#
|
||||
+# H10. For guessfstype of CD-Extra, do we have <linux/cdrom.h>
|
||||
+#
|
||||
+if ./testincl "linux/cdrom.h"; then
|
||||
+ echo "#define HAVE_cdrom_h" >> defines.h
|
||||
+fi
|
||||
|
||||
#
|
||||
# 8. For err.c: do we have __progname?
|
||||
--- util-linux-2.12q/mount/mount_guess_fstype.c
|
||||
+++ util-linux-2.12q/mount/mount_guess_fstype.c
|
||||
@@ -26,6 +26,9 @@
|
||||
* 2001-10-26 Tim Launchbury
|
||||
* added sysv magic.
|
||||
*
|
||||
+ * 2003-11-21 Mads Martin Joergensen <mmj@suse.de>
|
||||
+ * added guessfstype support for CD-Extra
|
||||
+ *
|
||||
* aeb - many changes.
|
||||
*
|
||||
*/
|
||||
@@ -37,11 +40,16 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/ioctl.h>
|
||||
#include "linux_fs.h"
|
||||
#include "mount_blkid.h"
|
||||
#include "mount_guess_fstype.h"
|
||||
#include "sundries.h" /* for xstrdup */
|
||||
#include "nls.h"
|
||||
+#include "../defines.h"
|
||||
+#ifdef HAVE_cdrom_h
|
||||
+#include <linux/cdrom.h>
|
||||
+#endif
|
||||
|
||||
#define ETC_FILESYSTEMS "/etc/filesystems"
|
||||
#define PROC_FILESYSTEMS "/proc/filesystems"
|
||||
@@ -249,7 +257,51 @@
|
||||
return 0;
|
||||
|
||||
/* do seeks and reads in disk order, otherwise a very short
|
||||
- partition may cause a failure because of read error */
|
||||
+ partition may cause a failure because of read error
|
||||
+ Rearranged a tiny bit to check ext2/3 before vfat. We still
|
||||
+ have to make sure it's not iso9660 first, or otherwise we
|
||||
+ might bail out wrongly due to an io-error */
|
||||
+
|
||||
+ if (!type) {
|
||||
+ /* block 0 */
|
||||
+ if (lseek(fd, 0, SEEK_SET) != 0
|
||||
+ || read(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb))
|
||||
+ goto try_iso9660;
|
||||
+ }
|
||||
+
|
||||
+ if (!type) {
|
||||
+ /* block 1 */
|
||||
+ if (lseek(fd, 1024, SEEK_SET) != 1024 ||
|
||||
+ read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb))
|
||||
+ goto io_error;
|
||||
+
|
||||
+ /* ext2 has magic in little-endian on disk, so "swapped" is
|
||||
+ superfluous; however, there have existed strange byteswapped
|
||||
+ PPC ext2 systems */
|
||||
+ if (ext2magic(sb.e2s) == EXT2_SUPER_MAGIC ||
|
||||
+ ext2magic(sb.e2s) == EXT2_PRE_02B_MAGIC ||
|
||||
+ ext2magic(sb.e2s) == swapped(EXT2_SUPER_MAGIC)) {
|
||||
+ type = "ext2";
|
||||
+
|
||||
+ /* maybe even ext3? */
|
||||
+ if ((assemble4le(sb.e2s.s_feature_compat)
|
||||
+ & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
|
||||
+ assemble4le(sb.e2s.s_journal_inum) != 0)
|
||||
+ type = "ext3"; /* "ext3,ext2" */
|
||||
+ }
|
||||
+
|
||||
+ else if (minixmagic(sb.ms) == MINIX_SUPER_MAGIC ||
|
||||
+ minixmagic(sb.ms) == MINIX_SUPER_MAGIC2 ||
|
||||
+ minixmagic(sb.ms) == MINIX2_SUPER_MAGIC ||
|
||||
+ minixmagic(sb.ms) == MINIX2_SUPER_MAGIC2)
|
||||
+ type = "minix";
|
||||
+
|
||||
+ else if (extmagic(sb.es) == EXT_SUPER_MAGIC)
|
||||
+ type = "ext";
|
||||
+
|
||||
+ else if (vxfsmagic(sb.vs) == VXFS_SUPER_MAGIC)
|
||||
+ type = "vxfs";
|
||||
+ }
|
||||
|
||||
if (!type) {
|
||||
/* block 0 */
|
||||
@@ -307,40 +359,6 @@
|
||||
type = "sysv";
|
||||
}
|
||||
|
||||
- if (!type) {
|
||||
- /* block 1 */
|
||||
- if (lseek(fd, 1024, SEEK_SET) != 1024 ||
|
||||
- read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb))
|
||||
- goto io_error;
|
||||
-
|
||||
- /* ext2 has magic in little-endian on disk, so "swapped" is
|
||||
- superfluous; however, there have existed strange byteswapped
|
||||
- PPC ext2 systems */
|
||||
- if (ext2magic(sb.e2s) == EXT2_SUPER_MAGIC ||
|
||||
- ext2magic(sb.e2s) == EXT2_PRE_02B_MAGIC ||
|
||||
- ext2magic(sb.e2s) == swapped(EXT2_SUPER_MAGIC)) {
|
||||
- type = "ext2";
|
||||
-
|
||||
- /* maybe even ext3? */
|
||||
- if ((assemble4le(sb.e2s.s_feature_compat)
|
||||
- & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
|
||||
- assemble4le(sb.e2s.s_journal_inum) != 0)
|
||||
- type = "ext3"; /* "ext3,ext2" */
|
||||
- }
|
||||
-
|
||||
- else if (minixmagic(sb.ms) == MINIX_SUPER_MAGIC ||
|
||||
- minixmagic(sb.ms) == MINIX_SUPER_MAGIC2 ||
|
||||
- minixmagic(sb.ms) == swapped(MINIX_SUPER_MAGIC2) ||
|
||||
- minixmagic(sb.ms) == MINIX2_SUPER_MAGIC ||
|
||||
- minixmagic(sb.ms) == MINIX2_SUPER_MAGIC2)
|
||||
- type = "minix";
|
||||
-
|
||||
- else if (extmagic(sb.es) == EXT_SUPER_MAGIC)
|
||||
- type = "ext";
|
||||
-
|
||||
- else if (vxfsmagic(sb.vs) == VXFS_SUPER_MAGIC)
|
||||
- type = "vxfs";
|
||||
- }
|
||||
|
||||
if (!type) {
|
||||
/* block 1 */
|
||||
@@ -416,8 +434,34 @@
|
||||
/* block 32 */
|
||||
try_iso9660:
|
||||
if (lseek(fd, 0x8000, SEEK_SET) != 0x8000
|
||||
- || read(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb))
|
||||
- goto io_error;
|
||||
+ || read(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb)) {
|
||||
+#ifdef HAVE_cdrom_h
|
||||
+ /* Try and see if we have an iso9660 data track later on */
|
||||
+ char toc_header[2];
|
||||
+ struct cdrom_tocentry *toc[CDROM_LEADOUT + 1];
|
||||
+ int i, offset;
|
||||
+
|
||||
+ if (ioctl(fd, CDROMREADTOCHDR, &toc_header))
|
||||
+ goto io_error;
|
||||
+ for (i = toc_header[0]; i <= toc_header[1]; i++) {
|
||||
+ toc[i] = malloc(sizeof(struct cdrom_tocentry));
|
||||
+ memset(toc[i],0,sizeof(struct cdrom_tocentry));
|
||||
+ toc[i]->cdte_track = i;
|
||||
+ toc[i]->cdte_format = CDROM_LBA;
|
||||
+ if(ioctl(fd,CDROMREADTOCENTRY,toc[i]))
|
||||
+ goto io_error;
|
||||
+ if((toc[i]->cdte_ctrl & CDROM_DATA_TRACK)) {
|
||||
+ offset = 2048 * (toc[i]->cdte_addr.lba + 16);
|
||||
+ if(lseek(fd, offset, SEEK_SET) != offset)
|
||||
+ goto io_error;
|
||||
+ if(read(fd,(char *) &isosb,sizeof(isosb))==-1)
|
||||
+ goto io_error;
|
||||
+ }
|
||||
+ }
|
||||
+#else
|
||||
+ goto io_error;
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
if (strncmp(isosb.hs.id, HS_STANDARD_ID, sizeof(isosb.hs.id)) == 0) {
|
||||
/* "CDROM" */
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12q/mount/nfsmount.c
|
||||
+++ util-linux-2.12q/mount/nfsmount.c
|
||||
@@ -169,8 +169,20 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -167,8 +167,20 @@ get_mountport(struct sockaddr_in *server
|
||||
}
|
||||
if (!p.pm_vers)
|
||||
p.pm_vers = MOUNTVERS;
|
||||
@ -22,7 +24,7 @@
|
||||
#if 0
|
||||
if (!p.pm_port) {
|
||||
p.pm_port = pmap_getport(server_addr, p.pm_prog, p.pm_vers,
|
||||
@@ -584,7 +596,8 @@
|
||||
@@ -582,7 +594,8 @@ retry_udp:
|
||||
pm_mnt = get_mountport(&mount_server_addr,
|
||||
mountprog,
|
||||
mountvers,
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12q/mount/nfs.5
|
||||
+++ util-linux-2.12q/mount/nfs.5
|
||||
@@ -199,11 +199,11 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
@@ -199,11 +199,11 @@ writing to common filesystem on the serv
|
||||
.TP 1.5i
|
||||
.I tcp
|
||||
Mount the NFS filesystem using the TCP protocol instead of the
|
||||
@ -15,7 +17,7 @@
|
||||
.TP 1.5i
|
||||
.I noacl
|
||||
Assume no extended access control mechanisms like POSIX ACLs are used
|
||||
@@ -227,8 +227,5 @@
|
||||
@@ -227,8 +227,5 @@ interrupted.
|
||||
The posix, and nocto options are parsed by mount
|
||||
but currently are silently ignored.
|
||||
.P
|
||||
@ -24,9 +26,11 @@
|
||||
-.P
|
||||
The umount command should notify the server
|
||||
when an NFS filesystem is unmounted.
|
||||
--- util-linux-2.12q/mount/nfsmount.c
|
||||
+++ util-linux-2.12q/mount/nfsmount.c
|
||||
@@ -319,7 +319,7 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -317,7 +317,7 @@ int nfsmount(const char *spec, const cha
|
||||
noacl = 0;
|
||||
noac = 0;
|
||||
retry = 10000; /* 10000 minutes ~ 1 week */
|
||||
@ -35,7 +39,7 @@
|
||||
|
||||
mountprog = MOUNTPROG;
|
||||
mountvers = 0;
|
||||
@@ -439,6 +439,8 @@
|
||||
@@ -437,6 +437,8 @@ int nfsmount(const char *spec, const cha
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -44,7 +48,7 @@
|
||||
proto = (tcp) ? IPPROTO_TCP : IPPROTO_UDP;
|
||||
|
||||
data.flags = (soft ? NFS_MOUNT_SOFT : 0)
|
||||
@@ -742,7 +744,13 @@
|
||||
@@ -740,7 +742,13 @@ int nfsmount(const char *spec, const cha
|
||||
* '0' for port (service unavailable), we then exit,
|
||||
* notifying the user, rather than hanging up mount.
|
||||
*/
|
@ -1,65 +0,0 @@
|
||||
--- disk-utils/raw.c
|
||||
+++ disk-utils/raw.c
|
||||
@@ -100,7 +100,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
- * It's a bind or a single query. Either way we need a raw device.
|
||||
+ * It's a bind or a single query.
|
||||
*/
|
||||
|
||||
if (optind >= argc)
|
||||
@@ -108,27 +108,38 @@
|
||||
raw_name = argv[optind++];
|
||||
|
||||
err = stat(raw_name, &statbuf);
|
||||
- if (err) {
|
||||
+ if (err && do_query) {
|
||||
fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
|
||||
raw_name, strerror(errno));
|
||||
exit(2);
|
||||
}
|
||||
|
||||
- if (!S_ISCHR(statbuf.st_mode)) {
|
||||
- fprintf (stderr, "raw device '%s' is not a character dev\n",
|
||||
- raw_name);
|
||||
- exit(2);
|
||||
- }
|
||||
- if (major(statbuf.st_rdev) != RAW_MAJOR) {
|
||||
- fprintf (stderr, "Device '%s' is not a raw dev\n",
|
||||
- raw_name);
|
||||
- exit(2);
|
||||
- }
|
||||
-
|
||||
- raw_minor = minor(statbuf.st_rdev);
|
||||
+ if (!err) {
|
||||
+ if (!S_ISCHR(statbuf.st_mode)) {
|
||||
+ fprintf (stderr, "raw device '%s' is not a character dev\n",
|
||||
+ raw_name);
|
||||
+ exit(2);
|
||||
+ }
|
||||
+ if (major(statbuf.st_rdev) != RAW_MAJOR) {
|
||||
+ fprintf (stderr, "Device '%s' is not a raw dev\n",
|
||||
+ raw_name);
|
||||
+ exit(2);
|
||||
+ }
|
||||
|
||||
- if (do_query)
|
||||
- return query(raw_minor, 0);
|
||||
+ raw_minor = minor(statbuf.st_rdev);
|
||||
+ if (do_query)
|
||||
+ return query(raw_minor, 0);
|
||||
+ } else {
|
||||
+ char *p;
|
||||
+ p = strrchr(raw_name, '/');
|
||||
+ if (p) {
|
||||
+ p = strpbrk(p, "0123456789");
|
||||
+ if (p)
|
||||
+ raw_minor = atoi(p);
|
||||
+ }
|
||||
+ if (!p)
|
||||
+ raw_minor = -1;
|
||||
+ }
|
||||
|
||||
/*
|
||||
* It's not a query, so we still have some parsing to do. Have
|
@ -1,149 +0,0 @@
|
||||
--- util-linux-2.12q/mount/lomount.c
|
||||
+++ util-linux-2.12q/mount/lomount.c
|
||||
@@ -52,6 +52,24 @@
|
||||
extern void show_all_loops(void);
|
||||
extern int read_options_from_fstab(char *, char **);
|
||||
|
||||
+int passphrase_timeout=0;
|
||||
+struct sigaction alrmact;
|
||||
+
|
||||
+static void
|
||||
+alrmhandler() {
|
||||
+ /* let the SIGINT handler do the work: */
|
||||
+ kill(getpid(),SIGINT);
|
||||
+ usleep(1000000);
|
||||
+ kill(getpid(),SIGTERM);
|
||||
+ usleep(1000000);
|
||||
+ /* stubborn... */
|
||||
+ exit(0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
#if !defined(LOOP_PASSWORD_MIN_LENGTH)
|
||||
# define LOOP_PASSWORD_MIN_LENGTH 20
|
||||
#endif
|
||||
@@ -460,6 +478,15 @@
|
||||
int i, ask2;
|
||||
|
||||
if(!passFDnumber) {
|
||||
+
|
||||
+ if(passphrase_timeout) {
|
||||
+ alrmact.sa_handler = &alrmhandler;
|
||||
+ memset(&alrmact.sa_mask, 0, sizeof(alrmact.sa_mask));
|
||||
+ alrmact.sa_flags = 0;
|
||||
+ sigaction(SIGALRM, &alrmact, NULL);
|
||||
+ alarm(passphrase_timeout);
|
||||
+ }
|
||||
+
|
||||
p = getpass(_("Password: "));
|
||||
ask2 = passAskTwice ? 1 : 0;
|
||||
} else {
|
||||
@@ -493,6 +520,15 @@
|
||||
s = malloc(i + 1);
|
||||
if(!s) goto nomem;
|
||||
strcpy(s, p);
|
||||
+
|
||||
+ if(passphrase_timeout) {
|
||||
+ alrmact.sa_handler = &alrmhandler;
|
||||
+ memset(&alrmact.sa_mask, 0, sizeof(alrmact.sa_mask));
|
||||
+ alrmact.sa_flags = 0;
|
||||
+ sigaction(SIGALRM, &alrmact, NULL);
|
||||
+ alarm(passphrase_timeout);
|
||||
+ }
|
||||
+
|
||||
p = getpass(_("Retype password: "));
|
||||
if(!p) goto nomem;
|
||||
if(strcmp(s, p)) goto compareErr;
|
||||
@@ -524,6 +560,15 @@
|
||||
strcpy(s, p);
|
||||
memset(p, 0, i);
|
||||
if(ask2) {
|
||||
+
|
||||
+ if(passphrase_timeout) {
|
||||
+ alrmact.sa_handler = &alrmhandler;
|
||||
+ memset(&alrmact.sa_mask, 0, sizeof(alrmact.sa_mask));
|
||||
+ alrmact.sa_flags = 0;
|
||||
+ sigaction(SIGALRM, &alrmact, NULL);
|
||||
+ alarm(passphrase_timeout);
|
||||
+ }
|
||||
+
|
||||
p = getpass(_("Retype password: "));
|
||||
if(!p) goto nomem;
|
||||
if(strcmp(s, p)) {
|
||||
@@ -738,7 +783,7 @@
|
||||
struct loop_info64 loopinfo;
|
||||
int fd, ffd, mode, i;
|
||||
char *pass, *apiName = NULL;
|
||||
- void (*hashFunc)(unsigned char *, int, unsigned char *, int);
|
||||
+ void (*hashFunc)(unsigned char *, int, unsigned char *, int) = NULL;
|
||||
unsigned char multiKeyBits[65][32];
|
||||
int minPassLen = LOOP_PASSWORD_MIN_LENGTH;
|
||||
int run_mkfs_command = 0;
|
||||
@@ -762,8 +807,23 @@
|
||||
|
||||
memset (&loopinfo, 0, sizeof (loopinfo));
|
||||
xstrncpy (loopinfo.lo_file_name, file, LO_NAME_SIZE);
|
||||
- if (loopEncryptionType)
|
||||
+ if (loopEncryptionType) {
|
||||
+ if (strcasecmp(loopEncryptionType,"twofish")==0
|
||||
+ && !passHashFuncName) {
|
||||
+ loopinfo.lo_encrypt_type = 3; /*LO_CRYPT_FISH*/
|
||||
+ loopinfo.lo_encrypt_key_size = 20;
|
||||
+ passHashFuncName = strdup("rmd160");
|
||||
+ fprintf(stderr,"Switching to old S.u.S.E. loop_fish2 compatibility mode.\n");
|
||||
+ } else if (strcasecmp(loopEncryptionType,"twofishSL92")==0
|
||||
+ && !passHashFuncName) {
|
||||
+ loopinfo.lo_encrypt_type = 3; /*LO_CRYPT_FISH*/
|
||||
+ loopinfo.lo_encrypt_key_size = 32;
|
||||
+ passHashFuncName = strdup("sha512");
|
||||
+ fprintf(stderr,"Switching to SuSE 9.2 loop_fish2 compatibility mode.\n");
|
||||
+ } else {
|
||||
loopinfo.lo_encrypt_type = loop_crypt_type (loopEncryptionType, &loopinfo.lo_encrypt_key_size, &apiName);
|
||||
+ }
|
||||
+ }
|
||||
if (loopOffsetBytes)
|
||||
loopinfo.lo_offset = mystrtoull(loopOffsetBytes, 1);
|
||||
if (loopSizeBytes)
|
||||
@@ -995,7 +1055,7 @@
|
||||
%s loop_device # give info\n\
|
||||
%s -a # give info of all loops\n\
|
||||
%s -d loop_device # delete\n\
|
||||
-options: -o offset -s sizelimit -p passwdfd -S pseed -H phash\n\
|
||||
+options: -o offset -s sizelimit -p passwdfd -S pseed -H phash -t timeout\n\
|
||||
-I loinit -T -K gpgkey -G gpghome -C itercountk -v -r\n"),
|
||||
progname, progname, progname, progname, progname);
|
||||
exit(1);
|
||||
@@ -1139,7 +1199,7 @@
|
||||
|
||||
delete = 0;
|
||||
progname = argv[0];
|
||||
- while ((c = getopt(argc,argv,"aC:de:FG:H:I:K:o:p:rs:S:Tv")) != -1) {
|
||||
+ while ((c = getopt(argc,argv,"aC:de:FG:H:I:K:o:p:rs:S:t:Tv")) != -1) {
|
||||
switch (c) {
|
||||
case 'a': /* show status of all loops */
|
||||
option_a = 1;
|
||||
@@ -1183,6 +1243,9 @@
|
||||
case 'S': /* optional seed for passphrase */
|
||||
passSeedString = optarg;
|
||||
break;
|
||||
+ case 't':
|
||||
+ passphrase_timeout = atoi(optarg);
|
||||
+ break;
|
||||
case 'T': /* ask passphrase _twice_ */
|
||||
passAskTwice = "T";
|
||||
break;
|
||||
--- util-linux-2.12q/mount/losetup.8
|
||||
+++ util-linux-2.12q/mount/losetup.8
|
||||
@@ -128,6 +128,9 @@
|
||||
password before hashing. Using different seeds for different partitions
|
||||
makes dictionary attacks slower but does not prevent them if user supplied
|
||||
password is guessable. Seed is not used in multi-key mode.
|
||||
+.IP "\fB\-t \fItimeout\fP"
|
||||
+make the password prompt time out after \fItimeout\fP seconds have
|
||||
+passed by.
|
||||
.IP "\fB\-T\fP"
|
||||
Asks password twice.
|
||||
.IP "\fB\-v\fP"
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12a/mount/mount_by_label.c.old 2004-08-11 22:25:06.000000000 +0100
|
||||
+++ util-linux-2.12a/mount/mount_by_label.c 2004-08-11 22:25:21.000000000 +0100
|
||||
@@ -17,6 +17,8 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/mount_by_label.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/mount_by_label.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/mount_by_label.c
|
||||
@@ -18,6 +18,8 @@
|
||||
* - Added JFS v2 format support
|
||||
* 2002-07-26 Luciano Chavez <lnx1138@us.ibm.com>
|
||||
* - Added EVMS support
|
||||
@ -9,15 +11,15 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -38,6 +40,7 @@
|
||||
@@ -39,6 +41,7 @@
|
||||
#define VG_DIR "/proc/lvm/VGs"
|
||||
#define EVMS_VOLUME_NAME_SIZE 127
|
||||
#define PROC_EVMS_VOLUMES "/proc/evms/volumes"
|
||||
+#define DEVICEMAPPERDIR "/dev/mapper"
|
||||
|
||||
static struct uuidCache_s {
|
||||
struct uuidCache_s *next;
|
||||
@@ -101,6 +104,34 @@
|
||||
extern char *progname;
|
||||
|
||||
@@ -104,6 +107,34 @@ uuidcache_init_lvm(void) {
|
||||
closedir(vg_dir);
|
||||
}
|
||||
|
||||
@ -52,7 +54,7 @@
|
||||
static int
|
||||
uuidcache_init_evms(void) {
|
||||
FILE *procvol;
|
||||
@@ -250,6 +281,8 @@
|
||||
@@ -256,6 +287,8 @@ uuidcache_init(void) {
|
||||
fclose(procpt);
|
||||
|
||||
uuidcache_init_lvm();
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12q/mount/mount.c
|
||||
+++ util-linux-2.12q/mount/mount.c
|
||||
@@ -1178,11 +1178,15 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
@@ -1207,11 +1207,15 @@ mount_one (const char *spec, const char
|
||||
|
||||
if (types == NULL && !mounttype && !is_existing_file(spec)) {
|
||||
if (strchr (spec, ':') != NULL) {
|
||||
@ -17,5 +19,5 @@
|
||||
+ }
|
||||
+ }
|
||||
} else if(!strncmp(spec, "//", 2)) {
|
||||
types = "smbfs";
|
||||
types = "cifs";
|
||||
if (verbose)
|
31
util-linux-2.12a-mount_procswapcheck.patch
Normal file
31
util-linux-2.12a-mount_procswapcheck.patch
Normal file
@ -0,0 +1,31 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/swapon.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/swapon.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/swapon.c
|
||||
@@ -138,6 +138,7 @@ static int
|
||||
is_in_proc_swaps(const char *fname) {
|
||||
int i;
|
||||
char canonical[PATH_MAX + 2];
|
||||
+ struct stat stfname, stswapFile;
|
||||
|
||||
if (!myrealpath(fname, canonical, PATH_MAX + 1)) {
|
||||
fprintf(stderr, _("%s: cannot canonicalize %s: %s\n"),
|
||||
@@ -146,9 +147,15 @@ is_in_proc_swaps(const char *fname) {
|
||||
*(canonical + (PATH_MAX + 1)) = '\0';
|
||||
}
|
||||
|
||||
- for (i = 0; i < numSwaps; i++)
|
||||
- if (swapFiles[i] && !strcmp(canonical, swapFiles[i]))
|
||||
- return 1;
|
||||
+ for (i = 0; i < numSwaps; i++) {
|
||||
+ if(S_ISBLK(stfname.st_mode)) {
|
||||
+ stat(swapFiles[i], &stswapFile);
|
||||
+ if(S_ISBLK(stswapFile.st_mode))
|
||||
+ if(stfname.st_rdev == stswapFile.st_rdev)
|
||||
+ return 1;
|
||||
+ } else if (swapFiles[i] && !strcmp(canonical, swapFiles[i]))
|
||||
+ return 1;
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,24 +0,0 @@
|
||||
--- util-linux-2.12q/mount/swapon.c
|
||||
+++ util-linux-2.12q/mount/swapon.c
|
||||
@@ -160,10 +160,19 @@
|
||||
static int
|
||||
is_in_proc_swaps(const char *fname) {
|
||||
int i;
|
||||
+ struct stat stfname, stswapFile;
|
||||
|
||||
- for (i = 0; i < numSwaps; i++)
|
||||
- if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
|
||||
+ stat(fname, &stfname);
|
||||
+
|
||||
+ for (i = 0; i < numSwaps; i++) {
|
||||
+ if(S_ISBLK(stfname.st_mode)) {
|
||||
+ stat(swapFiles[i], &stswapFile);
|
||||
+ if(S_ISBLK(stswapFile.st_mode))
|
||||
+ if(stfname.st_rdev == stswapFile.st_rdev)
|
||||
+ return 1;
|
||||
+ } else if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
|
||||
return 1;
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,152 +0,0 @@
|
||||
Index: util-linux-2.12r/mount/fstab.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/fstab.c
|
||||
+++ util-linux-2.12r/mount/fstab.c
|
||||
@@ -395,6 +395,7 @@ getfsvolspec (const char *label) {
|
||||
|
||||
/* Flag for already existing lock file. */
|
||||
static int we_created_lockfile = 0;
|
||||
+static int lockfile_fd = -1;
|
||||
|
||||
/* Flag to indicate that signals have been set up. */
|
||||
static int signals_have_been_setup = 0;
|
||||
@@ -416,6 +417,8 @@ setlkw_timeout (int sig) {
|
||||
void
|
||||
unlock_mtab (void) {
|
||||
if (we_created_lockfile) {
|
||||
+ close(lockfile_fd);
|
||||
+ lockfile_fd = -1;
|
||||
unlink (MOUNTED_LOCK);
|
||||
we_created_lockfile = 0;
|
||||
}
|
||||
@@ -443,7 +446,7 @@ unlock_mtab (void) {
|
||||
|
||||
void
|
||||
lock_mtab (void) {
|
||||
- int tries = 3;
|
||||
+ int tries = 100000, i;
|
||||
char linktargetfile[MOUNTLOCK_LINKTARGET_LTH];
|
||||
|
||||
at_die = unlock_mtab;
|
||||
@@ -469,45 +472,48 @@ lock_mtab (void) {
|
||||
|
||||
sprintf(linktargetfile, MOUNTLOCK_LINKTARGET, getpid ());
|
||||
|
||||
+ i = open (linktargetfile, O_WRONLY|O_CREAT, 0);
|
||||
+ if (i < 0) {
|
||||
+ int errsv = errno;
|
||||
+ /* linktargetfile does not exist (as a file)
|
||||
+ and we cannot create it. Read-only filesystem?
|
||||
+ Too many files open in the system?
|
||||
+ Filesystem full? */
|
||||
+ die (EX_FILEIO, _("can't create lock file %s: %s "
|
||||
+ "(use -n flag to override)"),
|
||||
+ linktargetfile, strerror (errsv));
|
||||
+ }
|
||||
+ close(i);
|
||||
+
|
||||
/* Repeat until it was us who made the link */
|
||||
while (!we_created_lockfile) {
|
||||
struct flock flock;
|
||||
- int errsv, fd, i, j;
|
||||
-
|
||||
- i = open (linktargetfile, O_WRONLY|O_CREAT, 0);
|
||||
- if (i < 0) {
|
||||
- int errsv = errno;
|
||||
- /* linktargetfile does not exist (as a file)
|
||||
- and we cannot create it. Read-only filesystem?
|
||||
- Too many files open in the system?
|
||||
- Filesystem full? */
|
||||
- die (EX_FILEIO, _("can't create lock file %s: %s "
|
||||
- "(use -n flag to override)"),
|
||||
- linktargetfile, strerror (errsv));
|
||||
- }
|
||||
- close(i);
|
||||
+ int errsv, j;
|
||||
|
||||
j = link(linktargetfile, MOUNTED_LOCK);
|
||||
errsv = errno;
|
||||
|
||||
- (void) unlink(linktargetfile);
|
||||
-
|
||||
if (j == 0)
|
||||
we_created_lockfile = 1;
|
||||
|
||||
if (j < 0 && errsv != EEXIST) {
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't link lock file %s: %s "
|
||||
"(use -n flag to override)"),
|
||||
MOUNTED_LOCK, strerror (errsv));
|
||||
}
|
||||
|
||||
- fd = open (MOUNTED_LOCK, O_WRONLY);
|
||||
+ lockfile_fd = open (MOUNTED_LOCK, O_WRONLY);
|
||||
|
||||
- if (fd < 0) {
|
||||
+ if (lockfile_fd < 0) {
|
||||
int errsv = errno;
|
||||
/* Strange... Maybe the file was just deleted? */
|
||||
- if (errno == ENOENT && tries-- > 0)
|
||||
+ if (errno == ENOENT && tries-- > 0) {
|
||||
+ if (tries % 200 == 0)
|
||||
+ usleep(30);
|
||||
continue;
|
||||
+ }
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't open lock file %s: %s "
|
||||
"(use -n flag to override)"),
|
||||
MOUNTED_LOCK, strerror (errsv));
|
||||
@@ -520,7 +526,7 @@ lock_mtab (void) {
|
||||
|
||||
if (j == 0) {
|
||||
/* We made the link. Now claim the lock. */
|
||||
- if (fcntl (fd, F_SETLK, &flock) == -1) {
|
||||
+ if (fcntl (lockfile_fd, F_SETLK, &flock) == -1) {
|
||||
if (verbose) {
|
||||
int errsv = errno;
|
||||
printf(_("Can't lock lock file %s: %s\n"),
|
||||
@@ -528,13 +534,15 @@ lock_mtab (void) {
|
||||
}
|
||||
/* proceed anyway */
|
||||
}
|
||||
+ (void) unlink(linktargetfile);
|
||||
} else {
|
||||
static int tries = 0;
|
||||
|
||||
/* Someone else made the link. Wait. */
|
||||
alarm(LOCK_TIMEOUT);
|
||||
- if (fcntl (fd, F_SETLKW, &flock) == -1) {
|
||||
+ if (fcntl (lockfile_fd, F_SETLKW, &flock) == -1) {
|
||||
int errsv = errno;
|
||||
+ (void) unlink(linktargetfile);
|
||||
die (EX_FILEIO, _("can't lock lock file %s: %s"),
|
||||
MOUNTED_LOCK, (errno == EINTR) ?
|
||||
_("timed out") : strerror (errsv));
|
||||
@@ -542,16 +550,18 @@ lock_mtab (void) {
|
||||
alarm(0);
|
||||
/* Limit the number of iterations - maybe there
|
||||
still is some old /etc/mtab~ */
|
||||
- if (tries++ > 3) {
|
||||
- if (tries > 5)
|
||||
- die (EX_FILEIO, _("Cannot create link %s\n"
|
||||
- "Perhaps there is a stale lock file?\n"),
|
||||
- MOUNTED_LOCK);
|
||||
- sleep(1);
|
||||
- }
|
||||
+ ++tries;
|
||||
+ if (tries % 200 == 0)
|
||||
+ usleep(30);
|
||||
+ if (tries > 100000) {
|
||||
+ (void) unlink(linktargetfile);
|
||||
+ close(lockfile_fd);
|
||||
+ die (EX_FILEIO, _("Cannot create link %s\n"
|
||||
+ "Perhaps there is a stale lock file?\n"),
|
||||
+ MOUNTED_LOCK);
|
||||
+ }
|
||||
+ close(lockfile_fd);
|
||||
}
|
||||
-
|
||||
- close(fd);
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
--- util-linux-2.12q/mount/lomount.c
|
||||
+++ util-linux-2.12q/mount/lomount.c
|
||||
@@ -73,6 +73,7 @@
|
||||
#if !defined(LOOP_PASSWORD_MIN_LENGTH)
|
||||
# define LOOP_PASSWORD_MIN_LENGTH 20
|
||||
#endif
|
||||
+#define SUSE_PASSWORD_MIN_LENGTH 8
|
||||
|
||||
char *passFDnumber = (char *)0;
|
||||
char *passAskTwice = (char *)0;
|
||||
@@ -459,7 +460,7 @@
|
||||
multiKeyPass[0] = 0;
|
||||
break;
|
||||
}
|
||||
- if(strlen(multiKeyPass[x]) < LOOP_PASSWORD_MIN_LENGTH) break;
|
||||
+ if(strlen(multiKeyPass[x]) < SUSE_PASSWORD_MIN_LENGTH) break;
|
||||
x++;
|
||||
}
|
||||
if(x == 65)
|
||||
@@ -498,7 +499,7 @@
|
||||
while(x < 65) {
|
||||
multiKeyPass[x] = get_FD_pass(i);
|
||||
if(!multiKeyPass[x]) goto nomem;
|
||||
- if(strlen(multiKeyPass[x]) < LOOP_PASSWORD_MIN_LENGTH) break;
|
||||
+ if(strlen(multiKeyPass[x]) < SUSE_PASSWORD_MIN_LENGTH) break;
|
||||
x++;
|
||||
}
|
||||
if(x == 65) {
|
||||
@@ -579,7 +580,7 @@
|
||||
memset(p, 0, i);
|
||||
}
|
||||
if(i < warnLen) {
|
||||
- fprintf(stderr, _("WARNING - Please use longer password (%d or more characters)\n"), LOOP_PASSWORD_MIN_LENGTH);
|
||||
+ fprintf(stderr, _("WARNING - Please use longer password (%d or more characters)\n"), SUSE_PASSWORD_MIN_LENGTH);
|
||||
}
|
||||
strcat(s, seed);
|
||||
return(s);
|
||||
@@ -785,7 +786,7 @@
|
||||
char *pass, *apiName = NULL;
|
||||
void (*hashFunc)(unsigned char *, int, unsigned char *, int) = NULL;
|
||||
unsigned char multiKeyBits[65][32];
|
||||
- int minPassLen = LOOP_PASSWORD_MIN_LENGTH;
|
||||
+ int minPassLen = SUSE_PASSWORD_MIN_LENGTH;
|
||||
int run_mkfs_command = 0;
|
||||
|
||||
loopFileName = (char *)file;
|
||||
@@ -900,7 +901,7 @@
|
||||
break; /* out of switch(loopinfo.lo_encrypt_type) */
|
||||
}
|
||||
}
|
||||
- pass = sGetPass (minPassLen, LOOP_PASSWORD_MIN_LENGTH);
|
||||
+ pass = sGetPass (minPassLen, SUSE_PASSWORD_MIN_LENGTH);
|
||||
if(!pass) goto close_fd_ffd_return1;
|
||||
i = strlen(pass);
|
||||
if(hashFunc == unhashed1_key_setup) {
|
@ -1,22 +0,0 @@
|
||||
--- util-linux-2.12q/MCONFIG
|
||||
+++ util-linux-2.12q/MCONFIG
|
||||
@@ -17,7 +17,7 @@
|
||||
# Select for CPU i386 if the binaries must be able to run on an intel 386
|
||||
# (by default i486 code is generated, see below)
|
||||
CPU=$(shell uname -m)
|
||||
-ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
|
||||
+ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/;s/x86_64/intel/')
|
||||
|
||||
# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
|
||||
# will use PAM for authentication. Additionally, passwd will not be
|
||||
@@ -137,6 +137,10 @@
|
||||
else
|
||||
CPUTAIL=486
|
||||
endif
|
||||
+ ifeq "$(CPU)" "x86_64"
|
||||
+ CPUHEAD=-mcpu=
|
||||
+ CPUTAIL=nocona
|
||||
+ endif
|
||||
CPUOPT= $(CPUHEAD)$(CPUTAIL)
|
||||
OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
|
||||
else
|
@ -1,6 +1,8 @@
|
||||
--- mount/mount.c
|
||||
Index: mount/mount.c
|
||||
===================================================================
|
||||
--- mount/mount.c.orig
|
||||
+++ mount/mount.c
|
||||
@@ -665,6 +665,25 @@
|
||||
@@ -760,6 +760,25 @@ update_mtab_entry(const char *spec, cons
|
||||
else {
|
||||
mntFILE *mfp;
|
||||
|
||||
@ -26,4 +28,3 @@
|
||||
lock_mtab();
|
||||
mfp = my_setmntent(MOUNTED, "a+");
|
||||
if (mfp == NULL || mfp->mntent_fp == NULL) {
|
||||
|
28
util-linux-2.12q-mount_strict_aliasing.patch
Normal file
28
util-linux-2.12q-mount_strict_aliasing.patch
Normal file
@ -0,0 +1,28 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
@@ -17,11 +17,11 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
|
||||
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
|
||||
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
|
||||
getusername.c \
|
||||
- nfsmount.c nfsmount_xdr.c nfsmount_clnt.c nfs4mount.c \
|
||||
+ nfsmount.c nfsmount_clnt.c nfs4mount.c \
|
||||
lomount.c \
|
||||
$(MNTHDRS)
|
||||
|
||||
-mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
|
||||
+mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a libnfsmount_xdr.a
|
||||
|
||||
umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
|
||||
getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
|
||||
@@ -60,6 +60,9 @@ swapargs.h:
|
||||
clean-local:
|
||||
rm -f swapargs.h
|
||||
|
||||
+noinst_LIBRARIES = libnfsmount_xdr.a
|
||||
+libnfsmount_xdr_a_SOURCES = nfsmount_xdr.c
|
||||
+libnfsmount_xdr_a_CFLAGS = -fno-strict-aliasing
|
||||
|
||||
install-exec-hook:
|
||||
chmod 4755 $(DESTDIR)$(bindir)/mount
|
@ -1,6 +1,8 @@
|
||||
--- mount/umount.c
|
||||
Index: mount/umount.c
|
||||
===================================================================
|
||||
--- mount/umount.c.orig
|
||||
+++ mount/umount.c
|
||||
@@ -40,7 +40,7 @@
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <linux/unistd.h>
|
||||
#ifdef __NR_umount2
|
||||
|
@ -1,628 +0,0 @@
|
||||
--- util-linux-2.12q/mount/Makefile
|
||||
+++ util-linux-2.12q/mount/Makefile
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
MAYBE = pivot_root swapoff
|
||||
|
||||
-NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o
|
||||
+NFS_OBJS = nfsmount.o nfsmount_xdr.o nfsmount_clnt.o nfs4mount.o
|
||||
GEN_FILES = nfsmount.h nfsmount_xdr.c nfsmount_clnt.c
|
||||
|
||||
all: $(PROGS)
|
||||
--- util-linux-2.12q/mount/mount.c
|
||||
+++ util-linux-2.12q/mount/mount.c
|
||||
@@ -847,8 +847,23 @@
|
||||
"without support for the type `nfs'"));
|
||||
#endif
|
||||
}
|
||||
+#ifdef HAVE_NFS
|
||||
+ /*
|
||||
+ * NFSv4 support
|
||||
+ */
|
||||
+ if (!fake && types && streq (types, "nfs4")) {
|
||||
+ mnt_err = nfs4mount(spec, node, &flags, &extra_opts, &mount_opts, bg);
|
||||
+ if (mnt_err)
|
||||
+ return mnt_err;
|
||||
+ goto nosigblock;
|
||||
+#else
|
||||
+ die (EX_SOFTWARE, _("mount: this version was compiled "
|
||||
+ "without support for the type `nfs4'"));
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
block_signals (SIG_BLOCK);
|
||||
+nosigblock:
|
||||
|
||||
if (!fake) {
|
||||
mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS,
|
||||
--- util-linux-2.12q/mount/nfs4mount.c
|
||||
+++ util-linux-2.12q/mount/nfs4mount.c
|
||||
@@ -0,0 +1,460 @@
|
||||
+/*
|
||||
+ * nfs4mount.c -- Linux NFS mount
|
||||
+ * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Note: this file based on the original nfsmount.c
|
||||
+ */
|
||||
+
|
||||
+#include "../defines.h" /* for HAVE_rpcsvc_nfs_prot_h and HAVE_inet_aton */
|
||||
+
|
||||
+#include <linux/posix_types.h>
|
||||
+#include <asm/posix_types.h>
|
||||
+#undef __FD_CLR
|
||||
+#undef __FD_SET
|
||||
+#undef __FD_ISSET
|
||||
+#undef __FD_ZERO
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <errno.h>
|
||||
+#include <netdb.h>
|
||||
+#include <time.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/time.h>
|
||||
+#include <sys/utsname.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <arpa/inet.h>
|
||||
+#include <rpc/auth.h>
|
||||
+#ifdef HAVE_rpcsvc_nfs_prot_h
|
||||
+#include <rpcsvc/nfs_prot.h>
|
||||
+#else
|
||||
+#include <linux/nfs.h>
|
||||
+#define nfsstat nfs_stat
|
||||
+#endif
|
||||
+
|
||||
+#include "sundries.h"
|
||||
+
|
||||
+#include "mount_constants.h"
|
||||
+#include "nfs4_mount.h"
|
||||
+
|
||||
+#include "nls.h"
|
||||
+
|
||||
+#ifndef NFS_PORT
|
||||
+#define NFS_PORT 2049
|
||||
+#endif
|
||||
+
|
||||
+extern int clnt_ping(struct sockaddr_in *, const u_long, const u_long, const u_int);
|
||||
+extern void rpc_strerror(void);
|
||||
+
|
||||
+struct {
|
||||
+ char *flavour;
|
||||
+ int fnum;
|
||||
+} flav_map[] = {
|
||||
+ { "krb5", RPC_AUTH_GSS_KRB5 },
|
||||
+ { "krb5i", RPC_AUTH_GSS_KRB5I },
|
||||
+ { "krb5p", RPC_AUTH_GSS_KRB5P },
|
||||
+ { "lipkey", RPC_AUTH_GSS_LKEY },
|
||||
+ { "lipkey-i", RPC_AUTH_GSS_LKEYI },
|
||||
+ { "lipkey-p", RPC_AUTH_GSS_LKEYP },
|
||||
+ { "spkm3", RPC_AUTH_GSS_SPKM },
|
||||
+ { "spkm3i", RPC_AUTH_GSS_SPKMI },
|
||||
+ { "spkm3p", RPC_AUTH_GSS_SPKMP },
|
||||
+ { "unix", AUTH_UNIX },
|
||||
+ { "sys", AUTH_SYS },
|
||||
+ { "null", AUTH_NULL },
|
||||
+ { "none", AUTH_NONE },
|
||||
+};
|
||||
+
|
||||
+#define FMAPSIZE (sizeof(flav_map)/sizeof(flav_map[0]))
|
||||
+#define MAX_USER_FLAVOUR 16
|
||||
+
|
||||
+static int parse_sec(char *sec, int *pseudoflavour)
|
||||
+{
|
||||
+ int i, num_flavour = 0;
|
||||
+
|
||||
+ for (sec = strtok(sec, ":"); sec; sec = strtok(NULL, ":")) {
|
||||
+ if (num_flavour >= MAX_USER_FLAVOUR) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: maximum number of security flavors "
|
||||
+ "exceeded\n"));
|
||||
+ return 0;
|
||||
+ }
|
||||
+ for (i = 0; i < FMAPSIZE; i++) {
|
||||
+ if (strcmp(sec, flav_map[i].flavour) == 0) {
|
||||
+ pseudoflavour[num_flavour++] = flav_map[i].fnum;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ if (i == FMAPSIZE) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: unknown security type %s\n"), sec);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!num_flavour)
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: no security flavors passed to sec= option\n"));
|
||||
+ return num_flavour;
|
||||
+}
|
||||
+
|
||||
+static int parse_devname(char *hostdir, char **hostname, char **dirname)
|
||||
+{
|
||||
+ char *s;
|
||||
+
|
||||
+ if (!(s = strchr(hostdir, ':'))) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: "
|
||||
+ "directory to mount not in host:dir format\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *hostname = hostdir;
|
||||
+ *dirname = s + 1;
|
||||
+ *s = '\0';
|
||||
+ /* Ignore all but first hostname in replicated mounts
|
||||
+ until they can be fully supported. (mack@sgi.com) */
|
||||
+ if ((s = strchr(hostdir, ','))) {
|
||||
+ *s = '\0';
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: warning: "
|
||||
+ "multiple hostnames not supported\n"));
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int fill_ipv4_sockaddr(const char *hostname, struct sockaddr_in *addr)
|
||||
+{
|
||||
+ struct hostent *hp;
|
||||
+ addr->sin_family = AF_INET;
|
||||
+
|
||||
+ if (inet_aton(hostname, &addr->sin_addr))
|
||||
+ return 0;
|
||||
+ if ((hp = gethostbyname(hostname)) == NULL) {
|
||||
+ fprintf(stderr, _("mount: can't get address for %s\n"),
|
||||
+ hostname);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (hp->h_length > sizeof(struct in_addr)) {
|
||||
+ fprintf(stderr,
|
||||
+ _("mount: got bad hp->h_length\n"));
|
||||
+ hp->h_length = sizeof(struct in_addr);
|
||||
+ }
|
||||
+ memcpy(&addr->sin_addr, hp->h_addr, hp->h_length);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int get_my_ipv4addr(char *ip_addr, int len)
|
||||
+{
|
||||
+ char myname[1024];
|
||||
+ struct sockaddr_in myaddr;
|
||||
+
|
||||
+ if (gethostname(myname, sizeof(myname))) {
|
||||
+ fprintf(stderr, _("mount: can't determine client address\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (fill_ipv4_sockaddr(myname, &myaddr))
|
||||
+ return -1;
|
||||
+ snprintf(ip_addr, len, "%s", inet_ntoa(myaddr.sin_addr));
|
||||
+ ip_addr[len-1] = '\0';
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* Convert RPC errors into strings */
|
||||
+void rpc_strerror(void)
|
||||
+{
|
||||
+ int cf_stat = rpc_createerr.cf_stat;
|
||||
+ int cf_errno = rpc_createerr.cf_error.re_errno;
|
||||
+ char *ptr, *estr = clnt_sperrno(cf_stat);
|
||||
+
|
||||
+ if (estr) {
|
||||
+ if ((ptr = index(estr, ':')))
|
||||
+ estr = ++ptr;
|
||||
+
|
||||
+ fprintf(stderr, "RPC Error: %d (%s )\n", cf_stat, estr);
|
||||
+ if (cf_stat == RPC_SYSTEMERROR)
|
||||
+ fprintf(stderr, "System Error: %d (%s)\n", cf_errno, strerror(cf_errno));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+clnt_ping(struct sockaddr_in *saddr, const u_long prog, const u_long vers,
|
||||
+ const u_int prot)
|
||||
+{
|
||||
+ static const struct timeval TIMEOUT = { 20, 0 };
|
||||
+ static const struct timeval RETRY_TIMEOUT = { 3, 0 };
|
||||
+ CLIENT *clnt=NULL;
|
||||
+ int sock, stat;
|
||||
+ static char clnt_res;
|
||||
+
|
||||
+ rpc_createerr.cf_stat = stat = 0;
|
||||
+ sock = RPC_ANYSOCK;
|
||||
+ switch(prot) {
|
||||
+ case IPPROTO_UDP:
|
||||
+ clnt = clntudp_bufcreate(saddr, prog, vers,
|
||||
+ RETRY_TIMEOUT, &sock,
|
||||
+ RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
|
||||
+ break;
|
||||
+ case IPPROTO_TCP:
|
||||
+ clnt = clnttcp_create(saddr, prog, vers, &sock,
|
||||
+ RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto out_bad;
|
||||
+ }
|
||||
+ if (!clnt)
|
||||
+ goto out_bad;
|
||||
+ memset(&clnt_res, 0, sizeof(clnt_res));
|
||||
+ stat = clnt_call(clnt, NULLPROC,
|
||||
+ (xdrproc_t)xdr_void, (caddr_t)NULL,
|
||||
+ (xdrproc_t)xdr_void, (caddr_t)&clnt_res,
|
||||
+ TIMEOUT);
|
||||
+ clnt_destroy(clnt);
|
||||
+ close(sock);
|
||||
+ if (stat != RPC_PROGVERSMISMATCH)
|
||||
+ return 1;
|
||||
+
|
||||
+ out_bad:
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int nfs4mount(const char *spec, const char *node, int *flags,
|
||||
+ char **extra_opts, char **mount_opts,
|
||||
+ int running_bg)
|
||||
+{
|
||||
+ static struct nfs4_mount_data data;
|
||||
+ static char hostdir[1024];
|
||||
+ static char ip_addr[16] = "127.0.0.1";
|
||||
+ static struct sockaddr_in server_addr;
|
||||
+ static int pseudoflavour[MAX_USER_FLAVOUR];
|
||||
+ int num_flavour = 0;
|
||||
+
|
||||
+ char *hostname, *dirname, *old_opts;
|
||||
+ char new_opts[1024];
|
||||
+ char *opt, *opteq;
|
||||
+ char *s;
|
||||
+ int val;
|
||||
+ int bg, soft, intr;
|
||||
+ int nocto, noac;
|
||||
+ int retry;
|
||||
+ int retval;
|
||||
+
|
||||
+ retval = EX_FAIL;
|
||||
+ if (strlen(spec) >= sizeof(hostdir)) {
|
||||
+ fprintf(stderr, _("mount: "
|
||||
+ "excessively long host:dir argument\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ strcpy(hostdir, spec);
|
||||
+ if (parse_devname(hostdir, &hostname, &dirname))
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (fill_ipv4_sockaddr(hostname, &server_addr))
|
||||
+ goto fail;
|
||||
+ if (get_my_ipv4addr(ip_addr, sizeof(ip_addr)))
|
||||
+ goto fail;
|
||||
+
|
||||
+ /* add IP address to mtab options for use when unmounting */
|
||||
+ s = inet_ntoa(server_addr.sin_addr);
|
||||
+ old_opts = *extra_opts;
|
||||
+ if (!old_opts)
|
||||
+ old_opts = "";
|
||||
+ if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
|
||||
+ fprintf(stderr, _("mount: "
|
||||
+ "excessively long option argument\n"));
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ snprintf(new_opts, sizeof(new_opts), "%s%saddr=%s",
|
||||
+ old_opts, *old_opts ? "," : "", s);
|
||||
+ *extra_opts = xstrdup(new_opts);
|
||||
+
|
||||
+ /* Set default options.
|
||||
+ * rsize/wsize and timeo are left 0 in order to
|
||||
+ * let the kernel decide.
|
||||
+ */
|
||||
+ memset(&data, 0, sizeof(data));
|
||||
+ data.retrans = 3;
|
||||
+ data.acregmin = 3;
|
||||
+ data.acregmax = 60;
|
||||
+ data.acdirmin = 30;
|
||||
+ data.acdirmax = 60;
|
||||
+ data.proto = IPPROTO_TCP;
|
||||
+
|
||||
+ bg = 0;
|
||||
+ soft = 0;
|
||||
+ intr = NFS4_MOUNT_INTR;
|
||||
+ nocto = 0;
|
||||
+ noac = 0;
|
||||
+ retry = 10000; /* 10000 minutes ~ 1 week */
|
||||
+
|
||||
+ /*
|
||||
+ * NFSv4 specifies that the default port should be 2049
|
||||
+ */
|
||||
+ server_addr.sin_port = htons(NFS_PORT);
|
||||
+
|
||||
+ /* parse options */
|
||||
+
|
||||
+ for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
|
||||
+ if ((opteq = strchr(opt, '='))) {
|
||||
+ val = atoi(opteq + 1);
|
||||
+ *opteq = '\0';
|
||||
+ if (!strcmp(opt, "rsize"))
|
||||
+ data.rsize = val;
|
||||
+ else if (!strcmp(opt, "wsize"))
|
||||
+ data.wsize = val;
|
||||
+ else if (!strcmp(opt, "timeo"))
|
||||
+ data.timeo = val;
|
||||
+ else if (!strcmp(opt, "retrans"))
|
||||
+ data.retrans = val;
|
||||
+ else if (!strcmp(opt, "acregmin"))
|
||||
+ data.acregmin = val;
|
||||
+ else if (!strcmp(opt, "acregmax"))
|
||||
+ data.acregmax = val;
|
||||
+ else if (!strcmp(opt, "acdirmin"))
|
||||
+ data.acdirmin = val;
|
||||
+ else if (!strcmp(opt, "acdirmax"))
|
||||
+ data.acdirmax = val;
|
||||
+ else if (!strcmp(opt, "actimeo")) {
|
||||
+ data.acregmin = val;
|
||||
+ data.acregmax = val;
|
||||
+ data.acdirmin = val;
|
||||
+ data.acdirmax = val;
|
||||
+ }
|
||||
+ else if (!strcmp(opt, "retry"))
|
||||
+ retry = val;
|
||||
+ else if (!strcmp(opt, "port"))
|
||||
+ server_addr.sin_port = htons(val);
|
||||
+ else if (!strcmp(opt, "proto")) {
|
||||
+ if (!strncmp(opteq+1, "tcp", 3))
|
||||
+ data.proto = IPPROTO_TCP;
|
||||
+ else if (!strncmp(opteq+1, "udp", 3))
|
||||
+ data.proto = IPPROTO_UDP;
|
||||
+ else
|
||||
+ printf(_("Warning: Unrecognized proto= option.\n"));
|
||||
+ } else if (!strcmp(opt, "clientaddr")) {
|
||||
+ if (strlen(opteq+1) >= sizeof(ip_addr))
|
||||
+ printf(_("Invalid client address %s"),
|
||||
+ opteq+1);
|
||||
+ strncpy(ip_addr,opteq+1, sizeof(ip_addr));
|
||||
+ ip_addr[sizeof(ip_addr)-1] = '\0';
|
||||
+ } else if (!strcmp(opt, "sec")) {
|
||||
+ num_flavour = parse_sec(opteq+1, pseudoflavour);
|
||||
+ if (!num_flavour)
|
||||
+ goto fail;
|
||||
+ } else if (!strcmp(opt, "addr")) {
|
||||
+ /* ignore */;
|
||||
+ } else {
|
||||
+ printf(_("unknown nfs mount parameter: "
|
||||
+ "%s=%d\n"), opt, val);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ } else {
|
||||
+ val = 1;
|
||||
+ if (!strncmp(opt, "no", 2)) {
|
||||
+ val = 0;
|
||||
+ opt += 2;
|
||||
+ }
|
||||
+ if (!strcmp(opt, "bg"))
|
||||
+ bg = val;
|
||||
+ else if (!strcmp(opt, "fg"))
|
||||
+ bg = !val;
|
||||
+ else if (!strcmp(opt, "soft"))
|
||||
+ soft = val;
|
||||
+ else if (!strcmp(opt, "hard"))
|
||||
+ soft = !val;
|
||||
+ else if (!strcmp(opt, "intr"))
|
||||
+ intr = val;
|
||||
+ else if (!strcmp(opt, "cto"))
|
||||
+ nocto = !val;
|
||||
+ else if (!strcmp(opt, "ac"))
|
||||
+ noac = !val;
|
||||
+ else {
|
||||
+ if (!sloppy) {
|
||||
+ printf(_("unknown nfs mount option: "
|
||||
+ "%s%s\n"), val ? "" : "no", opt);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ data.flags = (soft ? NFS4_MOUNT_SOFT : 0)
|
||||
+ | (intr ? NFS4_MOUNT_INTR : 0)
|
||||
+ | (nocto ? NFS4_MOUNT_NOCTO : 0)
|
||||
+ | (noac ? NFS4_MOUNT_NOAC : 0);
|
||||
+
|
||||
+ if (num_flavour == 0)
|
||||
+ pseudoflavour[num_flavour++] = AUTH_UNIX;
|
||||
+ data.auth_flavourlen = num_flavour;
|
||||
+ data.auth_flavours = pseudoflavour;
|
||||
+
|
||||
+ data.client_addr.data = ip_addr;
|
||||
+ data.client_addr.len = strlen(ip_addr);
|
||||
+
|
||||
+ data.mnt_path.data = dirname;
|
||||
+ data.mnt_path.len = strlen(dirname);
|
||||
+
|
||||
+ data.hostname.data = hostname;
|
||||
+ data.hostname.len = strlen(hostname);
|
||||
+ data.host_addr = (struct sockaddr *)&server_addr;
|
||||
+ data.host_addrlen = sizeof(server_addr);
|
||||
+
|
||||
+#ifdef NFS_MOUNT_DEBUG
|
||||
+ printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
|
||||
+ data.rsize, data.wsize, data.timeo, data.retrans);
|
||||
+ printf("acreg (min, max) = (%d, %d), acdir (min, max) = (%d, %d)\n",
|
||||
+ data.acregmin, data.acregmax, data.acdirmin, data.acdirmax);
|
||||
+ printf("port = %d, bg = %d, retry = %d, flags = %.8x\n",
|
||||
+ ntohs(server_addr.sin_port), bg, retry, data.flags);
|
||||
+ printf("soft = %d, intr = %d, nocto = %d, noac = %d\n",
|
||||
+ (data.flags & NFS4_MOUNT_SOFT) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_INTR) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_NOCTO) != 0,
|
||||
+ (data.flags & NFS4_MOUNT_NOAC) != 0);
|
||||
+
|
||||
+ if (num_flavour > 0) {
|
||||
+ int pf_cnt, i;
|
||||
+
|
||||
+ printf("sec = ");
|
||||
+ for (pf_cnt = 0; pf_cnt < num_flavour; pf_cnt++) {
|
||||
+ for (i = 0; i < FMAPSIZE; i++) {
|
||||
+ if (flav_map[i].fnum == pseudoflavour[pf_cnt]) {
|
||||
+ printf("%s", flav_map[i].flavour);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ printf("%s", (pf_cnt < num_flavour-1) ? ":" : "\n");
|
||||
+ }
|
||||
+ }
|
||||
+ printf("proto = %s\n", (data.proto == IPPROTO_TCP) ? "tcp" : "udp");
|
||||
+#endif
|
||||
+
|
||||
+ data.version = NFS4_MOUNT_VERSION;
|
||||
+
|
||||
+ clnt_ping(&server_addr, NFS_PROGRAM, 4, data.proto);
|
||||
+ if (rpc_createerr.cf_stat) {
|
||||
+ fprintf(stderr, "mount to NFS server '%s' failed.\n", data.hostname.data);
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
+ *mount_opts = (char *) &data;
|
||||
+ /* clean up */
|
||||
+ return 0;
|
||||
+
|
||||
+fail:
|
||||
+ if (verbose) {
|
||||
+ rpc_strerror();
|
||||
+ }
|
||||
+ return retval;
|
||||
+}
|
||||
--- util-linux-2.12q/mount/nfs4_mount.h
|
||||
+++ util-linux-2.12q/mount/nfs4_mount.h
|
||||
@@ -0,0 +1,82 @@
|
||||
+#ifndef _LINUX_NFS4_MOUNT_H
|
||||
+#define _LINUX_NFS4_MOUNT_H
|
||||
+
|
||||
+/*
|
||||
+ * linux/include/linux/nfs4_mount.h
|
||||
+ *
|
||||
+ * Copyright (C) 2002 Trond Myklebust
|
||||
+ *
|
||||
+ * structure passed from user-space to kernel-space during an nfsv4 mount
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * WARNING! Do not delete or change the order of these fields. If
|
||||
+ * a new field is required then add it to the end. The version field
|
||||
+ * tracks which fields are present. This will ensure some measure of
|
||||
+ * mount-to-kernel version compatibility. Some of these aren't used yet
|
||||
+ * but here they are anyway.
|
||||
+ */
|
||||
+#define NFS4_MOUNT_VERSION 1
|
||||
+
|
||||
+struct nfs_string {
|
||||
+ unsigned int len;
|
||||
+ const char* data;
|
||||
+};
|
||||
+
|
||||
+struct nfs4_mount_data {
|
||||
+ int version; /* 1 */
|
||||
+ int flags; /* 1 */
|
||||
+ int rsize; /* 1 */
|
||||
+ int wsize; /* 1 */
|
||||
+ int timeo; /* 1 */
|
||||
+ int retrans; /* 1 */
|
||||
+ int acregmin; /* 1 */
|
||||
+ int acregmax; /* 1 */
|
||||
+ int acdirmin; /* 1 */
|
||||
+ int acdirmax; /* 1 */
|
||||
+
|
||||
+ /* see the definition of 'struct clientaddr4' in RFC3010 */
|
||||
+ struct nfs_string client_addr; /* 1 */
|
||||
+
|
||||
+ /* Mount path */
|
||||
+ struct nfs_string mnt_path; /* 1 */
|
||||
+
|
||||
+ /* Server details */
|
||||
+ struct nfs_string hostname; /* 1 */
|
||||
+ /* Server IP address */
|
||||
+ unsigned int host_addrlen; /* 1 */
|
||||
+ struct sockaddr* host_addr; /* 1 */
|
||||
+
|
||||
+ /* Transport protocol to use */
|
||||
+ int proto; /* 1 */
|
||||
+
|
||||
+ /* Pseudo-flavours to use for authentication. See RFC2623 */
|
||||
+ int auth_flavourlen; /* 1 */
|
||||
+ int *auth_flavours; /* 1 */
|
||||
+};
|
||||
+
|
||||
+/* bits in the flags field */
|
||||
+/* Note: the fields that correspond to existing NFSv2/v3 mount options
|
||||
+ * should mirror the values from include/linux/nfs_mount.h
|
||||
+ */
|
||||
+
|
||||
+#define NFS4_MOUNT_SOFT 0x0001 /* 1 */
|
||||
+#define NFS4_MOUNT_INTR 0x0002 /* 1 */
|
||||
+#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
|
||||
+#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
|
||||
+#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
|
||||
+#define NFS4_MOUNT_FLAGMASK 0xFFFF
|
||||
+
|
||||
+/* pseudoflavors: */
|
||||
+
|
||||
+#define RPC_AUTH_GSS_KRB5 390003
|
||||
+#define RPC_AUTH_GSS_KRB5I 390004
|
||||
+#define RPC_AUTH_GSS_KRB5P 390005
|
||||
+#define RPC_AUTH_GSS_LKEY 390006
|
||||
+#define RPC_AUTH_GSS_LKEYI 390007
|
||||
+#define RPC_AUTH_GSS_LKEYP 390008
|
||||
+#define RPC_AUTH_GSS_SPKM 390009
|
||||
+#define RPC_AUTH_GSS_SPKMI 390010
|
||||
+#define RPC_AUTH_GSS_SPKMP 390011
|
||||
+
|
||||
+#endif
|
||||
--- util-linux-2.12q/mount/nfs_mount4.h
|
||||
+++ util-linux-2.12q/mount/nfs_mount4.h
|
||||
@@ -8,7 +8,9 @@
|
||||
* so it is easiest to ignore the kernel altogether (at compile time).
|
||||
*/
|
||||
|
||||
-#define NFS_MOUNT_VERSION 4
|
||||
+#define NFS_MOUNT_VERSION 6
|
||||
+#define NFS_MAX_CONTEXT_LEN 256
|
||||
+
|
||||
|
||||
struct nfs2_fh {
|
||||
char data[32];
|
||||
@@ -36,6 +38,9 @@
|
||||
int namlen; /* 2 */
|
||||
unsigned int bsize; /* 3 */
|
||||
struct nfs3_fh root; /* 4 */
|
||||
+ int pseudoflavor; /* 5 */
|
||||
+ char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */
|
||||
+
|
||||
};
|
||||
|
||||
/* bits in the flags field */
|
||||
@@ -52,3 +57,19 @@
|
||||
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
|
||||
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
|
||||
#define NFS_MOUNT_NOACL 0x0800 /* 4 */
|
||||
+#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
|
||||
+
|
||||
+/* security pseudoflavors */
|
||||
+
|
||||
+#ifndef AUTH_GSS_KRB5
|
||||
+#define AUTH_GSS_KRB5 390003
|
||||
+#define AUTH_GSS_KRB5I 390004
|
||||
+#define AUTH_GSS_KRB5P 390005
|
||||
+#define AUTH_GSS_LKEY 390006
|
||||
+#define AUTH_GSS_LKEYI 390007
|
||||
+#define AUTH_GSS_LKEYP 390008
|
||||
+#define AUTH_GSS_SPKM 390009
|
||||
+#define AUTH_GSS_SPKMI 390010
|
||||
+#define AUTH_GSS_SPKMP 390011
|
||||
+#endif
|
||||
+
|
@ -1,14 +0,0 @@
|
||||
--- util-linux-2.12q/misc-utils/script.c
|
||||
+++ util-linux-2.12q/misc-utils/script.c
|
||||
@@ -325,9 +325,9 @@
|
||||
shname = shell;
|
||||
|
||||
if (cflg)
|
||||
- execl(shell, shname, "-c", cflg, 0);
|
||||
+ execl(shell, shname, "-c", cflg, NULL);
|
||||
else
|
||||
- execl(shell, shname, "-i", 0);
|
||||
+ execl(shell, shname, "-i", NULL);
|
||||
|
||||
perror(shell);
|
||||
fail();
|
@ -1,11 +0,0 @@
|
||||
--- util-linux-2.12q/mount/Makefile
|
||||
+++ util-linux-2.12q/mount/Makefile
|
||||
@@ -110,7 +110,7 @@
|
||||
$(COMPILE) $(RPC_CFLAGS) nfsmount_clnt.c
|
||||
|
||||
nfsmount_xdr.o: nfsmount_xdr.c
|
||||
- $(COMPILE) $(RPC_CFLAGS) nfsmount_xdr.c
|
||||
+ $(COMPILE) -fno-strict-aliasing $(RPC_CFLAGS) nfsmount_xdr.c
|
||||
|
||||
ifeq "$(HAVE_GOOD_RPC)" "yes"
|
||||
nfsmount.h: nfsmount.x
|
@ -1,33 +1,7 @@
|
||||
--- util-linux-2.12q/sys-utils/Makefile
|
||||
+++ util-linux-2.12q/sys-utils/Makefile
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
# Where to put man pages?
|
||||
|
||||
-MAN1= arch.1 flock.1 readprofile.1
|
||||
+MAN1= arch.1 flock.1 readprofile.1 ionice.1
|
||||
|
||||
MAN8= ctrlaltdel.8 cytune.8 dmesg.8 \
|
||||
ipcrm.8 ipcs.8 renice.8 \
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
BIN= arch dmesg
|
||||
|
||||
-USRBIN= cytune flock ipcrm ipcs renice setsid
|
||||
+USRBIN= cytune flock ipcrm ipcs renice setsid ionice
|
||||
|
||||
USRSBIN= readprofile tunelp
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
ctrlaltdel: ctrlaltdel.o $(LIB)/my_reboot.o
|
||||
cytune.o: cytune.c cyclades.h
|
||||
cytune: cytune.o
|
||||
+ionice: ionice.o
|
||||
ipcrm: ipcrm.o
|
||||
ipcs: ipcs.o
|
||||
rdev: rdev.o
|
||||
--- util-linux-2.12q/sys-utils/ionice.1
|
||||
+++ util-linux-2.12q/sys-utils/ionice.1
|
||||
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.1
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.1
|
||||
@@ -0,0 +1,71 @@
|
||||
+.TH ionice "1" "August 2005" ionice
|
||||
+.SH NAME
|
||||
@ -100,8 +74,10 @@
|
||||
+
|
||||
+.SH AUTHORS
|
||||
+Jens Axboe <axboe@suse.de>
|
||||
--- util-linux-2.12q/sys-utils/ionice.c
|
||||
+++ util-linux-2.12q/sys-utils/ionice.c
|
||||
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/ionice.c
|
||||
@@ -0,0 +1,144 @@
|
||||
+/*
|
||||
+ * ionice: set or get process io scheduling class and priority
|
||||
@ -247,3 +223,27 @@
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
Index: util-linux-ng-2.12r+2.13pre7/sys-utils/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/sys-utils/Makefile.am
|
||||
+++ util-linux-ng-2.12r+2.13pre7/sys-utils/Makefile.am
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
bin_PROGRAMS = dmesg
|
||||
|
||||
-usrbinexec_PROGRAMS = cytune flock ipcrm ipcs renice setsid
|
||||
+usrbinexec_PROGRAMS = cytune flock ionice ipcrm ipcs renice setsid
|
||||
|
||||
cytune_SOURCES = cytune.c cyclades.h
|
||||
|
||||
sbin_PROGRAMS = ctrlaltdel
|
||||
|
||||
usrsbinexec_PROGRAMS = readprofile tunelp
|
||||
|
||||
tunelp_SOURCES = tunelp.c lp.h
|
||||
|
||||
-man_MANS = flock.1 readprofile.1 \
|
||||
+man_MANS = flock.1 ionice.1 readprofile.1 \
|
||||
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
|
||||
setsid.8 tunelp.8
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: util-linux-2.12r/disk-utils/mkswap.c
|
||||
Index: util-linux-ng-2.12r+git20070330/disk-utils/mkswap.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/disk-utils/mkswap.c
|
||||
+++ util-linux-2.12r/disk-utils/mkswap.c
|
||||
@@ -645,7 +645,7 @@ main(int argc, char ** argv) {
|
||||
--- util-linux-ng-2.12r+git20070330.orig/disk-utils/mkswap.c
|
||||
+++ util-linux-ng-2.12r+git20070330/disk-utils/mkswap.c
|
||||
@@ -660,7 +660,7 @@ main(int argc, char ** argv) {
|
||||
usage();
|
||||
}
|
||||
|
||||
@ -11,10 +11,10 @@ Index: util-linux-2.12r/disk-utils/mkswap.c
|
||||
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
|
||||
perror(device_name);
|
||||
exit(1);
|
||||
Index: util-linux-2.12r/disk-utils/mkfs.minix.c
|
||||
Index: util-linux-ng-2.12r+git20070330/disk-utils/mkfs.minix.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/disk-utils/mkfs.minix.c
|
||||
+++ util-linux-2.12r/disk-utils/mkfs.minix.c
|
||||
--- util-linux-ng-2.12r+git20070330.orig/disk-utils/mkfs.minix.c
|
||||
+++ util-linux-ng-2.12r+git20070330/disk-utils/mkfs.minix.c
|
||||
@@ -699,7 +699,7 @@ main(int argc, char ** argv) {
|
||||
tmp += dirsize;
|
||||
*(short *)tmp = 2;
|
||||
@ -24,10 +24,10 @@ Index: util-linux-2.12r/disk-utils/mkfs.minix.c
|
||||
if (DEV<0)
|
||||
die(_("unable to open %s"));
|
||||
if (fstat(DEV,&statbuf)<0)
|
||||
Index: util-linux-2.12r/disk-utils/mkfs.bfs.c
|
||||
Index: util-linux-ng-2.12r+git20070330/disk-utils/mkfs.bfs.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/disk-utils/mkfs.bfs.c
|
||||
+++ util-linux-2.12r/disk-utils/mkfs.bfs.c
|
||||
--- util-linux-ng-2.12r+git20070330.orig/disk-utils/mkfs.bfs.c
|
||||
+++ util-linux-ng-2.12r+git20070330/disk-utils/mkfs.bfs.c
|
||||
@@ -170,7 +170,7 @@ main(int argc, char *argv[]) {
|
||||
if (!S_ISBLK(statbuf.st_mode))
|
||||
fatal(_("%s is not a block special device"), device);
|
@ -1,8 +1,10 @@
|
||||
Index: util-linux-2.12r/disk-utils/mkswap.c
|
||||
default swap to V1 in any case [#205956]
|
||||
|
||||
Index: util-linux-ng-2.12r+git20070330/disk-utils/mkswap.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/disk-utils/mkswap.c 2004-12-21 09:21:24.000000000 -0800
|
||||
+++ util-linux-2.12r/disk-utils/mkswap.c 2006-10-23 17:51:24.636063632 -0700
|
||||
@@ -602,9 +602,7 @@
|
||||
--- util-linux-ng-2.12r+git20070330.orig/disk-utils/mkswap.c
|
||||
+++ util-linux-ng-2.12r+git20070330/disk-utils/mkswap.c
|
||||
@@ -617,9 +617,7 @@ main(int argc, char ** argv) {
|
||||
version = 1;
|
||||
else
|
||||
/* use version 1 as default, if possible */
|
@ -1,133 +0,0 @@
|
||||
From: Jeff Mahoney <jeffm@suse.com>
|
||||
Subject: [PATCH] mount: needs to handle special mountprog even on guessed file systems.
|
||||
|
||||
If the user doesn't specify -t <fstype> mount.fstype will never be called.
|
||||
|
||||
This patch fixes that.
|
||||
|
||||
Update: Fixes a bug where the mount would get added to mtab twice.
|
||||
|
||||
--
|
||||
|
||||
mount.c | 47 +++++++++++++++++++++++++++++++++++++++++------
|
||||
mount_guess_fstype.c | 3 +--
|
||||
2 files changed, 42 insertions(+), 8 deletions(-)
|
||||
|
||||
diff -rup util-linux-2.12r/mount/mount.c util-linux-2.12r.updated/mount/mount.c
|
||||
--- util-linux-2.12r/mount/mount.c 2006-05-17 17:35:37.000000000 -0400
|
||||
+++ util-linux-2.12r.updated/mount/mount.c 2006-05-17 17:35:17.000000000 -0400
|
||||
@@ -451,6 +451,10 @@ create_mtab (void) {
|
||||
unlock_mtab();
|
||||
}
|
||||
|
||||
+static int check_special_mountprog(const char *spec, const char *node,
|
||||
+ const char *type, int flags,
|
||||
+ char *extra_opts, int *status);
|
||||
+
|
||||
/* count successful mount system calls */
|
||||
static int mountcount = 0;
|
||||
|
||||
@@ -462,12 +466,30 @@ static int mountcount = 0;
|
||||
static int
|
||||
do_mount_syscall (struct mountargs *args) {
|
||||
int flags = args->flags;
|
||||
- int ret;
|
||||
|
||||
if ((flags & MS_MGC_MSK) == 0)
|
||||
flags |= MS_MGC_VAL;
|
||||
|
||||
- ret = mount (args->spec, args->node, args->type, flags, args->data);
|
||||
+ return mount (args->spec, args->node, args->type, flags, args->data);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * do_mount()
|
||||
+ * Mount a single file system, possibly invoking an external handler to
|
||||
+ * do so. Keep track of successes.
|
||||
+ * returns: 0: OK, -1: error in errno
|
||||
+ */
|
||||
+static int
|
||||
+do_mount (struct mountargs *args) {
|
||||
+ int ret;
|
||||
+ if (check_special_mountprog(args->spec, args->node, args->type,
|
||||
+ args->flags, args->data, &ret) == 0)
|
||||
+ ret = do_mount_syscall(args);
|
||||
+ else if (ret == 0) { /* set by the call */
|
||||
+ mountcount++;
|
||||
+ ret = 1;
|
||||
+ }
|
||||
+
|
||||
if (ret == 0)
|
||||
mountcount++;
|
||||
return ret;
|
||||
@@ -507,10 +529,11 @@ guess_fstype_and_mount(const char *spec,
|
||||
char *p;
|
||||
|
||||
while((p = index(t,',')) != NULL) {
|
||||
+ int ret;
|
||||
*p = 0;
|
||||
args.type = *types = t;
|
||||
- if(do_mount_syscall (&args) == 0)
|
||||
- return 0;
|
||||
+ if((ret = do_mount (&args)) >= 0)
|
||||
+ return ret;
|
||||
t = p+1;
|
||||
}
|
||||
/* do last type below */
|
||||
@@ -519,10 +542,10 @@ guess_fstype_and_mount(const char *spec,
|
||||
|
||||
if (*types || (flags & MS_REMOUNT)) {
|
||||
args.type = *types;
|
||||
- return do_mount_syscall (&args);
|
||||
+ return do_mount (&args);
|
||||
}
|
||||
|
||||
- return procfsloop(do_mount_syscall, &args, types);
|
||||
+ return procfsloop(do_mount, &args, types);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -895,8 +918,16 @@ retry_nfs:
|
||||
nosigblock:
|
||||
|
||||
if (!fake) {
|
||||
+ int skip_mtab = 0;
|
||||
mnt5_res = guess_fstype_and_mount (spec, node, &types, flags & ~MS_NOSYS,
|
||||
mount_opts);
|
||||
+ /* External program was executed to mount the file system, skip updating
|
||||
+ * mtab. */
|
||||
+ if (mnt5_res == 1) {
|
||||
+ skip_mtab = 1;
|
||||
+ mnt5_res = 0;
|
||||
+ res = 0;
|
||||
+ }
|
||||
if(!mnt5_res && LoopMountAutomaticChmod && (getuid() == 0)) {
|
||||
/*
|
||||
* If loop was set up using random keys and new file system
|
||||
@@ -907,8 +938,12 @@ nosigblock:
|
||||
error (_("Error: encrypted file system chmod() failed"));
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (skip_mtab)
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
+
|
||||
if (fake || mnt5_res == 0) {
|
||||
/* Mount succeeded, report this (if verbose) and write mtab entry. */
|
||||
if (loop)
|
||||
diff -rup util-linux-2.12r/mount/mount_guess_fstype.c util-linux-2.12r.updated/mount/mount_guess_fstype.c
|
||||
--- util-linux-2.12r/mount/mount_guess_fstype.c 2006-05-17 17:35:37.000000000 -0400
|
||||
+++ util-linux-2.12r.updated/mount/mount_guess_fstype.c 2006-05-17 17:19:44.000000000 -0400
|
||||
@@ -695,9 +695,8 @@ procfsloop(int (*mount_fn)(struct mounta
|
||||
printf(_("Trying %s\n"), fsname);
|
||||
fflush(stdout);
|
||||
}
|
||||
- if ((*mount_fn) (args) == 0) {
|
||||
+ if ((ret = (*mount_fn) (args)) >= 0) {
|
||||
*types = fsname;
|
||||
- ret = 0;
|
||||
break;
|
||||
} else if (errno != EINVAL &&
|
||||
is_in_procfs(fsname) == 1) {
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12r/fdisk/fdisk.c.old 2006-05-11 19:20:15.000000000 -0400
|
||||
+++ util-linux-2.12r/fdisk/fdisk.c 2006-05-11 19:33:44.000000000 -0400
|
||||
@@ -1916,6 +1916,16 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisk.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
@@ -1918,6 +1918,16 @@ verify(void) {
|
||||
total_number_of_sectors - total);
|
||||
}
|
||||
|
||||
@ -17,7 +19,7 @@
|
||||
static void
|
||||
add_partition(int n, int sys) {
|
||||
char mesg[256]; /* 48 does not suffice in Japanese */
|
||||
@@ -1951,8 +1961,10 @@
|
||||
@@ -1953,8 +1963,10 @@ add_partition(int n, int sys) {
|
||||
limit = get_start_sect(q) + get_nr_sects(q) - 1;
|
||||
}
|
||||
if (display_in_cyl_units)
|
||||
@ -29,4 +31,3 @@
|
||||
|
||||
snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
|
||||
do {
|
||||
|
@ -1,6 +1,8 @@
|
||||
--- util-linux-2.12r/fdisk/fdisk.c
|
||||
+++ util-linux-2.12r/fdisk/fdisk.c
|
||||
@@ -61,7 +61,7 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisk.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
@@ -63,7 +63,7 @@ static void delete_partition(int i);
|
||||
|
||||
/* A valid partition table sector ends in 0x55 0xaa */
|
||||
static unsigned int
|
||||
@ -9,7 +11,7 @@
|
||||
return ((unsigned int) b[510]) + (((unsigned int) b[511]) << 8);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
@@ -73,7 +73,7 @@ valid_part_table_flag(unsigned char *b)
|
||||
}
|
||||
|
||||
static void
|
||||
@ -18,7 +20,7 @@
|
||||
b[510] = 0x55;
|
||||
b[511] = 0xaa;
|
||||
}
|
||||
@@ -98,17 +98,17 @@
|
||||
@@ -100,17 +100,17 @@ set_start_sect(struct partition *p, unsi
|
||||
store4_little_endian(p->start4, start_sect);
|
||||
}
|
||||
|
||||
@ -39,7 +41,7 @@
|
||||
get_nr_sects(struct partition *p) {
|
||||
return read4_little_endian(p->size4);
|
||||
}
|
||||
@@ -120,7 +120,7 @@
|
||||
@@ -122,7 +122,7 @@ static int type_open = O_RDWR;
|
||||
* Raw disk label. For DOS-type partition tables the MBR,
|
||||
* with descriptions of the primary partitions.
|
||||
*/
|
||||
@ -48,7 +50,7 @@
|
||||
|
||||
/*
|
||||
* per partition table entry data
|
||||
@@ -134,8 +134,8 @@
|
||||
@@ -136,8 +136,8 @@ struct pte {
|
||||
struct partition *part_table; /* points into sectorbuffer */
|
||||
struct partition *ext_pointer; /* points into sectorbuffer */
|
||||
char changed; /* boolean */
|
||||
@ -59,7 +61,7 @@
|
||||
} ptes[MAXIMUM_PARTS];
|
||||
|
||||
char *disk_device, /* must be specified */
|
||||
@@ -154,15 +154,14 @@
|
||||
@@ -156,15 +156,14 @@ unsigned int user_cylinders, user_heads,
|
||||
unsigned int pt_heads, pt_sectors;
|
||||
unsigned int kern_heads, kern_sectors;
|
||||
|
||||
@ -78,16 +80,14 @@
|
||||
|
||||
unsigned long long total_number_of_sectors;
|
||||
|
||||
@@ -240,21 +239,21 @@
|
||||
@@ -242,21 +241,21 @@ void fatal(enum failure why) {
|
||||
}
|
||||
|
||||
static void
|
||||
-seek_sector(int fd, unsigned int secno) {
|
||||
- long long offset = (long long) secno * sector_size;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == (long long) -1)
|
||||
+seek_sector(int fd, unsigned long long secno) {
|
||||
+ off_t offset = (off_t) secno * sector_size;
|
||||
+ if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
|
||||
off_t offset = (off_t) secno * sector_size;
|
||||
if (lseek(fd, offset, SEEK_SET) == (off_t) -1)
|
||||
fatal(unable_to_seek);
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
seek_sector(fd, secno);
|
||||
if (write(fd, buf, sector_size) != sector_size)
|
||||
fatal(unable_to_write);
|
||||
@@ -262,11 +261,11 @@
|
||||
@@ -264,11 +263,11 @@ write_sector(int fd, unsigned int secno,
|
||||
|
||||
/* Allocate a buffer and read a partition table sector */
|
||||
static void
|
||||
@ -119,7 +119,7 @@
|
||||
if (!pe->sectorbuffer)
|
||||
fatal(out_of_memory);
|
||||
read_sector(fd, offset, pe->sectorbuffer);
|
||||
@@ -274,7 +273,7 @@
|
||||
@@ -276,7 +275,7 @@ read_pte(int fd, int pno, unsigned int o
|
||||
pe->part_table = pe->ext_pointer = NULL;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@
|
||||
get_partition_start(struct pte *pe) {
|
||||
return pe->offset + get_start_sect(pe->part_table);
|
||||
}
|
||||
@@ -547,10 +546,10 @@
|
||||
@@ -549,10 +548,10 @@ clear_partition(struct partition *p) {
|
||||
}
|
||||
|
||||
static void
|
||||
@ -142,7 +142,7 @@
|
||||
|
||||
if (doext) {
|
||||
p = ptes[i].ext_pointer;
|
||||
@@ -1546,7 +1545,7 @@
|
||||
@@ -1548,7 +1547,7 @@ list_disk_geometry(void) {
|
||||
else
|
||||
printf(_("\nDisk %s: %ld.%ld GB, %lld bytes\n"),
|
||||
disk_device, megabytes/1000, (megabytes/100)%10, bytes);
|
||||
@ -151,7 +151,7 @@
|
||||
heads, sectors, cylinders);
|
||||
if (units_per_sector == 1)
|
||||
printf(_(", total %llu sectors"),
|
||||
@@ -1778,20 +1777,21 @@
|
||||
@@ -1780,20 +1779,21 @@ x_list_table(int extend) {
|
||||
struct partition *p;
|
||||
int i;
|
||||
|
||||
@ -176,7 +176,7 @@
|
||||
if (p->sys_ind)
|
||||
check_consistency(p, i);
|
||||
}
|
||||
@@ -1799,7 +1799,7 @@
|
||||
@@ -1801,7 +1801,7 @@ x_list_table(int extend) {
|
||||
}
|
||||
|
||||
static void
|
||||
@ -185,7 +185,7 @@
|
||||
int i;
|
||||
struct pte *pe = &ptes[0];
|
||||
struct partition *p;
|
||||
@@ -1832,7 +1832,7 @@
|
||||
@@ -1834,7 +1834,7 @@ check(int n, unsigned int h, unsigned in
|
||||
n, h + 1, heads);
|
||||
if (real_s >= sectors)
|
||||
fprintf(stderr, _("Partition %d: sector %d greater than "
|
||||
@ -194,7 +194,7 @@
|
||||
if (real_c >= cylinders)
|
||||
fprintf(stderr, _("Partitions %d: cylinder %d greater than "
|
||||
"maximum %d\n"), n, real_c + 1, cylinders);
|
||||
@@ -1845,8 +1845,8 @@
|
||||
@@ -1847,8 +1847,8 @@ check(int n, unsigned int h, unsigned in
|
||||
static void
|
||||
verify(void) {
|
||||
int i, j;
|
||||
@ -205,7 +205,7 @@
|
||||
struct partition *p;
|
||||
|
||||
if (warn_geometry())
|
||||
@@ -1890,7 +1890,7 @@
|
||||
@@ -1892,7 +1892,7 @@ verify(void) {
|
||||
|
||||
if (extended_offset) {
|
||||
struct pte *pex = &ptes[ext_index];
|
||||
@ -214,7 +214,7 @@
|
||||
get_nr_sects(pex->part_table) - 1;
|
||||
|
||||
for (i = 4; i < partitions; i++) {
|
||||
@@ -1909,8 +1909,8 @@
|
||||
@@ -1911,8 +1911,8 @@ verify(void) {
|
||||
}
|
||||
|
||||
if (total > total_number_of_sectors)
|
||||
@ -225,7 +225,7 @@
|
||||
else if (total < total_number_of_sectors)
|
||||
printf(_("%lld unallocated sectors\n"),
|
||||
total_number_of_sectors - total);
|
||||
@@ -1923,7 +1923,7 @@
|
||||
@@ -1925,7 +1925,7 @@ add_partition(int n, int sys) {
|
||||
struct partition *p = ptes[n].part_table;
|
||||
struct partition *q = ptes[ext_index].part_table;
|
||||
long long llimit;
|
||||
@ -234,7 +234,7 @@
|
||||
first[partitions], last[partitions];
|
||||
|
||||
if (p && p->sys_ind) {
|
||||
@@ -1969,7 +1969,7 @@
|
||||
@@ -1971,7 +1971,7 @@ add_partition(int n, int sys) {
|
||||
if (start > limit)
|
||||
break;
|
||||
if (start >= temp+units_per_sector && read) {
|
||||
@ -243,7 +243,7 @@
|
||||
temp = start;
|
||||
read = 0;
|
||||
}
|
||||
@@ -2228,14 +2228,14 @@
|
||||
@@ -2230,14 +2230,14 @@ reread_partition_table(int leave) {
|
||||
|
||||
#define MAX_PER_LINE 16
|
||||
static void
|
||||
@ -260,9 +260,11 @@
|
||||
if (l == MAX_PER_LINE - 1) {
|
||||
printf("\n");
|
||||
l = -1;
|
||||
--- util-linux-2.12r/fdisk/fdisk.h
|
||||
+++ util-linux-2.12r/fdisk/fdisk.h
|
||||
@@ -84,8 +84,8 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisk.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.h
|
||||
@@ -81,8 +81,8 @@ extern unsigned int read_int(unsigned in
|
||||
#define SINGULAR 1
|
||||
extern char *const str_units(int);
|
||||
|
||||
@ -273,9 +275,11 @@
|
||||
|
||||
extern int osf_label;
|
||||
|
||||
--- util-linux-2.12r/fdisk/fdiskaixlabel.h
|
||||
+++ util-linux-2.12r/fdisk/fdiskaixlabel.h
|
||||
@@ -19,9 +19,10 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdiskaixlabel.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdiskaixlabel.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdiskaixlabel.h
|
||||
@@ -19,9 +19,10 @@ typedef struct {
|
||||
|
||||
/* fdisk.c */
|
||||
#define aixlabel ((aix_partition *)MBRbuffer)
|
||||
@ -288,9 +292,11 @@
|
||||
extern int show_begin;
|
||||
extern int aix_label;
|
||||
extern char *partition_type(unsigned char type);
|
||||
--- util-linux-2.12r/fdisk/fdiskmaclabel.h
|
||||
+++ util-linux-2.12r/fdisk/fdiskmaclabel.h
|
||||
@@ -25,9 +25,10 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdiskmaclabel.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdiskmaclabel.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdiskmaclabel.h
|
||||
@@ -25,9 +25,10 @@ typedef struct {
|
||||
|
||||
/* fdisk.c */
|
||||
#define maclabel ((mac_partition *)MBRbuffer)
|
||||
@ -303,9 +309,11 @@
|
||||
extern int show_begin;
|
||||
extern int mac_label;
|
||||
extern char *partition_type(unsigned char type);
|
||||
--- util-linux-2.12r/fdisk/fdisksgilabel.c
|
||||
+++ util-linux-2.12r/fdisk/fdisksgilabel.c
|
||||
@@ -197,7 +197,7 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisksgilabel.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisksgilabel.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisksgilabel.c
|
||||
@@ -197,7 +197,7 @@ sgi_list_table(int xtra) {
|
||||
w = strlen(disk_device);
|
||||
|
||||
if (xtra) {
|
||||
@ -314,7 +322,7 @@
|
||||
"%d cylinders, %d physical cylinders\n"
|
||||
"%d extra sects/cyl, interleave %d:1\n"
|
||||
"%s\n"
|
||||
@@ -211,7 +211,7 @@
|
||||
@@ -211,7 +211,7 @@ sgi_list_table(int xtra) {
|
||||
sector_size);
|
||||
} else {
|
||||
printf(_("\nDisk %s (SGI disk label): "
|
||||
@ -323,9 +331,11 @@
|
||||
"Units = %s of %d * %d bytes\n\n"),
|
||||
disk_device, heads, sectors, cylinders,
|
||||
str_units(PLURAL), units_per_sector,
|
||||
--- util-linux-2.12r/fdisk/fdisksgilabel.h
|
||||
+++ util-linux-2.12r/fdisk/fdisksgilabel.h
|
||||
@@ -103,8 +103,9 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisksgilabel.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisksgilabel.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisksgilabel.h
|
||||
@@ -103,8 +103,9 @@ typedef struct {
|
||||
/* fdisk.c */
|
||||
#define sgilabel ((sgi_partition *)MBRbuffer)
|
||||
#define sgiparam (sgilabel->devparam)
|
||||
@ -337,9 +347,11 @@
|
||||
extern int show_begin;
|
||||
extern int sgi_label;
|
||||
extern char *partition_type(unsigned char type);
|
||||
--- util-linux-2.12r/fdisk/fdisksunlabel.c
|
||||
+++ util-linux-2.12r/fdisk/fdisksunlabel.c
|
||||
@@ -349,7 +349,7 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisksunlabel.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisksunlabel.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisksunlabel.c
|
||||
@@ -348,7 +348,7 @@ void create_sunlabel(void)
|
||||
}
|
||||
|
||||
snprintf(sunlabel->info, sizeof(sunlabel->info),
|
||||
@ -348,7 +360,7 @@
|
||||
p ? p->vendor : "", (p && *p->vendor) ? " " : "",
|
||||
p ? p->model
|
||||
: (floppy ? _("3,5\" floppy") : _("Linux custom")),
|
||||
@@ -656,7 +656,7 @@
|
||||
@@ -655,7 +655,7 @@ sun_list_table(int xtra) {
|
||||
w = strlen(disk_device);
|
||||
if (xtra)
|
||||
printf(
|
||||
@ -357,7 +369,7 @@
|
||||
"%d cylinders, %d alternate cylinders, %d physical cylinders\n"
|
||||
"%d extra sects/cyl, interleave %d:1\n"
|
||||
"%s\n"
|
||||
@@ -670,7 +670,7 @@
|
||||
@@ -669,7 +669,7 @@ sun_list_table(int xtra) {
|
||||
str_units(PLURAL), units_per_sector);
|
||||
else
|
||||
printf(
|
||||
@ -366,9 +378,11 @@
|
||||
"Units = %s of %d * 512 bytes\n\n"),
|
||||
disk_device, heads, sectors, cylinders,
|
||||
str_units(PLURAL), units_per_sector);
|
||||
--- util-linux-2.12r/fdisk/fdisksunlabel.h
|
||||
+++ util-linux-2.12r/fdisk/fdisksunlabel.h
|
||||
@@ -37,8 +37,9 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisksunlabel.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisksunlabel.h
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisksunlabel.h
|
||||
@@ -37,8 +37,9 @@ typedef struct {
|
||||
: (__u32)(x))
|
||||
|
||||
/* fdisk.c */
|
@ -1,234 +0,0 @@
|
||||
--- fdisk/Makefile
|
||||
+++ fdisk/Makefile
|
||||
@@ -39,7 +39,7 @@
|
||||
endif
|
||||
endif
|
||||
|
||||
-cfdisk: cfdisk.o llseek.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
||||
+cfdisk: cfdisk.o disksize.o i386_sys_types.o $(LIB)/xstrncpy.o
|
||||
ifeq "$(HAVE_SLANG)" "yes"
|
||||
$(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
|
||||
else
|
||||
@@ -55,7 +55,7 @@
|
||||
rm -f activate
|
||||
ln -s sfdisk activate
|
||||
|
||||
-fdisk: fdisk.o llseek.o disksize.o fdiskbsdlabel.o fdisksgilabel.o fdisksunlabel.o \
|
||||
+fdisk: fdisk.o disksize.o fdiskbsdlabel.o fdisksgilabel.o fdisksunlabel.o \
|
||||
fdiskmaclabel.o fdiskaixlabel.o i386_sys_types.o partname.o
|
||||
fdisk.o: fdisk.c fdisk.h
|
||||
fdiskbsdlabel.o: fdiskbsdlabel.c fdisk.h fdiskbsdlabel.h
|
||||
--- fdisk/cfdisk.c
|
||||
+++ fdisk/cfdisk.c
|
||||
@@ -84,9 +84,6 @@
|
||||
#include "xstrncpy.h"
|
||||
#include "common.h"
|
||||
|
||||
-extern long long ext2_llseek(unsigned int fd, long long offset,
|
||||
- unsigned int origin);
|
||||
-
|
||||
#define VERSION UTIL_LINUX_VERSION
|
||||
|
||||
#define DEFAULT_DEVICE "/dev/hda"
|
||||
@@ -552,7 +549,7 @@
|
||||
|
||||
static void
|
||||
read_sector(char *buffer, long long sect_num) {
|
||||
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
||||
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
||||
fatal(_("Cannot seek on disk drive"), 2);
|
||||
if (read(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
|
||||
fatal(_("Cannot read disk drive"), 2);
|
||||
@@ -560,7 +557,7 @@
|
||||
|
||||
static void
|
||||
write_sector(char *buffer, long long sect_num) {
|
||||
- if (ext2_llseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
||||
+ if (lseek(fd, sect_num*SECTOR_SIZE, SEEK_SET) < 0)
|
||||
fatal(_("Cannot seek on disk drive"), 2);
|
||||
if (write(fd, buffer, SECTOR_SIZE) != SECTOR_SIZE)
|
||||
fatal(_("Cannot write disk drive"), 2);
|
||||
@@ -587,7 +584,7 @@
|
||||
long long offset;
|
||||
|
||||
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
||||
+ if (lseek(fd, offset, SEEK_SET) == offset
|
||||
&& read(fd, §or, sizeof(sector)) == sizeof(sector)) {
|
||||
dos_copy_to_info(p_info[i].ostype, OSTYPESZ,
|
||||
sector+DOS_OSTYPE_OFFSET, DOS_OSTYPE_SZ);
|
||||
@@ -672,7 +669,7 @@
|
||||
|
||||
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
|
||||
+ 1024;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
||||
+ if (lseek(fd, offset, SEEK_SET) == offset
|
||||
&& read(fd, &e2fsb, sizeof(e2fsb)) == sizeof(e2fsb)
|
||||
&& e2fsb.s_magic[0] + (e2fsb.s_magic[1]<<8) == EXT2_SUPER_MAGIC) {
|
||||
label = e2fsb.s_volume_name;
|
||||
@@ -688,7 +685,7 @@
|
||||
}
|
||||
|
||||
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
||||
+ if (lseek(fd, offset, SEEK_SET) == offset
|
||||
&& read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
|
||||
&& !strncmp(xfsb.s_magic, XFS_SUPER_MAGIC, 4)) {
|
||||
label = xfsb.s_fname;
|
||||
@@ -702,7 +699,7 @@
|
||||
/* jfs? */
|
||||
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
|
||||
+ JFS_SUPER1_OFF;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
||||
+ if (lseek(fd, offset, SEEK_SET) == offset
|
||||
&& read(fd, &jfsb, sizeof(jfsb)) == sizeof(jfsb)
|
||||
&& !strncmp(jfsb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC))) {
|
||||
label = jfsb.s_label;
|
||||
@@ -716,7 +713,7 @@
|
||||
/* reiserfs? */
|
||||
offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
|
||||
+ REISERFS_DISK_OFFSET_IN_BYTES;
|
||||
- if (ext2_llseek(fd, offset, SEEK_SET) == offset
|
||||
+ if (lseek(fd, offset, SEEK_SET) == offset
|
||||
&& read(fd, &reiserfsb, sizeof(reiserfsb)) == sizeof(reiserfsb)
|
||||
&& has_reiserfs_magic_string(&reiserfsb, &reiserfs_is_3_6)) {
|
||||
if (reiserfs_is_3_6) {
|
||||
--- fdisk/fdiskbsdlabel.c
|
||||
+++ fdisk/fdiskbsdlabel.c
|
||||
@@ -566,7 +566,7 @@
|
||||
sector = get_start_sect(xbsd_part);
|
||||
#endif
|
||||
|
||||
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
||||
+ if (lseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
||||
fatal (unable_to_seek);
|
||||
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
|
||||
fatal (unable_to_write);
|
||||
@@ -735,7 +735,7 @@
|
||||
sector = 0;
|
||||
#endif
|
||||
|
||||
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
||||
+ if (lseek (fd, (long long) sector * SECTOR_SIZE, SEEK_SET) == -1)
|
||||
fatal (unable_to_seek);
|
||||
if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
|
||||
fatal (unable_to_read);
|
||||
@@ -781,12 +781,12 @@
|
||||
|
||||
#if defined (__alpha__) && BSD_LABELSECTOR == 0
|
||||
alpha_bootblock_checksum (disklabelbuffer);
|
||||
- if (ext2_llseek (fd, (long long) 0, SEEK_SET) == -1)
|
||||
+ if (lseek (fd, (long long) 0, SEEK_SET) == -1)
|
||||
fatal (unable_to_seek);
|
||||
if (BSD_BBSIZE != write (fd, disklabelbuffer, BSD_BBSIZE))
|
||||
fatal (unable_to_write);
|
||||
#else
|
||||
- if (ext2_llseek (fd, (long long) sector * SECTOR_SIZE + BSD_LABELOFFSET,
|
||||
+ if (lseek (fd, (long long) sector * SECTOR_SIZE + BSD_LABELOFFSET,
|
||||
SEEK_SET) == -1)
|
||||
fatal (unable_to_seek);
|
||||
if (sizeof (struct xbsd_disklabel) != write (fd, d, sizeof (struct xbsd_disklabel)))
|
||||
--- fdisk/fdisksgilabel.c
|
||||
+++ fdisk/fdisksgilabel.c
|
||||
@@ -379,7 +379,7 @@
|
||||
*/
|
||||
sgiinfo *info = fill_sgiinfo();
|
||||
int infostartblock = SSWAP32(sgilabel->directory[0].vol_file_start);
|
||||
- if (ext2_llseek(fd, (long long)infostartblock*
|
||||
+ if (lseek(fd, (long long)infostartblock*
|
||||
SECTOR_SIZE, SEEK_SET) < 0)
|
||||
fatal(unable_to_seek);
|
||||
if (write(fd, info, SECTOR_SIZE) != SECTOR_SIZE)
|
||||
--- fdisk/llseek.c
|
||||
+++ fdisk/llseek.c
|
||||
@@ -13,31 +13,12 @@
|
||||
extern long long ext2_llseek (unsigned int, long long, unsigned int);
|
||||
|
||||
#ifdef __linux__
|
||||
-
|
||||
-#ifdef HAVE_LLSEEK
|
||||
-#include <syscall.h>
|
||||
-
|
||||
-#else /* HAVE_LLSEEK */
|
||||
-
|
||||
-#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
|
||||
-
|
||||
-#define my_llseek lseek
|
||||
-
|
||||
-#else
|
||||
-#include <linux/unistd.h> /* for __NR__llseek */
|
||||
-
|
||||
-static int _llseek (unsigned int, unsigned long,
|
||||
- unsigned long, long long *, unsigned int);
|
||||
-
|
||||
-#ifdef __NR__llseek
|
||||
-
|
||||
-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
|
||||
- unsigned long, offset_low,long long *,result,
|
||||
- unsigned int, origin)
|
||||
-
|
||||
-#else
|
||||
+# if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
|
||||
+# define my_llseek lseek
|
||||
+# else
|
||||
|
||||
/* no __NR__llseek on compilation machine - might give it explicitly */
|
||||
+# ifndef __NR__llseek
|
||||
static int _llseek (unsigned int fd, unsigned long oh,
|
||||
unsigned long ol, long long *result,
|
||||
unsigned int origin) {
|
||||
@@ -45,10 +26,10 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
-#endif
|
||||
+# endif /* __NR__llseek */
|
||||
|
||||
static long long my_llseek (unsigned int fd, long long offset,
|
||||
- unsigned int origin)
|
||||
+ unsigned int origin)
|
||||
{
|
||||
long long result;
|
||||
int retval;
|
||||
--- fdisk/sfdisk.c
|
||||
+++ fdisk/sfdisk.c
|
||||
@@ -164,36 +164,16 @@
|
||||
/*
|
||||
* sseek: seek to specified sector - return 0 on failure
|
||||
*
|
||||
- * For >4GB disks lseek needs a > 32bit arg, and we have to use llseek.
|
||||
- * On the other hand, a 32 bit sector number is OK until 2TB.
|
||||
- * The routines _llseek and sseek below are the only ones that
|
||||
- * know about the loff_t type.
|
||||
- *
|
||||
* Note: we use 512-byte sectors here, irrespective of the hardware ss.
|
||||
*/
|
||||
-#undef use_lseek
|
||||
-#if defined (__alpha__) || defined (__ia64__) || defined (__x86_64__) || defined (__s390x__)
|
||||
-#define use_lseek
|
||||
-#endif
|
||||
-
|
||||
-#ifndef use_lseek
|
||||
-static __attribute__used
|
||||
-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
|
||||
- loff_t *, res, unsigned int, wh);
|
||||
-#endif
|
||||
-
|
||||
static int
|
||||
sseek(char *dev, unsigned int fd, unsigned long s) {
|
||||
- loff_t in, out;
|
||||
- in = ((loff_t) s << 9);
|
||||
+ off_t in, out;
|
||||
+ in = ((off_t) s << 9);
|
||||
out = 1;
|
||||
|
||||
-#ifndef use_lseek
|
||||
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0) {
|
||||
-#else
|
||||
if ((out = lseek(fd, in, SEEK_SET)) != in) {
|
||||
-#endif
|
||||
- perror("llseek");
|
||||
+ perror("lseek");
|
||||
error(_("seek error on %s - cannot seek to %lu\n"), dev, s);
|
||||
return 0;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
Index: util-linux-2.12r/fdisk/fdisk.c
|
||||
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/fdisk/fdisk.c
|
||||
+++ util-linux-2.12r/fdisk/fdisk.c
|
||||
@@ -1496,6 +1496,7 @@ static void check_consistency(struct par
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisk.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
|
||||
@@ -1498,6 +1498,7 @@ static void check_consistency(struct par
|
||||
/* compute logical ending (c, h, s) */
|
||||
long2chs(get_start_sect(p) + get_nr_sects(p) - 1, &lec, &leh, &les);
|
||||
|
||||
@ -10,7 +10,7 @@ Index: util-linux-2.12r/fdisk/fdisk.c
|
||||
/* Same physical / logical beginning? */
|
||||
if (cylinders <= 1024 && (pbc != lbc || pbh != lbh || pbs != lbs)) {
|
||||
printf(_("Partition %d has different physical/logical "
|
||||
@@ -1512,7 +1513,6 @@ static void check_consistency(struct par
|
||||
@@ -1514,7 +1515,6 @@ static void check_consistency(struct par
|
||||
printf(_("logical=(%d, %d, %d)\n"),lec, leh, les);
|
||||
}
|
||||
|
||||
|
@ -1,247 +0,0 @@
|
||||
Index: util-linux-2.12r/mount/lomount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/lomount.c
|
||||
+++ util-linux-2.12r/mount/lomount.c
|
||||
@@ -46,24 +46,24 @@
|
||||
#include "rmd160.h"
|
||||
#include "aes.h"
|
||||
|
||||
+#define LO_PASS_OK EXIT_SUCCESS
|
||||
+#define LO_PASS_ERR EXIT_FAILURE
|
||||
+#define LO_PASS_EMPTY 5
|
||||
+#define LO_PASS_SHORT 6
|
||||
+
|
||||
extern int verbose;
|
||||
extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
|
||||
extern void error (const char *fmt, ...); /* idem */
|
||||
extern void show_all_loops(void);
|
||||
extern int read_options_from_fstab(char *, char **);
|
||||
|
||||
+volatile int timeout=0;
|
||||
int passphrase_timeout=0;
|
||||
struct sigaction alrmact;
|
||||
|
||||
static void
|
||||
alrmhandler() {
|
||||
- /* let the SIGINT handler do the work: */
|
||||
- kill(getpid(),SIGINT);
|
||||
- usleep(1000000);
|
||||
- kill(getpid(),SIGTERM);
|
||||
- usleep(1000000);
|
||||
- /* stubborn... */
|
||||
- exit(0);
|
||||
+ timeout = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -473,11 +473,14 @@ static char *do_GPG_pipe(char *pass)
|
||||
return multiKeyPass[0];
|
||||
}
|
||||
|
||||
-static char *sGetPass(int minLen, int warnLen)
|
||||
+static int sGetPass(char **pass, int minLen, int warnLen)
|
||||
{
|
||||
char *p, *s, *seed;
|
||||
int i, ask2;
|
||||
|
||||
+ *pass = NULL;
|
||||
+ timeout = 0;
|
||||
+
|
||||
if(!passFDnumber) {
|
||||
|
||||
if(passphrase_timeout) {
|
||||
@@ -489,6 +492,9 @@ static char *sGetPass(int minLen, int wa
|
||||
}
|
||||
|
||||
p = getpass(_("Password: "));
|
||||
+ alarm(0);
|
||||
+ if (timeout)
|
||||
+ return LO_PASS_EMPTY;
|
||||
ask2 = passAskTwice ? 1 : 0;
|
||||
} else {
|
||||
i = atoi(passFDnumber);
|
||||
@@ -504,11 +510,13 @@ static char *sGetPass(int minLen, int wa
|
||||
}
|
||||
if(x == 65) {
|
||||
multiKeyMode = 65;
|
||||
- return multiKeyPass[0];
|
||||
+ *pass = multiKeyPass[0];
|
||||
+ return LO_PASS_OK;
|
||||
}
|
||||
if(x == 64) {
|
||||
multiKeyMode = 64;
|
||||
- return multiKeyPass[0];
|
||||
+ *pass = multiKeyPass[0];
|
||||
+ return LO_PASS_OK;
|
||||
}
|
||||
p = multiKeyPass[0];
|
||||
}
|
||||
@@ -531,6 +539,9 @@ static char *sGetPass(int minLen, int wa
|
||||
}
|
||||
|
||||
p = getpass(_("Retype password: "));
|
||||
+ alarm(0);
|
||||
+ if (timeout)
|
||||
+ return LO_PASS_EMPTY;
|
||||
if(!p) goto nomem;
|
||||
if(strcmp(s, p)) goto compareErr;
|
||||
memset(s, 0, i);
|
||||
@@ -538,17 +549,25 @@ static char *sGetPass(int minLen, int wa
|
||||
ask2 = 0;
|
||||
}
|
||||
p = do_GPG_pipe(p);
|
||||
- if(!p) return(NULL);
|
||||
+ if(!p)
|
||||
+ return LO_PASS_ERR;
|
||||
if(!p[0]) {
|
||||
fprintf(stderr, _("Error: gpg key file decryption failed\n"));
|
||||
- return(NULL);
|
||||
+ return LO_PASS_ERR;
|
||||
+ }
|
||||
+ if(multiKeyMode) {
|
||||
+ *pass = p;
|
||||
+ return LO_PASS_OK;
|
||||
}
|
||||
- if(multiKeyMode) return(p);
|
||||
}
|
||||
i = strlen(p);
|
||||
+ if(i == 0) {
|
||||
+ fprintf(stderr, _("Error: Empty password\n"));
|
||||
+ return LO_PASS_EMPTY;
|
||||
+ }
|
||||
if(i < minLen) {
|
||||
fprintf(stderr, _("Error: Password must be at least %d characters.\n"), minLen);
|
||||
- return(NULL);
|
||||
+ return LO_PASS_SHORT;
|
||||
}
|
||||
seed = passSeedString;
|
||||
if(!seed) seed = "";
|
||||
@@ -556,7 +575,7 @@ static char *sGetPass(int minLen, int wa
|
||||
if(!s) {
|
||||
nomem:
|
||||
fprintf(stderr, _("Error: Unable to allocate memory\n"));
|
||||
- return(NULL);
|
||||
+ return LO_PASS_ERR;
|
||||
}
|
||||
strcpy(s, p);
|
||||
memset(p, 0, i);
|
||||
@@ -571,11 +590,14 @@ static char *sGetPass(int minLen, int wa
|
||||
}
|
||||
|
||||
p = getpass(_("Retype password: "));
|
||||
+ alarm(0);
|
||||
+ if (timeout)
|
||||
+ return LO_PASS_EMPTY;
|
||||
if(!p) goto nomem;
|
||||
if(strcmp(s, p)) {
|
||||
compareErr:
|
||||
fprintf(stderr, _("Error: Passwords are not identical\n"));
|
||||
- return(NULL);
|
||||
+ return LO_PASS_ERR;
|
||||
}
|
||||
memset(p, 0, i);
|
||||
}
|
||||
@@ -583,7 +605,8 @@ static char *sGetPass(int minLen, int wa
|
||||
fprintf(stderr, _("WARNING - Please use longer password (%d or more characters)\n"), SUSE_PASSWORD_MIN_LENGTH);
|
||||
}
|
||||
strcat(s, seed);
|
||||
- return(s);
|
||||
+ *pass = s;
|
||||
+ return LO_PASS_OK;
|
||||
}
|
||||
|
||||
/* this is for compatibility with historic loop-AES version */
|
||||
@@ -788,6 +811,7 @@ set_loop(const char *device, const char
|
||||
unsigned char multiKeyBits[65][32];
|
||||
int minPassLen = SUSE_PASSWORD_MIN_LENGTH;
|
||||
int run_mkfs_command = 0;
|
||||
+ int ret;
|
||||
|
||||
loopFileName = (char *)file;
|
||||
multiKeyMode = 0;
|
||||
@@ -802,6 +826,7 @@ set_loop(const char *device, const char
|
||||
}
|
||||
if ((fd = open(device, mode)) < 0) {
|
||||
perror (device);
|
||||
+ ret = 1;
|
||||
goto close_ffd_return1;
|
||||
}
|
||||
*loopro = (mode == O_RDONLY);
|
||||
@@ -848,8 +873,8 @@ set_loop(const char *device, const char
|
||||
loopinfo.lo_encrypt_key_size = 0;
|
||||
break;
|
||||
case LO_CRYPT_XOR:
|
||||
- pass = sGetPass (1, 0);
|
||||
- if(!pass) goto close_fd_ffd_return1;
|
||||
+ ret = sGetPass (&pass, 1, 0);
|
||||
+ if(ret) goto close_fd_ffd_return1;
|
||||
xstrncpy (loopinfo.lo_encrypt_key, pass, LO_KEY_SIZE);
|
||||
loopinfo.lo_encrypt_key_size = strlen(loopinfo.lo_encrypt_key);
|
||||
break;
|
||||
@@ -886,6 +911,7 @@ set_loop(const char *device, const char
|
||||
/* This is not compatible with gpgkey= mount option */
|
||||
if(rd_wr_retry(atoi(passFDnumber), (char *)&loopinfo.lo_encrypt_key[0], LO_KEY_SIZE, 0) < 1) {
|
||||
fprintf(stderr, _("Error: couldn't read binary key\n"));
|
||||
+ ret = 1;
|
||||
goto close_fd_ffd_return1;
|
||||
}
|
||||
break; /* out of switch(loopinfo.lo_encrypt_type) */
|
||||
@@ -894,6 +920,7 @@ set_loop(const char *device, const char
|
||||
/* WARNING! DO NOT USE RANDOM HASH TYPE ON PARTITION WITH EXISTING */
|
||||
/* IMPORTANT DATA ON IT. RANDOM HASH TYPE WILL DESTROY YOUR DATA. */
|
||||
if(loop_create_random_keys((char*)file, *loopro, &multiKeyBits[0][0])) {
|
||||
+ ret = 1;
|
||||
goto close_fd_ffd_return1;
|
||||
}
|
||||
memcpy(&loopinfo.lo_encrypt_key[0], &multiKeyBits[0][0], sizeof(loopinfo.lo_encrypt_key));
|
||||
@@ -901,8 +928,8 @@ set_loop(const char *device, const char
|
||||
break; /* out of switch(loopinfo.lo_encrypt_type) */
|
||||
}
|
||||
}
|
||||
- pass = sGetPass (minPassLen, SUSE_PASSWORD_MIN_LENGTH);
|
||||
- if(!pass) goto close_fd_ffd_return1;
|
||||
+ ret = sGetPass (&pass, minPassLen, SUSE_PASSWORD_MIN_LENGTH);
|
||||
+ if(ret) goto close_fd_ffd_return1;
|
||||
i = strlen(pass);
|
||||
if(hashFunc == unhashed1_key_setup) {
|
||||
/* this is for compatibility with historic loop-AES version */
|
||||
@@ -966,6 +993,7 @@ set_loop(const char *device, const char
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, _("Error: don't know how to get key for encryption system %d\n"), loopinfo.lo_encrypt_type);
|
||||
+ ret = 1;
|
||||
goto close_fd_ffd_return1;
|
||||
}
|
||||
|
||||
@@ -985,7 +1013,7 @@ close_fd_ffd_return1:
|
||||
close (fd);
|
||||
close_ffd_return1:
|
||||
close (ffd);
|
||||
- return 1;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* type 18 == LO_CRYPT_CRYPTOAPI */
|
||||
@@ -995,6 +1023,7 @@ close_ffd_return1:
|
||||
fprintf(stderr, _("ioctl: LOOP_SET_STATUS: %s, requested cipher or key length (%d bits) not supported by kernel\n"), strerror(errno), loopinfo.lo_encrypt_key_size << 3);
|
||||
loop_clr_fd_out:
|
||||
(void) ioctl (fd, LOOP_CLR_FD, 0);
|
||||
+ ret = 1;
|
||||
goto keyclean_close_fd_ffd_return1;
|
||||
}
|
||||
}
|
||||
Index: util-linux-2.12r/mount/losetup.8
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/losetup.8
|
||||
+++ util-linux-2.12r/mount/losetup.8
|
||||
@@ -143,6 +143,10 @@ displays the status of a loop device, it
|
||||
is not configured and 2 if an error occurred which prevented
|
||||
.B losetup
|
||||
from determining the status of the device.
|
||||
+When using encryption
|
||||
+.B losetup
|
||||
+returns 5 if the passphrase is empty or a timeout occurred and 6 if
|
||||
+the passphrase is too short.
|
||||
|
||||
.SH FILES
|
||||
.nf
|
@ -1,58 +0,0 @@
|
||||
Author: Lars Mueller <lars at samba dot org>
|
||||
Subject: Use cifs instead of smbfs by default if the source starts with //; minor mount man pages changes (mention cifs and point to mount.cifs man page)
|
||||
Bugzilla: na
|
||||
submitted upstream: yes
|
||||
accepeted upstream: no
|
||||
|
||||
Index: util-linux-2.12r/mount/mount.8
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount.8
|
||||
+++ util-linux-2.12r/mount/mount.8
|
||||
@@ -367,6 +367,7 @@ currently supported include:
|
||||
.IR adfs ,
|
||||
.IR affs ,
|
||||
.IR autofs ,
|
||||
+.IR cifs ,
|
||||
.IR coda ,
|
||||
.IR coherent ,
|
||||
.IR cramfs ,
|
||||
@@ -420,8 +421,8 @@ For most types all the
|
||||
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
|
||||
-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
|
||||
+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
|
||||
.I /sbin/mount.TYPE
|
||||
@@ -733,6 +734,11 @@ These options are accepted but ignored.
|
||||
(However, quota utilities may react to such strings in
|
||||
.IR /etc/fstab .)
|
||||
|
||||
+.SH "Mount options for cifs"
|
||||
+See the options section of the
|
||||
+.BR mount.cifs (8)
|
||||
+man page (cifs-mount package must be installed).
|
||||
+
|
||||
.SH "Mount options for coherent"
|
||||
None.
|
||||
|
||||
Index: util-linux-2.12r/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount.c
|
||||
+++ util-linux-2.12r/mount/mount.c
|
||||
@@ -1178,10 +1178,10 @@ mount_one (const char *spec, const char
|
||||
"I'll assume nfs because of "
|
||||
"the colon\n"));
|
||||
} else if(!strncmp(spec, "//", 2)) {
|
||||
- types = "smbfs";
|
||||
+ types = "cifs";
|
||||
if (verbose)
|
||||
printf(_("mount: no type was given - "
|
||||
- "I'll assume smbfs because of "
|
||||
+ "I'll assume cifs because of "
|
||||
"the // prefix\n"));
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
diff -pur util-linux-2.12r/mount.orig/fstab.c util-linux-2.12r/mount/fstab.c
|
||||
--- util-linux-2.12r/mount.orig/fstab.c 2004-12-21 20:09:24.000000000 +0100
|
||||
+++ util-linux-2.12r/mount/fstab.c 2005-11-10 08:53:42.000000000 +0100
|
||||
@@ -296,7 +296,7 @@ has_uuid(const char *device, const char
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/fstab.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/fstab.c
|
||||
@@ -295,7 +295,7 @@ has_uuid(const char *device, const char
|
||||
const char *devuuid;
|
||||
int ret;
|
||||
|
||||
@ -10,10 +11,10 @@ diff -pur util-linux-2.12r/mount.orig/fstab.c util-linux-2.12r/mount/fstab.c
|
||||
ret = !strcmp(uuid, devuuid);
|
||||
/* free(devuuid); */
|
||||
return ret;
|
||||
Only in util-linux-2.12r/mount: fstab.c~
|
||||
diff -pur util-linux-2.12r/mount.orig/mount_blkid.c util-linux-2.12r/mount/mount_blkid.c
|
||||
--- util-linux-2.12r/mount.orig/mount_blkid.c 2004-12-22 10:54:41.000000000 +0100
|
||||
+++ util-linux-2.12r/mount/mount_blkid.c 2005-11-10 08:55:00.000000000 +0100
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
|
||||
@@ -16,6 +16,11 @@ mount_blkid_put_cache(void) {
|
||||
}
|
||||
|
||||
@ -38,10 +39,10 @@ diff -pur util-linux-2.12r/mount.orig/mount_blkid.c util-linux-2.12r/mount/mount
|
||||
mount_get_volume_label_by_spec(const char *spec) {
|
||||
return xstrdup(get_volume_label_by_spec(spec));
|
||||
}
|
||||
Only in util-linux-2.12r/mount: mount_blkid.c~
|
||||
diff -pur util-linux-2.12r/mount.orig/mount_blkid.h util-linux-2.12r/mount/mount_blkid.h
|
||||
--- util-linux-2.12r/mount.orig/mount_blkid.h 2004-04-13 22:00:02.000000000 +0200
|
||||
+++ util-linux-2.12r/mount/mount_blkid.h 2005-11-10 08:55:21.000000000 +0100
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.h
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
|
||||
@@ -7,6 +7,7 @@ extern void mount_blkid_get_cache(void);
|
||||
extern void mount_blkid_put_cache(void);
|
||||
extern const char *mount_get_devname_by_uuid(const char *uuid);
|
||||
@ -50,4 +51,3 @@ diff -pur util-linux-2.12r/mount.orig/mount_blkid.h util-linux-2.12r/mount/mount
|
||||
extern const char *mount_get_volume_label_by_spec(const char *spec);
|
||||
extern const char *mount_get_devname(const char *spec);
|
||||
extern const char *mount_get_devname_for_mounting(const char *spec);
|
||||
Only in util-linux-2.12r/mount: mount_blkid.h~
|
@ -1,6 +1,8 @@
|
||||
--- mount/mount.8
|
||||
Index: mount/mount.8
|
||||
===================================================================
|
||||
--- mount/mount.8.orig
|
||||
+++ mount/mount.8
|
||||
@@ -1781,6 +1781,12 @@
|
||||
@@ -1841,6 +1841,12 @@ system call.
|
||||
.TP
|
||||
.B dmapi " / " xdsm
|
||||
Enable the DMAPI (Data Management API) event callouts.
|
@ -1,6 +1,8 @@
|
||||
--- mount/mount.c
|
||||
Index: mount/mount.c
|
||||
===================================================================
|
||||
--- mount/mount.c.orig
|
||||
+++ mount/mount.c
|
||||
@@ -805,6 +805,7 @@
|
||||
@@ -842,6 +842,7 @@ try_mount_one (const char *spec0, const
|
||||
int mnt5_res = 0; /* only for gcc */
|
||||
int mnt_err;
|
||||
int flags;
|
||||
@ -8,7 +10,7 @@
|
||||
char *extra_opts; /* written in mtab */
|
||||
char *mount_opts; /* actually used on system call */
|
||||
const char *opts, *spec, *node, *types;
|
||||
@@ -913,13 +914,17 @@
|
||||
@@ -942,13 +943,17 @@ retry_nfs:
|
||||
if (loop)
|
||||
opt_loopdev = loopdev;
|
||||
|
@ -1,8 +1,10 @@
|
||||
Index: util-linux-2.12r/mount/nfsmount.c
|
||||
do not append addr option with each nfs remount [#130625]
|
||||
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/nfsmount.c
|
||||
+++ util-linux-2.12r/mount/nfsmount.c
|
||||
@@ -305,8 +305,11 @@ int nfsmount(const char *spec, const cha
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -303,8 +303,11 @@ int nfsmount(const char *spec, const cha
|
||||
"excessively long option argument\n"));
|
||||
goto fail;
|
||||
}
|
@ -1,31 +1,30 @@
|
||||
Index: util-linux-2.12r/mount/lomount.c
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/lomount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/lomount.c
|
||||
+++ util-linux-2.12r/mount/lomount.c
|
||||
@@ -1005,7 +1005,17 @@ set_loop(const char *device, const char
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/lomount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/lomount.c
|
||||
@@ -341,8 +341,15 @@ set_loop(const char *device, const char
|
||||
}
|
||||
|
||||
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
|
||||
- perror("ioctl: LOOP_SET_FD");
|
||||
- return 1;
|
||||
+ switch (errno) {
|
||||
+ case EBUSY:
|
||||
+ ret = 2;
|
||||
+ if (verbose)
|
||||
+ perror("ioctl: LOOP_SET_FD");
|
||||
+ break;
|
||||
+ return 2;
|
||||
+ default:
|
||||
+ ret = 1;
|
||||
+ perror("ioctl: LOOP_SET_FD");
|
||||
+ break;
|
||||
+ return 1;
|
||||
+ }
|
||||
keyclean_close_fd_ffd_return1:
|
||||
memset(loopinfo.lo_encrypt_key, 0, sizeof(loopinfo.lo_encrypt_key));
|
||||
memset(&multiKeyBits[0][0], 0, sizeof(multiKeyBits));
|
||||
Index: util-linux-2.12r/mount/mount.c
|
||||
}
|
||||
close (ffd);
|
||||
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount.c
|
||||
+++ util-linux-2.12r/mount/mount.c
|
||||
@@ -653,18 +653,32 @@ loop_check(const char **spec, const char
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
@@ -712,20 +712,33 @@ loop_check(const char **spec, const char
|
||||
printf(_("mount: skipping the setup of a loop device\n"));
|
||||
} else {
|
||||
int loopro = (*flags & MS_RDONLY);
|
||||
@ -37,7 +36,9 @@ Index: util-linux-2.12r/mount/mount.c
|
||||
- return EX_SYSERR; /* no more loop devices */
|
||||
- if (verbose)
|
||||
- printf(_("mount: going to use the loop device %s\n"), *loopdev);
|
||||
- if (set_loop (*loopdev, *loopfile, &loopro, type, AutoChmodPtr)) {
|
||||
- offset = opt_offset ? strtoull(opt_offset, NULL, 0) : 0;
|
||||
- if (set_loop(*loopdev, *loopfile, offset,
|
||||
- opt_encryption, pfd, &loopro)) {
|
||||
+ do {
|
||||
+ if (!*loopdev || !**loopdev)
|
||||
+ *loopdev = find_unused_loop_device();
|
||||
@ -48,7 +49,8 @@ Index: util-linux-2.12r/mount/mount.c
|
||||
- return EX_FAIL;
|
||||
- }
|
||||
+ printf(_("mount: going to use the loop device %s\n"), *loopdev);
|
||||
+ if (res = set_loop (*loopdev, *loopfile, &loopro, type, AutoChmodPtr)) {
|
||||
+ if (res = set_loop (*loopdev, *loopfile, offset,
|
||||
+ opt_encryption, pfd, &loopro)) {
|
||||
+ switch(res) {
|
||||
+ case 2:
|
||||
+ /* loop dev has been grabbed by some other process,
|
||||
|
@ -1,6 +1,8 @@
|
||||
--- mount/nfsmount.c.orig 2006-03-17 19:42:33.000000000 +1100
|
||||
+++ mount/nfsmount.c 2006-03-17 19:56:55.000000000 +1100
|
||||
@@ -119,8 +119,10 @@ find_kernel_nfs_mount_version(void) {
|
||||
Index: mount/nfsmount.c
|
||||
===================================================================
|
||||
--- mount/nfsmount.c.orig
|
||||
+++ mount/nfsmount.c
|
||||
@@ -117,8 +117,10 @@ find_kernel_nfs_mount_version(void) {
|
||||
nfs_mount_version = 4; /* since 2.2.18pre9 */
|
||||
else if (kernel_version < MAKE_VERSION(2,3,99))
|
||||
nfs_mount_version = 3;
|
||||
@ -12,7 +14,7 @@
|
||||
}
|
||||
if (nfs_mount_version > NFS_MOUNT_VERSION)
|
||||
nfs_mount_version = NFS_MOUNT_VERSION;
|
||||
@@ -320,7 +322,6 @@ int nfsmount(const char *spec, const cha
|
||||
@@ -318,7 +320,6 @@ int nfsmount(const char *spec, const cha
|
||||
#if NFS_MOUNT_VERSION >= 2
|
||||
data.namlen = NAME_MAX;
|
||||
#endif
|
||||
@ -20,7 +22,7 @@
|
||||
bg = 0;
|
||||
soft = 0;
|
||||
intr = 0;
|
||||
@@ -402,6 +403,38 @@ int nfsmount(const char *spec, const cha
|
||||
@@ -400,6 +401,38 @@ int nfsmount(const char *spec, const cha
|
||||
printf(_("Warning: Option namlen is not supported.\n"));
|
||||
} else if (!strcmp(opt, "addr")) {
|
||||
/* ignore */;
|
||||
@ -59,7 +61,7 @@
|
||||
} else {
|
||||
printf(_("unknown nfs mount parameter: "
|
||||
"%s=%d\n"), opt, val);
|
||||
@@ -474,6 +507,11 @@ retry_udp:
|
||||
@@ -472,6 +505,11 @@ retry_udp:
|
||||
data.flags |= (noacl ? NFS_MOUNT_NOACL : 0);
|
||||
}
|
||||
#endif
|
||||
@ -71,7 +73,7 @@
|
||||
if (nfsvers > MAX_NFSPROT) {
|
||||
fprintf(stderr, "NFSv%d not supported!\n", nfsvers);
|
||||
return 0;
|
||||
@@ -510,6 +548,9 @@ retry_udp:
|
||||
@@ -508,6 +546,9 @@ retry_udp:
|
||||
printf("tcp = %d\n",
|
||||
(data.flags & NFS_MOUNT_TCP) != 0);
|
||||
#endif
|
||||
@ -81,7 +83,7 @@
|
||||
#endif
|
||||
|
||||
data.version = nfs_mount_version;
|
||||
@@ -717,6 +758,30 @@ retry_udp:
|
||||
@@ -715,6 +756,30 @@ retry_udp:
|
||||
nfs_strerror(status.nfsv3.fhs_status));
|
||||
goto fail;
|
||||
}
|
@ -7,11 +7,11 @@ Acked-by: okir@suse.de
|
||||
mount/nfs.5 | 24 ++++++++++++++++++++----
|
||||
1 files changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: util-linux-2.12r/mount/nfs.5
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/nfs.5
|
||||
+++ util-linux-2.12r/mount/nfs.5
|
||||
@@ -128,7 +128,7 @@ mount daemon program number.
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
@@ -165,7 +165,7 @@ mount daemon program number.
|
||||
Use an alternate RPC version number to contact the
|
||||
mount daemon on the remote host. This option is useful
|
||||
for hosts that can run multiple NFS servers.
|
||||
@ -20,7 +20,7 @@ Index: util-linux-2.12r/mount/nfs.5
|
||||
.TP 1.5i
|
||||
.I nfsprog=n
|
||||
Use an alternate RPC program number to contact the
|
||||
@@ -193,9 +193,25 @@ Suppress the retrieval of new attributes
|
||||
@@ -230,9 +230,25 @@ Suppress the retrieval of new attributes
|
||||
.TP 1.5i
|
||||
.I noac
|
||||
Disable all forms of attribute caching entirely. This extracts a
|
@ -1,8 +1,9 @@
|
||||
## 30swsusp-resume.dpatch by Jeff Bailey <jbailey@ubuntu.com>
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./mount/get_label_uuid.c /tmp/dpep-work.5ak7Cm/util-linux/mount/get_label_uuid.c
|
||||
--- ./mount/get_label_uuid.c 2004-12-22 08:44:32.000000000 -0700
|
||||
+++ /tmp/dpep-work.5ak7Cm/util-linux/mount/get_label_uuid.c 2005-12-06 11:54:33.000000000 -0700
|
||||
@@ -93,7 +93,25 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/get_label_uuid.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/get_label_uuid.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/get_label_uuid.c
|
||||
@@ -93,7 +93,25 @@ is_v1_swap_partition(int fd, char **labe
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -29,7 +30,7 @@ diff -urNad --exclude=CVS --exclude=.svn ./mount/get_label_uuid.c /tmp/dpep-work
|
||||
|
||||
/*
|
||||
* Get both label and uuid.
|
||||
@@ -126,6 +143,8 @@
|
||||
@@ -126,6 +144,8 @@ get_label_uuid(const char *device, char
|
||||
|
||||
if (is_v1_swap_partition(fd, label, uuid))
|
||||
goto done;
|
||||
@ -38,10 +39,21 @@ diff -urNad --exclude=CVS --exclude=.svn ./mount/get_label_uuid.c /tmp/dpep-work
|
||||
|
||||
if (lseek(fd, 1024, SEEK_SET) == 1024
|
||||
&& read(fd, (char *) &e2sb, sizeof(e2sb)) == sizeof(e2sb)
|
||||
diff -urNad --exclude=CVS --exclude=.svn ./mount/swapon.c /tmp/dpep-work.5ak7Cm/util-linux/mount/swapon.c
|
||||
--- ./mount/swapon.c 2004-12-22 08:44:32.000000000 -0700
|
||||
+++ /tmp/dpep-work.5ak7Cm/util-linux/mount/swapon.c 2005-12-06 11:54:33.000000000 -0700
|
||||
@@ -22,6 +25,7 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/swapon.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/swapon.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/swapon.c
|
||||
@@ -10,7 +10,9 @@
|
||||
#include <string.h>
|
||||
#include <mntent.h>
|
||||
#include <errno.h>
|
||||
+#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <fcntl.h>
|
||||
#include "xmalloc.h"
|
||||
#include "swap_constants.h"
|
||||
#include "swapargs.h"
|
||||
@@ -23,6 +25,7 @@
|
||||
|
||||
#define _PATH_FSTAB "/etc/fstab"
|
||||
#define PROC_SWAPS "/proc/swaps"
|
||||
@ -49,7 +61,7 @@ diff -urNad --exclude=CVS --exclude=.svn ./mount/swapon.c /tmp/dpep-work.5ak7Cm/
|
||||
|
||||
#define SWAPON_NEEDS_TWO_ARGS
|
||||
|
||||
@@ -164,6 +168,85 @@
|
||||
@@ -179,6 +182,85 @@ display_summary(void)
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
@ -135,7 +147,7 @@ diff -urNad --exclude=CVS --exclude=.svn ./mount/swapon.c /tmp/dpep-work.5ak7Cm/
|
||||
static int
|
||||
do_swapon(const char *orig_special, int prio) {
|
||||
int status;
|
||||
@@ -187,6 +269,18 @@
|
||||
@@ -202,6 +284,18 @@ do_swapon(const char *orig_special, int
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
--- mount/umount.c
|
||||
Added sysfs to list of filesystems not to unmount with umount -a [#190385]
|
||||
|
||||
Index: mount/umount.c
|
||||
===================================================================
|
||||
--- mount/umount.c.orig
|
||||
+++ mount/umount.c
|
||||
@@ -724,7 +724,7 @@
|
||||
@@ -721,7 +721,7 @@ main (int argc, char *argv[]) {
|
||||
if (all) {
|
||||
/* nodev stuff: sysfs, usbfs, oprofilefs, ... */
|
||||
if (types == NULL)
|
@ -1,31 +0,0 @@
|
||||
--- util-linux-2.12r/mount/mount.c
|
||||
+++ util-linux-2.12r/mount/mount.c
|
||||
@@ -927,17 +927,6 @@
|
||||
|
||||
block_signals (SIG_UNBLOCK);
|
||||
|
||||
-#ifdef HAVE_NFS
|
||||
- if (mnt_err && types && streq (types, "nfs")) {
|
||||
- if (nfs_mount_version == 4 && mnt_err != EBUSY && mnt_err != ENOENT) {
|
||||
- if (verbose)
|
||||
- printf(_("mount: failed with nfs mount version 4, trying 3..\n"));
|
||||
- nfs_mount_version = 3;
|
||||
- goto retry_nfs;
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
/* Mount failed, complain, but don't die. */
|
||||
|
||||
if (types == 0) {
|
||||
--- util-linux-2.12r/mount/nfsmount.c
|
||||
+++ util-linux-2.12r/mount/nfsmount.c
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
#define MAKE_VERSION(p,q,r) (65536*(p) + 256*(q) + (r))
|
||||
|
||||
-#define MAX_NFSPROT ((nfs_mount_version >= 4) ? 3 : 2)
|
||||
+#define MAX_NFSPROT 3
|
||||
|
||||
static int
|
||||
linux_version_code(void) {
|
@ -1,12 +0,0 @@
|
||||
--- mount/swapon.c
|
||||
+++ mount/swapon.c
|
||||
@@ -50,6 +50,9 @@
|
||||
|
||||
#define QUIET 1
|
||||
|
||||
+#undef PAGE_SIZE
|
||||
+#define PAGE_SIZE sysconf(_SC_PAGESIZE)
|
||||
+
|
||||
int all = 0;
|
||||
int verbose = 0;
|
||||
int priority = -1; /* non-prioritized swap by default */
|
@ -1,118 +0,0 @@
|
||||
Index: util-linux-2.12r/Makefile
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/Makefile
|
||||
+++ util-linux-2.12r/Makefile
|
||||
@@ -18,7 +18,8 @@ SUBDIRS=po \
|
||||
fdisk \
|
||||
hwclock \
|
||||
sys-utils \
|
||||
- text-utils
|
||||
+ text-utils \
|
||||
+ partx
|
||||
|
||||
.PHONEY: all install clean now
|
||||
all: defines.h
|
||||
@@ -43,7 +44,7 @@ install:
|
||||
|
||||
clean:
|
||||
-rm -f *.o *~ omake conftest conftest.c core
|
||||
- @for subdir in $(SUBDIRS) partx; do \
|
||||
+ @for subdir in $(SUBDIRS); do \
|
||||
(cd $$subdir && $(MAKE) $@) || exit 1; \
|
||||
done
|
||||
|
||||
Index: util-linux-2.12r/partx/partx.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/partx/partx.c
|
||||
+++ util-linux-2.12r/partx/partx.c
|
||||
@@ -38,6 +38,8 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/hdreg.h> /* HDIO_GETGEO */
|
||||
+/* workaround for __user in header file */
|
||||
+#define __user
|
||||
#include <linux/blkpg.h>
|
||||
#define BLKGETSIZE _IO(0x12,96) /* return device size */
|
||||
|
||||
@@ -333,29 +335,13 @@ xmalloc (size_t size) {
|
||||
/*
|
||||
* sseek: seek to specified sector
|
||||
*/
|
||||
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__s390x__) && !defined(__x86_64__)
|
||||
-#define NEED__llseek
|
||||
-#endif
|
||||
-
|
||||
-#ifdef NEED__llseek
|
||||
-#include <linux/unistd.h> /* _syscall */
|
||||
-static
|
||||
-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
|
||||
- long long *, res, uint, wh);
|
||||
-#endif
|
||||
-
|
||||
static int
|
||||
sseek(int fd, unsigned int secnr) {
|
||||
long long in, out;
|
||||
in = ((long long) secnr << 9);
|
||||
out = 1;
|
||||
|
||||
-#ifdef NEED__llseek
|
||||
- if (_llseek (fd, in>>32, in & 0xffffffff, &out, SEEK_SET) != 0
|
||||
- || out != in)
|
||||
-#else
|
||||
if ((out = lseek(fd, in, SEEK_SET)) != in)
|
||||
-#endif
|
||||
{
|
||||
fprintf(stderr, "llseek error\n");
|
||||
return -1;
|
||||
Index: util-linux-2.12r/partx/addpart.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/partx/addpart.c
|
||||
+++ util-linux-2.12r/partx/addpart.c
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
+/* workaround for __user in header file */
|
||||
+#define __user
|
||||
#include <linux/blkpg.h>
|
||||
|
||||
int
|
||||
Index: util-linux-2.12r/partx/delpart.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/partx/delpart.c
|
||||
+++ util-linux-2.12r/partx/delpart.c
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
+/* workaround for __user in header file */
|
||||
+#define __user
|
||||
#include <linux/blkpg.h>
|
||||
|
||||
int
|
||||
Index: util-linux-2.12r/partx/Makefile
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/partx/Makefile
|
||||
+++ util-linux-2.12r/partx/Makefile
|
||||
@@ -1,7 +1,12 @@
|
||||
+include ../MCONFIG
|
||||
+
|
||||
OBJ = bsd.o dos.o partx.o solaris.o unixware.o gpt.o crc32.o
|
||||
CFLAGS += -Wall
|
||||
+SBIN=
|
||||
+
|
||||
+SBIN:=$(SBIN) partx
|
||||
|
||||
-all: addpart delpart partx
|
||||
+all: addpart delpart $(SBIN)
|
||||
|
||||
partx: $(OBJ)
|
||||
|
||||
@@ -13,3 +18,7 @@ clean:
|
||||
rm -f $(OBJ) addpart.o delpart.o addpart delpart partx *~
|
||||
|
||||
$(OBJ): partx.h
|
||||
+
|
||||
+install: all
|
||||
+ $(INSTALLDIR) $(SBINDIR)
|
||||
+ $(INSTALLBIN) $(SBIN) $(SBINDIR)
|
@ -1,13 +0,0 @@
|
||||
Index: util-linux-2.12r/partx/gpt.h
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/partx/gpt.h
|
||||
+++ util-linux-2.12r/partx/gpt.h
|
||||
@@ -36,7 +36,7 @@
|
||||
#define MSDOS_MBR_SIGNATURE 0xaa55
|
||||
#define GPT_BLOCK_SIZE 512
|
||||
|
||||
-#define GPT_HEADER_SIGNATURE 0x5452415020494645
|
||||
+#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
|
||||
#define GPT_HEADER_REVISION_V1_02 0x00010200
|
||||
#define GPT_HEADER_REVISION_V1_00 0x00010000
|
||||
#define GPT_HEADER_REVISION_V0_99 0x00009900
|
@ -1,19 +0,0 @@
|
||||
--- util-linux-2.12a/disk-utils/raw.c.=K0000=.orig
|
||||
+++ util-linux-2.12a/disk-utils/raw.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#endif
|
||||
#define DEVFS_RAWCTLDEV "/dev/raw/rawctl"
|
||||
|
||||
+#define RAW_NR_MINORS 4096
|
||||
|
||||
char * progname;
|
||||
int do_query = 0;
|
||||
@@ -94,7 +95,7 @@ int main(int argc, char *argv[])
|
||||
if (do_query_all) {
|
||||
if (optind < argc)
|
||||
usage(1);
|
||||
- for (i=1; i<255; i++)
|
||||
+ for (i = 1; i < RAW_NR_MINORS; i++)
|
||||
query(i, 1);
|
||||
exit(0);
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
--- util-linux-2.12q/configure
|
||||
+++ util-linux-2.12q/configure
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
CC=${CC-cc}
|
||||
CFLAGS=${CFLAGS-"-O2"}
|
||||
-LDFLAGS=${LDFLAGS-"-s"}
|
||||
+LDFLAGS=${LDFLAGS-""}
|
||||
echo CC=$CC >> make_include
|
||||
echo CFLAGS=$CFLAGS >> make_include
|
||||
echo LDFLAGS=$LDFLAGS >> make_include
|
||||
--- util-linux-2.12q/MCONFIG
|
||||
+++ util-linux-2.12q/MCONFIG
|
||||
@@ -22,7 +22,7 @@
|
||||
# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
|
||||
# will use PAM for authentication. Additionally, passwd will not be
|
||||
# installed as it is not PAM aware.
|
||||
-HAVE_PAM=no
|
||||
+HAVE_PAM=yes
|
||||
|
||||
# If HAVE_SELINUX is set to "yes", the login will make sure the user is
|
||||
# logged into an appropriate security context
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
# If HAVE_PASSWD is set to "yes", then passwd will not be built or
|
||||
# installed from the login-utils subdirectory.
|
||||
-HAVE_PASSWD=no
|
||||
+HAVE_PASSWD=yes
|
||||
|
||||
# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
|
||||
# non-root users to enter the account password before updating /etc/passwd.
|
||||
@@ -59,7 +59,7 @@
|
||||
# not be built or installed from the login-utils subdirectory. (The
|
||||
# shutdown and init from the SysVinit package do not depend on the last,
|
||||
# mesg, and wall from that package.)
|
||||
-HAVE_SYSVINIT_UTILS=yes
|
||||
+HAVE_SYSVINIT_UTILS=no
|
||||
|
||||
# If HAVE_WRITE is set to "yes", then write will not be built or
|
||||
# installed from the misc-utils subdirectory.
|
||||
@@ -77,7 +77,7 @@
|
||||
# user's tty to "tty" [The login in util-linux does this correctly, and
|
||||
# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
|
||||
# properly.]
|
||||
-USE_TTY_GROUP=yes
|
||||
+USE_TTY_GROUP=no
|
||||
|
||||
# If HAVE_KILL is set to "yes", then kill will not be built or
|
||||
# installed from the misc-utils subdirectory.
|
||||
@@ -141,7 +141,7 @@
|
||||
OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
|
||||
else
|
||||
ifeq "$(ARCH)" "arm"
|
||||
- OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
|
||||
+ OPT= -pipe -O2 -fomit-frame-pointer
|
||||
else
|
||||
OPT= -O2 -fomit-frame-pointer
|
||||
endif
|
||||
@@ -220,7 +220,7 @@
|
||||
INSTALLBIN= $(INSTALL) -m $(BINMODE)
|
||||
INSTALLMAN= $(INSTALL) -m $(MANMODE)
|
||||
INSTALLDAT= $(INSTALL) -m $(DATMODE)
|
||||
-INSTALLSUID= $(INSTALL) -m $(SUIDMODE) -o root
|
||||
+INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
|
||||
|
||||
ifeq "$(DISABLE_NLS)" "yes"
|
||||
NLSFLAGS = -DDISABLE_NLS
|
||||
--- util-linux-2.12q/mount/filesystems
|
||||
+++ util-linux-2.12q/mount/filesystems
|
||||
@@ -0,0 +1,5 @@
|
||||
+vfat
|
||||
+hfs
|
||||
+minix
|
||||
+reiserfs
|
||||
+*
|
||||
--- util-linux-2.12q/mount/linux_fs.h
|
||||
+++ util-linux-2.12q/mount/linux_fs.h
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2, 30 char names */
|
||||
struct minix_super_block {
|
||||
u_char s_dummy[16];
|
||||
- u_char s_magic[2];
|
||||
+ short s_magic[2];
|
||||
};
|
||||
#define minixmagic(s) assemble2le(s.s_magic)
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8e499b338ce9fbd1fb315194b26540ec823c0afc46c9e145ac7a3e38ad57e6b
|
||||
size 1370907
|
13
util-linux-2.13-build_fix_intel_check.patch
Normal file
13
util-linux-2.13-build_fix_intel_check.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/configure.ac
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/configure.ac
|
||||
+++ util-linux-ng-2.12r+git20070330/configure.ac
|
||||
@@ -170,7 +170,7 @@ AC_TRY_COMPILE([
|
||||
|
||||
|
||||
case "$host" in
|
||||
- i?86-*) intel=true ;;
|
||||
+ i?86-* | x86_64*) intel=true ;;
|
||||
m68*) m68k=true ;;
|
||||
sparc*) sparc=true ;;
|
||||
esac
|
12
util-linux-2.13-build_gnu_source.patch
Normal file
12
util-linux-2.13-build_gnu_source.patch
Normal file
@ -0,0 +1,12 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/configure.ac
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/configure.ac
|
||||
+++ util-linux-ng-2.12r+git20070330/configure.ac
|
||||
@@ -10,6 +10,7 @@ AC_CONFIG_SRCDIR(mount/mount.c)
|
||||
|
||||
AC_PREFIX_DEFAULT(/)
|
||||
|
||||
+AC_GNU_SOURCE
|
||||
AC_PROG_CC_STDC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_LIBTOOL
|
13
util-linux-2.13-misc_utils_add_man_scriptreplay.patch
Normal file
13
util-linux-2.13-misc_utils_add_man_scriptreplay.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/misc-utils/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/misc-utils/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/misc-utils/Makefile.am
|
||||
@@ -24,7 +24,7 @@ scriptreplay: scriptreplay.pl
|
||||
CLEANFILES = chkdupexe scriptreplay
|
||||
|
||||
man_MANS = cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
|
||||
- namei.1 script.1 whereis.1 hostid.1
|
||||
+ namei.1 script.1 whereis.1 hostid.1 scriptreplay.1
|
||||
|
||||
if HAVE_NCURSES
|
||||
cal_LDADD = -lncurses
|
13
util-linux-2.13-mount_nfs_timeo.patch
Normal file
13
util-linux-2.13-mount_nfs_timeo.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -487,7 +487,7 @@ retry_udp:
|
||||
|
||||
/* Adjust options if none specified */
|
||||
if (!data.timeo)
|
||||
- data.timeo = tcp ? 70 : 7;
|
||||
+ data.timeo = tcp ? 600 : 7;
|
||||
|
||||
#ifdef NFS_MOUNT_DEBUG
|
||||
printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
|
105
util-linux-2.13-sys_utils_arch.patch
Normal file
105
util-linux-2.13-sys_utils_arch.patch
Normal file
@ -0,0 +1,105 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/sys-utils/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/sys-utils/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/sys-utils/Makefile.am
|
||||
@@ -1,9 +1,11 @@
|
||||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
-bin_PROGRAMS = dmesg
|
||||
+bin_PROGRAMS = arch dmesg
|
||||
|
||||
usrbinexec_PROGRAMS = cytune flock ionice ipcrm ipcs renice setsid
|
||||
|
||||
+arch_SOURCES = arch.c
|
||||
+
|
||||
cytune_SOURCES = cytune.c cyclades.h
|
||||
|
||||
sbin_PROGRAMS = ctrlaltdel
|
||||
@@ -12,7 +14,7 @@ usrsbinexec_PROGRAMS = readprofile tunel
|
||||
|
||||
tunelp_SOURCES = tunelp.c lp.h
|
||||
|
||||
-man_MANS = flock.1 ionice.1 readprofile.1 \
|
||||
+man_MANS = arch.1 flock.1 ionice.1 readprofile.1 \
|
||||
ctrlaltdel.8 cytune.8 dmesg.8 ipcrm.8 ipcs.8 renice.8 \
|
||||
setsid.8 tunelp.8
|
||||
|
||||
Index: util-linux-ng-2.12r+git20070330/sys-utils/arch.1
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/sys-utils/arch.1
|
||||
@@ -0,0 +1,34 @@
|
||||
+.\" arch.1 --
|
||||
+.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+.\" Public domain: may be freely distributed.
|
||||
+.TH ARCH 1 "4 July 1997" "Linux 2.0" "Linux Programmer's Manual"
|
||||
+.SH NAME
|
||||
+arch \- print machine architecture
|
||||
+.SH SYNOPSIS
|
||||
+.B arch
|
||||
+.SH DESCRIPTION
|
||||
+.B arch
|
||||
+is equivalent to
|
||||
+.BR "uname -m" .
|
||||
+
|
||||
+On current Linux systems,
|
||||
+.B arch
|
||||
+prints things such as "i386", "i486", "i586", "alpha", "sparc",
|
||||
+"arm", "m68k", "mips", "ppc".
|
||||
+.SH SEE ALSO
|
||||
+.BR uname (1),
|
||||
+.BR uname (2)
|
||||
+.\"
|
||||
+.\" Details:
|
||||
+.\" arch prints the machine part of the system_utsname struct
|
||||
+.\" This struct is defined in version.c, and this field is
|
||||
+.\" initialized with UTS_MACHINE, which is defined as $ARCH
|
||||
+.\" in the main Makefile.
|
||||
+.\" That gives the possibilities
|
||||
+.\" alpha arm i386 m68k mips ppc sparc sparc64
|
||||
+.\"
|
||||
+.\" If Makefile is not edited, ARCH is guessed by
|
||||
+.\" ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
|
||||
+.\" Then how come we get these i586 values?
|
||||
+.\" Well, the routine check_bugs() does system_utsname.machine[1] = '0' + x86;
|
||||
+.\" (called in init/main.c, defined in ./include/asm-i386/bugs.h)
|
||||
Index: util-linux-ng-2.12r+git20070330/sys-utils/arch.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/sys-utils/arch.c
|
||||
@@ -0,0 +1,35 @@
|
||||
+/* arch -- print machine architecture information
|
||||
+ * Created: Mon Dec 20 12:27:15 1993 by faith@cs.unc.edu
|
||||
+ * Revised: Mon Dec 20 12:29:23 1993 by faith@cs.unc.edu
|
||||
+ * Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
|
||||
+
|
||||
+ * This program is free software; you can redistribute it and/or modify it
|
||||
+ * under the terms of the GNU General Public License as published by the
|
||||
+ * Free Software Foundation; either version 2, or (at your option) any
|
||||
+ * later version.
|
||||
+
|
||||
+ * This program is distributed in the hope that it will be useful, but
|
||||
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * General Public License for more details.
|
||||
+
|
||||
+ * You should have received a copy of the GNU General Public License along
|
||||
+ * with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
+ * 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <sys/utsname.h>
|
||||
+
|
||||
+int main (void)
|
||||
+{
|
||||
+ struct utsname utsbuf;
|
||||
+
|
||||
+ if (uname( &utsbuf )) {
|
||||
+ perror( "arch" );
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ printf( "%s\n", utsbuf.machine );
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
12
util-linux-2.13-tests_missing_include.patch
Normal file
12
util-linux-2.13-tests_missing_include.patch
Normal file
@ -0,0 +1,12 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/tests/helpers/mnt_test_sysinfo.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/tests/helpers/mnt_test_sysinfo.c
|
||||
+++ util-linux-ng-2.12r+git20070330/tests/helpers/mnt_test_sysinfo.c
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <limits.h>
|
@ -1,3 +1,5 @@
|
||||
remove unwanted newline (#12181)
|
||||
|
||||
--- util-linux-2.12q/login-utils/wall.c
|
||||
+++ util-linux-2.12q/login-utils/wall.c
|
||||
@@ -217,8 +217,6 @@
|
@ -1,127 +1,16 @@
|
||||
--- MCONFIG
|
||||
+++ MCONFIG
|
||||
@@ -138,8 +138,8 @@
|
||||
CPUTAIL=486
|
||||
endif
|
||||
ifeq "$(CPU)" "x86_64"
|
||||
- CPUHEAD=-mcpu=
|
||||
- CPUTAIL=nocona
|
||||
+ CPUHEAD=-mtune=
|
||||
+ CPUTAIL=k8
|
||||
endif
|
||||
CPUOPT= $(CPUHEAD)$(CPUTAIL)
|
||||
OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
|
||||
@@ -151,7 +151,7 @@
|
||||
endif
|
||||
endif
|
||||
|
||||
-WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
|
||||
+WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -g
|
||||
|
||||
LIB=../lib
|
||||
|
||||
--- configure
|
||||
+++ configure
|
||||
@@ -754,3 +754,23 @@
|
||||
echo "You don't have blkid"
|
||||
fi
|
||||
rm -f conftest conftest.c
|
||||
+
|
||||
+#
|
||||
+# 16. For mount, do we have libvolume_id?
|
||||
+#
|
||||
+echo '
|
||||
+#include <stdlib.h>
|
||||
+#include <libvolume_id.h>
|
||||
+int main(){ exit(0); volume_id_close(NULL); }
|
||||
+' > conftest.c
|
||||
+LIBS="-lvolume_id"
|
||||
+eval $compile
|
||||
+LIBS=
|
||||
+if test -s conftest; then
|
||||
+ echo "HAVE_VOLID=yes" >> make_include
|
||||
+ echo "You have libvolume_id"
|
||||
+else
|
||||
+ echo "HAVE_VOLID=no" >> make_include
|
||||
+ echo "You don't have libvolume_id"
|
||||
+fi
|
||||
+rm -f conftest conftest.c
|
||||
--- mount/Makefile
|
||||
+++ mount/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../make_include
|
||||
include ../MCONFIG
|
||||
|
||||
-DEFINES = -DHAVE_NFS $(BLKID_DEFINE)
|
||||
+DEFINES = -DHAVE_NFS $(BLKID_DEFINE) $(VOLID_DEFINE)
|
||||
|
||||
RPCSVCDIR = rpcsvc
|
||||
RPC_CFLAGS = -Wno-unused
|
||||
@@ -25,6 +25,11 @@
|
||||
BLKID_LIB = -lblkid -luuid
|
||||
endif
|
||||
|
||||
+ifeq "$(HAVE_VOLID)" "yes"
|
||||
+VOLID_DEFINE = -DHAVE_VOLID
|
||||
+VOLID_LIB = -lvolume_id
|
||||
+endif
|
||||
+
|
||||
PROGS = $(SUID_PROGS) $(NOSUID_PROGS)
|
||||
|
||||
MAYBE = pivot_root swapoff
|
||||
@@ -48,23 +53,25 @@
|
||||
|
||||
mount: mount.o fstab.o sundries.o xmalloc.o realpath.o mntent.o version.o \
|
||||
get_label_uuid.o mount_by_label.o mount_blkid.o mount_guess_fstype.o \
|
||||
+ mount_udev.o \
|
||||
getusername.o $(LIB)/setproctitle.o $(LIB)/env.o $(NFS_OBJS) lomount.o \
|
||||
loumount.o loop.o sha512.o rmd160.o aes.o $(LIB)/xstrncpy.o
|
||||
- $(LINK) $^ -o $@ $(BLKID_LIB)
|
||||
+ $(LINK) $^ -o $@ $(BLKID_LIB) $(VOLID_LIB)
|
||||
|
||||
umount: umount.o fstab.o sundries.o xmalloc.o realpath.o mntent.o \
|
||||
getusername.o get_label_uuid.o mount_by_label.o mount_blkid.o \
|
||||
- version.o $(LIB)/env.o loumount.o
|
||||
- $(LINK) $^ -o $@ $(BLKID_LIB)
|
||||
+ mount_udev.o version.o $(LIB)/env.o loumount.o
|
||||
+ $(LINK) $^ -o $@ $(BLKID_LIB) $(VOLID_LIB)
|
||||
|
||||
guessfstype: guessfstype.o mount_guess_fstype.o sundries.o realpath.o \
|
||||
fstab.o mntent.o get_label_uuid.o mount_blkid.o mount_by_label.o \
|
||||
- xmalloc.o
|
||||
- $(LINK) $^ -o $@
|
||||
+ mount_udev.o xmalloc.o
|
||||
+ $(LINK) $^ -o $@ $(VOLID_LIB)
|
||||
|
||||
swapon: swapon.o version.o xmalloc.o \
|
||||
- get_label_uuid.o mount_by_label.o mount_blkid.o loop.o sha512.o $(LIB)/xstrncpy.o
|
||||
- $(LINK) $^ -o $@ $(BLKID_LIB)
|
||||
+ get_label_uuid.o mount_by_label.o mount_blkid.o mount_udev.o \
|
||||
+ loop.o sha512.o $(LIB)/xstrncpy.o
|
||||
+ $(LINK) $^ -o $@ $(BLKID_LIB) $(VOLID_LIB)
|
||||
|
||||
main_losetup.o: lomount.c
|
||||
$(COMPILE) -DMAIN lomount.c -o $@
|
||||
@@ -142,7 +149,7 @@
|
||||
|
||||
clean:
|
||||
rm -f a.out core *~ *.o swapargs.h $(PROGS) $(MAYBE)
|
||||
- rm -f nfs_mountversion.h
|
||||
+ rm -f nfs_mountversion.h nfsmount_clnt.c nfsmount.h nfsmount_xdr.c
|
||||
|
||||
clobber distclean realclean: clean
|
||||
rm -f $(GEN_FILES)
|
||||
--- mount/fstab.c
|
||||
+++ mount/fstab.c
|
||||
@@ -305,6 +305,7 @@
|
||||
/* Find the entry (SPEC,FILE) in fstab */
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/fstab.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/fstab.c
|
||||
@@ -305,6 +305,7 @@ has_uuid(const char *device, const char
|
||||
struct mntentchn *
|
||||
getfsspecfile (const char *spec, const char *file) {
|
||||
+ char *nspec;
|
||||
struct mntentchn *mc, *mc0;
|
||||
+ char *nspec;
|
||||
|
||||
mc0 = fstab_head();
|
||||
@@ -316,11 +317,12 @@
|
||||
|
||||
@@ -315,11 +316,12 @@ getfsspecfile (const char *spec, const c
|
||||
return mc;
|
||||
|
||||
/* second attempt: names found after symlink resolution */
|
||||
@ -135,7 +24,7 @@
|
||||
return mc;
|
||||
|
||||
/* third attempt: names found after LABEL= or UUID= resolution */
|
||||
@@ -357,11 +359,21 @@
|
||||
@@ -356,11 +358,21 @@ getfsfile (const char *file) {
|
||||
struct mntentchn *
|
||||
getfsspec (const char *spec) {
|
||||
struct mntentchn *mc, *mc0;
|
||||
@ -159,18 +48,20 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- mount/mount.c
|
||||
+++ mount/mount.c
|
||||
@@ -1667,7 +1667,7 @@
|
||||
use only for testing purposes -
|
||||
the guessing is not reliable at all */
|
||||
{
|
||||
- char *fstype;
|
||||
+ const char *fstype;
|
||||
fstype = do_guess_fstype(optarg);
|
||||
printf("%s\n", fstype ? fstype : "unknown");
|
||||
exit(fstype ? 0 : EX_FAIL);
|
||||
@@ -1738,6 +1738,8 @@
|
||||
@@ -723,6 +735,8 @@ char *progname;
|
||||
|
||||
const char *mount_get_volume_label_by_spec(const char *spec) { return NULL; }
|
||||
const char *mount_get_devname_by_uuid(const char *uuid) { return NULL; }
|
||||
+const char *mount_get_devname_by_label(const char *label) { return NULL; }
|
||||
+const char *mount_get_volume_uuid_by_spec(const char *spec) { return NULL; }
|
||||
struct my_mntent *my_getmntent (mntFILE *mfp) { return NULL; }
|
||||
mntFILE *my_setmntent (const char *file, char *mode) { return NULL; }
|
||||
void my_endmntent (mntFILE *mfp) { }
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
@@ -1746,6 +1746,8 @@ main(int argc, char *argv[]) {
|
||||
if (mc == NULL)
|
||||
mc = getfsspec (spec);
|
||||
if (mc == NULL)
|
||||
@ -179,44 +70,54 @@
|
||||
die (EX_USAGE,
|
||||
_("mount: cannot find %s in %s"),
|
||||
spec, _PATH_FSTAB);
|
||||
--- mount/mount_blkid.c
|
||||
+++ mount/mount_blkid.c
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "mount_blkid.h"
|
||||
|
||||
+#ifndef HAVE_VOLID
|
||||
#ifdef HAVE_BLKID
|
||||
+#ifndef HAVE_LIBVOLUME_ID
|
||||
#ifdef HAVE_LIBBLKID
|
||||
|
||||
blkid_cache blkid;
|
||||
@@ -119,3 +120,4 @@
|
||||
@@ -118,4 +119,5 @@ mount_get_devname_for_mounting(const cha
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
+#endif
|
||||
--- mount/mount_blkid.h
|
||||
+++ mount/mount_blkid.h
|
||||
@@ -11,3 +11,5 @@
|
||||
-#endif
|
||||
+#endif /* HAVE_LIBBLKID */
|
||||
+#endif /* HAVE_LIBVOLUME_ID */
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.h
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
|
||||
@@ -11,3 +11,5 @@ extern const char *mount_get_volume_uuid
|
||||
extern const char *mount_get_volume_label_by_spec(const char *spec);
|
||||
extern const char *mount_get_devname(const char *spec);
|
||||
extern const char *mount_get_devname_for_mounting(const char *spec);
|
||||
+
|
||||
+extern const char *volume_id_get_tag(const char *spec, const char *token);
|
||||
--- mount/mount_by_label.c
|
||||
+++ mount/mount_by_label.c
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_by_label.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_by_label.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_by_label.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-#ifndef HAVE_BLKID
|
||||
+#if (!defined HAVE_BLKID) && (!defined HAVE_VOLID)
|
||||
-#ifndef HAVE_LIBBLKID
|
||||
+#if (!defined HAVE_BLKID) && (!defined HAVE_LIBVOLUME_ID)
|
||||
/*
|
||||
* mount_by_label.c - aeb
|
||||
*
|
||||
--- mount/mount_guess_fstype.c
|
||||
+++ mount/mount_guess_fstype.c
|
||||
@@ -54,9 +54,23 @@
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_guess_fstype.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.c
|
||||
@@ -46,15 +46,29 @@
|
||||
#define ETC_FILESYSTEMS "/etc/filesystems"
|
||||
#define PROC_FILESYSTEMS "/proc/filesystems"
|
||||
|
||||
+#ifdef HAVE_VOLID
|
||||
+#ifdef HAVE_LIBVOLUME_ID
|
||||
+
|
||||
+static int
|
||||
+known_fstype(const char *fstype) {
|
||||
@ -230,32 +131,29 @@
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
#ifdef HAVE_BLKID
|
||||
#ifdef HAVE_LIBBLKID
|
||||
|
||||
-char *
|
||||
+const char *
|
||||
do_guess_fstype(const char *device)
|
||||
{
|
||||
return blkid_get_tag_value(blkid, "TYPE", device);
|
||||
@@ -208,7 +222,7 @@
|
||||
return (sum == p[511]);
|
||||
}
|
||||
|
||||
-char *
|
||||
+const char *
|
||||
do_guess_fstype(const char *device) {
|
||||
int fd;
|
||||
char *type = NULL;
|
||||
@@ -536,7 +550,7 @@
|
||||
-static int
|
||||
+const static int
|
||||
known_fstype(const char *fstype)
|
||||
{
|
||||
return blkid_known_fstype(fstype);
|
||||
@@ -492,6 +506,7 @@ io_error:
|
||||
}
|
||||
|
||||
#endif
|
||||
-
|
||||
+#endif
|
||||
|
||||
static struct tried {
|
||||
struct tried *next;
|
||||
char *type;
|
||||
@@ -578,9 +592,9 @@
|
||||
@@ -534,9 +549,9 @@ free_tested(void) {
|
||||
tried = NULL;
|
||||
}
|
||||
|
||||
@ -267,8 +165,10 @@
|
||||
if (verbose) {
|
||||
printf (_("mount: you didn't specify a filesystem type for %s\n"),
|
||||
spec);
|
||||
--- /dev/null 2006-06-02 17:12:45.000000000 +0200
|
||||
+++ mount/mount_udev.c 2006-06-12 11:14:42.285154088 +0200
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_udev.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_udev.c
|
||||
@@ -0,0 +1,237 @@
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
@ -282,7 +182,7 @@
|
||||
+
|
||||
+#include "mount_blkid.h"
|
||||
+
|
||||
+#ifdef HAVE_VOLID
|
||||
+#ifdef HAVE_LIBVOLUME_ID
|
||||
+
|
||||
+extern int verbose;
|
||||
+
|
||||
@ -507,8 +407,10 @@
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
--- mount/mount_guess_fstype.h
|
||||
+++ mount/mount_guess_fstype.h
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.h
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_guess_fstype.h
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_guess_fstype.h
|
||||
@@ -8,8 +8,8 @@ struct mountargs {
|
||||
|
||||
extern int verbose;
|
||||
@ -520,4 +422,62 @@
|
||||
int procfsloop(int (*mount_fn)(struct mountargs *), struct mountargs *args,
|
||||
const char **type);
|
||||
int is_in_procfs(const char *fstype);
|
||||
Index: util-linux-ng-2.12r+git20070330/configure.ac
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/configure.ac
|
||||
+++ util-linux-ng-2.12r+git20070330/configure.ac
|
||||
@@ -57,8 +57,10 @@ AC_CHECK_LIB(termcap, tgetnum)
|
||||
AM_CONDITIONAL(HAVE_TERMCAP, test x$ac_cv_lib_termcap_tgetnum = xyes)
|
||||
|
||||
AC_CHECK_LIB(blkid, blkid_known_fstype)
|
||||
-AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
|
||||
+AC_CHECK_LIB(volume_id, volume_id_open_node)
|
||||
|
||||
+AM_CONDITIONAL(HAVE_BLKID, test x$ac_cv_lib_blkid_blkid_known_fstype = xyes)
|
||||
+AM_CONDITIONAL(HAVE_VOLUME_ID, test x$ac_cv_lib_volume_id_volume_id_open_node = xyes)
|
||||
|
||||
AM_GNU_GETTEXT_VERSION([0.14.1])
|
||||
AM_GNU_GETTEXT([external])
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/Makefile.am
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/Makefile.am
|
||||
@@ -16,7 +16,7 @@ MNTHDRS = fstab.h linux_fs.h mount_mnten
|
||||
|
||||
mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
|
||||
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
|
||||
- getusername.c \
|
||||
+ mount_udev.c getusername.c \
|
||||
nfsmount.c nfsmount_clnt.c nfs4mount.c \
|
||||
lomount.c \
|
||||
$(MNTHDRS)
|
||||
@@ -24,14 +24,14 @@ mount_SOURCES = mount.c fstab.c sundries
|
||||
mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a libnfsmount_xdr.a
|
||||
|
||||
umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
|
||||
- getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
|
||||
+ getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c mount_udev.c \
|
||||
lomount.c \
|
||||
$(MNTHDRS)
|
||||
|
||||
umount_LDADD = $(top_srcdir)/lib/libenv.a
|
||||
|
||||
swapon_SOURCES = swapon.c xmalloc.c \
|
||||
- get_label_uuid.c mount_by_label.c mount_blkid.c \
|
||||
+ get_label_uuid.c mount_by_label.c mount_blkid.c mount_udev.c \
|
||||
swap_constants.h realpath.c
|
||||
|
||||
losetup_SOURCES = lomount.c loop.h lomount.h
|
||||
@@ -43,6 +43,12 @@ umount_LDADD += -lblkid -luuid
|
||||
swapon_LDADD = -lblkid -luuid
|
||||
endif
|
||||
|
||||
+if HAVE_VOLUME_ID
|
||||
+mount_LDADD += -lvolume_id
|
||||
+umount_LDADD += -lvolume_id
|
||||
+swapon_LDADD = -lvolume_id
|
||||
+endif
|
||||
+
|
||||
if HAVE_PIVOT_ROOT
|
||||
sbin_PROGRAMS += pivot_root
|
||||
man_MANS += pivot_root.8
|
@ -3,10 +3,10 @@
|
||||
mount/mount_constants.h | 3 +++
|
||||
3 files changed, 23 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: util-linux-2.12r/mount/mount.8
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.8
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount.8
|
||||
+++ util-linux-2.12r/mount/mount.8
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.8
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.8
|
||||
@@ -572,6 +572,10 @@ This option implies the options
|
||||
(unless overridden by subsequent options, as in the option line
|
||||
.BR group,dev,suid ).
|
||||
@ -18,7 +18,7 @@ Index: util-linux-2.12r/mount/mount.8
|
||||
.B mand
|
||||
Allow mandatory locks on this filesystem. See
|
||||
.BR fcntl (2).
|
||||
@@ -599,6 +603,9 @@ Do not allow direct execution of any bin
|
||||
@@ -602,6 +606,9 @@ Do not allow direct execution of any bin
|
||||
(Until recently it was possible to run binaries anyway using a command like
|
||||
/lib/ld*.so /mnt/binary. This trick fails since Linux 2.4.25 / 2.6.0.)
|
||||
.TP
|
||||
@ -28,11 +28,11 @@ Index: util-linux-2.12r/mount/mount.8
|
||||
.B nomand
|
||||
Do not allow mandatory locks on this filesystem.
|
||||
.TP
|
||||
Index: util-linux-2.12r/mount/mount.c
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount.c
|
||||
+++ util-linux-2.12r/mount/mount.c
|
||||
@@ -162,9 +162,14 @@ static const struct opt_map opt_map[] =
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount.c
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount.c
|
||||
@@ -174,9 +174,14 @@ static const struct opt_map opt_map[] =
|
||||
{ "diratime", 0, 1, MS_NODIRATIME }, /* Update dir access times */
|
||||
{ "nodiratime", 0, 0, MS_NODIRATIME },/* Do not update dir access times */
|
||||
#endif
|
||||
@ -44,10 +44,10 @@ Index: util-linux-2.12r/mount/mount.c
|
||||
|
||||
+static int option_hotplug; /* can not invent our own MS_FLAGS */
|
||||
+
|
||||
static const char *opt_loopdev, *opt_vfstype,
|
||||
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_encryption,
|
||||
*opt_speed, *opt_comment;
|
||||
|
||||
@@ -265,6 +270,10 @@ parse_opt(const char *opt, int *mask, ch
|
||||
@@ -269,6 +274,10 @@ parse_opt(const char *opt, int *mask, ch
|
||||
|
||||
for (om = opt_map; om->opt != NULL; om++)
|
||||
if (streq (opt, om->opt)) {
|
||||
@ -58,7 +58,7 @@ Index: util-linux-2.12r/mount/mount.c
|
||||
if (om->inv)
|
||||
*mask &= ~om->mask;
|
||||
else
|
||||
@@ -958,9 +967,11 @@ nosigblock:
|
||||
@@ -985,9 +994,11 @@ retry_nfs:
|
||||
else if (stat (node, &statbuf))
|
||||
error (_("mount: mount point %s is a symbolic link to nowhere"),
|
||||
node);
|
||||
@ -72,10 +72,10 @@ Index: util-linux-2.12r/mount/mount.c
|
||||
errno = mnt_err;
|
||||
perror("mount");
|
||||
}
|
||||
Index: util-linux-2.12r/mount/mount_constants.h
|
||||
Index: util-linux-ng-2.12r+git20070330/mount/mount_constants.h
|
||||
===================================================================
|
||||
--- util-linux-2.12r.orig/mount/mount_constants.h
|
||||
+++ util-linux-2.12r/mount/mount_constants.h
|
||||
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_constants.h
|
||||
+++ util-linux-ng-2.12r+git20070330/mount/mount_constants.h
|
||||
@@ -57,6 +57,9 @@ if we have a stack or plain mount - moun
|
||||
#ifndef MS_VERBOSE
|
||||
#define MS_VERBOSE 0x8000 /* 32768 */
|
@ -1,8 +1,8 @@
|
||||
Index: util-linux-2.12/mount/nfs.5
|
||||
================================================================================
|
||||
--- util-linux-2.12q/mount/nfs.5
|
||||
+++ util-linux-2.12q/mount/nfs.5
|
||||
@@ -201,9 +201,13 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfs.5
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfs.5
|
||||
@@ -238,9 +238,13 @@ writing to common filesystem on the serv
|
||||
Mount the NFS filesystem using the TCP protocol instead of the
|
||||
UDP protocol. This is the default, but in case it fails (many NFS servers only
|
||||
support UDP) it will fallback and try UDP.
|
||||
@ -16,7 +16,7 @@ Index: util-linux-2.12/mount/nfs.5
|
||||
.TP 1.5i
|
||||
.I noacl
|
||||
Assume no extended access control mechanisms like POSIX ACLs are used
|
||||
@@ -217,6 +221,83 @@
|
||||
@@ -411,6 +415,83 @@ writing to common filesystem on the serv
|
||||
All of the non-value options have corresponding nooption forms.
|
||||
For example, nointr means don't allow file operations to be
|
||||
interrupted.
|
||||
@ -100,9 +100,11 @@ Index: util-linux-2.12/mount/nfs.5
|
||||
.SH FILES
|
||||
.I /etc/fstab
|
||||
.SH "SEE ALSO"
|
||||
--- util-linux-2.12q/mount/nfsmount.c
|
||||
+++ util-linux-2.12q/mount/nfsmount.c
|
||||
@@ -737,8 +737,12 @@
|
||||
Index: util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
===================================================================
|
||||
--- util-linux-ng-2.12r+2.13pre7.orig/mount/nfsmount.c
|
||||
+++ util-linux-ng-2.12r+2.13pre7/mount/nfsmount.c
|
||||
@@ -735,8 +735,12 @@ retry_udp:
|
||||
goto fail;
|
||||
}
|
||||
fsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
@ -1,11 +0,0 @@
|
||||
--- util-linux-2.12q/mount/nfsmount.c
|
||||
+++ util-linux-2.12q/mount/nfsmount.c
|
||||
@@ -489,7 +489,7 @@
|
||||
|
||||
/* Adjust options if none specified */
|
||||
if (!data.timeo)
|
||||
- data.timeo = tcp ? 70 : 7;
|
||||
+ data.timeo = tcp ? 600 : 7;
|
||||
|
||||
#ifdef NFS_MOUNT_DEBUG
|
||||
printf("rsize = %d, wsize = %d, timeo = %d, retrans = %d\n",
|
3
util-linux-ng-2.12r+git20070330.tar.bz2
Normal file
3
util-linux-ng-2.12r+git20070330.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d072434a058eb2c3545194f13dc1914efc59c52b5f4d3e6f2a509ee52452778b
|
||||
size 1518908
|
@ -1,14 +0,0 @@
|
||||
Index: util-linux-2.12/mount/mount.8
|
||||
===================================================================
|
||||
--- util-linux-2.12.orig/mount/mount.8
|
||||
+++ util-linux-2.12/mount/mount.8
|
||||
@@ -572,6 +572,9 @@ until the network has been enabled on th
|
||||
Do not update inode access times on this file system (e.g, for faster
|
||||
access on the news spool to speed up news servers).
|
||||
.TP
|
||||
+.B nodiratime
|
||||
+Do not update directory inode access times on this filesystem.
|
||||
+.TP
|
||||
.B noauto
|
||||
Can only be mounted explicitly (i.e., the
|
||||
.B \-a
|
@ -1,3 +1,46 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 10 17:25:34 CEST 2007 - mkoenig@suse.de
|
||||
|
||||
- update to version git20070330 of new forked development tree
|
||||
- removed Suse crypto patches for losetup [FATE#302001]
|
||||
- removed binaries:
|
||||
/bin/guessfstype
|
||||
/sbin/sln
|
||||
/usr/bin/setfdprm
|
||||
- removed obsolete patches:
|
||||
* guessfstype2.patch
|
||||
* loop-AES-v3.0a-util-linux-2.12p.diff
|
||||
* mount-nfs-nonreserved
|
||||
* stupid-programmer.diff
|
||||
* util-linux-nodiratime.diff
|
||||
* util-linux-2.12-multipleraw.diff
|
||||
* util-linux-2.12-enablereplaybuild.diff
|
||||
* util-linux-2.12-mount_guessfstype.diff
|
||||
* util-linux-2.12h-mtablock.diff
|
||||
* util-linux-2.12i-x86_64intel.diff
|
||||
* util-linux-2.12q-null.diff
|
||||
* util-linux-2.12r.diff
|
||||
* util-linux-2.12r-fdisk_llseek.patch
|
||||
* util-linux-2.12r-mount-doubleslashessourceprefix-cifs.diff
|
||||
* util-linux-2.12r-mount_external_prog_on_guess.patch
|
||||
* util-linux-2.12r-nonfsmountfallback.diff
|
||||
* util-linux-2.12r-pagesize.patch
|
||||
* util-linux-2.12r-partx_enable.patch
|
||||
* util-linux-2.12r-partx_gpt_warning.patch
|
||||
- add patches:
|
||||
* util-linux-2.13-misc_utils_add_man_scriptreplay.patch
|
||||
install man page for scriptreplay
|
||||
* util-linux-2.13-tests_missing_include.patch
|
||||
fix missing header in tests/mnt_test_sysinfo.c
|
||||
* util-linux-2.13-sys_utils_arch.patch
|
||||
keep /bin/arch
|
||||
* util-linux-2.13-build_gnu_source.patch
|
||||
build with _GNU_SOURCE
|
||||
* util-linux-2.13-build_fix_intel_check.patch
|
||||
detect also x86_64 as INTEL architecture
|
||||
- rename patches to identify them clearly by subsystem
|
||||
- schedutils now part of util-linux itself
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 4 12:55:40 CEST 2007 - mkoenig@suse.de
|
||||
|
||||
|
415
util-linux.spec
415
util-linux.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package util-linux (Version 2.12r)
|
||||
# spec file for package util-linux (Version 2.12r+git20070330)
|
||||
#
|
||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
@ -11,7 +11,7 @@
|
||||
# norootforbuild
|
||||
|
||||
Name: util-linux
|
||||
BuildRequires: libvolume_id-devel ncurses-devel pam-devel zlib-devel
|
||||
BuildRequires: gettext-devel libvolume_id-devel ncurses-devel pam-devel zlib-devel
|
||||
URL: http://kernel.org/pub/linux/utils/util-linux
|
||||
Provides: util rawio raw base schedutils
|
||||
Supplements: filesystem(minix)
|
||||
@ -20,15 +20,15 @@ PreReq: %install_info_prereq permissions
|
||||
License: BSD License and BSD-like, GNU General Public License (GPL)
|
||||
Group: System/Base
|
||||
Autoreqprov: on
|
||||
Version: 2.12r
|
||||
Release: 87
|
||||
Version: 2.12r+git20070330
|
||||
Release: 1
|
||||
Summary: A collection of basic system utilities
|
||||
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-%version.tar.bz2
|
||||
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/%name-ng-%version.tar.bz2
|
||||
Source2: nologin.c
|
||||
Source3: nologin.8
|
||||
Source4: raw.init
|
||||
Source5: etc.raw
|
||||
Source8: guessfstype.8
|
||||
Source6: etc_filesystems
|
||||
%define time_ver 1.7
|
||||
%define which_ver 2.13
|
||||
%define adjtimex_ver 1.20
|
||||
@ -38,9 +38,6 @@ Source11: klogconsole.tar.bz2
|
||||
Source12: which-%{which_ver}.tar.gz
|
||||
Source13: time-%{time_ver}.tar.gz
|
||||
Source15: cryptoloop.txt
|
||||
Source16: schedutils-1.4.0.tar.bz2
|
||||
Source20: README.loop-AES-v2.2d
|
||||
Source21: README.loop-AES-v2.2d.SuSE
|
||||
Source22: setctsid.c
|
||||
Source23: setctsid.8
|
||||
Source24: sm-notify-20060111.tar.bz2
|
||||
@ -50,70 +47,100 @@ Source27: renice.8
|
||||
Source28: mkzimage_cmdline.8
|
||||
Source29: mkzimage_cmdline.c
|
||||
Source30: README.largedisk
|
||||
Patch: util-linux-%version.diff
|
||||
Patch2: loop-AES-v3.0a-util-linux-2.12p.diff
|
||||
Patch3: util-linux-2.12-multipleraw.diff
|
||||
Patch7: util-linux-2.12-hostid.diff
|
||||
Patch8: util-linux-wall.dif
|
||||
Patch10: util-linux-2.12-mount_guessfstype.diff
|
||||
Patch11: guessfstype2.patch
|
||||
Patch15: util-linux-nfs.8.diff
|
||||
Patch23: util-linux-2.12h-mtablock.diff
|
||||
Patch25: util-linux-2.11u-nfs-mount_acl.diff
|
||||
Patch26: mount.8-acl.diff
|
||||
Patch27: klogconsole-quiet.patch
|
||||
Patch32: klogconsole.diff
|
||||
Patch40: time-1.7.dif
|
||||
Patch43: util-linux-2.11z-hwclock_geteuid.diff
|
||||
Patch44: adjtimex-1.20-nosyscall.diff
|
||||
Patch45: mount-nfs-nonreserved
|
||||
Patch46: util-linux-2.12-nfs-tcp.diff
|
||||
Patch51: util-linux-2.12-suse-compatibility.diff
|
||||
Patch52: util-linux-2.12-enablereplaybuild.diff
|
||||
Patch58: util-linux-2.12a-procswapscheck.diff
|
||||
Patch61: util-linux-2.12-mountfallback.patch
|
||||
Patch62: util-linux-2.12a-mountpointwithcolon.diff
|
||||
Patch64: util-linux-2.12i-x86_64intel.diff
|
||||
Patch70: util-linux-2.12h-short-passwords.diff
|
||||
Patch71: util-linux-2.12q-null.diff
|
||||
Patch72: stupid-programmer.diff
|
||||
Patch74: util-linux-nfs-timeo.diff
|
||||
Patch75: util-linux-2.12q-nfsv4.patch
|
||||
Patch76: util-linux-warn-nfsudp.diff
|
||||
Patch77: util-linux-2.12q-ionice.diff
|
||||
Patch78: util-linux-2.11q-fs_mac.diff
|
||||
Patch79: util-linux-opt-hotplug.diff
|
||||
Patch81: util-linux-2.12a-mountbylabel-dm.patch
|
||||
Patch83: util-linux-2.12q-mount--move.diff
|
||||
Patch84: util-linux-nodiratime.diff
|
||||
Patch85: util-linux-2.12q-strict-aliasing.diff
|
||||
Patch86: util-linux-2.12r-mount-by-uuid.patch
|
||||
Patch88: util-linux-2.12q-umount2-not-static.patch
|
||||
Patch90: util-linux-2.12r-nonfsmountfallback.diff
|
||||
Patch91: util-linux-2.12r-mount-mtab-update.patch
|
||||
Patch92: util-linux-2.12r-mount-doubleslashessourceprefix-cifs.diff
|
||||
Patch93: util-linux-2.12r-fdiskwrap.patch
|
||||
Patch94: util-linux-2.12r-rawfixes.patch
|
||||
Patch95: util-linux-2.12r-rpcsec-gss.patch
|
||||
Patch96: util-linux-2.12r-external-prog-on-guess.diff
|
||||
Patch97: util-linux-2.12r-sec-manpage.patch
|
||||
Patch98: util-linux-2.12r-mount.8-xfs-update.patch
|
||||
Patch99: util-linux-libvolume_id-support.patch
|
||||
Patch100: util-linux-2.12r-umount_nosysfs.patch
|
||||
Patch101: util-linux-2.12r-fdisk_llseek.patch
|
||||
Patch102: util-linux-2.12r-pagesize.patch
|
||||
Patch103: util-linux-2.12r-fdiskcyl.patch
|
||||
Patch104: util-linux-2.12r-readprofile-mapfile.patch
|
||||
Patch105: util-linux-2.12r-cal_formatting.patch
|
||||
Patch106: util-linux-2.12r-partx.patch
|
||||
Patch107: util-linux-2.12r-mkswap_fix.patch
|
||||
Patch108: util-linux-2.12r-nfs_remount_options.patch
|
||||
Patch109: util-linux-2.12r-losetup_password.patch
|
||||
Patch110: util-linux-2.12r-mkfs_open_exclusive.patch
|
||||
Patch111: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
|
||||
Patch112: util-linux-2.12r-mount_racy_loop.patch
|
||||
Patch113: util-linux-2.12r-partx_gpt_warning.patch
|
||||
Patch114: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
|
||||
##
|
||||
## util-linux
|
||||
##
|
||||
# add hostid
|
||||
Patch1: util-linux-2.12-misc_utils_hostid.patch
|
||||
# 27181 (suse12181) - wall adds newlines
|
||||
Patch2: util-linux-login_utils_wall.patch
|
||||
# 31815 (suse16815) - Fixed nfs.5 to tell nfsver defaults to 3
|
||||
Patch3: util-linux-mount_nfs.8.patch
|
||||
# 33183 (suse18183) - NFS ACCESS patch, [no]acl nfs mount option
|
||||
Patch4: util-linux-2.11u-mount_nfs_mount_acl.patch
|
||||
Patch5: util-linux-mount_mount.8-acl.patch
|
||||
# geteuid instead of getuid in hwclock to enable making hwclock suid root.
|
||||
Patch6: util-linux-2.11z-hwclock_geteuid.patch
|
||||
# 48018 (suse33018) - mount -t nfs must default to tcp in sles9
|
||||
Patch7: util-linux-2.12-mount_nfs_tcp.patch
|
||||
# 54436 (suse39436) - boot.swap "failed" activating swap on LVM
|
||||
Patch8: util-linux-2.12a-mount_procswapcheck.patch
|
||||
# 56735 (suse41735) - NFS can't mount some exports
|
||||
Patch9: util-linux-2.12-mount_mountfallback.patch
|
||||
# 57097 (suse42097) - mount doesn't allow to mount files that have colons in their path
|
||||
Patch10: util-linux-2.12a-mount_mountpointwithcolon.patch
|
||||
# 76198 - Default retransmit timeout is too small on NFS over TCP
|
||||
Patch11: util-linux-2.13-mount_nfs_timeo.patch
|
||||
# Basic NFSv4 support
|
||||
Patch12: util-linux-2.12-mount_base_nfsv4.patch
|
||||
# 80263 - UDP data corruption due to incorrect IP fragment reassembly
|
||||
Patch13: util-linux-mount_warn_nfsudp.patch
|
||||
# add ionice
|
||||
Patch14: util-linux-2.12q-sys_utils_ionice.patch
|
||||
# 104081 - make fdisk detect MAC-fs
|
||||
Patch15: util-linux-2.11q-fdisk_fs_mac.patch
|
||||
# 104405 - mount -a doesn't work with hotpluggable devices
|
||||
Patch16: util-linux-mount_opt_hotplug.patch
|
||||
Patch17: util-linux-2.12a-mount_mountbylabel-dm.patch
|
||||
# 115129 - mount --move doesn't work as expected
|
||||
Patch18: util-linux-2.12q-mount_--move.patch
|
||||
Patch19: util-linux-2.12q-mount_strict_aliasing.patch
|
||||
Patch20: util-linux-2.12r-mount_by_uuid.patch
|
||||
Patch21: util-linux-2.12q-mount_umount2_not_static.patch
|
||||
# 148409 - df, mount, /proc/mounts show root mounted twice
|
||||
# TODO: Needs fix, because of 231599
|
||||
Patch22: util-linux-2.12r-mount_mtab_update.patch
|
||||
# 153657 - fdisk is not able to manage huge disks
|
||||
Patch23: util-linux-2.12r-fdisk_fdiskwrap.patch
|
||||
# 158401 - cthon06: NFSv3 client does not support RPCSEC_GSS
|
||||
Patch24: util-linux-2.12r-mount_rpcsec_gss.patch
|
||||
# 176582 - If the user doesn't specify -t <fstype> mount.fstype will never be called
|
||||
#TODO: check alternative upstream fix
|
||||
#Patch96: util-linux-2.12r-mount_external_prog_on_guess.patch
|
||||
# 159368 - NFSv4: krb5p; nfs(5) manpage
|
||||
Patch25: util-linux-2.12r-mount_sec_manpage.patch
|
||||
# 158955 - document xfs dmapi mount options better
|
||||
Patch26: util-linux-2.12r-mount_mount.8_xfs_update.patch
|
||||
# use libvolume_id for fs guessing
|
||||
Patch27: util-linux-mount_libvolume_id_support.patch
|
||||
# 190385 - Added sysfs to list of filesystems not to unmount with umount -a
|
||||
Patch28: util-linux-2.12r-mount_umount_nosysfs.patch
|
||||
# 160822 - fix for 153657
|
||||
Patch29: util-linux-2.12r-fdisk_cyl.patch
|
||||
# 179122 - Fix readprofile one ppc64
|
||||
Patch30: util-linux-2.12r-sys_utils_readprofile_mapfile.patch
|
||||
# 203469
|
||||
Patch31: util-linux-2.12r-misc_utils_cal_formatting.patch
|
||||
# 205956 - default swap to V1 in any case
|
||||
Patch32: util-linux-2.12r-disk_utils_mkswap_fix.patch
|
||||
# 130625 - do not append addr option with each nfs remount
|
||||
Patch33: util-linux-2.12r-mount_nfs_remount_options.patch
|
||||
# 238687 - let mkfs tools open block devices with O_EXCL
|
||||
Patch34: util-linux-2.12r-disk_utils_mkfs_open_exclusive.patch
|
||||
# 241372 - remove legacy warnings from fdisk
|
||||
Patch35: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
|
||||
# 242750 - mount: fix race condition when using -o loop
|
||||
Patch36: util-linux-2.12r-mount_racy_loop.patch
|
||||
Patch37: util-linux-2.13-misc_utils_add_man_scriptreplay.patch
|
||||
# 254437 - swapon should automatically reset the suspend signature
|
||||
Patch38: util-linux-2.12r-mount_swapon_swsuspend_resume.patch
|
||||
Patch39: util-linux-2.13-tests_missing_include.patch
|
||||
Patch40: util-linux-2.13-sys_utils_arch.patch
|
||||
Patch41: util-linux-2.13-build_gnu_source.patch
|
||||
Patch42: util-linux-2.13-build_fix_intel_check.patch
|
||||
##
|
||||
## adjtimex
|
||||
##
|
||||
Patch50: adjtimex-1.20-nosyscall.diff
|
||||
##
|
||||
## klogconsole
|
||||
##
|
||||
Patch55: klogconsole-quiet.patch
|
||||
Patch56: klogconsole.diff
|
||||
##
|
||||
## time
|
||||
##
|
||||
Patch60: time-1.7.dif
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
PreReq: %insserv_prereq %fillup_prereq /bin/sed
|
||||
|
||||
@ -129,78 +156,62 @@ Authors:
|
||||
Adrian Bunk <bunk at stusta dot de>
|
||||
|
||||
%prep
|
||||
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -b 16 -b 24
|
||||
%patch -p1
|
||||
%setup -q -a 9 -b 10 -b 11 -b 12 -b 13 -b 24 -n %name-ng-%version
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p0
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p0
|
||||
%patch6
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch43
|
||||
cd adjtimex-*
|
||||
%patch44 -p1
|
||||
cd -
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21
|
||||
%patch22
|
||||
%patch23 -p1
|
||||
%patch24
|
||||
%patch25 -p1
|
||||
%patch26 -p0
|
||||
%patch46 -p1
|
||||
%patch51 -p1
|
||||
%patch52 -p0
|
||||
%patch58 -p1
|
||||
%patch61 -p1
|
||||
%patch62 -p1
|
||||
%patch64 -p1
|
||||
%patch70 -p1
|
||||
%patch71 -p1
|
||||
%patch72
|
||||
%patch74 -p1
|
||||
%patch75 -p1
|
||||
%patch76 -p1
|
||||
%patch77 -p1
|
||||
%patch78 -p1
|
||||
%patch79 -p1
|
||||
%patch81 -p1
|
||||
%patch83
|
||||
%patch84 -p1
|
||||
%patch85 -p1
|
||||
%patch86 -p1
|
||||
%patch88
|
||||
%patch90 -p1
|
||||
%patch91
|
||||
%patch92 -p1
|
||||
%patch93 -p1
|
||||
%patch94 -p1
|
||||
%patch95
|
||||
%patch96 -p1
|
||||
%patch97 -p1
|
||||
%patch98
|
||||
%patch99 -p0
|
||||
%patch100
|
||||
%patch101
|
||||
%patch102
|
||||
%patch103 -p1
|
||||
%patch104 -p1
|
||||
%patch105
|
||||
%patch106 -p1
|
||||
%patch107 -p1
|
||||
%patch108 -p1
|
||||
%patch109 -p1
|
||||
%patch110 -p1
|
||||
%patch111 -p1
|
||||
%patch112 -p1
|
||||
%patch113 -p1
|
||||
%patch114 -p1
|
||||
%patch26
|
||||
%patch27 -p1
|
||||
%patch28
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
%patch31
|
||||
%patch32 -p1
|
||||
%patch33 -p1
|
||||
%patch34 -p1
|
||||
%patch35 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch38 -p1
|
||||
%patch39 -p1
|
||||
%patch40 -p1
|
||||
%patch41 -p1
|
||||
%patch42 -p1
|
||||
#
|
||||
cd adjtimex-*
|
||||
%patch50 -p1
|
||||
cd -
|
||||
# setctsid
|
||||
cp %{S:22} %{S:23} .
|
||||
# nologin and guessfstype
|
||||
cp %{S:2} %{S:3} %{S:8} %{S:15} %{S:20} %{S:21} %{S:26} %{S:30} .
|
||||
# nologin
|
||||
cp %{S:2} %{S:3} %{S:15} %{S:26} %{S:30} .
|
||||
cd ../klogconsole
|
||||
%patch27 -p1 -b .quiet
|
||||
%patch32 -p1
|
||||
%patch55 -p1 -b .quiet
|
||||
%patch56 -p1
|
||||
cd ../time-*
|
||||
%patch40
|
||||
%patch60
|
||||
|
||||
%build
|
||||
# adjtimex build
|
||||
@ -241,20 +252,30 @@ cd ..
|
||||
cd sm-notify*
|
||||
make CFLAGS="$RPM_OPT_FLAGS"
|
||||
cd ..
|
||||
# schedutils build
|
||||
cd schedutils-*
|
||||
make CFLAGS="$RPM_OPT_FLAGS"
|
||||
popd
|
||||
# setctsid build
|
||||
rm -f setctsid
|
||||
make setctsid OPT="$RPM_OPT_FLAGS"
|
||||
make setctsid CFLAGS="$RPM_OPT_FLAGS"
|
||||
#
|
||||
# util-linux itself
|
||||
#
|
||||
%ifarch s390 s390x
|
||||
export CFLAGS=-DCONFIG_SMP
|
||||
CFLAGS=-DCONFIG_SMP
|
||||
%endif
|
||||
export CFLAGS
|
||||
./configure
|
||||
make OPT="$RPM_OPT_FLAGS"
|
||||
#autoreconf -fi
|
||||
./autogen.sh
|
||||
./configure --mandir=%{_mandir} \
|
||||
--datadir=%{_datadir} \
|
||||
--enable-elvtune \
|
||||
--enable-mesg \
|
||||
--enable-partx \
|
||||
--enable-raw \
|
||||
--enable-rdev \
|
||||
--enable-script \
|
||||
--enable-write \
|
||||
--disable-use-tty-group \
|
||||
CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
||||
make
|
||||
gcc $RPM_OPT_FLAGS -o nologin nologin.c
|
||||
gcc $RPM_OPT_FLAGS -o mkzimage_cmdline %{S:29}
|
||||
|
||||
@ -304,27 +325,19 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/nfs/sm.bak
|
||||
chmod 700 $RPM_BUILD_ROOT/var/lib/nfs/sm.bak
|
||||
touch $RPM_BUILD_ROOT/var/lib/nfs/state
|
||||
chmod 644 $RPM_BUILD_ROOT/var/lib/nfs/state
|
||||
cd ..
|
||||
# schedutils install
|
||||
cd schedutils-*
|
||||
make PREFIX=$RPM_BUILD_ROOT/usr \
|
||||
DOCDIR=$RPM_BUILD_ROOT%_docdir/schedutils \
|
||||
MANDIR=$RPM_BUILD_ROOT%_mandir install installdoc
|
||||
popd
|
||||
#
|
||||
# util-linux install
|
||||
#
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
mv $RPM_BUILD_ROOT/usr/bin/logger $RPM_BUILD_ROOT/bin/logger
|
||||
install -m 644 mount/filesystems $RPM_BUILD_ROOT/etc/filesystems
|
||||
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/filesystems
|
||||
install -m 755 nologin $RPM_BUILD_ROOT/sbin
|
||||
%ifnarch ppc ppc64
|
||||
install -m 755 mkzimage_cmdline $RPM_BUILD_ROOT/usr/bin
|
||||
install -m 644 %{S:28} $RPM_BUILD_ROOT%{_mandir}/man8
|
||||
%endif
|
||||
install -m 755 mount/guessfstype $RPM_BUILD_ROOT/bin
|
||||
install -m 644 nologin.8 $RPM_BUILD_ROOT%{_mandir}/man8
|
||||
install -m 755 disk-utils/raw $RPM_BUILD_ROOT/usr/sbin
|
||||
install -m 644 disk-utils/raw.8 $RPM_BUILD_ROOT%{_mandir}/man8
|
||||
install -m 644 guessfstype.8 $RPM_BUILD_ROOT%{_mandir}/man8
|
||||
# setctsid install
|
||||
install -m 755 setctsid $RPM_BUILD_ROOT/usr/sbin
|
||||
install -m 444 setctsid.8 $RPM_BUILD_ROOT%{_mandir}/man8/
|
||||
@ -336,15 +349,9 @@ install -m 644 $RPM_SOURCE_DIR/etc.raw $RPM_BUILD_ROOT/etc/raw
|
||||
install -m 755 $RPM_SOURCE_DIR/raw.init $RPM_BUILD_ROOT/etc/init.d/raw
|
||||
ln -sf ../../etc/init.d/raw $RPM_BUILD_ROOT/usr/sbin/rcraw
|
||||
# Stupid hack so we don't have a tcsh dependency
|
||||
chmod 644 $RPM_BUILD_ROOT/usr/share/misc/getopt/*
|
||||
#chmod 644 $RPM_BUILD_ROOT/usr/share/misc/getopt/*
|
||||
# Following files we don't want to package, so remove them
|
||||
rm -f $RPM_BUILD_ROOT/bin/kill
|
||||
rm -f $RPM_BUILD_ROOT/sbin/guessfstype # in /bin
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/last
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/raw
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/pg
|
||||
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/kill.1*
|
||||
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/last.1*
|
||||
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/pg.1*
|
||||
%ifarch s390 s390x
|
||||
rm -f $RPM_BUILD_ROOT/etc/fdprm
|
||||
@ -352,26 +359,14 @@ rm -f $RPM_BUILD_ROOT/usr/bin/cytune
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/fdformat
|
||||
rm -f $RPM_BUILD_ROOT/sbin/hwclock
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/klogconsole
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/setfdprm
|
||||
rm -f $RPM_BUILD_ROOT/usr/bin/setterm
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/tunelp
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cytune.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/fdformat.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/hwclock.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/klogconsole.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/setfdprm.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/tunelp.8*
|
||||
%endif
|
||||
%ifnarch %ix86 x86_64
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/ramsize
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/rdev
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/rootflags
|
||||
rm -f $RPM_BUILD_ROOT/usr/sbin/vidmode
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/ramsize.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/rdev.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/rootflags.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/vidmode.8*
|
||||
%endif
|
||||
%ifarch ia64 sparc
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cfdisk.8*
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/sfdisk.8*
|
||||
@ -413,17 +408,16 @@ fi
|
||||
%files
|
||||
# Common files for all archs
|
||||
%defattr(-,root,root)
|
||||
%doc HISTORY INSTALL
|
||||
%doc INSTALL
|
||||
%doc login-utils/README.getty
|
||||
%doc login-utils/README.modems-with-agetty
|
||||
%doc login-utils/README.poeigl
|
||||
%doc misc-utils/README.cal
|
||||
%doc misc-utils/README.namei
|
||||
%doc misc-utils/README1.namei
|
||||
%doc misc-utils/README.namei2
|
||||
%doc mount/README.mount
|
||||
%doc hwclock/README.hwclock
|
||||
%doc text-utils/README.col
|
||||
%doc README.loop-AES-v2.2d README.loop-AES-v2.2d.SuSE
|
||||
%doc README.largedisk
|
||||
%config %attr(744,root,root) /etc/init.d/raw
|
||||
%attr(755,root,root) /etc/init.d/nfsboot
|
||||
@ -431,7 +425,6 @@ fi
|
||||
/usr/sbin/rcraw
|
||||
/bin/arch
|
||||
/bin/dmesg
|
||||
/bin/guessfstype
|
||||
/bin/more
|
||||
/bin/mount
|
||||
/bin/umount
|
||||
@ -449,9 +442,8 @@ fi
|
||||
/sbin/mkfs.cramfs
|
||||
/sbin/mkswap
|
||||
/sbin/nologin
|
||||
/sbin/partx
|
||||
/sbin/pivot_root
|
||||
/sbin/sln
|
||||
/sbin/raw
|
||||
/sbin/sm-notify
|
||||
/sbin/swapoff
|
||||
/sbin/swapon
|
||||
@ -491,18 +483,19 @@ fi
|
||||
/usr/bin/taskset
|
||||
/usr/bin/time
|
||||
/usr/bin/which
|
||||
/usr/sbin/addpart
|
||||
/usr/sbin/delpart
|
||||
/usr/sbin/freeramdisk
|
||||
/usr/sbin/partx
|
||||
/usr/sbin/setctsid
|
||||
%verify(not mode) %attr(0755,root,tty) /usr/bin/wall
|
||||
/usr/bin/whereis
|
||||
/usr/sbin/adjtimex
|
||||
%verify(not mode) %attr(0755,root,tty) /usr/bin/write
|
||||
%dir %{_defaultdocdir}/schedutils
|
||||
%dir %{_defaultdocdir}/time
|
||||
%dir %{_defaultdocdir}/which
|
||||
/var/lib/nfs
|
||||
%ghost /var/lib/nfs/state
|
||||
%{_defaultdocdir}/schedutils/*
|
||||
%{_defaultdocdir}/time/*
|
||||
%{_defaultdocdir}/which/*
|
||||
%{_infodir}/ipc.info.gz
|
||||
@ -535,6 +528,7 @@ fi
|
||||
%{_mandir}/man1/scriptreplay.1.gz
|
||||
%{_mandir}/man1/rev.1.gz
|
||||
%{_mandir}/man1/script.1.gz
|
||||
%{_mandir}/man1/setterm.1.gz
|
||||
%{_mandir}/man1/tailf.1.gz
|
||||
%{_mandir}/man1/taskset.1.gz
|
||||
%{_mandir}/man1/ul.1.gz
|
||||
@ -544,9 +538,10 @@ fi
|
||||
%{_mandir}/man1/which.1.gz
|
||||
%{_mandir}/man5/fstab.5.gz
|
||||
%{_mandir}/man5/nfs.5.gz
|
||||
%{_mandir}/man8/addpart.8.gz
|
||||
%{_mandir}/man8/agetty.8.gz
|
||||
%{_mandir}/man8/blockdev.8.gz
|
||||
%{_mandir}/man1/setterm.1.gz
|
||||
%{_mandir}/man8/delpart.8.gz
|
||||
%{_mandir}/man8/elvtune.8*
|
||||
%{_mandir}/man8/ctrlaltdel.8.gz
|
||||
%{_mandir}/man8/adjtimex.8.gz
|
||||
@ -565,26 +560,24 @@ fi
|
||||
%ifnarch ppc ppc64
|
||||
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
||||
%endif
|
||||
%{_mandir}/man8/partx.8.gz
|
||||
%{_mandir}/man8/pivot_root.8.gz
|
||||
%{_mandir}/man8/raw.8.gz
|
||||
%{_mandir}/man8/renice.8.gz
|
||||
%{_mandir}/man8/setsid.8.gz
|
||||
%{_mandir}/man8/sln.8.gz
|
||||
%{_mandir}/man8/sm-notify.8.gz
|
||||
%{_mandir}/man8/swapoff.8.gz
|
||||
%{_mandir}/man8/swapon.8.gz
|
||||
%{_mandir}/man8/umount.8.gz
|
||||
%{_mandir}/man8/guessfstype.8.gz
|
||||
%{_mandir}/man8/setctsid.8.gz
|
||||
/usr/sbin/raw
|
||||
/usr/sbin/flushb
|
||||
/usr/sbin/readprofile
|
||||
%dir /usr/share/misc/getopt
|
||||
%attr (755,root,root) /usr/share/misc/getopt/getopt-parse.bash
|
||||
%attr (755,root,root) /usr/share/misc/getopt/getopt-parse.tcsh
|
||||
%attr (755,root,root) /usr/share/misc/getopt/getopt-test.bash
|
||||
%attr (755,root,root) /usr/share/misc/getopt/getopt-test.tcsh
|
||||
/usr/share/locale/*/LC_MESSAGES/util-linux.mo
|
||||
%dir /usr/share/getopt
|
||||
%attr (755,root,root) /usr/share/getopt/getopt-parse.bash
|
||||
%attr (755,root,root) /usr/share/getopt/getopt-parse.tcsh
|
||||
%attr (755,root,root) /usr/share/getopt/getopt-test.bash
|
||||
%attr (755,root,root) /usr/share/getopt/getopt-test.tcsh
|
||||
/usr/share/locale/*/LC_MESSAGES/util-linux-ng.mo
|
||||
%ifnarch ia64
|
||||
%doc fdisk/README.fdisk
|
||||
/sbin/fdisk
|
||||
@ -608,23 +601,61 @@ fi
|
||||
%{_mandir}/man8/vidmode.8.gz
|
||||
%endif
|
||||
%ifnarch s390 s390x
|
||||
%config(noreplace) /etc/fdprm
|
||||
#%config(noreplace) /etc/fdprm
|
||||
/usr/bin/cytune
|
||||
/usr/bin/fdformat
|
||||
/sbin/hwclock
|
||||
/usr/sbin/klogconsole
|
||||
/usr/bin/setfdprm
|
||||
/usr/bin/setterm
|
||||
/usr/sbin/tunelp
|
||||
%{_mandir}/man8/cytune.8.gz
|
||||
%{_mandir}/man8/fdformat.8.gz
|
||||
%{_mandir}/man8/hwclock.8.gz
|
||||
%{_mandir}/man8/klogconsole.8.gz
|
||||
%{_mandir}/man8/setfdprm.8.gz
|
||||
%{_mandir}/man8/tunelp.8.gz
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Apr 10 2007 - mkoenig@suse.de
|
||||
- update to version git20070330 of new forked development tree
|
||||
- removed Suse crypto patches for losetup [FATE#302001]
|
||||
- removed binaries:
|
||||
/bin/guessfstype
|
||||
/sbin/sln
|
||||
/usr/bin/setfdprm
|
||||
- removed obsolete patches:
|
||||
* guessfstype2.patch
|
||||
* loop-AES-v3.0a-util-linux-2.12p.diff
|
||||
* mount-nfs-nonreserved
|
||||
* stupid-programmer.diff
|
||||
* util-linux-nodiratime.diff
|
||||
* util-linux-2.12-multipleraw.diff
|
||||
* util-linux-2.12-enablereplaybuild.diff
|
||||
* util-linux-2.12-mount_guessfstype.diff
|
||||
* util-linux-2.12h-mtablock.diff
|
||||
* util-linux-2.12i-x86_64intel.diff
|
||||
* util-linux-2.12q-null.diff
|
||||
* util-linux-2.12r.diff
|
||||
* util-linux-2.12r-fdisk_llseek.patch
|
||||
* util-linux-2.12r-mount-doubleslashessourceprefix-cifs.diff
|
||||
* util-linux-2.12r-mount_external_prog_on_guess.patch
|
||||
* util-linux-2.12r-nonfsmountfallback.diff
|
||||
* util-linux-2.12r-pagesize.patch
|
||||
* util-linux-2.12r-partx_enable.patch
|
||||
* util-linux-2.12r-partx_gpt_warning.patch
|
||||
- add patches:
|
||||
* util-linux-2.13-misc_utils_add_man_scriptreplay.patch
|
||||
install man page for scriptreplay
|
||||
* util-linux-2.13-tests_missing_include.patch
|
||||
fix missing header in tests/mnt_test_sysinfo.c
|
||||
* util-linux-2.13-sys_utils_arch.patch
|
||||
keep /bin/arch
|
||||
* util-linux-2.13-build_gnu_source.patch
|
||||
build with _GNU_SOURCE
|
||||
* util-linux-2.13-build_fix_intel_check.patch
|
||||
detect also x86_64 as INTEL architecture
|
||||
- rename patches to identify them clearly by subsystem
|
||||
- schedutils now part of util-linux itself
|
||||
* Wed Apr 04 2007 - mkoenig@suse.de
|
||||
- add Supplements line [FATE#301966]
|
||||
* Mon Mar 26 2007 - rguenther@suse.de
|
||||
|
Loading…
Reference in New Issue
Block a user