From owner-svn-src-all@FreeBSD.ORG Fri Apr 8 18:31:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CF9106566B; Fri, 8 Apr 2011 18:31:02 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E89128FC20; Fri, 8 Apr 2011 18:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p38IV13R088488; Fri, 8 Apr 2011 18:31:01 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p38IV10s088484; Fri, 8 Apr 2011 18:31:01 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201104081831.p38IV10s088484@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 8 Apr 2011 18:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220455 - stable/8/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 18:31:02 -0000 Author: uqs Date: Fri Apr 8 18:31:01 2011 New Revision: 220455 URL: http://svn.freebsd.org/changeset/base/220455 Log: MFH r219446-219449: - Remove bsdlabel.5 - Remove bsdlabel test-script that was full of broken assumptions - Remove dead code depending on __alpha__ - Widen fields that display partition offset/length. Deleted: stable/8/sbin/bsdlabel/bsdlabel.5 stable/8/sbin/bsdlabel/runtest.sh Modified: stable/8/sbin/bsdlabel/Makefile stable/8/sbin/bsdlabel/bsdlabel.8 stable/8/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/8/sbin/bsdlabel/ (props changed) Modified: stable/8/sbin/bsdlabel/Makefile ============================================================================== --- stable/8/sbin/bsdlabel/Makefile Fri Apr 8 14:42:29 2011 (r220454) +++ stable/8/sbin/bsdlabel/Makefile Fri Apr 8 18:31:01 2011 (r220455) @@ -5,7 +5,6 @@ PROG= bsdlabel SRCS= bsdlabel.c geom_bsd_enc.c -#MAN= bsdlabel.5 MAN+= bsdlabel.8 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" @@ -17,9 +16,3 @@ DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF LDADD= -lgeom -lbsdxml -lsbuf .include - -test: ${PROG} - sh ${.CURDIR}/runtest.sh - -testx: ${PROG} - sh -x ${.CURDIR}/runtest.sh Modified: stable/8/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- stable/8/sbin/bsdlabel/bsdlabel.8 Fri Apr 8 14:42:29 2011 (r220454) +++ stable/8/sbin/bsdlabel/bsdlabel.8 Fri Apr 8 18:31:01 2011 (r220455) @@ -31,7 +31,7 @@ .\" @(#)disklabel.8 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 8, 2007 +.Dd March 5, 2011 .Dt BSDLABEL 8 .Os .Sh NAME @@ -109,9 +109,9 @@ argument forces .Nm to use a layout suitable for a different architecture. Current valid values are -.Cm i386 , amd64 , ia64 , pc98 , +.Cm i386 , amd64 , ia64 , and -.Cm alpha . +.Cm pc98 . If this option is omitted, .Nm will use a layout suitable for the current machine. @@ -493,7 +493,6 @@ are not generally compatible. .Xr ccd 4 , .Xr geom 4 , .Xr md 4 , -.\" Xr bsdlabel 5 , .Xr disktab 5 , .Xr boot0cfg 8 , .Xr fdisk 8 , Modified: stable/8/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/8/sbin/bsdlabel/bsdlabel.c Fri Apr 8 14:42:29 2011 (r220454) +++ stable/8/sbin/bsdlabel/bsdlabel.c Fri Apr 8 18:31:01 2011 (r220455) @@ -105,7 +105,7 @@ static char tmpfil[] = PATH_TMPFILE; static struct disklabel lab; static u_char bootarea[BBSIZE]; static off_t mediasize; -static u_int secsize; +static ssize_t secsize; static char blank[] = ""; static char unknown[] = "unknown"; @@ -129,12 +129,6 @@ static uint32_t lba_offset; static int labelsoffset = LABELSECTOR; static int labeloffset = LABELOFFSET; static int bbsize = BBSIZE; -static int alphacksum = -#if defined(__alpha__) - 1; -#else - 0; -#endif enum { UNSPEC, EDIT, READ, RESTORE, WRITE, WRITEBOOT @@ -176,12 +170,6 @@ main(int argc, char *argv[]) labelsoffset = 1; labeloffset = 0; bbsize = 8192; - alphacksum = 0; - } else if (!strcmp(optarg, "alpha")) { - labelsoffset = 0; - labeloffset = 64; - bbsize = 8192; - alphacksum = 1; } else { errx(1, "Unsupported architecture"); } @@ -350,7 +338,6 @@ readboot(void) { int fd; struct stat st; - uint64_t *p; if (xxboot == NULL) xxboot = "/boot/boot"; @@ -358,20 +345,7 @@ readboot(void) if (fd < 0) err(1, "cannot open %s", xxboot); fstat(fd, &st); - if (alphacksum && st.st_size <= BBSIZE - 512) { - if (read(fd, bootarea + 512, st.st_size) != st.st_size) - err(1, "read error %s", xxboot); - - /* - * Set the location and length so SRM can find the - * boot blocks. - */ - p = (uint64_t *)bootarea; - p[60] = (st.st_size + secsize - 1) / secsize; - p[61] = 1; - p[62] = 0; - return; - } else if ((!alphacksum) && st.st_size <= BBSIZE) { + if (st.st_size <= BBSIZE) { if (read(fd, bootarea, st.st_size) != st.st_size) err(1, "read error %s", xxboot); return; @@ -405,7 +379,6 @@ geom_bsd_available(void) static int writelabel(void) { - uint64_t *p, sum; int i, fd, serrno; struct gctl_req *grq; char const *errstr; @@ -428,12 +401,6 @@ writelabel(void) lab.d_partitions[i].p_offset += lba_offset; bsd_disklabel_le_enc(bootarea + labeloffset + labelsoffset * secsize, lp); - if (alphacksum) { - /* Generate the bootblock checksum for the SRM console. */ - for (p = (uint64_t *)bootarea, i = 0, sum = 0; i < 63; i++) - sum += p[i]; - p[63] = sum; - } fd = open(specname, O_RDWR); if (fd < 0) { @@ -621,11 +588,11 @@ display(FILE *f, const struct disklabel } fprintf(f, "%u partitions:\n", lp->d_npartitions); fprintf(f, - "# size offset fstype [fsize bsize bps/cpg]\n"); + "# size offset fstype [fsize bsize bps/cpg]\n"); pp = lp->d_partitions; for (i = 0; i < lp->d_npartitions; i++, pp++) { if (pp->p_size) { - fprintf(f, " %c: %8lu %8lu ", 'a' + i, + fprintf(f, " %c: %10lu %10lu ", 'a' + i, (u_long)pp->p_size, (u_long)pp->p_offset); if (pp->p_fstype < FSMAXTYPES) fprintf(f, "%8.8s", fstypenames[pp->p_fstype]); @@ -634,13 +601,13 @@ display(FILE *f, const struct disklabel switch (pp->p_fstype) { case FS_UNUSED: /* XXX */ - fprintf(f, " %5lu %5lu %5.5s ", + fprintf(f, " %5lu %5lu %2s", (u_long)pp->p_fsize, (u_long)(pp->p_fsize * pp->p_frag), ""); break; case FS_BSDFFS: - fprintf(f, " %5lu %5lu %5u ", + fprintf(f, " %5lu %5lu %5u", (u_long)pp->p_fsize, (u_long)(pp->p_fsize * pp->p_frag), pp->p_cpg);