Hi,
The following patch replaces the -U flag with a -D flag that forces
usage of device name in /etc/dumpdates. The default is now to use DUID.
Why?:
- dump identification would better be unique
- dumpdates is less human readable but not that less if need be
Index: dump.8
===================================================================
RCS file: /cvs/src/sbin/dump/dump.8,v
retrieving revision 1.48
diff -u -p -r1.48 dump.8
--- dump.8 17 Jul 2014 19:58:05 -0000 1.48
+++ dump.8 3 Apr 2015 14:04:04 -0000
@@ -40,7 +40,7 @@
.Sh SYNOPSIS
.Nm dump
.Bk -words
-.Op Fl 0123456789acnSUuWw
+.Op Fl 0123456789acnSDuWw
.Op Fl B Ar records
.Op Fl b Ar blocksize
.Op Fl d Ar density
@@ -229,13 +229,13 @@ The
flag is mutually exclusive from the
.Fl u
flag.
-.It Fl U
-Use the
-.Xr disklabel 8
-UID instead of the device name when updating
+.It Fl D
+Use the device name when updating
.Pa /etc/dumpdates
and when searching for the date of the latest
-lower-level dump.
+lower-level dump. The default is to use the
+.Xr disklabel 8
+UID.
.It Fl u
Update the file
.Pa /etc/dumpdates
Index: dump.h
===================================================================
RCS file: /cvs/src/sbin/dump/dump.h,v
retrieving revision 1.22
diff -u -p -r1.22 dump.h
--- dump.h 3 Sep 2014 02:34:34 -0000 1.22
+++ dump.h 3 Apr 2015 14:04:04 -0000
@@ -60,7 +60,7 @@ char *duid; /* duid of the disk being d
char lastlevel; /* dump level of previous dump */
char level; /* dump level of this dump */
int uflag; /* update flag */
-int Uflag; /* use duids in dumpdates flag */
+int Dflag; /* use devices names in dumpdates flag (defaults to
duids) */
int diskfd; /* disk file descriptor */
int tapefd; /* tape file descriptor */
int pipeout; /* true => output to standard output */
Index: itime.c
===================================================================
RCS file: /cvs/src/sbin/dump/itime.c,v
retrieving revision 1.19
diff -u -p -r1.19 itime.c
--- itime.c 16 Jan 2015 06:39:57 -0000 1.19
+++ itime.c 3 Apr 2015 14:04:04 -0000
@@ -125,7 +125,7 @@ getdumptime(void)
int i;
char *fname;
- fname = Uflag ? duid : disk;
+ fname = Dflag ? disk : duid;
#ifdef FDEBUG
msg("Looking for name %s in dumpdates = %s for level = %c\n",
fname, dumpdates, level);
@@ -165,7 +165,7 @@ putdumptime(void)
quit("cannot rewrite %s: %s\n", dumpdates, strerror(errno));
fd = fileno(df);
(void) flock(fd, LOCK_EX);
- fname = Uflag ? duid : disk;
+ fname = Dflag ? disk : duid;
free((char *)ddatev);
ddatev = 0;
nddates = 0;
Index: main.c
===================================================================
RCS file: /cvs/src/sbin/dump/main.c,v
retrieving revision 1.54
diff -u -p -r1.54 main.c
--- main.c 20 Jan 2015 18:22:20 -0000 1.54
+++ main.c 3 Apr 2015 14:04:04 -0000
@@ -115,7 +115,7 @@ main(int argc, char *argv[])
usage();
obsolete(&argc, &argv);
- while ((ch = getopt(argc, argv, "0123456789aB:b:cd:f:h:ns:ST:UuWw")) !=
-1)
+ while ((ch = getopt(argc, argv, "0123456789aB:b:cd:f:h:ns:ST:DuWw")) !=
-1)
switch (ch) {
/* dump level */
case '0': case '1': case '2': case '3': case '4':
@@ -183,8 +183,8 @@ main(int argc, char *argv[])
lastlevel = '?';
break;
- case 'U':
- Uflag = 1; /* use duids */
+ case 'D':
+ Dflag = 1; /* use devices names instead of duids */
break;
case 'u': /* update /etc/dumpdates */
@@ -394,7 +394,7 @@ main(int argc, char *argv[])
}
if (ioctl(diskfd, DIOCGDINFO, (char *)&lab) < 0)
err(1, "ioctl (DIOCGDINFO)");
- if (!Uflag)
+ if (Dflag)
;
else if (memcmp(lab.d_uid, &zero_uid, sizeof(lab.d_uid)) == 0) {
msg("Cannot find DUID of disk %s\n", disk);
--
Manuel Giraud