Module Name:    src
Committed By:   christos
Date:           Sat Feb  9 18:50:11 UTC 2013

Modified Files:
        src/distrib/utils/embedded: mkimage

Log Message:
add tool hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/utils/embedded/mkimage

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.20 src/distrib/utils/embedded/mkimage:1.21
--- src/distrib/utils/embedded/mkimage:1.20	Sat Feb  9 06:20:56 2013
+++ src/distrib/utils/embedded/mkimage	Sat Feb  9 13:50:11 2013
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.20 2013/02/09 11:20:56 jmcneill Exp $
+# $NetBSD: mkimage,v 1.21 2013/02/09 18:50:11 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,6 +35,10 @@
 DIR="$(cd "$(dirname "$0")" && pwd)"
 PROG="$(basename "$0")"
 
+DISKLABEL=${TOOL_DISKLABEL:-disklabel}
+FDISK=${TOOL_DISKLABEL:-fdisk}
+MAKEFS=${TOOL_MAKEFS:-makefs}
+
 src="/usr/src"
 release="/usr/obj/evbarm/release"
 sets="base comp etc games man misc modules text"
@@ -114,8 +118,6 @@ if [ -n "$1" ]; then
 	shift
 fi
 
-. "${DIR}/conf/${h}.conf"
-
 echo ${bar} configuring sets ${bar}
 (echo '/set type=dir uname=root gname=wheel mode=0755'
 for i in $selected_sets; do
@@ -130,12 +132,12 @@ populate
 (cd ${mnt}; mtree -c -k all | mtree -C -k all) >> "$tmp/selected_sets"
 if [ -n ${msdosid} ]; then
 	echo ${bar} Populating msdos filesystem ${bar}
-	makefs -t msdos -O $((${init} / 2))m -s $((${boot} / 2))m \
+	${MAKEFS} -t msdos -O $((${init} / 2))m -s $((${boot} / 2))m \
 	    ${image} ${mnt}/boot
 fi
 
 echo ${bar} Populating ffs filesystem ${bar}
-makefs -t ffs -rx -O $(((${init} + ${boot} + ${swap}) / 2))m \
+${MAKEFS} -t ffs -rx -O $(((${init} + ${boot} + ${swap}) / 2))m \
     -F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 
 if [ -z "$size" ]; then
@@ -145,9 +147,9 @@ newsize=$((size / 2 / 1024))
 
 echo ${bar} Adding label ${bar}
 make_label > ${tmp}/label
-disklabel -R -F ${image} ${tmp}/label
+${DISKLABEL} -R -F ${image} ${tmp}/label
 if [ -n ${msdosid} ]; then
 	echo ${bar} Running fdisk ${bar}
-	fdisk -f -u -0 -s ${msdosid}/${init}/${boot} -F ${image}
+	${FDISK} -f -u -0 -s ${msdosid}/${init}/${boot} -F ${image}
 fi
 echo ${bar} Image is ${image} ${bar}

Reply via email to