From owner-cvs-all@FreeBSD.ORG Tue Apr 15 16:46:20 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 101F637B401; Tue, 15 Apr 2003 16:46:20 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A3B3443FAF; Tue, 15 Apr 2003 16:46:19 -0700 (PDT) (envelope-from jake@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3FNkJ0U058721; Tue, 15 Apr 2003 16:46:19 -0700 (PDT) (envelope-from jake@repoman.freebsd.org) Received: (from jake@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3FNkJTA058720; Tue, 15 Apr 2003 16:46:19 -0700 (PDT) Message-Id: <200304152346.h3FNkJTA058720@repoman.freebsd.org> From: Jake Burkholder Date: Tue, 15 Apr 2003 16:46:19 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sbin/sunlabel sunlabel.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Apr 2003 23:46:20 -0000 jake 2003/04/15 16:46:19 PDT FreeBSD src repository Modified files: sbin/sunlabel sunlabel.c Log: - Use read(2) to get the existing sunlabel on a disk, instead of parsing kern.geom.conftxt, which md disks don't show up in. If the magic and the checksum are right assume its a valid sunlabel, otherwise use the DIOC ioctls to get the disk parameters and whip up a label out of thin air. - Don't just silently create or correct invalid c partitions, warn about invalid ones in label proto files. - Split checksumming into a function since we do it a couple times. Also don't include the sl_cksum field in the checksum, which avoids needing to clear it first. This is makes sunlabel a suitable replacement for disklabel in make release. Revision Changes Path 1.2 +80 -76 src/sbin/sunlabel/sunlabel.c