From owner-svn-src-head@FreeBSD.ORG Fri Mar 14 19:46:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E45E369B; Fri, 14 Mar 2014 19:46:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1B9775C; Fri, 14 Mar 2014 19:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2EJkWS7056091; Fri, 14 Mar 2014 19:46:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2EJkWT6056090; Fri, 14 Mar 2014 19:46:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201403141946.s2EJkWT6056090@svn.freebsd.org> From: Warner Losh Date: Fri, 14 Mar 2014 19:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263188 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Mar 2014 19:46:33 -0000 Author: imp Date: Fri Mar 14 19:46:32 2014 New Revision: 263188 URL: http://svnweb.freebsd.org/changeset/base/263188 Log: When NANO_IMAGE_MBRONLY is set, and we're backing via swap, only copy the MBR. PR: 136889 Submitted by: Aragon Gouveia Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:46:18 2014 (r263187) +++ head/tools/tools/nanobsd/nanobsd.sh Fri Mar 14 19:46:32 2014 (r263188) @@ -136,6 +136,9 @@ NANO_BOOT2CFG="-h" # Can be "file" or "swap" NANO_MD_BACKING="file" +# for swap type md(4) backing, write out the mbr only +NANO_IMAGE_MBRONLY=true + # Progress Print level PPLEVEL=3 @@ -573,6 +576,14 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then + if [ ${NANO_IMAGE_MBRONLY} ]; then + echo "Writing out _.disk.mbr..." + dd if=/dev/${MD} of=${NANO_DISKIMGDIR}/_.disk.mbr bs=512 count=1 + else + echo "Writing out ${NANO_IMGNAME}..." + dd if=/dev/${MD} of=${IMG} bs=64k + fi + echo "Writing out ${NANO_IMGNAME}..." dd conv=sparse if=/dev/${MD} of=${IMG} bs=64k fi