3
0
forked from pool/util-linux

Accepting request 57964 from Base:System

Accepted submit request 57964 from user puzel

OBS-URL: https://build.opensuse.org/request/show/57964
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=107
This commit is contained in:
Marcus Rückert 2011-01-14 00:23:23 +00:00 committed by Git OBS Bridge
parent 169936d2c5
commit ef9ea17de6
10 changed files with 311 additions and 1073 deletions

View File

@ -38,10 +38,10 @@ Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
create mode 100644 mount/sha512.c create mode 100644 mount/sha512.c
create mode 100644 mount/sha512.h create mode 100644 mount/sha512.h
Index: util-linux-ng-2.18/mount/Makefile.am Index: util-linux-2.19-rc1/mount/Makefile.am
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/Makefile.am --- util-linux-2.19-rc1.orig/mount/Makefile.am
+++ util-linux-ng-2.18/mount/Makefile.am +++ util-linux-2.19-rc1/mount/Makefile.am
@@ -7,7 +7,7 @@ sbin_PROGRAMS = losetup swapon @@ -7,7 +7,7 @@ sbin_PROGRAMS = losetup swapon
dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8 dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
@ -51,10 +51,10 @@ Index: util-linux-ng-2.18/mount/Makefile.am
# generic header for mount and umount # generic header for mount and umount
hdrs_mount = fstab.h mount_mntent.h mount_constants.h \ hdrs_mount = fstab.h mount_mntent.h mount_constants.h \
Index: util-linux-ng-2.18/mount/lomount.c Index: util-linux-2.19-rc1/mount/lomount.c
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/lomount.c --- util-linux-2.19-rc1.orig/mount/lomount.c
+++ util-linux-ng-2.18/mount/lomount.c +++ util-linux-2.19-rc1/mount/lomount.c
@@ -23,6 +23,12 @@ @@ -23,6 +23,12 @@
#include "sundries.h" #include "sundries.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -68,7 +68,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
#ifdef LOOP_SET_FD #ifdef LOOP_SET_FD
@@ -390,12 +396,22 @@ show_loop_fd(int fd, char *device) { @@ -464,12 +470,22 @@ show_loop_fd(int fd, char *device) {
if (loopinfo64.lo_encrypt_type || if (loopinfo64.lo_encrypt_type ||
loopinfo64.lo_crypt_name[0]) { loopinfo64.lo_crypt_name[0]) {
@ -94,7 +94,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
} }
printf("\n"); printf("\n");
return 0; return 0;
@@ -644,7 +660,7 @@ xgetpass(int pfd, const char *prompt) { @@ -718,7 +734,7 @@ xgetpass(int pfd, const char *prompt) {
} }
if (pass == NULL) if (pass == NULL)
@ -103,7 +103,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
pass[i] = 0; pass[i] = 0;
return pass; return pass;
@@ -658,6 +674,24 @@ digits_only(const char *s) { @@ -732,6 +748,24 @@ digits_only(const char *s) {
return 1; return 1;
} }
@ -128,7 +128,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
/* /*
* return codes: * return codes:
* 0 - success * 0 - success
@@ -666,10 +700,11 @@ digits_only(const char *s) { @@ -740,10 +774,11 @@ digits_only(const char *s) {
*/ */
int int
set_loop(const char *device, const char *file, unsigned long long offset, set_loop(const char *device, const char *file, unsigned long long offset,
@ -142,7 +142,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
char *filename; char *filename;
if (verbose) { if (verbose) {
@@ -707,13 +742,37 @@ set_loop(const char *device, const char @@ -781,13 +816,37 @@ set_loop(const char *device, const char
filename = (char *) file; filename = (char *) file;
xstrncpy((char *)loopinfo64.lo_file_name, filename, LO_NAME_SIZE); xstrncpy((char *)loopinfo64.lo_file_name, filename, LO_NAME_SIZE);
@ -182,7 +182,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
} }
} }
@@ -734,20 +793,69 @@ set_loop(const char *device, const char @@ -808,20 +867,69 @@ set_loop(const char *device, const char
} }
#endif #endif
@ -264,9 +264,9 @@ Index: util-linux-ng-2.18/mount/lomount.c
} }
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) { if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
@@ -897,7 +1005,13 @@ usage(void) { @@ -969,7 +1077,13 @@ usage(FILE *f) {
fprintf(stderr, _("\nOptions:\n" fprintf(f, _("\nOptions:\n"
" -e | --encryption <type> enable data encryption with specified <name/num>\n" " -e | --encryption <type> enable data encryption with specified <name/num>\n"
+ " -H | --phash <type> hash password using specified algorithm (sha512/sha256/sha384/rmd160/none)\n" + " -H | --phash <type> hash password using specified algorithm (sha512/sha256/sha384/rmd160/none)\n"
" -h | --help this help\n" " -h | --help this help\n"
@ -278,7 +278,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
" -o | --offset <num> start at offset <num> into file\n" " -o | --offset <num> start at offset <num> into file\n"
" --sizelimit <num> loop limited to only <num> bytes of the file\n" " --sizelimit <num> loop limited to only <num> bytes of the file\n"
" -p | --pass-fd <num> read passphrase from file descriptor <num>\n" " -p | --pass-fd <num> read passphrase from file descriptor <num>\n"
@@ -910,11 +1024,14 @@ usage(void) { @@ -983,11 +1097,14 @@ usage(FILE *f) {
int int
main(int argc, char **argv) { main(int argc, char **argv) {
char *p, *offset, *sizelimit, *encryption, *passfd, *device, *file, *assoc; char *p, *offset, *sizelimit, *encryption, *passfd, *device, *file, *assoc;
@ -293,7 +293,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
uintmax_t off = 0, slimit = 0; uintmax_t off = 0, slimit = 0;
struct option longopts[] = { struct option longopts[] = {
{ "all", 0, 0, 'a' }, { "all", 0, 0, 'a' },
@@ -923,6 +1040,8 @@ main(int argc, char **argv) { @@ -996,6 +1113,8 @@ main(int argc, char **argv) {
{ "encryption", 1, 0, 'e' }, { "encryption", 1, 0, 'e' },
{ "find", 0, 0, 'f' }, { "find", 0, 0, 'f' },
{ "help", 0, 0, 'h' }, { "help", 0, 0, 'h' },
@ -302,7 +302,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
{ "associated", 1, 0, 'j' }, { "associated", 1, 0, 'j' },
{ "offset", 1, 0, 'o' }, { "offset", 1, 0, 'o' },
{ "sizelimit", 1, 0, 128 }, { "sizelimit", 1, 0, 128 },
@@ -939,12 +1058,13 @@ main(int argc, char **argv) { @@ -1012,12 +1131,13 @@ main(int argc, char **argv) {
capacity = delete = find = all = 0; capacity = delete = find = all = 0;
assoc = offset = sizelimit = encryption = passfd = NULL; assoc = offset = sizelimit = encryption = passfd = NULL;
@ -317,7 +317,7 @@ Index: util-linux-ng-2.18/mount/lomount.c
longopts, NULL)) != -1) { longopts, NULL)) != -1) {
switch (c) { switch (c) {
case 'a': case 'a':
@@ -969,6 +1089,12 @@ main(int argc, char **argv) { @@ -1045,6 +1165,12 @@ main(int argc, char **argv) {
case 'j': case 'j':
assoc = optarg; assoc = optarg;
break; break;
@ -330,36 +330,37 @@ Index: util-linux-ng-2.18/mount/lomount.c
case 'o': case 'o':
offset = optarg; offset = optarg;
break; break;
@@ -1058,8 +1184,11 @@ main(int argc, char **argv) { @@ -1134,8 +1260,10 @@ main(int argc, char **argv) {
else { else {
if (passfd && sscanf(passfd, "%d", &pfd) != 1) if (passfd && sscanf(passfd, "%d", &pfd) != 1)
usage(); usage(stderr);
+ if (keysize && sscanf(keysize,"%d",&keysz) != 1) + if (keysize && sscanf(keysize,"%d",&keysz) != 1)
+ usage(); + usage(stderr);
do { do {
- res = set_loop(device, file, off, slimit, encryption, pfd, &ro); - res = set_loop(device, file, off, slimit, encryption, pfd, &ro);
+ res = set_loop(device, file, off, slimit, encryption, phash, + res = set_loop(device, file, off, slimit, encryption, phash, pfd, &ro, keysz);
+ pfd, &ro, keysz);
if (res == 2 && find) { if (res == 2 && find) {
if (verbose) if (verbose)
printf(_("stolen loop=%s...trying again\n"), printf(_("stolen loop=%s...trying again\n"),
Index: util-linux-ng-2.18/mount/lomount.h Index: util-linux-2.19-rc1/mount/lomount.h
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/lomount.h --- util-linux-2.19-rc1.orig/mount/lomount.h
+++ util-linux-ng-2.18/mount/lomount.h +++ util-linux-2.19-rc1/mount/lomount.h
@@ -1,5 +1,6 @@ @@ -1,8 +1,8 @@
#ifndef UTIL_LINUX_LOMOUNT_H
#define UTIL_LINUX_LOMOUNT_H
-extern int set_loop(const char *, const char *, unsigned long long, unsigned long long, -extern int set_loop(const char *, const char *, unsigned long long, unsigned long long,
- const char *, int, int *); - const char *, int, int *);
+extern int set_loop(const char * device, const char * file, unsigned long long offset, +extern int set_loop(const char * device, const char * file, unsigned long long offset, unsigned long long,
+ unsigned long long, const char *encryption, const char *phash, + const char * encryption, const char *phash, int pfd, int *options, int keysz);
+ int pfd, int *options, int keysz);
extern int del_loop(const char *); extern int del_loop(const char *);
extern int is_loop_device(const char *); extern int is_loop_device(const char *);
extern int is_loop_autoclear(const char *device); extern int is_loop_autoclear(const char *device);
Index: util-linux-ng-2.18/mount/losetup.8 Index: util-linux-2.19-rc1/mount/losetup.8
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/losetup.8 --- util-linux-2.19-rc1.orig/mount/losetup.8
+++ util-linux-ng-2.18/mount/losetup.8 +++ util-linux-2.19-rc1/mount/losetup.8
@@ -96,9 +96,18 @@ find the first unused loop device. If a @@ -96,9 +96,18 @@ find the first unused loop device. If a
argument is present, use this device. Otherwise, print its name argument is present, use this device. Otherwise, print its name
.IP "\fB\-h, \-\-help\fP" .IP "\fB\-h, \-\-help\fP"
@ -388,11 +389,11 @@ Index: util-linux-ng-2.18/mount/losetup.8
Cryptoloop is deprecated in favor of dm-crypt. For more details see Cryptoloop is deprecated in favor of dm-crypt. For more details see
.BR cryptsetup (8). .BR cryptsetup (8).
Index: util-linux-ng-2.18/mount/mount.8 Index: util-linux-2.19-rc1/mount/mount.8
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/mount.8 --- util-linux-2.19-rc1.orig/mount/mount.8
+++ util-linux-ng-2.18/mount/mount.8 +++ util-linux-2.19-rc1/mount/mount.8
@@ -869,6 +869,15 @@ Every time the inode is modified, the i_ @@ -901,6 +901,15 @@ Every time the inode is modified, the i_
.B noiversion .B noiversion
Do not increment the i_version inode field. Do not increment the i_version inode field.
.TP .TP
@ -408,7 +409,7 @@ Index: util-linux-ng-2.18/mount/mount.8
.B mand .B mand
Allow mandatory locks on this filesystem. See Allow mandatory locks on this filesystem. See
.BR fcntl (2). .BR fcntl (2).
@@ -2582,6 +2591,10 @@ that are really options to @@ -2623,6 +2632,10 @@ that are really options to
.BR \%losetup (8). .BR \%losetup (8).
(These options can be used in addition to those specific (These options can be used in addition to those specific
to the filesystem type.) to the filesystem type.)
@ -419,11 +420,11 @@ Index: util-linux-ng-2.18/mount/mount.8
Since Linux 2.6.25 is supported auto-destruction of loop devices and Since Linux 2.6.25 is supported auto-destruction of loop devices and
then any loop device allocated by then any loop device allocated by
Index: util-linux-ng-2.18/mount/mount.c Index: util-linux-2.19-rc1/mount/mount.c
=================================================================== ===================================================================
--- util-linux-ng-2.18.orig/mount/mount.c --- util-linux-2.19-rc1.orig/mount/mount.c
+++ util-linux-ng-2.18/mount/mount.c +++ util-linux-2.19-rc1/mount/mount.c
@@ -96,6 +96,9 @@ struct mountargs { @@ -105,6 +105,9 @@ struct mountargs {
void *data; void *data;
}; };
@ -433,7 +434,7 @@ Index: util-linux-ng-2.18/mount/mount.c
/* Map from -o and fstab option strings to the flag argument to mount(2). */ /* Map from -o and fstab option strings to the flag argument to mount(2). */
struct opt_map { struct opt_map {
const char *opt; /* option name */ const char *opt; /* option name */
@@ -201,6 +204,7 @@ static int opt_nofail = 0; @@ -210,6 +213,7 @@ static int opt_nofail = 0;
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit, static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit,
*opt_encryption, *opt_speed, *opt_comment, *opt_uhelper; *opt_encryption, *opt_speed, *opt_comment, *opt_uhelper;
@ -441,7 +442,7 @@ Index: util-linux-ng-2.18/mount/mount.c
static int is_readonly(const char *node); static int is_readonly(const char *node);
static int mounted (const char *spec0, const char *node0); static int mounted (const char *spec0, const char *node0);
@@ -217,6 +221,8 @@ static struct string_opt_map { @@ -226,6 +230,8 @@ static struct string_opt_map {
{ "offset=", 0, &opt_offset }, { "offset=", 0, &opt_offset },
{ "sizelimit=", 0, &opt_sizelimit }, { "sizelimit=", 0, &opt_sizelimit },
{ "encryption=", 0, &opt_encryption }, { "encryption=", 0, &opt_encryption },
@ -450,7 +451,7 @@ Index: util-linux-ng-2.18/mount/mount.c
{ "speed=", 0, &opt_speed }, { "speed=", 0, &opt_speed },
{ "comment=", 1, &opt_comment }, { "comment=", 1, &opt_comment },
{ "uhelper=", 0, &opt_uhelper }, { "uhelper=", 0, &opt_uhelper },
@@ -1116,7 +1122,8 @@ loop_check(const char **spec, const char @@ -1208,7 +1214,8 @@ loop_check(const char **spec, const char
*type = opt_vfstype; *type = opt_vfstype;
} }
@ -460,7 +461,7 @@ Index: util-linux-ng-2.18/mount/mount.c
*loopfile = *spec; *loopfile = *spec;
/* Automatically create a loop device from a regular file if a filesystem /* Automatically create a loop device from a regular file if a filesystem
@@ -1170,7 +1177,7 @@ loop_check(const char **spec, const char @@ -1273,7 +1280,7 @@ loop_check(const char **spec, const char
printf(_("mount: going to use the loop device %s\n"), *loopdev); printf(_("mount: going to use the loop device %s\n"), *loopdev);
if ((res = set_loop(*loopdev, *loopfile, offset, sizelimit, if ((res = set_loop(*loopdev, *loopfile, offset, sizelimit,
@ -469,7 +470,7 @@ Index: util-linux-ng-2.18/mount/mount.c
if (res == 2) { if (res == 2) {
/* loop dev has been grabbed by some other process, /* loop dev has been grabbed by some other process,
try again, if not given explicitly */ try again, if not given explicitly */
@@ -1981,6 +1988,7 @@ static struct option longopts[] = { @@ -2209,6 +2216,7 @@ static struct option longopts[] = {
{ "options", 1, 0, 'o' }, { "options", 1, 0, 'o' },
{ "test-opts", 1, 0, 'O' }, { "test-opts", 1, 0, 'O' },
{ "pass-fd", 1, 0, 'p' }, { "pass-fd", 1, 0, 'p' },
@ -477,7 +478,7 @@ Index: util-linux-ng-2.18/mount/mount.c
{ "types", 1, 0, 't' }, { "types", 1, 0, 't' },
{ "bind", 0, 0, 'B' }, { "bind", 0, 0, 'B' },
{ "move", 0, 0, 'M' }, { "move", 0, 0, 'M' },
@@ -2143,6 +2151,7 @@ main(int argc, char *argv[]) { @@ -2372,6 +2380,7 @@ main(int argc, char *argv[]) {
char *options = NULL, *test_opts = NULL, *node; char *options = NULL, *test_opts = NULL, *node;
const char *spec = NULL; const char *spec = NULL;
char *label = NULL; char *label = NULL;
@ -485,7 +486,7 @@ Index: util-linux-ng-2.18/mount/mount.c
char *uuid = NULL; char *uuid = NULL;
char *types = NULL; char *types = NULL;
char *p; char *p;
@@ -2173,7 +2182,7 @@ main(int argc, char *argv[]) { @@ -2402,7 +2411,7 @@ main(int argc, char *argv[]) {
initproctitle(argc, argv); initproctitle(argc, argv);
#endif #endif
@ -494,7 +495,7 @@ Index: util-linux-ng-2.18/mount/mount.c
longopts, NULL)) != -1) { longopts, NULL)) != -1) {
switch (c) { switch (c) {
case 'a': /* mount everything in fstab */ case 'a': /* mount everything in fstab */
@@ -2194,6 +2203,9 @@ main(int argc, char *argv[]) { @@ -2423,6 +2432,9 @@ main(int argc, char *argv[]) {
case 'i': case 'i':
external_allowed = 0; external_allowed = 0;
break; break;
@ -504,7 +505,7 @@ Index: util-linux-ng-2.18/mount/mount.c
case 'l': case 'l':
list_with_volumelabel = 1; list_with_volumelabel = 1;
break; break;
@@ -2341,6 +2353,9 @@ main(int argc, char *argv[]) { @@ -2573,6 +2585,9 @@ main(int argc, char *argv[]) {
atexit(unlock_mtab); atexit(unlock_mtab);
@ -514,10 +515,10 @@ Index: util-linux-ng-2.18/mount/mount.c
switch (argc+specseen) { switch (argc+specseen) {
case 0: case 0:
/* mount -a */ /* mount -a */
Index: util-linux-ng-2.18/mount/rmd160.c Index: util-linux-2.19-rc1/mount/rmd160.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ util-linux-ng-2.18/mount/rmd160.c +++ util-linux-2.19-rc1/mount/rmd160.c
@@ -0,0 +1,532 @@ @@ -0,0 +1,532 @@
+/* rmd160.c - RIPE-MD160 +/* rmd160.c - RIPE-MD160
+ * Copyright (C) 1998 Free Software Foundation, Inc. + * Copyright (C) 1998 Free Software Foundation, Inc.
@ -1051,10 +1052,10 @@ Index: util-linux-ng-2.18/mount/rmd160.c
+ rmd160_final( &hd ); + rmd160_final( &hd );
+ memcpy( outbuf, hd.buf, 20 ); + memcpy( outbuf, hd.buf, 20 );
+} +}
Index: util-linux-ng-2.18/mount/rmd160.h Index: util-linux-2.19-rc1/mount/rmd160.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ util-linux-ng-2.18/mount/rmd160.h +++ util-linux-2.19-rc1/mount/rmd160.h
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
+#ifndef RMD160_H +#ifndef RMD160_H
+#define RMD160_H +#define RMD160_H
@ -1067,10 +1068,10 @@ Index: util-linux-ng-2.18/mount/rmd160.h
+#endif /*RMD160_H*/ +#endif /*RMD160_H*/
+ +
+ +
Index: util-linux-ng-2.18/mount/sha512.c Index: util-linux-2.19-rc1/mount/sha512.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ util-linux-ng-2.18/mount/sha512.c +++ util-linux-2.19-rc1/mount/sha512.c
@@ -0,0 +1,432 @@ @@ -0,0 +1,432 @@
+/* +/*
+ * sha512.c + * sha512.c
@ -1504,10 +1505,10 @@ Index: util-linux-ng-2.18/mount/sha512.c
+ memset(&ctx, 0, sizeof(ctx)); + memset(&ctx, 0, sizeof(ctx));
+} +}
+#endif +#endif
Index: util-linux-ng-2.18/mount/sha512.h Index: util-linux-2.19-rc1/mount/sha512.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ util-linux-ng-2.18/mount/sha512.h +++ util-linux-2.19-rc1/mount/sha512.h
@@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
+/* +/*
+ * sha512.h + * sha512.h

View File

@ -1,24 +0,0 @@
commit 1cf4c20b198c0c6566198fd00b983d9aaf8321bc
Author: Miklos Szeredi <miklos@szeredi.hu>
Date: Thu Oct 7 16:05:12 2010 +0200
mount: don't canonicalize "spec" with --no-canonicalize option
"Spec" was still canonicalized despite --no-canonicalize. This
resulted in a hang during login with pam_encfs (Debian Bug#593336).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
diff --git a/mount/devname.c b/mount/devname.c
index 585d259..05da092 100644
--- a/mount/devname.c
+++ b/mount/devname.c
@@ -8,7 +8,7 @@ spec_to_devname(const char *spec)
{
if (!spec)
return NULL;
- if (is_pseudo_fs(spec))
+ if (nocanonicalize || is_pseudo_fs(spec))
return xstrdup(spec);
return fsprobe_get_devname_by_spec(spec);
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:583c122245f301b8cdd27e37a7a1fc774fcf1a73c3d633d9eac0c165e9b573d6
size 4266321

View File

@ -1,188 +0,0 @@
git diff v2.18..HEAD login-utils/agetty.c login-utils/agetty.8
agetty: fix -s option (baud rate setup)
agetty: add -c to reuse cflags
agetty: add -s to reuse existing baud rate
diff --git a/login-utils/agetty.8 b/login-utils/agetty.8
index 8761374..084086f 100644
--- a/login-utils/agetty.8
+++ b/login-utils/agetty.8
@@ -3,7 +3,7 @@
agetty \- alternative Linux getty
.SH SYNOPSIS
-.BR "agetty " [\-8ihLmnUw]
+.BR "agetty " [\-c8ihLmnsUw]
.RI "[-f " issue_file ]
.RI "[-l " login_program ]
.RI "[-I " init ]
@@ -12,16 +12,6 @@ agetty \- alternative Linux getty
.I port
.I baud_rate,...
.RI [ term ]
-.br
-.BR "agetty " [\-8ihLmnw]
-.RI "[-f " issue_file ]
-.RI "[-l " login_program ]
-.RI "[-I " init ]
-.RI "[-t " timeout ]
-.RI "[-H " login_host ]
-.I baud_rate,...
-.I port
-.RI [ term ]
.SH DESCRIPTION
.ad
@@ -92,6 +82,10 @@ whatever init(8) may have set, and is inherited by login and the shell.
.fi
.ad
.TP
+\-c
+Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
+details.
+.TP
\-8
Assume that the tty is 8-bit clean, hence disable parity detection.
.TP
@@ -163,6 +157,10 @@ Force the line to be a local line with no need for carrier detect. This can
be useful when you have a locally attached terminal where the serial line
does not set the carrier detect signal.
.TP
+\-s
+Try to keep the existing baud rate. The baud rates from
+the command line are used when agetty receives a BREAK character.
+.TP
\-U
Turn on support for detecting an uppercase only terminal. This setting will
detect a login name containing only capitals as indicating an uppercase
diff --git a/login-utils/agetty.c b/login-utils/agetty.c
index 39a1fd3..9d463ce 100644
--- a/login-utils/agetty.c
+++ b/login-utils/agetty.c
@@ -133,6 +133,8 @@ struct options {
#define F_CUSTISSUE (1<<6) /* give alternative issue file */
#define F_NOPROMPT (1<<7) /* don't ask for login name! */
#define F_LCUC (1<<8) /* Support for *LCUC stty modes */
+#define F_KEEPSPEED (1<<9) /* Follow baud rate from kernel */
+#define F_KEEPCFLAGS (1<<10) /* Reuse c_cflags setup from kernel */
/* Storage for things detected while the login name was read. */
@@ -203,7 +205,7 @@ void parse_args P_((int argc, char **argv, struct options *op));
void parse_speeds P_((struct options *op, char *arg));
void update_utmp P_((char *line));
void open_tty P_((char *tty, struct termios *tp, int local));
-void termio_init P_((struct termios *tp, int speed, struct options *op));
+void termio_init P_((struct termios *tp, struct options *op));
void auto_baud P_((struct termios *tp));
void do_prompt P_((struct options *op, struct termios *tp));
void next_speed P_((struct termios *tp, struct options *op));
@@ -297,7 +299,7 @@ main(argc, argv)
tcsetpgrp(0, getpid());
/* Initialize the termios settings (raw mode, eight-bit, blocking i/o). */
debug("calling termio_init\n");
- termio_init(&termios, options.speeds[FIRST_SPEED], &options);
+ termio_init(&termios, &options);
/* write the modem init string and DON'T flush the buffers */
if (options.flags & F_INITSTRING) {
@@ -373,8 +375,11 @@ parse_args(argc, argv, op)
extern int optind; /* getopt */
int c;
- while (isascii(c = getopt(argc, argv, "8I:LH:f:hil:mt:wUn"))) {
+ while (isascii(c = getopt(argc, argv, "8cI:LH:f:hil:mst:wUn"))) {
switch (c) {
+ case 'c':
+ op->flags |= F_KEEPCFLAGS;
+ break;
case '8':
op->eightbits = 1;
break;
@@ -443,6 +448,9 @@ parse_args(argc, argv, op)
case 'n':
op->flags |= F_NOPROMPT;
break;
+ case 's':
+ op->flags |= F_KEEPSPEED; /* keep kernel defined speed */
+ break;
case 't': /* time out */
if ((op->timeout = atoi(optarg)) <= 0)
error(_("bad timeout value: %s"), optarg);
@@ -691,11 +699,17 @@ char gbuf[1024];
char area[1024];
void
-termio_init(tp, speed, op)
+termio_init(tp, op)
struct termios *tp;
- int speed;
struct options *op;
{
+ speed_t ispeed, ospeed;
+
+ if (op->flags & F_KEEPSPEED) {
+ ispeed = cfgetispeed(tp); /* save the original setting */
+ ospeed = cfgetospeed(tp);
+ } else
+ ospeed = ispeed = op->speeds[FIRST_SPEED];
/*
* Initial termios settings: 8-bit characters, raw-mode, blocking i/o.
@@ -706,14 +720,21 @@ termio_init(tp, speed, op)
/* flush input and output queues, important for modems! */
(void) tcflush(0, TCIOFLUSH);
- tp->c_cflag = CS8 | HUPCL | CREAD;
- cfsetispeed(tp, speed);
- cfsetospeed(tp, speed);
+ tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
+
+ if (!(op->flags & F_KEEPCFLAGS))
+ tp->c_cflag = CS8 | HUPCL | CREAD | (tp->c_cflag & CLOCAL);
+
+ /* Note that the speed is stored in the c_cflag termios field, so we have
+ * set the speed always when the cflag se reseted.
+ */
+ cfsetispeed(tp, ispeed);
+ cfsetospeed(tp, ospeed);
+
if (op->flags & F_LOCAL) {
tp->c_cflag |= CLOCAL;
}
- tp->c_iflag = tp->c_lflag = tp->c_oflag = 0;
#ifdef HAVE_STRUCT_TERMIOS_C_LINE
tp->c_line = 0;
#endif
@@ -973,9 +994,18 @@ next_speed(tp, op)
struct termios *tp;
struct options *op;
{
- static int baud_index = FIRST_SPEED;/* current speed index */
+ static int baud_index = -1;
+
+ if (baud_index == -1)
+ /*
+ * if the F_KEEPSPEED flags is set then the FIRST_SPEED is not
+ * tested yet (see termio_init()).
+ */
+ baud_index = (op->flags & F_KEEPSPEED) ? FIRST_SPEED :
+ 1 % op->numspeed;
+ else
+ baud_index = (baud_index + 1) % op->numspeed;
- baud_index = (baud_index + 1) % op->numspeed;
cfsetispeed(tp, op->speeds[baud_index]);
cfsetospeed(tp, op->speeds[baud_index]);
(void) tcsetattr(0, TCSANOW, tp);
@@ -1203,7 +1233,7 @@ bcode(s)
void
usage()
{
- fprintf(stderr, _("Usage: %s [-8hiLmUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
+ fprintf(stderr, _("Usage: %s [-8hiLmsUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate,... line [termtype]\nor\t[-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate,... [termtype]\n"), progname);
exit(1);
}

View File

@ -1,526 +0,0 @@
fsck: add support for whole-disk locking (-l option)
This feature allows to call multiple independent fsck instances rather
than use only one "fsck -A" process.
The lock uses LOCK_EX flock(2). The lock request is ignored if the
whole-disk is non-rotating disk. The verbose mode (-V) provides
information about disk locking.
Note that "fsck -l" does not care if the device is stacked, for
example if you want to call "fsck -l /dev/md0" and "fsck -l /dev/md1"
then the underlying devices will not be locked. The traditional "fsck
-A" does not run in parallel for stacked devices.
http://pkgs.fedoraproject.org/gitweb/?p=util-linux-ng.git;a=commitdiff;h=6c69926dbfca8b07bd2f93b56bc8e7c54c7b227d#patch1
diff -up util-linux-ng-2.18/fsck/fsck.8.kzak util-linux-ng-2.18/fsck/fsck.8
--- util-linux-ng-2.18/fsck/fsck.8.kzak 2010-06-30 12:51:35.000000000 +0200
+++ util-linux-ng-2.18/fsck/fsck.8 2010-10-26 23:55:30.000000000 +0200
@@ -7,7 +7,7 @@
fsck \- check and repair a Linux file system
.SH SYNOPSIS
.B fsck
-.RB [ \-sAVRTMNP ]
+.RB [ \-lsAVRTMNP ]
.RB [ \-C
.RI [ fd ]]
.RB [ \-t
@@ -80,6 +80,17 @@ variable. Please see the file system-sp
further details.
.SH OPTIONS
.TP
+.B \-l
+Lock whole-disk device by exclusive
+.BR flock (2).
+This option can be used with one device only (e.g. -A and -l are mutually
+exclusive). This option is recommended when more
+.B fsck (8)
+instances are executed in the same time. The option is ignored when used for
+multiple devices or for non-rotating disk. The fsck does not lock underlying
+devices if executed to check stacked devices (e.g. MD or DM) -- this feature is
+not implemented yet.
+.TP
.B \-s
Serialize
.B fsck
@@ -200,6 +211,11 @@ If there are multiple filesystems with t
fsck will attempt to check them in parallel, although it will avoid running
multiple filesystem checks on the same physical disk.
.sp
+.B fsck
+does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other
+device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
+used to detemine dependencies between devices.
+.sp
Hence, a very common configuration in
.I /etc/fstab
files is to set the root filesystem to have a
@@ -366,10 +382,10 @@ program's behavior is affected by the fo
.B FSCK_FORCE_ALL_PARALLEL
If this environment variable is set,
.B fsck
-will attempt to run all of the specified filesystems in parallel,
-regardless of whether the filesystems appear to be on the same
-device. (This is useful for RAID systems or high-end storage systems
-such as those sold by companies such as IBM or EMC.)
+will attempt to run all of the specified filesystems in parallel, regardless of
+whether the filesystems appear to be on the same device. (This is useful for
+RAID systems or high-end storage systems such as those sold by companies such
+as IBM or EMC.) Note that the fs_passno value is still used.
.TP
.B FSCK_MAX_INST
This environment variable will limit the maximum number of file system
diff -up util-linux-ng-2.18/fsck/fsck.c.kzak util-linux-ng-2.18/fsck/fsck.c
--- util-linux-ng-2.18/fsck/fsck.c.kzak 2010-05-19 23:36:23.000000000 +0200
+++ util-linux-ng-2.18/fsck/fsck.c 2010-10-26 23:55:30.000000000 +0200
@@ -31,6 +31,8 @@
#include <sys/wait.h>
#include <sys/signal.h>
#include <sys/stat.h>
+#include <sys/file.h>
+#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <ctype.h>
@@ -42,6 +44,8 @@
#include <errno.h>
#include <malloc.h>
#include <signal.h>
+#include <dirent.h>
+#include <blkid.h>
#include "fsprobe.h"
@@ -85,6 +89,7 @@ char *devices[MAX_DEVICES];
char *args[MAX_ARGS];
int num_devices, num_args;
+int lockdisk = 0;
int verbose = 0;
int doall = 0;
int noexecute = 0;
@@ -214,11 +219,97 @@ static void parse_escape(char *word)
*q = 0;
}
+static dev_t get_disk(const char *device)
+{
+ struct stat st;
+ dev_t disk;
+
+ if (!stat(device, &st) &&
+ !blkid_devno_to_wholedisk(st.st_rdev, NULL, 0, &disk))
+ return disk;
+
+ return 0;
+}
+
+static int is_irrotational_disk(dev_t disk)
+{
+ char path[PATH_MAX];
+ FILE *f;
+ int rc, x;
+
+ rc = snprintf(path, sizeof(path),
+ "/sys/dev/block/%d:%d/queue/rotational",
+ major(disk), minor(disk));
+
+ if (rc < 0 || rc + 1 > sizeof(path))
+ return 0;
+
+ f = fopen(path, "r");
+ if (!f)
+ return 0;
+
+ rc = fscanf(f, "%u", &x);
+ fclose(f);
+
+ return rc == 1 ? !x : 0;
+}
+
+static void lock_disk(struct fsck_instance *inst)
+{
+ dev_t disk = inst->fs->disk ? : get_disk(inst->fs->device);
+ char *diskname;
+
+ if (!disk || is_irrotational_disk(disk))
+ return;
+
+ diskname = blkid_devno_to_devname(disk);
+ if (!diskname)
+ return;
+
+ if (verbose)
+ printf(_("Locking disk %s ... "), diskname);
+
+ inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
+ if (inst->lock >= 0) {
+ int rc = -1;
+
+ /* inform users that we're waiting on the lock */
+ if (verbose &&
+ (rc = flock(inst->lock, LOCK_EX | LOCK_NB)) != 0 &&
+ errno == EWOULDBLOCK)
+ printf(_("(waiting) "));
+
+ if (rc != 0 && flock(inst->lock, LOCK_EX) != 0) {
+ close(inst->lock); /* failed */
+ inst->lock = -1;
+ }
+ }
+
+ if (verbose)
+ printf("%s.\n", inst->lock >= 0 ? _("success") : _("failed"));
+
+ free(diskname);
+ return;
+}
+
+static void unlock_disk(struct fsck_instance *inst)
+{
+ if (inst->lock >= 0) {
+ /* explicitly unlock, don't rely on close(), maybe some library
+ * (e.g. liblkid) has still open the device.
+ */
+ flock(inst->lock, LOCK_UN);
+ close(inst->lock);
+ }
+}
+
+
+
static void free_instance(struct fsck_instance *i)
{
+ if (lockdisk)
+ unlock_disk(i);
free(i->prog);
- free(i->device);
- free(i->base_device);
free(i);
return;
}
@@ -240,6 +331,8 @@ static struct fs_info *create_fs_device(
fs->passno = passno;
fs->flags = 0;
fs->next = NULL;
+ fs->disk = 0;
+ fs->stacked = 0;
if (!filesys_info)
filesys_info = fs;
@@ -414,8 +507,7 @@ static int progress_active(NOARGS)
* Execute a particular fsck program, and link it into the list of
* child processes we are waiting for.
*/
-static int execute(const char *type, const char *device, const char *mntpt,
- int interactive)
+static int execute(const char *type, struct fs_info *fs, int interactive)
{
char *s, *argv[80], prog[80];
int argc, i;
@@ -452,7 +544,7 @@ static int execute(const char *type, con
}
}
- argv[argc++] = string_copy(device);
+ argv[argc++] = string_copy(fs->device);
argv[argc] = 0;
s = find_fsck(prog);
@@ -464,12 +556,19 @@ static int execute(const char *type, con
if (verbose || noexecute) {
printf("[%s (%d) -- %s] ", s, num_running,
- mntpt ? mntpt : device);
+ fs->mountpt ? fs->mountpt : fs->device);
for (i=0; i < argc; i++)
printf("%s ", argv[i]);
printf("\n");
}
+
+ inst->fs = fs;
+ inst->lock = -1;
+
+ if (lockdisk)
+ lock_disk(inst);
+
/* Fork and execute the correct program. */
if (noexecute)
pid = -1;
@@ -492,8 +591,6 @@ static int execute(const char *type, con
inst->pid = pid;
inst->prog = string_copy(prog);
inst->type = string_copy(type);
- inst->device = string_copy(device);
- inst->base_device = base_device(device);
inst->start_time = time(0);
inst->next = NULL;
@@ -597,12 +694,12 @@ static struct fsck_instance *wait_one(in
} else {
printf(_("Warning... %s for device %s exited "
"with signal %d.\n"),
- inst->prog, inst->device, sig);
+ inst->prog, inst->fs->device, sig);
status = EXIT_ERROR;
}
} else {
printf(_("%s %s: status is %x, should never happen.\n"),
- inst->prog, inst->device, status);
+ inst->prog, inst->fs->device, status);
status = EXIT_ERROR;
}
inst->exit_status = status;
@@ -641,7 +738,7 @@ ret_inst:
instance_list = inst->next;
if (verbose > 1)
printf(_("Finished with %s (exit status %d)\n"),
- inst->device, inst->exit_status);
+ inst->fs->device, inst->exit_status);
num_running--;
return inst;
}
@@ -698,7 +795,7 @@ static void fsck_device(struct fs_info *
type = DEFAULT_FSTYPE;
num_running++;
- retval = execute(type, fs->device, fs->mountpt, interactive);
+ retval = execute(type, fs, interactive);
if (retval) {
fprintf(stderr, _("%s: Error %d while executing fsck.%s "
"for %s\n"), progname, retval, type, fs->device);
@@ -924,40 +1021,70 @@ static int ignore(struct fs_info *fs)
return 0;
}
+static int count_slaves(dev_t disk)
+{
+ DIR *dir;
+ struct dirent *dp;
+ char dirname[PATH_MAX];
+ int count = 0;
+
+ snprintf(dirname, sizeof(dirname),
+ "/sys/dev/block/%u:%u/slaves/",
+ major(disk), minor(disk));
+
+ if (!(dir = opendir(dirname)))
+ return -1;
+
+ while ((dp = readdir(dir)) != 0) {
+#ifdef _DIRENT_HAVE_D_TYPE
+ if (dp->d_type != DT_UNKNOWN && dp->d_type != DT_LNK)
+ continue;
+#endif
+ if (dp->d_name[0] == '.' &&
+ ((dp->d_name[1] == 0) ||
+ ((dp->d_name[1] == '.') && (dp->d_name[2] == 0))))
+ continue;
+
+ count++;
+ }
+ closedir(dir);
+ return count;
+}
+
/*
* Returns TRUE if a partition on the same disk is already being
* checked.
*/
-static int device_already_active(char *device)
+static int disk_already_active(struct fs_info *fs)
{
struct fsck_instance *inst;
- char *base;
if (force_all_parallel)
return 0;
-#ifdef BASE_MD
- /* Don't check a soft raid disk with any other disk */
- if (instance_list &&
- (!strncmp(instance_list->device, BASE_MD, sizeof(BASE_MD)-1) ||
- !strncmp(device, BASE_MD, sizeof(BASE_MD)-1)))
+ if (instance_list && instance_list->fs->stacked)
+ /* any instance for a stacked device is already running */
return 1;
-#endif
- base = base_device(device);
+ if (!fs->disk) {
+ fs->disk = get_disk(fs->device);
+ if (fs->disk)
+ fs->stacked = count_slaves(fs->disk);
+ }
+
/*
* If we don't know the base device, assume that the device is
* already active if there are any fsck instances running.
+ *
+ * Don't check a stacked device with any other disk too.
*/
- if (!base)
+ if (!fs->disk || fs->stacked)
return (instance_list != 0);
+
for (inst = instance_list; inst; inst = inst->next) {
- if (!inst->base_device || !strcmp(base, inst->base_device)) {
- free(base);
+ if (!inst->fs->disk || fs->disk == inst->fs->disk)
return 1;
- }
}
- free(base);
return 0;
}
@@ -1038,7 +1165,7 @@ static int check_all(NOARGS)
* already been spawned, then we need to defer
* this to another pass.
*/
- if (device_already_active(fs->device)) {
+ if (disk_already_active(fs)) {
pass_done = 0;
continue;
}
@@ -1188,6 +1315,9 @@ static void PRS(int argc, char *argv[])
}
}
break;
+ case 'l':
+ lockdisk++;
+ break;
case 'V':
verbose++;
break;
@@ -1298,6 +1428,12 @@ int main(int argc, char *argv[])
if ((num_devices == 1) || (serialize))
interactive = 1;
+ if (lockdisk && (doall || num_devices > 1)) {
+ fprintf(stderr, _("%s: the -l option can be used with one "
+ "device only -- ignore\n"), progname);
+ lockdisk = 0;
+ }
+
/* If -A was specified ("check all"), do that! */
if (doall)
return check_all();
diff -up util-linux-ng-2.18/fsck/fsck.h.kzak util-linux-ng-2.18/fsck/fsck.h
--- util-linux-ng-2.18/fsck/fsck.h.kzak 2010-03-18 23:11:23.000000000 +0100
+++ util-linux-ng-2.18/fsck/fsck.h 2010-10-26 23:55:30.000000000 +0200
@@ -44,6 +44,8 @@ struct fs_info {
int freq;
int passno;
int flags;
+ dev_t disk;
+ int stacked;
struct fs_info *next;
};
@@ -56,12 +58,12 @@ struct fs_info {
struct fsck_instance {
int pid;
int flags;
+ int lock; /* flock()ed whole disk file descriptor or -1 */
int exit_status;
time_t start_time;
char * prog;
char * type;
- char * device;
- char * base_device;
+ struct fs_info *fs;
struct fsck_instance *next;
};
diff -up util-linux-ng-2.18/fsck/Makefile.am.kzak util-linux-ng-2.18/fsck/Makefile.am
--- util-linux-ng-2.18/fsck/Makefile.am.kzak 2010-05-24 12:33:46.000000000 +0200
+++ util-linux-ng-2.18/fsck/Makefile.am 2010-10-26 23:55:30.000000000 +0200
@@ -3,7 +3,7 @@ include $(top_srcdir)/config/include-Mak
sbin_PROGRAMS = fsck
dist_man_MANS = fsck.8
-fsck_SOURCES = base_device.c fsck.c fsck.h $(top_srcdir)/lib/ismounted.c \
+fsck_SOURCES = fsck.c fsck.h $(top_srcdir)/lib/ismounted.c \
$(top_srcdir)/lib/fsprobe.c $(top_srcdir)/lib/canonicalize.c
fsck_LDADD =
fsck_CFLAGS = $(AM_CFLAGS)
diff -up util-linux-ng-2.18/fsck/Makefile.in.kzak util-linux-ng-2.18/fsck/Makefile.in
--- util-linux-ng-2.18/fsck/Makefile.in.kzak 2010-10-26 23:56:04.000000000 +0200
+++ util-linux-ng-2.18/fsck/Makefile.in 2010-10-26 23:56:15.000000000 +0200
@@ -62,9 +62,8 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
PROGRAMS = $(sbin_PROGRAMS)
-am_fsck_OBJECTS = fsck-base_device.$(OBJEXT) fsck-fsck.$(OBJEXT) \
- fsck-ismounted.$(OBJEXT) fsck-fsprobe.$(OBJEXT) \
- fsck-canonicalize.$(OBJEXT)
+am_fsck_OBJECTS = fsck-fsck.$(OBJEXT) fsck-ismounted.$(OBJEXT) \
+ fsck-fsprobe.$(OBJEXT) fsck-canonicalize.$(OBJEXT)
fsck_OBJECTS = $(am_fsck_OBJECTS)
am__DEPENDENCIES_1 =
@BUILD_LIBBLKID_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
@@ -204,6 +203,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
@@ -315,7 +315,7 @@ ul_libmount_la = $(top_builddir)/shlibs/
# mount.h is generated by ./configure script and stored in build directory
ul_libmount_incdir = $(ul_libmount_builddir)
dist_man_MANS = fsck.8
-fsck_SOURCES = base_device.c fsck.c fsck.h $(top_srcdir)/lib/ismounted.c \
+fsck_SOURCES = fsck.c fsck.h $(top_srcdir)/lib/ismounted.c \
$(top_srcdir)/lib/fsprobe.c $(top_srcdir)/lib/canonicalize.c
fsck_LDADD = $(am__append_1) $(am__append_3)
@@ -407,7 +407,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-base_device.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-canonicalize.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-fsck.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck-fsprobe.Po@am__quote@
@@ -437,22 +436,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
-fsck-base_device.o: base_device.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-base_device.o -MD -MP -MF $(DEPDIR)/fsck-base_device.Tpo -c -o fsck-base_device.o `test -f 'base_device.c' || echo '$(srcdir)/'`base_device.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsck-base_device.Tpo $(DEPDIR)/fsck-base_device.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='base_device.c' object='fsck-base_device.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-base_device.o `test -f 'base_device.c' || echo '$(srcdir)/'`base_device.c
-
-fsck-base_device.obj: base_device.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-base_device.obj -MD -MP -MF $(DEPDIR)/fsck-base_device.Tpo -c -o fsck-base_device.obj `if test -f 'base_device.c'; then $(CYGPATH_W) 'base_device.c'; else $(CYGPATH_W) '$(srcdir)/base_device.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsck-base_device.Tpo $(DEPDIR)/fsck-base_device.Po
-@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='base_device.c' object='fsck-base_device.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -c -o fsck-base_device.obj `if test -f 'base_device.c'; then $(CYGPATH_W) 'base_device.c'; else $(CYGPATH_W) '$(srcdir)/base_device.c'; fi`
-
fsck-fsck.o: fsck.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fsck_CFLAGS) $(CFLAGS) -MT fsck-fsck.o -MD -MP -MF $(DEPDIR)/fsck-fsck.Tpo -c -o fsck-fsck.o `test -f 'fsck.c' || echo '$(srcdir)/'`fsck.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fsck-fsck.Tpo $(DEPDIR)/fsck-fsck.Po
diff -up util-linux-ng-2.18/Makefile.am.kzak util-linux-ng-2.18/Makefile.am
--- util-linux-ng-2.18/Makefile.am.kzak 2010-03-18 23:11:23.000000000 +0100
+++ util-linux-ng-2.18/Makefile.am 2010-10-26 23:55:30.000000000 +0200
@@ -30,8 +30,10 @@ SUBDIRS += mount
endif
if BUILD_FSCK
+if BUILD_LIBBLKID
SUBDIRS += fsck
endif
+endif
ACLOCAL_AMFLAGS = -I m4

BIN
util-linux-ng-2.18.tar.bz2 (Stored with Git LFS)

Binary file not shown.

View File

@ -1,42 +0,0 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: swapon: Document btrfs limitation with swapfiles
References: bnc#616617
Btrfs, as of 2.6.35, is unable to allow swapfiles to be used on its
filesystems. This is due to the swapfile implementation wanting to build
an extent map of each block in the file and expecting it to be static
for the life of the swapfile.
Btrfs can't guarantee this and refuses to return the mapping. The swapfile
implementation just makes a comment about there being holes in the file -
but that's how btrfs denies the mapping.
This patch adds a section to the swapon manpage to document it.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
mount/swapon.8 | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/mount/swapon.8
+++ b/mount/swapon.8
@@ -167,6 +167,18 @@ automatically detects and rewrites swap
suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't
do it, then we get data corruption the next time an attempt at unsuspending is
made.
+.PP
+.B swapon
+may not work correctly when using a swap file with some versions of btrfs.
+This is due to the swap file implementation in the kernel expecting to be able
+to write to the file directly, without the assistance of the file system.
+Since btrfs is a copy-on-write file system, the file location may not be
+static and corruption can result. Btrfs actively disallows the use of files
+on its file systems by refusing to map the file. This can be seen in the system
+log as "swapon: swapfile has holes." One possible workaround is to map the
+file to a loopback device. This will allow the file system to determine the
+mapping properly but may come with a performance impact.
+
.SH SEE ALSO
.BR swapon (2),
.BR swapoff (2),

View File

@ -1,41 +0,0 @@
Index: util-linux-ng-2.18/mount/swapon.c
===================================================================
--- util-linux-ng-2.18.orig/mount/swapon.c
+++ util-linux-ng-2.18/mount/swapon.c
@@ -23,6 +23,7 @@
#include "pathnames.h"
#include "swapheader.h"
#include "mangle.h"
+#include "canonicalize.h"
#define PATH_MKSWAP "/sbin/mkswap"
@@ -171,7 +172,11 @@ read_proc_swaps(void) {
break;
swapFiles = q;
- swapFiles[numSwaps++] = unmangle(line);
+ if ((p = unmangle(line)) == NULL)
+ break;
+
+ swapFiles[numSwaps++] = canonicalize_path(p);
+ free(p);
}
fclose(swaps);
}
@@ -179,10 +184,14 @@ read_proc_swaps(void) {
static int
is_in_proc_swaps(const char *fname) {
int i;
+ char *p = canonicalize_path(fname);
for (i = 0; i < numSwaps; i++)
- if (swapFiles[i] && !strcmp(fname, swapFiles[i]))
+ if (swapFiles[i] && !strcmp(p, swapFiles[i])) {
+ free(p);
return 1;
+ }
+ free(p);
return 0;
}

View File

@ -1,3 +1,56 @@
-------------------------------------------------------------------
Thu Jan 6 16:43:46 UTC 2011 - puzel@novell.com
- update to util-linux-2.19-rc1
- important changes:
* lsblk(8):
- this NEW COMMAND lists information about all or selected block
devices in tree-like format.
* partx(8):
- this command has been rewritten to use libblkid for partition
tables parsing. It supports aix, bsd, dos, gpt, mac, minix,
sgi, solaris_x86, sun, ultrix and unixware now.
- supports new command line option "--show" to list partitions in
new format
- prints UUID and name for GPT and mac partitions
* findmnt(8):
- supports new command line option "--submounts" to list all
submounts for selected mountpoint(s)
* agetty(8):
- supports new command line options "-c" and "-s" to reuse
already initialized tty cflags and existing baud rate
* mount(8), umount(8):
- could be linked with libmount (--enable-libmount-mount) to
manage userspace mount options outside /etc/mtab on systems
where the file is a symlink to /proc/mounts. (EXPERIMENTAL,
enabled in openSUSE package)
* losetup(8), mount(8):
- uses /sys/dev/block/<device>/loop/backing_file rather than
loopdev ioctls (requires kernel >= 2.6.37)
* fsck(8):
- supports new command line option "-l" to lock whole-disk device
by exclusive flock(2). This option is recommended when more
fsck(8) instances are executed in the same time.
* rtcwake(8):
- supports new mode "show" to print the current RTC alarm time
* fstrim(8):
- this NEW COMMAND allows to discard unused blocks on a mounted
filesystem (wrapper for FITRIM ioctl)
* swapon(8):
- supports new options "discard" and "nofail"
- in post, replace /etc/mtab with a symlink to /proc/mounts/self
- drop following patches (in upstream)
- util-linux-swapon-btrfs-limitations
- util-linux-agetty-s-option.patch
- util-linux-fsck-l-option.patch
- util-linux-2.18-no-canonicalize-fix.patch
- util-linux-swapon-canonicalize-swap-device.patch
- fix uuidd Summary and Description
- build with --enable-libmount-mount (new option)
- use set_permissions macros
- run spec-cleaner
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 14 16:11:34 UTC 2010 - puzel@novell.com Tue Dec 14 16:11:34 UTC 2010 - puzel@novell.com

View File

@ -1,5 +1,5 @@
# #
# spec file for package util-linux (Version 2.18) # spec file for package util-linux (Version 2.19-rc1)
# #
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
@ -20,6 +20,8 @@
%define which_ver 2.20 %define which_ver 2.20
%define adjtimex_ver 1.28 %define adjtimex_ver 1.28
%define ul_tar_version 2.19-rc1
Name: util-linux Name: util-linux
BuildRequires: audit-devel BuildRequires: audit-devel
BuildRequires: gettext-devel BuildRequires: gettext-devel
@ -30,6 +32,7 @@ BuildRequires: pam-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
Version: 2.18.91
Url: http://kernel.org/~kzak/util-linux/ Url: http://kernel.org/~kzak/util-linux/
Supplements: filesystem(minix) Supplements: filesystem(minix)
Provides: fsck-with-dev-lock = %{version} Provides: fsck-with-dev-lock = %{version}
@ -39,11 +42,10 @@ PreReq: %install_info_prereq permissions
License: GPLv2+ License: GPLv2+
Group: System/Base Group: System/Base
AutoReqProv: on AutoReqProv: on
Version: 2.18
Release: 7 Release: 7
Recommends: %name-lang = %{version} Recommends: %{name}-lang = %{version}
Summary: A collection of basic system utilities Summary: A collection of basic system utilities
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v%{version}/%name-ng-%{version}.tar.bz2 Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v19/%{name}-%{ul_tar_version}.tar.bz2
Source1: util-linux-rpmlintrc Source1: util-linux-rpmlintrc
# XXX: make nologin part of login package # XXX: make nologin part of login package
Source2: nologin.c Source2: nologin.c
@ -81,11 +83,6 @@ Patch1: util-linux-2.12r-fdisk_remove_bogus_warnings.patch
# crypto patch # crypto patch
Patch3: util-linux-2.17.1-mount_losetup_crypto.patch Patch3: util-linux-2.17.1-mount_losetup_crypto.patch
Patch4: util-linux-2.17.1-losetup-honor-documented-c-option Patch4: util-linux-2.17.1-losetup-honor-documented-c-option
Patch7: util-linux-swapon-btrfs-limitations
Patch8: util-linux-agetty-s-option.patch
Patch9: util-linux-fsck-l-option.patch
Patch10: util-linux-2.18-no-canonicalize-fix.patch
Patch11: util-linux-swapon-canonicalize-swap-device.patch
## ##
## adjtimex ## adjtimex
## ##
@ -117,7 +114,6 @@ mount program, the fdisk configuration tool, and more.
License: GPLv2+ License: GPLv2+
Summary: Filesystem detection library Summary: Filesystem detection library
Group: System/Filesystems Group: System/Filesystems
AutoReqProv: on
%description -n libblkid1 %description -n libblkid1
Library for filesystem detection. Library for filesystem detection.
@ -126,8 +122,7 @@ Library for filesystem detection.
License: GPLv2+ License: GPLv2+
Summary: Development files for the filesystem detection library Summary: Development files for the filesystem detection library
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
AutoReqProv: on Requires: libblkid1 = %{version}
Requires: libblkid1 = %version
%description -n libblkid-devel %description -n libblkid-devel
Files needed to develop applications using the library for filesystem Files needed to develop applications using the library for filesystem
@ -135,21 +130,22 @@ detection.
%package -n uuidd %package -n uuidd
License: GPLv2+ License: GPLv2+
Summary: Utilities for the Second Extended File System Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
Group: System/Filesystems Group: System/Filesystems
AutoReqProv: on PreReq: %fillup_prereq
PreReq: %fillup_prereq %insserv_prereq permissions pwdutils PreReq: %insserv_prereq
PreReq: permissions
PreReq: pwdutils
%description -n uuidd %description -n uuidd
Utilities needed to create and maintain ext2 and ext3 file systems The uuidd package contains a userspace daemon (uuidd) which guarantees
under Linux. Included in this package are: chattr, lsattr, mke2fs, uniqueness of time-based UUID generation even at very high rates on
mklost+found, tune2fs, e2fsck, resize2fs, and badblocks. SMP systems.
%package -n libuuid1 %package -n libuuid1
License: GPLv2+ License: GPLv2+
Summary: Library to generate UUIDs Summary: Library to generate UUIDs
Group: System/Filesystems Group: System/Filesystems
AutoReqProv: on
%description -n libuuid1 %description -n libuuid1
A library to generate universally unique IDs (UUIDs). A library to generate universally unique IDs (UUIDs).
@ -158,8 +154,7 @@ A library to generate universally unique IDs (UUIDs).
License: GPLv2+ License: GPLv2+
Summary: Development files for libuuid1 Summary: Development files for libuuid1
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
AutoReqProv: on Requires: libuuid1 = %{version}
Requires: libuuid1 = %version
%description -n libuuid-devel %description -n libuuid-devel
Files to develop applications using the library to generate universally Files to develop applications using the library to generate universally
@ -167,9 +162,8 @@ unique IDs (UUIDs).
%package -n libmount1 %package -n libmount1
License: GPLv2+ License: GPLv2+
Summary: Mount library Summary: Device mount library
Group: System/Filesystems Group: System/Filesystems
AutoReqProv: on
%description -n libmount1 %description -n libmount1
Library designed to be used in low-level utils like Library designed to be used in low-level utils like
@ -179,23 +173,17 @@ mount(8) and /sbin/mount.<type> helpers.
License: GPLv2+ License: GPLv2+
Summary: Development files for libmount1 Summary: Development files for libmount1
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
AutoReqProv: on Requires: libmount1 = %{version}
Requires: libmount1 = %version
%description -n libmount-devel %description -n libmount-devel
Files to develop applications using the libmount library. Files to develop applications using the libmount library.
%lang_package %lang_package
%prep %prep
%setup -q -a 9 -b 11 -b 12 -b 13 -n %name-ng-%version %setup -q -a 9 -b 11 -b 12 -b 13 -n %{name}-%ul_tar_version
%patch1 -p1 %patch1 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
# #
cd adjtimex-* cd adjtimex-*
@ -217,7 +205,7 @@ cd ../which-*
%build %build
# adjtimex build # adjtimex build
cd adjtimex-%{adjtimex_ver} cd adjtimex-%{adjtimex_ver}
CFLAGS="$RPM_OPT_FLAGS" ./configure CFLAGS="%{optflags}" ./configure
make %{?_smp_mflags} make %{?_smp_mflags}
cd .. cd ..
pushd ../ pushd ../
@ -227,7 +215,7 @@ aclocal --force
autoconf --force autoconf --force
automake --force-missing --add-missing --foreign automake --force-missing --add-missing --foreign
%{?suse_update_config:%{suse_update_config}} %{?suse_update_config:%{suse_update_config}}
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr \ CFLAGS="%{optflags}" ./configure --prefix=/usr \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
--infodir=%{_infodir} \ --infodir=%{_infodir} \
%{_target_cpu}-suse-linux %{_target_cpu}-suse-linux
@ -236,7 +224,7 @@ cd ..
# time build # time build
cd time-%{time_ver} cd time-%{time_ver}
%{?suse_update_config:%{suse_update_config}} %{?suse_update_config:%{suse_update_config}}
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE " INSTALL_PROGRAM='$(INSTALL)' \ CFLAGS="%{optflags} -D_GNU_SOURCE " INSTALL_PROGRAM='$(INSTALL)' \
./configure --prefix=/usr \ ./configure --prefix=/usr \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
--infodir=%{_infodir} \ --infodir=%{_infodir} \
@ -245,19 +233,19 @@ make %{?_smp_mflags}
cd .. cd ..
# klogconsole build # klogconsole build
cd klogconsole cd klogconsole
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags} CFLAGS="%{optflags}"
cd .. cd ..
popd popd
# setctsid build # setctsid build
rm -f setctsid rm -f setctsid
make %{?_smp_mflags} setctsid CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags} setctsid CFLAGS="%{optflags}"
# #
# util-linux itself # util-linux itself
# #
autoreconf -fi autoreconf -fi
export SUID_CFLAGS="-fpie" export SUID_CFLAGS="-fpie"
export SUID_LDFLAGS="-pie" export SUID_LDFLAGS="-pie"
CFLAGS="$RPM_OPT_FLAGS" \ CFLAGS="%{optflags}" \
%configure \ %configure \
--bindir=/bin \ --bindir=/bin \
--sbindir=/sbin \ --sbindir=/sbin \
@ -269,154 +257,163 @@ CFLAGS="$RPM_OPT_FLAGS" \
--enable-partx \ --enable-partx \
--enable-raw \ --enable-raw \
--enable-write \ --enable-write \
--enable-libmount-mount \
--disable-use-tty-group \ --disable-use-tty-group \
--disable-static \ --disable-static \
--disable-silent-rules --disable-silent-rules
# #
make %{?_smp_mflags} make %{?_smp_mflags}
# #
gcc $RPM_OPT_FLAGS -o nologin nologin.c gcc %{optflags} -o nologin nologin.c
gcc $RPM_OPT_FLAGS -o mkzimage_cmdline %{S:29} gcc %{optflags} -o mkzimage_cmdline %{S:29}
gcc $RPM_OPT_FLAGS -o chrp-addnote %{SOURCE31} gcc %{optflags} -o chrp-addnote %{SOURCE31}
%check %check
cd ../time-%{time_ver} cd ../time-%{time_ver}
make check make check
%install %install
mkdir -p "$RPM_BUILD_ROOT"{/etc/init.d,%{_mandir}/man{1,8},/bin,/sbin,/usr/bin,/usr/sbin,%{_infodir}} mkdir -p %{buildroot}{/etc/init.d,%{_mandir}/man{1,8},/bin,/sbin,/usr/bin,/usr/sbin,%{_infodir}}
mkdir -p $RPM_BUILD_ROOT/var/lib/libuuid/ mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid/
mkdir -p $RPM_BUILD_ROOT/var/run/uuidd/ mkdir -p %{buildroot}%{_localstatedir}/run/uuidd/
install -m 744 %{SOURCE50} $RPM_BUILD_ROOT/etc/init.d/uuidd install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
install -m 644 %{SOURCE51} $RPM_BUILD_ROOT/etc/blkid.conf install -m 644 %{SOURCE51} %{buildroot}%{_sysconfdir}/blkid.conf
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates
cp adjtimex-*/adjtimex %{buildroot}/sbin/ cp adjtimex-*/adjtimex %{buildroot}/sbin/
cp adjtimex-*/adjtimex.8 %{buildroot}%{_mandir}/man8/ cp adjtimex-*/adjtimex.8 %{buildroot}%{_mandir}/man8/
pushd .. pushd ..
# which install # which install
cd which-%{which_ver} cd which-%{which_ver}
make install DESTDIR=$RPM_BUILD_ROOT %make_install
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/which mkdir -p %{buildroot}%{_defaultdocdir}/which
install -m 0644 README $RPM_BUILD_ROOT%{_defaultdocdir}/which/ install -m 0644 README %{buildroot}%{_defaultdocdir}/which/
install -m 0644 EXAMPLES $RPM_BUILD_ROOT%{_defaultdocdir}/which/ install -m 0644 EXAMPLES %{buildroot}%{_defaultdocdir}/which/
install -m 0644 README.alias $RPM_BUILD_ROOT%{_defaultdocdir}/which/ install -m 0644 README.alias %{buildroot}%{_defaultdocdir}/which/
cd .. cd ..
# time install # time install
cd time-%{time_ver} cd time-%{time_ver}
mkdir -p $RPM_BUILD_ROOT%{_defaultdocdir}/time mkdir -p %{buildroot}%{_defaultdocdir}/time
make install DESTDIR=$RPM_BUILD_ROOT \ make install DESTDIR=%{buildroot} \
prefix=$RPM_BUILD_ROOT/usr \ prefix=%{buildroot}/usr \
infodir=$RPM_BUILD_ROOT%{_infodir} \ infodir=%{buildroot}%{_infodir} \
mandir=$RPM_BUILD_ROOT%{_mandir} mandir=%{buildroot}%{_mandir}
install -m 0644 README $RPM_BUILD_ROOT%{_defaultdocdir}/time/ install -m 0644 README %{buildroot}%{_defaultdocdir}/time/
install -m 0644 AUTHORS $RPM_BUILD_ROOT%{_defaultdocdir}/time/ install -m 0644 AUTHORS %{buildroot}%{_defaultdocdir}/time/
install -m 0644 COPYING $RPM_BUILD_ROOT%{_defaultdocdir}/time/ install -m 0644 COPYING %{buildroot}%{_defaultdocdir}/time/
install -m 0644 NEWS $RPM_BUILD_ROOT%{_defaultdocdir}/time/ install -m 0644 NEWS %{buildroot}%{_defaultdocdir}/time/
cd .. cd ..
# klogconsole install # klogconsole install
cd klogconsole cd klogconsole
make install DEST=$RPM_BUILD_ROOT make install DEST=%{buildroot}
popd popd
# #
# util-linux install # util-linux install
# #
make DESTDIR=$RPM_BUILD_ROOT install %make_install
mv $RPM_BUILD_ROOT/usr/bin/logger $RPM_BUILD_ROOT/bin/logger mv %{buildroot}%{_bindir}/logger %{buildroot}/bin/logger
install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/filesystems install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems
install -m 755 nologin $RPM_BUILD_ROOT/sbin install -m 755 nologin %{buildroot}/sbin
rm -f $RPM_BUILD_ROOT/%{_libdir}/libblkid.la rm -f %{buildroot}/%{_libdir}/libblkid.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/libuuid.la rm -f %{buildroot}/%{_libdir}/libuuid.la
rm -f $RPM_BUILD_ROOT/%{_libdir}/libmount.la rm -f %{buildroot}/%{_libdir}/libmount.la
%ifnarch ppc ppc64 %ifnarch ppc ppc64
install -m 755 mkzimage_cmdline $RPM_BUILD_ROOT/usr/bin install -m 755 mkzimage_cmdline %{buildroot}%{_prefix}/bin
install -m 644 %{S:28} $RPM_BUILD_ROOT%{_mandir}/man8 install -m 644 %{S:28} %{buildroot}%{_mandir}/man8
install -m 755 chrp-addnote $RPM_BUILD_ROOT/usr/bin install -m 755 chrp-addnote %{buildroot}%{_prefix}/bin
%endif %endif
install -m 644 nologin.8 $RPM_BUILD_ROOT%{_mandir}/man8 install -m 644 nologin.8 %{buildroot}%{_mandir}/man8
# setctsid install # setctsid install
install -m 755 setctsid $RPM_BUILD_ROOT/usr/sbin install -m 755 setctsid %{buildroot}%{_prefix}/sbin
install -m 444 setctsid.8 $RPM_BUILD_ROOT%{_mandir}/man8/ install -m 444 setctsid.8 %{buildroot}%{_mandir}/man8/
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > $RPM_BUILD_ROOT/usr/sbin/flushb echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
chmod 755 $RPM_BUILD_ROOT/usr/sbin/flushb chmod 755 %{buildroot}%{_sbindir}/flushb
# Install scripts to configure raw devices at boot time # Install scripts to configure raw devices at boot time
install -m 644 $RPM_SOURCE_DIR/etc.raw $RPM_BUILD_ROOT/etc/raw install -m 644 $RPM_SOURCE_DIR/etc.raw %{buildroot}%{_sysconfdir}/raw
install -m 755 $RPM_SOURCE_DIR/raw.init $RPM_BUILD_ROOT/etc/init.d/raw install -m 755 $RPM_SOURCE_DIR/raw.init %{buildroot}%{_initddir}/raw
ln -sf ../../etc/init.d/raw $RPM_BUILD_ROOT/usr/sbin/rcraw ln -sf ../../etc/init.d/raw %{buildroot}%{_sbindir}/rcraw
# Stupid hack so we don't have a tcsh dependency # Stupid hack so we don't have a tcsh dependency
chmod 644 $RPM_BUILD_ROOT/usr/share/getopt/getopt*.tcsh chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh
# Following files we don't want to package, so remove them # Following files we don't want to package, so remove them
rm -f $RPM_BUILD_ROOT/usr/bin/pg rm -f %{buildroot}%{_bindir}/pg
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/pg.1* rm -f %{buildroot}%{_mandir}/man1/pg.1*
# Do not package these files to get rid of the perl dependency # Do not package these files to get rid of the perl dependency
rm -f $RPM_BUILD_ROOT/usr/bin/chkdupexe rm -f %{buildroot}%{_bindir}/chkdupexe
rm -f $RPM_BUILD_ROOT/usr/share/man/man1/chkdupexe.1 rm -f %{buildroot}%{_mandir}/man1/chkdupexe.1
# arch dependent # arch dependent
%ifarch s390 s390x %ifarch s390 s390x
rm -f $RPM_BUILD_ROOT/etc/fdprm rm -f %{buildroot}%{_sysconfdir}/fdprm
rm -f $RPM_BUILD_ROOT/usr/bin/cytune rm -f %{buildroot}%{_bindir}/cytune
rm -f $RPM_BUILD_ROOT/usr/sbin/fdformat rm -f %{buildroot}%{_sbindir}/fdformat
rm -f $RPM_BUILD_ROOT/sbin/hwclock rm -f %{buildroot}/sbin/hwclock
rm -f $RPM_BUILD_ROOT/usr/sbin/klogconsole rm -f %{buildroot}%{_sbindir}/klogconsole
rm -f $RPM_BUILD_ROOT/usr/bin/setterm rm -f %{buildroot}%{_bindir}/setterm
rm -f $RPM_BUILD_ROOT/usr/sbin/tunelp rm -f %{buildroot}%{_sbindir}/tunelp
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cytune.8* rm -f %{buildroot}/%{_mandir}/man8/cytune.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/fdformat.8* rm -f %{buildroot}/%{_mandir}/man8/fdformat.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/hwclock.8* rm -f %{buildroot}/%{_mandir}/man8/hwclock.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/klogconsole.8* rm -f %{buildroot}/%{_mandir}/man8/klogconsole.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/tunelp.8* rm -f %{buildroot}/%{_mandir}/man8/tunelp.8*
%endif %endif
%ifarch ia64 %sparc %ifarch ia64 %sparc
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/cfdisk.8* rm -f %{buildroot}/%{_mandir}/man8/cfdisk.8*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/sfdisk.8* rm -f %{buildroot}/%{_mandir}/man8/sfdisk.8*
rm -f $RPM_BUILD_ROOT/sbin/cfdisk rm -f %{buildroot}/sbin/cfdisk
rm -f $RPM_BUILD_ROOT/sbin/sfdisk rm -f %{buildroot}/sbin/sfdisk
%endif %endif
%ifarch ia64 %ifarch ia64
rm -f $RPM_BUILD_ROOT/sbin/fdisk rm -f %{buildroot}/sbin/fdisk
rm -f $RPM_BUILD_ROOT%{_mandir}/man8/fdisk.8* rm -f %{buildroot}%{_mandir}/man8/fdisk.8*
%endif %endif
%find_lang %{name}-ng %{name}.lang %find_lang %{name} %{name}.lang
# create list of setarch(8) symlinks # create list of setarch(8) symlinks
find $RPM_BUILD_ROOT%{_bindir}/ -regextype posix-egrep -type l \ find %{buildroot}%{_bindir}/ -regextype posix-egrep -type l \
-regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)$" \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)$" \
-printf "%{_bindir}/%f\n" >> %{name}.files -printf "%{_bindir}/%f\n" >> %{name}.files
find $RPM_BUILD_ROOT%{_mandir}/man8 -regextype posix-egrep \ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
-regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)\.8.*" \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)\.8.*" \
-printf "%{_mandir}/man8/%f*\n" >> %{name}.files -printf "%{_mandir}/man8/%f*\n" >> %{name}.files
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf %{buildroot}
%post %post
%{fillup_and_insserv raw} %{fillup_and_insserv raw}
%install_info --info-dir=%{_infodir} %{_infodir}/ipc.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/ipc.info.gz
%install_info --entry="* time: (time). summarizing used system resources" --info-dir=%{_infodir} %{_infodir}/time.info.gz %install_info --entry="* time: (time). summarizing used system resources" --info-dir=%{_infodir} %{_infodir}/time.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/which.info.gz %install_info --info-dir=%{_infodir} %{_infodir}/which.info.gz
%if 0%{?suse_version} <= 1130
%run_permissions %run_permissions
%else
%set_permissions /usr/bin/wall /usr/bin/write /bin/mount /bin/umount
%endif
# mount option 'code=' is now called 'codepage=' so change fstab # mount option 'code=' is now called 'codepage=' so change fstab
if [ -f etc/fstab ]; then if [ -f etc/fstab ]; then
sed -i 's:code=:codepage=:' etc/fstab sed -i 's:code=:codepage=:' etc/fstab
fi fi
# if /etc/mtab is a regular file, replace it with a symlink to /proc/self/mounts
# (regular mtab is not written/cleaned-up/supported by systemd)
if [ -f /etc/mtab ]; then
ln -sf /proc/self/mounts /etc/mtab || :
fi
%postun %postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/ipc.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/ipc.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/time.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/time.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/which.info.gz %install_info_delete --info-dir=%{_infodir} %{_infodir}/which.info.gz
%{insserv_cleanup} %{insserv_cleanup}
%verifyscript %verifyscript
%verify_permissions -e /usr/bin/wall -e /usr/bin/write %verify_permissions -e /usr/bin/wall -e /usr/bin/write -e /bin/mount -e /bin/umount
%post -n libblkid1 %post -n libblkid1 -p /sbin/ldconfig
/sbin/ldconfig
%postun -n libblkid1 %postun -n libblkid1 -p /sbin/ldconfig
/sbin/ldconfig
%post -n libmount1 %post -n libmount1 -p /sbin/ldconfig
/sbin/ldconfig
%postun -n libmount1 %postun -n libmount1 -p /sbin/ldconfig
/sbin/ldconfig
%pre -n uuidd %pre -n uuidd
/usr/sbin/groupadd -r uuidd 2>/dev/null || : /usr/sbin/groupadd -r uuidd 2>/dev/null || :
@ -428,17 +425,21 @@ fi
%post -n uuidd %post -n uuidd
%{fillup_and_insserv -n uuidd} %{fillup_and_insserv -n uuidd}
%if 0%{?suse_version} <= 1130
%run_permissions %run_permissions
%else
%set_permissions /usr/sbin/uuidd
%endif
%postun -n uuidd %postun -n uuidd
%{restart_on_update uuidd} %{restart_on_update uuidd}
%{insserv_cleanup} %{insserv_cleanup}
%post -n libuuid1 %post -n libuuid1 -p /sbin/ldconfig
/sbin/ldconfig
%postun -n libuuid1 %postun -n libuuid1
/sbin/ldconfig /sbin/ldconfig
%verifyscript -n uuidd %verifyscript -n uuidd
%verify_permissions -e /usr/sbin/uuidd %verify_permissions -e /usr/sbin/uuidd
@ -457,15 +458,16 @@ fi
%doc hwclock/README.hwclock %doc hwclock/README.hwclock
%doc text-utils/README.col %doc text-utils/README.col
%doc README.largedisk %doc README.largedisk
%config %attr(744,root,root) /etc/init.d/raw %config %attr(744,root,root) %{_sysconfdir}/init.d/raw
%config(noreplace) %attr(644,root,root) /etc/raw %config(noreplace) %attr(644,root,root) %{_sysconfdir}/raw
%config(noreplace) /etc/filesystems %config(noreplace) %{_sysconfdir}/filesystems
%config(noreplace) /etc/blkid.conf %config(noreplace) %{_sysconfdir}/blkid.conf
/bin/dmesg /bin/dmesg
/bin/more /bin/more
/bin/mount /bin/mount
/bin/umount /bin/umount
/bin/findmnt /bin/findmnt
/bin/lsblk
/sbin/adjtimex /sbin/adjtimex
/sbin/agetty /sbin/agetty
/sbin/blockdev /sbin/blockdev
@ -491,62 +493,62 @@ fi
/sbin/wipefs /sbin/wipefs
/sbin/fsfreeze /sbin/fsfreeze
/sbin/swaplabel /sbin/swaplabel
/usr/bin/ipcmk /sbin/fstrim
%{_bindir}/ipcmk
/bin/logger /bin/logger
/usr/bin/cal %{_bindir}/cal
/usr/bin/chrt %{_bindir}/chrt
/usr/bin/col %{_bindir}/col
/usr/bin/colcrt %{_bindir}/colcrt
/usr/bin/colrm %{_bindir}/colrm
/usr/bin/column %{_bindir}/column
/usr/bin/ddate %{_bindir}/ddate
/usr/bin/fallocate %{_bindir}/fallocate
/usr/bin/flock %{_bindir}/flock
/usr/bin/getopt %{_bindir}/getopt
/usr/bin/hexdump %{_bindir}/hexdump
/usr/bin/ionice %{_bindir}/ionice
/usr/bin/ipcrm %{_bindir}/ipcrm
/usr/bin/ipcs %{_bindir}/ipcs
/usr/bin/isosize %{_bindir}/isosize
/usr/bin/line %{_bindir}/line
/usr/bin/look %{_bindir}/look
/usr/bin/lscpu %{_bindir}/lscpu
/usr/bin/mcookie %{_bindir}/mcookie
/usr/bin/mesg %{_bindir}/mesg
/usr/bin/uuidgen %{_bindir}/uuidgen
%ifnarch ppc ppc64 %ifnarch ppc ppc64
/usr/bin/chrp-addnote %{_bindir}/chrp-addnote
/usr/bin/mkzimage_cmdline %{_bindir}/mkzimage_cmdline
%endif %endif
/usr/bin/namei %{_bindir}/namei
/usr/bin/rename %{_bindir}/rename
/usr/bin/renice %{_bindir}/renice
/usr/bin/rev %{_bindir}/rev
/usr/bin/script %{_bindir}/script
/usr/bin/setarch %{_bindir}/setarch
/usr/bin/scriptreplay %{_bindir}/scriptreplay
/usr/bin/setsid %{_bindir}/setsid
/usr/bin/ul %{_bindir}/ul
/usr/bin/tailf %{_bindir}/tailf
/usr/bin/taskset %{_bindir}/taskset
/usr/bin/time %{_bindir}/time
/usr/bin/unshare %{_bindir}/unshare
/usr/bin/which %{_bindir}/which
/usr/sbin/addpart %{_sbindir}/addpart
/usr/sbin/delpart %{_sbindir}/delpart
/usr/sbin/ldattach %{_sbindir}/ldattach
/usr/sbin/partx %{_sbindir}/partx
/usr/sbin/rcraw %{_sbindir}/rcraw
/usr/sbin/rtcwake %{_sbindir}/rtcwake
/usr/sbin/setctsid %{_sbindir}/setctsid
%verify(not mode) %attr(0755,root,tty) /usr/bin/wall %verify(not mode) %attr(0755,root,tty) %{_bindir}/wall
/usr/bin/whereis %{_bindir}/whereis
%verify(not mode) %attr(0755,root,tty) /usr/bin/write %verify(not mode) %attr(0755,root,tty) %{_bindir}/write
%dir %{_defaultdocdir}/time %dir %{_defaultdocdir}/time
%dir %{_defaultdocdir}/which %dir %{_defaultdocdir}/which
%{_defaultdocdir}/time/* %{_defaultdocdir}/time/*
%{_defaultdocdir}/which/* %{_defaultdocdir}/which/*
%{_infodir}/ipc.info.gz
%{_infodir}/time.info*.gz %{_infodir}/time.info*.gz
%{_infodir}/which.info*.gz %{_infodir}/which.info*.gz
%{_mandir}/man1/cal.1.gz %{_mandir}/man1/cal.1.gz
@ -628,13 +630,16 @@ fi
%{_mandir}/man8/umount.8.gz %{_mandir}/man8/umount.8.gz
%{_mandir}/man8/setctsid.8.gz %{_mandir}/man8/setctsid.8.gz
%{_mandir}/man8/wipefs.8.gz %{_mandir}/man8/wipefs.8.gz
/usr/sbin/flushb %{_mandir}/man8/fstrim.8.gz
/usr/sbin/readprofile %{_mandir}/man8/lsblk.8.gz
%dir /usr/share/getopt %{_mandir}/ru
%attr (755,root,root) /usr/share/getopt/getopt-parse.bash %{_sbindir}/flushb
%attr (755,root,root) /usr/share/getopt/getopt-parse.tcsh %{_sbindir}/readprofile
%attr (755,root,root) /usr/share/getopt/getopt-test.bash %dir %{_datadir}/getopt
%attr (755,root,root) /usr/share/getopt/getopt-test.tcsh %attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh
%attr (755,root,root) %{_datadir}/getopt/getopt-test.bash
%attr (755,root,root) %{_datadir}/getopt/getopt-test.tcsh
%ifnarch ia64 %ifnarch ia64
%doc fdisk/README.fdisk %doc fdisk/README.fdisk
/sbin/fdisk /sbin/fdisk
@ -648,12 +653,12 @@ fi
/sbin/sfdisk /sbin/sfdisk
%endif %endif
%ifnarch s390 s390x %ifnarch s390 s390x
/usr/bin/cytune %{_bindir}/cytune
/usr/sbin/fdformat %{_sbindir}/fdformat
/sbin/hwclock /sbin/hwclock
/usr/sbin/klogconsole %{_sbindir}/klogconsole
/usr/bin/setterm %{_bindir}/setterm
/usr/sbin/tunelp %{_sbindir}/tunelp
%{_mandir}/man8/cytune.8.gz %{_mandir}/man8/cytune.8.gz
%{_mandir}/man8/fdformat.8.gz %{_mandir}/man8/fdformat.8.gz
%{_mandir}/man8/hwclock.8.gz %{_mandir}/man8/hwclock.8.gz
@ -671,7 +676,7 @@ fi
%{_libdir}/libblkid.so %{_libdir}/libblkid.so
%dir %{_includedir}/blkid %dir %{_includedir}/blkid
%{_includedir}/blkid/blkid.h %{_includedir}/blkid/blkid.h
%_libdir/pkgconfig/blkid.pc %{_libdir}/pkgconfig/blkid.pc
%{_mandir}/man3/libblkid.3.gz %{_mandir}/man3/libblkid.3.gz
%files -n libmount1 %files -n libmount1
@ -684,14 +689,14 @@ fi
%{_libdir}/libmount.so %{_libdir}/libmount.so
%dir %{_includedir}/mount %dir %{_includedir}/mount
%{_includedir}/mount/mount.h %{_includedir}/mount/mount.h
%_libdir/pkgconfig/mount.pc %{_libdir}/pkgconfig/mount.pc
%files -n uuidd %files -n uuidd
%defattr(-, root, root) %defattr(-, root, root)
%verify(not mode) %attr(0755,root,root) /usr/sbin/uuidd %verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd
%attr(-,uuidd,uuidd) %dir /var/lib/libuuid %attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid
%attr(-,uuidd,uuidd) %ghost %dir /var/run/uuidd %attr(-,uuidd,uuidd) %ghost %dir %{_localstatedir}/run/uuidd
/etc/init.d/uuidd %{_sysconfdir}/init.d/uuidd
%{_mandir}/man8/uuidd.8.gz %{_mandir}/man8/uuidd.8.gz
%files -n libuuid1 %files -n libuuid1
@ -704,7 +709,7 @@ fi
%{_libdir}/libuuid.so %{_libdir}/libuuid.so
%dir %{_includedir}/uuid %dir %{_includedir}/uuid
%{_includedir}/uuid/uuid.h %{_includedir}/uuid/uuid.h
%_libdir/pkgconfig/uuid.pc %{_libdir}/pkgconfig/uuid.pc
%{_mandir}/man3/uuid* %{_mandir}/man3/uuid*
%changelog %changelog