Module Name:    src
Committed By:   christos
Date:           Tue Jan 15 03:26:28 UTC 2013

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

Log Message:
first step at autosizing, still does not work.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/conf/rpi.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.9 src/distrib/utils/embedded/mkimage:1.10
--- src/distrib/utils/embedded/mkimage:1.9	Mon Jan 14 21:50:08 2013
+++ src/distrib/utils/embedded/mkimage	Mon Jan 14 22:26:27 2013
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mkimage,v 1.9 2013/01/15 02:50:08 jmcneill Exp $
+# $NetBSD: mkimage,v 1.10 2013/01/15 03:26:27 christos Exp $
 
 # Copyright (c) 2012 Alistair Crooks <a...@netbsd.org>
 # All rights reserved.
@@ -168,17 +168,18 @@ fi
 total=$(( ( ( ${total} + ${custsize} ) / 1000000 ) + ${overhead} ))
 if [ $size -eq 0 ]; then
         # auto-size the pkgs fs
-        size=${total}
+        newsize=${total}
 else
         # check that we've been given enough space
         if [ ${total} -gt ${size} ]; then
                 echo "$PROG: Given size is ${size} MB, but we need ${total} MB" >&2
                 exit 1
         fi
+	newsize=${size}
 fi
 
-echo "${bar} making a new ${size} MB image in ${image} ${bar}"
-dd if=/dev/zero of=${image} bs=1m count=${size} conv=sparse
+echo "${bar} making a new ${newsize} MB image in ${image} ${bar}"
+dd if=/dev/zero of=${image} bs=1m count=${newsize} conv=sparse
 
 vnddev=$(next_avail vnd)
 echo "${bar} mounting image via vnd ${vnddev} ${bar}"
@@ -188,15 +189,17 @@ make_filesystems
 
 ${sudo} mkdir -p ${mnt}/etc ${mnt}/dev
 
-echo "${bar} installing sets ${bar}"
+echo -n "${bar} installing sets:"
 (cd ${mnt} &&
 	for s in ${sets}; do
-		if [ -f "${setsdir}/${s}.tgz" ]; then
-			echo ${s}
-			${sudo} tar xpzf ${setsdir}/${s}.tgz
+		ss="${setsdir}/${s}.tgz"
+		if [ -f "${ss}" ]; then
+			echo -n " ${s}"
+			${sudo} tar xpzf "${ss}"
 		fi
 	done
 )
+echo " ${bar}"
 
 echo "${bar} performing customisations ${bar}"
 

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.5 src/distrib/utils/embedded/conf/rpi.conf:1.6
--- src/distrib/utils/embedded/conf/rpi.conf:1.5	Sun Jan 13 17:08:43 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Mon Jan 14 22:26:28 2013
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.5 2013/01/13 22:08:43 christos Exp $
+# $NetBSD: rpi.conf,v 1.6 2013/01/15 03:26:28 christos Exp $
 # Raspberry PI customization script used by mkimage
 #
 image=$HOME/rpi.img
@@ -7,22 +7,24 @@ firmwaredir=$src/external/broadcom/rpi-f
 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 sets="base etc comp games man misc modules tests text"
-setsdir=$obj/evbarm/media
+setsdir=$obj/evbarm//media/evbarm/binary/sets/
 kerneldir=$src/sys/arch/evbarm/compile/RPI
 specialdirs="/kern /proc"
 
-swap=512
-size=2048
-overhead=8
+swap=256
+extra=8
 boot=112
 init=8
+
+size=0
 msdosid=12
+overhead=$(( ${swap} + ${extra} + ${init} + ${boot} ))
 
 tmp=/tmp/rpi.disklabel.$$
 
 make_filesystems() {
 
-	local asize=$(( ${size} * 1024 ))
+	local asize=$(( ${newsize} * 1024 ))
 	local swapsize=$(( ${swap} * 1024 ))
 	local bootsize=$(( ${boot} * 1024 ))
 
@@ -100,13 +102,14 @@ console=fb
 #fb=disable		# to disable fb completely
 EOF
 
-	echo "${bar} installing firmware files ${bar}"
+	echo -n "${bar} installing firmware files:"
 	(cd ${mnt}/boot &&
 		for f in ${firmwarefiles}; do
-			echo $f
+			echo -n " $f"
 			${sudo} cp ${firmwaredir}/${f} .
 		done
 	)
+	echo " ${bar}"
 
 	if [ ! -f ${kerneldir}/kernel.img ]; then
 		echo ${PROG}: Missing ${kerneldir}/kernel.img 1>&2

Reply via email to