From owner-freebsd-embedded@FreeBSD.ORG Thu Nov 29 14:27:13 2012 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF7798D7 for ; Thu, 29 Nov 2012 14:27:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ia0-f182.google.com (mail-ia0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7ABF78FC15 for ; Thu, 29 Nov 2012 14:27:13 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id x2so13696597iad.13 for ; Thu, 29 Nov 2012 06:27:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=9GCCWgujyvDGR3jD7y/+no3v4rqt8LO2AXi7r0karkU=; b=Hn3ANf8AzTaUqx9fQ12PhPW2wj1UMicdOLS3XW3+A+TtIInSsWeuuqaUsgbg3ShBzs upK+RiUyOJ67qsnE3oGZWyns3M5vz+7LOuwL2TdzN4tpcEW1TteV5NhDl3CL7s72Hoy1 1j4fv6g9+re3hf1CUHNPA+F3NasG1Phpg/6TByfuTZPgutzQJwq+BjuIH3SqunNf9x4C Itlzm6kf//4K0fJsR7yHzqr2lIulIpOvTMAXNtwb5CqSqBTUEa+C3fgPQO5us0x5zApo d2F1Y3qnv6IVbHwGzReGryMhVehEmSxBnEihG4+TPkkBdd80w7mPuln9STyN9LWWM4FF Jukg== Received: by 10.50.158.201 with SMTP id ww9mr26103109igb.22.1354199232442; Thu, 29 Nov 2012 06:27:12 -0800 (PST) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id v12sm1639177igv.3.2012.11.29.06.27.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Nov 2012 06:27:09 -0800 (PST) Sender: Warner Losh Subject: Re: NanoBSD: Create image sparsely Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org> Date: Thu, 29 Nov 2012 07:27:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org> To: Nick Hibma X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQm6SoVEax4Yn1vxBBdQYQ0ry4G0n7awOiVdbl7y0w/yu/wWLyVY5QrEplaHVpXI2v/osFax Cc: =?windows-1252?Q?=93FreeBSD_Embedded_Mailing_List=94?= X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 14:27:13 -0000 Looks good to me, go ahead. Warner On Nov 29, 2012, at 12:42 AM, Nick Hibma wrote: > In the past I have submitted patches to create images sparsely. There = is however one patch missing still which, with the addition of = NANO_INIT_IMG2, has become much more useful: >=20 > --- AnyWi/freebsd/nanobsd/nanobsd.sh 2012-11-08 19:48:40.000000000 = +0100 > +++ /usr/src/tools/tools/nanobsd/nanobsd.sh 2012-11-06 = 15:24:52.000000000 +0100 > @@ -540,7 +540,7 @@ > if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then > # Duplicate to second image (if present) > echo "Duplicating to second image..." > - dd if=3D/dev/${MD}s1 of=3D/dev/${MD}s2 bs=3D64k > + dd conv=3Dsparse if=3D/dev/${MD}s1 of=3D/dev/${MD}s2 = bs=3D64k > mount /dev/${MD}s2a ${MNT} > for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab > do > @@ -569,7 +569,7 @@ >=20 > if ${do_copyout_partition} ; then > echo "Writing out _.disk.image..." > - dd if=3D/dev/${MD}s1 of=3D${NANO_DISKIMGDIR}/_.disk.image= bs=3D64k > + dd conv=3Dsparse if=3D/dev/${MD}s1 = of=3D${NANO_DISKIMGDIR}/_.disk.image bs=3D64k > fi > mdconfig -d -u $MD >=20 > It copies out the image sparsely (conv=3Dsparse). The big advantage = comes when creating many images (I have between 10 and 20 images = simultaneously on my disk). >=20 > Any objections to this? (*) >=20 > Nick Hibma > nick@van-laarhoven.org