From owner-freebsd-hackers@FreeBSD.ORG Sun Nov 16 17:37:02 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9058110656EC for ; Sun, 16 Nov 2008 17:37:02 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 71A738FC0A for ; Sun, 16 Nov 2008 17:37:02 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.123.2.178] (p53.kientzle.com [66.166.149.53]) by kientzle.com (8.12.9/8.12.9) with ESMTP id mAGHP1tv004066; Sun, 16 Nov 2008 09:25:06 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <4920576F.9030606@freebsd.org> Date: Sun, 16 Nov 2008 09:25:03 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Luigi Rizzo References: <20081114131217.GA62275@onelab2.iet.unipi.it> In-Reply-To: <20081114131217.GA62275@onelab2.iet.unipi.it> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: convert bootable freebsd iso to bootable flash image X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2008 17:37:02 -0000 Luigi Rizzo wrote: > Just in case people have a similar need, or can point me to better > code to do the same job: > > i needed to convert a bootable FreeBSD iso image into a bootable > flash image, and have come up with the following code (derived > from PicoBSD). The nice part is that this is all done without > requiring root permissions -- the iso extraction is done with > bsdtar, the file system is created using makefs, and the > other patching is done with bsdlabel and dd. It doesn't look like this would preserve file ownership, which can be important. It might be interesting to use libarchive within makefs so that makefs can generate the filesystem image directly from tar or iso archives and preserve all of the ownership, permissions, etc. Tim