From owner-freebsd-stable@FreeBSD.ORG Sun Oct 27 08:05:58 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F3F8DE94 for ; Sun, 27 Oct 2013 08:05:57 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBEB2C8C for ; Sun, 27 Oct 2013 08:05:56 +0000 (UTC) Received: from ur.dons.net.au (ppp118-210-221-155.lns20.adl6.internode.on.net [118.210.221.155]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id r9R85YT8025918 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 27 Oct 2013 18:35:40 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: memstick.img size adjustment Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20131027144834.T80429@sola.nimnet.asn.au> Date: Sun, 27 Oct 2013 18:35:34 +1030 Content-Transfer-Encoding: quoted-printable Message-Id: References: <0BEF1ADC0CFB448F9CB7264B652C4643@sneezy> <20131027144834.T80429@sola.nimnet.asn.au> To: Ian Smith X-Mailer: Apple Mail (2.1816) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: David Boyd , freebsd-stable stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2013 08:05:58 -0000 On 27 Oct 2013, at 17:54, Ian Smith wrote: > But then, I never understood why we used DD mode (/dev/da0a) rather = than=20 > a properly sliced MBR with the potential to have multiple releases = &/or=20 > architectures on one stick. Again, PC-BSD (at 8.2 anyway) made a = stick=20 > with a slice table, so storing data (dmesg, pciconf, whatever) back to=20= > the stick was trivial, as was adding boot0 to allow boot selection. I don't know either, although given how makefs works it might be the = easy option. >> Or can someone identify the custom changes we need to = generate-release.sh in >> order to accomplish this? >=20 > I'm all ears. I make custom releases for work with a large (multi gigabyte) tar file = which is unpacked over the installed system. My script looks like.. =3D=3D SNIP =3D=3D set -e PATH=3D/bin:/usr/bin:/sbin:/usr/sbin export PATH BLOCKSIZE=3D10240 if [ $# -lt 2 ]; then echo "$0 file srcdir [path ..]" echo "" echo "For example.." echo "$0 /tmp/memstick.img /usr/obj/usr/src/release/release = /tmp/extra" echo "" echo "Note that srcdir must have a release built (we need the boot = loader from it)" exit 1 fi FILE=3D"${1}" shift SRC=3D"${1}" shift DIRS=3D"$@" for d in $DIRS; do if [ ! -e "${d}" ]; then echo "${d} doesn't exist" exit 1 fi done TMPDIR=3D`mktemp -d -q /tmp/make-usbimg.XXXXXX` if [ $? -ne 0 ]; then echo "Unable to create temporary directory" exit 1 fi mkdir -p "${TMPDIR}/etc" echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > = ${TMPDIR}/etc/fstab makefs -b 204800 -B little -o label=3DFreeBSD_Install ${FILE} ${TMPDIR} = ${SRC} ${DIRS} if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi unit=3D`mdconfig -a -t vnode -f ${FILE}` if [ $? -ne 0 ]; then echo "mdconfig failed" exit 1 fi gpart create -s BSD ${unit} gpart bootcode -b ${SRC}/boot/boot ${unit} gpart add -t freebsd-ufs ${unit} mdconfig -d -u ${unit} rm -rf "${TMPDIR}" =3D=3D SNIP =3D=3D I haven't tried using partitions, given the way it is made it might be = tricky. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C