From owner-freebsd-small@FreeBSD.ORG Tue Oct 24 12:38:46 2006 Return-Path: X-Original-To: freebsd-small@FreeBSD.org Delivered-To: freebsd-small@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13E7816A403; Tue, 24 Oct 2006 12:38:46 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E7A243D6D; Tue, 24 Oct 2006 12:38:45 +0000 (GMT) (envelope-from tataz@tataz.chchile.org) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp3-g19.free.fr (Postfix) with ESMTP id AC72E4859A; Tue, 24 Oct 2006 14:38:44 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id 9FD169E6C5; Tue, 24 Oct 2006 12:39:31 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 8CE71405D; Tue, 24 Oct 2006 14:39:31 +0200 (CEST) Date: Tue, 24 Oct 2006 14:39:31 +0200 From: Jeremie Le Hen To: Julian Elischer , Jean Milanez Melo Message-ID: <20061024123931.GF20405@obiwan.tataz.chchile.org> References: <20061024100641.GB20405@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: <20061024100641.GB20405@obiwan.tataz.chchile.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-current@FreeBSD.org, freebsd-small@FreeBSD.org Subject: Re: Handling non-standard directories in tinybsd X-BeenThere: freebsd-small@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2006 12:38:46 -0000 --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, this next patch knows how to handle image file specified with an absolute path. Moreover if the creation of the final image has failed, the temporary "vnode file" is left for the user. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tinybsd_absolutepath.patch" Index: tinybsd =================================================================== RCS file: /home/ncvs/src/tools/tools/tinybsd/tinybsd,v retrieving revision 1.4 diff -u -p -r1.4 tinybsd --- tinybsd 11 Oct 2006 21:46:53 -0000 1.4 +++ tinybsd 24 Oct 2006 12:34:19 -0000 @@ -422,17 +431,29 @@ create_image() { sleep 1 umount ${IMGMNT} - dd if=/dev/${MD} of=${CURRENTDIR}/${IMG} bs=64k + case ${IMG} in + /*) dd if=/dev/${MD} of=${IMG} bs=64k ;; + *) dd if=/dev/${MD} of=${CURRENTDIR}/${IMG} bs=64k ;; + esac + DD_RET=$? - rm -vf ${VNODEFILE} rm -rvf ${IMGMNT} mdconfig -d -u ${MD} - echo "" - echo "${TS} Done!" - echo "${TS} Your configuration options were saved in ${FULLFILENAME}" - echo "${TS} You can see your build log in ${HOME}/tinybsd.log" - echo "${TS} Your final image is in ${CURRENTDIR}/${IMG}" - echo "${TS} Now use dd(1) to write it." + + if [ $DD_RET -eq 0 ]; then + rm -vf ${VNODEFILE} + echo "" + echo "${TS} Done!" + echo "${TS} Your configuration options were saved in ${FULLFILENAME}" + echo "${TS} You can see your build log in ${HOME}/tinybsd.log" + echo "${TS} Your final image is in ${CURRENTDIR}/${IMG}" + echo "${TS} Now use dd(1) to write it." + else + echo "" >&2 + echo "${TS} Failed to create ${CURRENTDIR}/${IMG}!" >&2 + echo "${TS} You can see your build log in ${HOME}/tinybsd.log" >&2 + echo "${TS} The temporary image is still in ${VNODEFILE}" >&2 + fi } --0ntfKIWw70PvrIHh--