rpms/util-linux-ng/devel util-linux-ng-2.13-mkswap-uuid.patch, NONE, 1.1 util-linux-ng-2.13-swapon-swsuspend.patch, 1.1, 1.2 util-linux-ng.spec, 1.20, 1.21
Karel Zak (kzak)
fedora-extras-commits at redhat.com
Wed Apr 2 14:13:11 UTC 2008
Author: kzak
Update of /cvs/pkgs/rpms/util-linux-ng/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26699
Modified Files:
util-linux-ng-2.13-swapon-swsuspend.patch util-linux-ng.spec
Added Files:
util-linux-ng-2.13-mkswap-uuid.patch
Log Message:
* Wed Apr 2 2008 Karel Zak <kzak at redhat.com> 2.13.1-6
- fix 439984 - backport mkswap -U
util-linux-ng-2.13-mkswap-uuid.patch:
--- NEW FILE util-linux-ng-2.13-mkswap-uuid.patch ---
diff -up util-linux-ng-2.13.1/disk-utils/mkswap.c.uuid util-linux-ng-2.13.1/disk-utils/mkswap.c
--- util-linux-ng-2.13.1/disk-utils/mkswap.c.uuid 2008-01-16 10:31:41.000000000 +0100
+++ util-linux-ng-2.13.1/disk-utils/mkswap.c 2008-04-02 16:07:47.000000000 +0200
@@ -351,7 +351,7 @@ bit_test_and_clear (unsigned long *addr,
static void
usage(void) {
fprintf(stderr,
- _("Usage: %s [-c] [-v0|-v1] [-pPAGESZ] [-L label] /dev/name [blocks]\n"),
+ _("Usage: %s [-c] [-v0|-v1] [-pPAGESZ] [-L label] [-U UUID] /dev/name [blocks]\n"),
program_name);
exit(1);
}
@@ -502,6 +502,7 @@ main(int argc, char ** argv) {
char *opt_label = NULL;
unsigned char *uuid = NULL;
#ifdef HAVE_LIBUUID
+ unsigned char *opt_uuid = NULL;
uuid_t uuid_dat;
#endif
@@ -546,6 +547,16 @@ main(int argc, char ** argv) {
case 'v':
version = atoi(argv[i]+2);
break;
+ case 'U':
+#ifdef HAVE_LIBUUID
+ opt_uuid = argv[i]+2;
+ if (!*opt_uuid && i+1 < argc)
+ opt_uuid = argv[++i];
+#else
+ fprintf(stderr, _("%1$s: warning: ignore -U (UUIDs are unsupported by %1$s)\n"),
+ program_name);
+#endif
+ break;
default:
usage();
}
@@ -558,7 +569,11 @@ main(int argc, char ** argv) {
}
#ifdef HAVE_LIBUUID
- uuid_generate(uuid_dat);
+ if(opt_uuid) {
+ if (uuid_parse(opt_uuid, uuid_dat) != 0)
+ die(_("error: UUID parsing failed"));
+ } else
+ uuid_generate(uuid_dat);
uuid = uuid_dat;
#endif
diff -up util-linux-ng-2.13.1/disk-utils/mkswap.8.uuid util-linux-ng-2.13.1/disk-utils/mkswap.8
--- util-linux-ng-2.13.1/disk-utils/mkswap.8.uuid 2007-08-27 15:00:34.000000000 +0200
+++ util-linux-ng-2.13.1/disk-utils/mkswap.8 2008-04-02 16:07:47.000000000 +0200
@@ -7,7 +7,7 @@
.SH NAME
mkswap \- set up a Linux swap area
.SH SYNOPSIS
-.BI "mkswap [\-c] [\-v" N "] [\-f] [\-p " PSZ "] [\-L " label "] " device " [" size "]"
+.BI "mkswap [\-c] [\-v" N "] [\-f] [\-p " PSZ "] [\-L " label "] [\-U " uuid "] " device " [" size "]"
.SH DESCRIPTION
.B mkswap
sets up a Linux swap area on a device or in a file.
@@ -156,6 +156,10 @@ when creating the swapspace.
Version 0 (-v0) swap space format is no longer supported in 2.5+ kernels.
+.TP
+.B \-U uuid
+Specify the uuid to use. The default is to generate UUIDs.
+
.SH "SEE ALSO"
.BR fdisk (8),
.BR swapon (8)
util-linux-ng-2.13-swapon-swsuspend.patch:
Index: util-linux-ng-2.13-swapon-swsuspend.patch
===================================================================
RCS file: /cvs/pkgs/rpms/util-linux-ng/devel/util-linux-ng-2.13-swapon-swsuspend.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- util-linux-ng-2.13-swapon-swsuspend.patch 20 Aug 2007 10:48:20 -0000 1.1
+++ util-linux-ng-2.13-swapon-swsuspend.patch 2 Apr 2008 14:12:59 -0000 1.2
@@ -1,21 +1,6 @@
-From db6041b3a569d78f5716baa5a134a3a857014337 Mon Sep 17 00:00:00 2001
-From: Karel Zak <kzak at redhat.com>
-Date: Wed, 30 May 2007 13:22:51 +0200
-Subject: [PATCH] mount: automatically reinitialize swap with old swsuspend data
-
-We have to reinitialize swap area with old (=useless) software suspend
-data. The problem is that if we don't do it, then we get data
-corruption the next time with suspended on.
-
-Signed-off-by: Karel Zak <kzak at redhat.com>
----
- mount/swapon.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 63 insertions(+), 0 deletions(-)
-
-diff --git a/mount/swapon.c b/mount/swapon.c
-index ed91afc..3f9b442 100644
---- a/mount/swapon.c
-+++ b/mount/swapon.c
+diff -up util-linux-ng-2.13.1/mount/swapon.c.reinit util-linux-ng-2.13.1/mount/swapon.c
+--- util-linux-ng-2.13.1/mount/swapon.c.reinit 2008-01-16 10:31:41.000000000 +0100
++++ util-linux-ng-2.13.1/mount/swapon.c 2008-04-02 16:00:24.000000000 +0200
@@ -10,6 +10,9 @@
#include <errno.h>
#include <sys/stat.h>
@@ -35,22 +20,25 @@
#ifdef HAVE_SYS_SWAP_H
# include <sys/swap.h>
#endif
-@@ -158,6 +163,52 @@ display_summary(void)
+@@ -158,6 +163,64 @@ display_summary(void)
}
static int
-+swap_is_swsuspend(const char *device) {
++swap_is_suspend(const char *device) {
+ const char *type = fsprobe_get_fstype_by_devname(device);
+
-+ return (type && strcmp(type, "swsuspend") == 0) ? 1 : 0;
++ return (type && strcmp(type, "suspend") == 0) ? 1 : 0;
+}
+
+/* calls mkswap */
+static int
+swap_reinitialize(const char *device) {
+ const char *label = fsprobe_get_label_by_devname(device);
++ const char *uuid = fsprobe_get_uuid_by_devname(device);
+ pid_t pid;
+ int status, ret;
++ char *cmd[7];
++ int idx=0;
+
+ switch((pid=fork())) {
+ case -1: /* fork error */
@@ -59,10 +47,19 @@
+ return -1;
+
+ case 0: /* child */
-+ if (label && *label)
-+ execl(PATH_MKSWAP, PATH_MKSWAP, "-L", label, device, NULL);
-+ else
-+ execl(PATH_MKSWAP, PATH_MKSWAP, device, NULL);
++ cmd[idx++] = PATH_MKSWAP;
++ if (label && *label) {
++ cmd[idx++] = "-L";
++ cmd[idx++] = (char *) label;
++ }
++ if (uuid && *uuid) {
++ cmd[idx++] = "-U";
++ cmd[idx++] = (char *) uuid;
++ }
++ cmd[idx++] = (char *) device;
++ cmd[idx++] = NULL;
++ execv(cmd[0], cmd);
++ perror("execv");
+ exit(1); /* error */
+
+ default: /* parent */
@@ -88,15 +85,15 @@
do_swapon(const char *orig_special, int prio, int canonic) {
int status;
struct stat st;
-@@ -179,6 +230,18 @@ do_swapon(const char *orig_special, int prio, int canonic) {
+@@ -179,6 +242,18 @@ do_swapon(const char *orig_special, int
return -1;
}
+ /* We have to reinitialize swap with old (=useless) software suspend
+ * data. The problem is that if we don't do it, then we get data
-+ * corruption the next time with suspended on.
++ * corruption the next time an attempt at unsuspending is made.
+ */
-+ if (swap_is_swsuspend(special)) {
++ if (swap_is_suspend(special)) {
+ fprintf(stdout, _("%s: %s: software suspend data detected. "
+ "Reinitializing the swap.\n"),
+ progname, special);
@@ -107,6 +104,3 @@
/* people generally dislike this warning - now it is printed
only when `verbose' is set */
if (verbose) {
---
-1.5.2.2
-
Index: util-linux-ng.spec
===================================================================
RCS file: /cvs/pkgs/rpms/util-linux-ng/devel/util-linux-ng.spec,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- util-linux-ng.spec 26 Mar 2008 15:30:40 -0000 1.20
+++ util-linux-ng.spec 2 Apr 2008 14:12:59 -0000 1.21
@@ -2,7 +2,7 @@
Summary: A collection of basic system utilities
Name: util-linux-ng
Version: 2.13.1
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv2 and GPLv2+ and BSD with advertising and Public Domain
Group: System Environment/Base
URL: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng
@@ -104,6 +104,8 @@
Patch11: util-linux-ng-2.13-floppy-locale.patch
# remove partitions
Patch12: util-linux-ng-2.13-blockdev-rmpart.patch
+# 439984 - backport mkswap -U
+Patch13: util-linux-ng-2.13-mkswap-uuid.patch
%description
The util-linux-ng package contains a large variety of low-level system
@@ -128,6 +130,7 @@
%patch10 -p1
%patch11 -p1
%patch12 -p1
+%patch13 -p1
%build
unset LINGUAS || :
@@ -521,6 +524,9 @@
/sbin/losetup
%changelog
+* Wed Apr 2 2008 Karel Zak <kzak at redhat.com> 2.13.1-6
+- fix 439984 - backport mkswap -U
+
* Wed Mar 26 2008 Tom "spot" Callaway <tcallawa at redhat.com> - 2.13.1-5
- clean up sparc conditionals
More information about the fedora-extras-commits
mailing list