svn commit: r291914 - head/tools/tools/nanobsd/embedded

Warner Losh imp at FreeBSD.org
Mon Dec 7 04:02:34 UTC 2015


Author: imp
Date: Mon Dec  7 04:02:32 2015
New Revision: 291914
URL: https://svnweb.freebsd.org/changeset/base/291914

Log:
  Allow the .cfg files to specify the ultimate format for the images
  created.

Modified:
  head/tools/tools/nanobsd/embedded/common
  head/tools/tools/nanobsd/embedded/qemu-i386.cfg

Modified: head/tools/tools/nanobsd/embedded/common
==============================================================================
--- head/tools/tools/nanobsd/embedded/common	Mon Dec  7 04:02:31 2015	(r291913)
+++ head/tools/tools/nanobsd/embedded/common	Mon Dec  7 04:02:32 2015	(r291914)
@@ -312,6 +312,7 @@ create_diskimage ( ) (
 	pprint 3 "log: ${NANO_OBJ}/_.di"
 
 	(
+	set -o xtrace
 	if [ ! -z ${NANO_NOPRIV_BUILD} ]; then
 	    extra="-F ${NANO_OBJ}/_.metalog"
 	fi
@@ -348,17 +349,19 @@ create_diskimage ( ) (
 	fi
 	eval $NANO_SLICE_CFG=freebsd
 	eval $NANO_SLICE_ROOT=freebsd
+	[ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}"
+	[ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}"
 	if [ ! -z "${NANO_SLICE_FAT}" ]; then
-		mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
+		mkimg -a 3 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
 			-p ${s2}:=${NANO_OBJ}/_.s2 \
 			-p ${s3}:=${NANO_OBJ}/_.s3 \
-			-o ${NANO_OBJ}/_.disk.image.${NANO_NAME}
+			-o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt}
 	else
 		# s1 is cfg, s2 is /, not sure how to make that
 		# boot (marked as active) with mkimg yet
-		mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
+		mkimg -a 2 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \
 			-p ${s2}:=${NANO_OBJ}/_.s2 \
-			-o ${NANO_OBJ}/_.disk.image.${NANO_NAME}
+			-o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt}
 	fi
 	) > ${NANO_OBJ}/_.di 2>&1
 )

Modified: head/tools/tools/nanobsd/embedded/qemu-i386.cfg
==============================================================================
--- head/tools/tools/nanobsd/embedded/qemu-i386.cfg	Mon Dec  7 04:02:31 2015	(r291913)
+++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg	Mon Dec  7 04:02:32 2015	(r291914)
@@ -37,6 +37,7 @@ NANO_KERNEL=GENERIC
 NANO_DRIVE=ada0
 NANO_NAME=qemu-i386
 
+NANO_DISKIMAGE_FORMAT=qcow2
 export EMBED_OMIT_FAT=t
 
 . common	# Pull in common definitions, keep last


More information about the svn-src-head mailing list