From ue@nathan.ruhr.de  Sun Jun 15 02:20:26 2003
Return-Path: <ue@nathan.ruhr.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 91EAD37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Jun 2003 02:20:26 -0700 (PDT)
Received: from mail.ruhr.de (in-ruhr4.ruhr.de [212.23.134.2])
	by mx1.FreeBSD.org (Postfix) with SMTP id 17DBD43FBD
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Jun 2003 02:20:24 -0700 (PDT)
	(envelope-from ue@nathan.ruhr.de)
Received: (qmail 20878 invoked by uid 10); 15 Jun 2003 09:20:21 -0000
Received: from nathan.internal (localhost.internal [127.0.0.1])
	by nathan.internal (8.12.9/8.12.9) with ESMTP id h5F9BXPI082211
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 Jun 2003 11:11:33 +0200 (CEST)
	(envelope-from ue@nathan.internal)
Received: (from ue@localhost)
	by nathan.internal (8.12.9/8.12.9/Submit) id h5F9BXYh082210;
	Sun, 15 Jun 2003 11:11:33 +0200 (CEST)
Message-Id: <200306150911.h5F9BXYh082210@nathan.internal>
Date: Sun, 15 Jun 2003 11:11:33 +0200 (CEST)
From: Udo Erdelhoff <ue@nathan.ruhr.de>
Reply-To: Udo Erdelhoff <ue@nathan.ruhr.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: dump frequency in sysinstall is always the fsck sequence number
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         53341
>Category:       bin
>Synopsis:       sysinstall(8): [patch] dump frequency in sysinstall is always the fsck sequence number
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-sysinstall
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 15 02:30:11 PDT 2003
>Closed-Date:    
>Last-Modified:  Tue Jul 13 13:49:01 UTC 2010
>Originator:     Udo Erdelhoff
>Release:        FreeBSD 5.1-BETA i386
>Organization:
>Environment:
System: FreeBSD nathan.internal 5.1-BETA FreeBSD 5.1-BETA #0: Mon May 19 06:45:58 CEST 2003 root@nathan.internal:/home/data/obj/home/data/src/sys/NATHAN i386

>Description:
The dump frequency and fsck pass columns in the /etc/fstab of a freshly
installed FreeBSD system will always be identical because the code in
sysinstall/config.c hardcodes that.  This make the periodic "dump these
file systems" report rather useless, because it insists on dumping the
root fs every day and every other file system every two days.

>How-To-Repeat:
Install a FreeBSD system for the first time and look into /etc/fstab

>Fix:
WARNING: Untested.  It compiles, but that is about it.

The numbers I choose (7 days for /home, 28 days for static stuff)
are what I use on my boxes, they are perfect bikeshed material.

Index: config.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/config.c,v
retrieving revision 1.210
diff -u -r1.210 config.c
--- config.c	31 May 2003 11:28:28 -0000	1.210
+++ config.c	15 Jun 2003 08:56:52 -0000
@@ -172,6 +172,21 @@
     return 0;
 }
 
+static int
+dump_freq(Chunk *c1)
+{
+    if (c1->type == part && c1->subtype != FS_SWAP) {
+	if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0)
+	    return 0;
+	else if (strncmp(mount_point(c1), "/home", 5) == 0)
+	    return 7;
+	else
+	    return 28;
+    }
+    return 0;
+}
+
+
 int
 configFstab(dialogMenuItem *self)
 {
@@ -233,7 +248,7 @@
     fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n");
     for (i = 0; i < nchunks; i++)
 	fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]),
-		fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i]));
+		fstype(chunk_list[i]), fstype_short(chunk_list[i]), dump_freq(chunk_list[i]), seq_num(chunk_list[i]));
     
     /* Now look for the CDROMs */
     devs = deviceFind(NULL, DEVICE_TYPE_CDROM);



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->qa 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Jul 18 16:00:30 PDT 2003 
Responsible-Changed-Why:  
Assign to qa group 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53341 
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Tue Jul 13 13:49:01 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=53341 
>Unformatted:
