Module Name: src
Committed By: palle
Date: Tue May 27 19:04:29 UTC 2014
Modified Files:
src/distrib/sparc64/xminiroot: Makefile
Log Message:
Ensure a disklabel is present since sun4v OpenBoot requires a valid disklabel
in the disk file image. With this change the miniroot.fs can be used as a
virtual disk when using sun4v LDOMs. OK martin@
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/distrib/sparc64/xminiroot/Makefile
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sparc64/xminiroot/Makefile
diff -u src/distrib/sparc64/xminiroot/Makefile:1.30 src/distrib/sparc64/xminiroot/Makefile:1.31
--- src/distrib/sparc64/xminiroot/Makefile:1.30 Mon Jan 27 08:18:07 2014
+++ src/distrib/sparc64/xminiroot/Makefile Tue May 27 19:04:29 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2014/01/27 08:18:07 apb Exp $
+# $NetBSD: Makefile,v 1.31 2014/05/27 19:04:29 palle Exp $
.include <bsd.own.mk>
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -6,10 +6,19 @@
.include <bsd.kernobj.mk>
.include "${.CURDIR}/../instfs/Makefile.instfs"
-IMAGE= miniroot.fs
-IMAGESIZE= 12m
-IMAGEPOSTBUILD= ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${IMAGE} \
- ${DESTDIR}/usr/mdec/bootblk
+IMAGE= miniroot.fs
+NUMCYLS= 12 # size of image in MB, tune this if we need more space
+SECSPERCYL= 2048
+CYLSIZE= $$(( ${SECSPERCYL} * 512 ))
+IMAGESIZE= $$(( ${NUMCYLS} * ${CYLSIZE} ))
+IMAGEPOSTBUILD= \
+ ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${IMAGE} \
+ ${DESTDIR}/usr/mdec/bootblk && \
+ echo "Creating disklabel" && \
+ printf 'V nsect %d\nV nhead 1\nV rpm 7200\nV pcyl %d\nV ncyl %d\na 0 %d/0/0\nc 0 %d/0/0\nd 0 %d/0/0\nW\nL\nP\n' \
+ ${SECSPERCYL} ${NUMCYLS} ${NUMCYLS} ${NUMCYLS} ${NUMCYLS} ${NUMCYLS} | \
+ ${TOOL_SUNLABEL} -nq ${IMAGE}
+
IMAGE_RELEASEDIR= installation/miniroot
CRUNCHBINDIR!= cd ${INSTFSDIR} && ${PRINTOBJDIR}