From owner-freebsd-current@FreeBSD.ORG Thu Jan 1 17:23:15 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85C2137F for ; Thu, 1 Jan 2015 17:23:15 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 6D3F764DAC for ; Thu, 1 Jan 2015 17:23:14 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id t01HN69V005468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 1 Jan 2015 09:23:07 -0800 Message-ID: <54A5827A.3000406@freebsd.org> Date: Thu, 01 Jan 2015 09:23:06 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: makefs && gpart (...) References: <20150101114829.GA3196@unixarea.DDR.dd> In-Reply-To: <20150101114829.GA3196@unixarea.DDR.dd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbFWzmrKR5FWVS43Nm0cQ7wOR9/xK5WSNddKQelyAGiZL4PLQqMR52FEnX2R11vpLgJxs8n/Mf9fEme1ig8mXJXDOQzt3mgoGc= X-Sonic-ID: C;xvSQ2dqR5BGG+PCsS5uE/A== M;tgQJ2tqR5BGG+PCsS5uE/A== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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: Thu, 01 Jan 2015 17:23:15 -0000 On 01/01/15 03:48, Matthias Apitz wrote: > > Hello, > > I have a small question and a small request re/ makefs && gpart: > > There is a script src/release/i386/make-memstick.sh to create an image > from a full directory tree; the tree is result of > > make installworld DESTDIR=/tree > make installkernel DESTDIR=/tree > > the script mainly does: > > ... > makefs -B little -o label=FreeBSD_Install ${2} ${1} > if [ $? -ne 0 ]; then > echo "makefs failed" > exit 1 > fi > rm ${1}/etc/fstab > > unit=$(mdconfig -a -t vnode -f ${2}) > if [ $? -ne 0 ]; then > echo "mdconfig failed" > exit 1 > fi > gpart create -s BSD ${unit} > gpart bootcode -b ${1}/boot/boot ${unit} > gpart add -t freebsd-ufs ${unit} > mdconfig -d -u ${unit} > > As you can see, it does makefs first, and after this it creates the > gpart structure in the image (i.e. in its memory file system). > Why is this in this order and where exactly starts the file system > created by makefs? This is a quirk of BSD disklabels: the first partition can start at address 0 and the first 16 sectors of UFS2 file systems are reserved for the label headers. It's not portable to other partition schemes. For -CURRENT, this script has been replaced, by the way, and doesn't use BSD labels anymore. -Nathan > > The request is: it would also be nice if 'make-memstick.sh' would allow > to pass from the command line some values for the size of the file > system to be created in the image; I modified it to fit my needs as: > > size=15482880b > ... > makefs -B little -M ${size} -m ${size} -f 400000 .... > > Thanks > > matthias >