From owner-freebsd-current@FreeBSD.ORG Sun May 2 09:55:50 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0C0616A4CE; Sun, 2 May 2004 09:55:50 -0700 (PDT) Received: from mailbox.univie.ac.at (mailbox.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id B08DA43D1F; Sun, 2 May 2004 09:55:49 -0700 (PDT) (envelope-from le@FreeBSD.org) Received: from wireless (adslle.cc.univie.ac.at [131.130.102.11]) i42GtdUX1045880; Sun, 2 May 2004 18:55:41 +0200 Date: Sun, 2 May 2004 18:55:40 +0200 (CEST) From: Lukas Ertl To: Scott Long In-Reply-To: <40952044.1000306@freebsd.org> Message-ID: <20040502185320.Q1661@korben> References: <200404301403.50634.past@noc.ntua.gr> <20040430123040.GB30157@melusine.cuivre.fr.eu.org> <4094F86E.2020908@noc.ntua.gr><40952044.1000306@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-DCC-ZID-Univie-Metrics: imap 4244; Body=0 Fuz1=0 Fuz2=0 cc: freebsd-current@FreeBSD.org cc: Panagiotis Astithas cc: Thomas Quinot Subject: Re: Change default dumpdir to /usr/crash? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 May 2004 16:55:50 -0000 On Sun, 2 May 2004, Scott Long wrote: > Thomas Quinot wrote: > > What about computing a default /var size as a function of the available > > RAM? Would that be workable within sysinstall? > > I believe that sysinstall already computes the swap partition size based > on RAM, so computing /var also should be easy. Patches are happily > accecpted =-) How about this one? Makes /var = physical RAM + some extra 64MB (VAR_NOMINAL_SIZE). Untested, so don't beat me. :-) ---8<--- Index: label.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/sysinstall/label.c,v retrieving revision 1.143 diff -u -r1.143 label.c --- label.c 16 Mar 2004 17:07:06 -0000 1.143 +++ label.c 2 May 2004 16:53:09 -0000 @@ -1452,8 +1452,21 @@ record_label_chunks(devs, dev); } if (!vardev) { - sz = requested_part_size(VAR_VAR_SIZE, VAR_NOMINAL_SIZE, VAR_DEFAULT_SIZE, perc); + sz = requested_part_size(VAR_VAR_SIZE, 0, 0, perc); + if (sz == 0) { + daddr_t nom; + daddr_t def; + mib[0] = CTL_HW; + mib[1] = HW_PHYSMEM; + size = sizeof physmem; + sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); + def = (int)(physmem / 512); + if (def < VAR_MIN_SIZE * ONE_MEG) + def = VAR_MIN_SIZE * ONE_MEG; + nom = (int)(physmem / 512) / 8; + sz = VAR_NOMINAL_SIZE * ONE_MEG + nom + (def - nom) * perc / 100; + } var_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); ---8<--- cheers, le -- Lukas Ertl http://mailbox.univie.ac.at/~le/ le@FreeBSD.org http://people.freebsd.org/~le/