Module Name:    src
Committed By:   christos
Date:           Sun Dec 14 00:28:46 UTC 2014

Modified Files:
        src/distrib/utils/embedded: mkimage
        src/distrib/utils/embedded/conf: x86.conf

Log Message:
fix image building:
        - round up the total size of the disk image
        - fix fdisk offset for netbsd ffs images


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/x86.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.48 src/distrib/utils/embedded/mkimage:1.49
--- src/distrib/utils/embedded/mkimage:1.48	Thu Apr  3 18:51:38 2014
+++ src/distrib/utils/embedded/mkimage	Sat Dec 13 19:28:46 2014
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.48 2014/04/03 22:51:38 christos Exp $
+# $NetBSD: mkimage,v 1.49 2014/12/14 00:28:46 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -190,6 +190,13 @@ if [ "${size}" = 0 ]; then
 	size="$(getsize "${image}")"
 fi
 newsize=$((${size} / 2 / 1024))
+compare=$((${newsize} * 2 * 1024))
+while [ "${compare}" != "${size}" ]
+do    
+	size="$((size + size - compare))"  
+	newsize="$((${size} / 2 / 1024))"
+	compare="$((${newsize} * 2 * 1024))"
+done                      
 
 echo ${bar} Adding label ${bar}
 make_label > ${tmp}/label
@@ -202,7 +209,7 @@ if [ -n "${msdosid}" ]; then
 elif [ -n "${netbsdid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s 169 ${image}
+	${FDISK} -f -a -u -0 -s 169/${init} ${image}
 	${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
 fi
 

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.4 src/distrib/utils/embedded/conf/x86.conf:1.5
--- src/distrib/utils/embedded/conf/x86.conf:1.4	Fri Apr  4 12:45:51 2014
+++ src/distrib/utils/embedded/conf/x86.conf	Sat Dec 13 19:28:46 2014
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.4 2014/04/04 16:45:51 christos Exp $
+# $NetBSD: x86.conf,v 1.5 2014/12/14 00:28:46 christos Exp $
 # x86 shared config
 #
 
@@ -12,13 +12,14 @@ specialdirs="/kern /proc"
 extra=8		# spare space
 size=0		# autocompute
 netbsdid=169
-ffsoffset=63b
+init=63
+ffsoffset=${init}b
 
 make_label() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
-	local aoffset=63
+	local aoffset=${init}
 	local asize=$(( ${totalsize} - ${aoffset} ))
 
 	local bps=512

Reply via email to