From owner-svn-src-user@FreeBSD.ORG Thu Mar 27 22:39:22 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E30B790B; Thu, 27 Mar 2014 22:39:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04A4FD7; Thu, 27 Mar 2014 22:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2RMdMai017946; Thu, 27 Mar 2014 22:39:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2RMdMTv017945; Thu, 27 Mar 2014 22:39:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201403272239.s2RMdMTv017945@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 27 Mar 2014 22:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r263843 - user/marcel/mkimg X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2014 22:39:23 -0000 Author: marcel Date: Thu Mar 27 22:39:22 2014 New Revision: 263843 URL: http://svnweb.freebsd.org/changeset/base/263843 Log: Remove trksz, which was hardcoded to 1, and replace it by secs, which can be set on the command line. Modified: user/marcel/mkimg/ebr.c Modified: user/marcel/mkimg/ebr.c ============================================================================== --- user/marcel/mkimg/ebr.c Thu Mar 27 21:43:00 2014 (r263842) +++ user/marcel/mkimg/ebr.c Thu Mar 27 22:39:22 2014 (r263843) @@ -68,7 +68,7 @@ ebr_write(int fd, lba_t imgsz __unused, u_char *ebr; struct dos_partition *dp; struct part *part, *next; - lba_t block, trksz; + lba_t block; int error; ebr = malloc(secsz); @@ -78,27 +78,26 @@ ebr_write(int fd, lba_t imgsz __unused, le16enc(ebr + DOSMAGICOFFSET, DOSMAGIC); error = 0; - trksz = 1; /* Sectors/track */ STAILQ_FOREACH_SAFE(part, &partlist, link, next) { - block = part->block - trksz; + block = part->block - nsecs; dp = (void *)(ebr + DOSPARTOFF); - ebr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, trksz); + ebr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, nsecs); dp->dp_typ = ALIAS_TYPE2INT(part->type); ebr_chs(&dp->dp_ecyl, &dp->dp_ehd, &dp->dp_esect, part->block + part->size - 1); - le32enc(&dp->dp_start, trksz); + le32enc(&dp->dp_start, nsecs); le32enc(&dp->dp_size, part->size); /* Add link entry */ if (next != NULL) { dp++; ebr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, - next->block - trksz); + next->block - nsecs); dp->dp_typ = DOSPTYP_EXT; ebr_chs(&dp->dp_ecyl, &dp->dp_ehd, &dp->dp_esect, next->block + next->size - 1); - le32enc(&dp->dp_start, next->block - trksz); - le32enc(&dp->dp_size, next->size + trksz); + le32enc(&dp->dp_start, next->block - nsecs); + le32enc(&dp->dp_size, next->size + nsecs); } error = mkimg_seek(fd, block);