Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2014 19:46:32 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263188 - head/tools/tools/nanobsd
Message-ID:  <201403141946.s2EJkWT6056090@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403141946.s2EJkWT6056090>