summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-09-29 16:06:59 +0000
committerphk <phk@FreeBSD.org>2005-09-29 16:06:59 +0000
commitdc422f3b7040f86462067426ff05c22309e74c98 (patch)
treea89bcc9c39d916e3c26cf0568228febf783c55bd /tools
parent2f8b40443aef15f7c63c2004aa3e4198d96746ab (diff)
downloadFreeBSD-src-dc422f3b7040f86462067426ff05c22309e74c98.zip
FreeBSD-src-dc422f3b7040f86462067426ff05c22309e74c98.tar.gz
Fix a bug in disk geometry calculation.
Fix NANO_TOOLS usage in FlashDevice()
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/nanobsd/nanobsd.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index 42c9c44..5555fa1 100644
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -272,7 +272,7 @@ create_i386_diskimage ( ) (
$NANO_SECTS $NANO_HEADS \
$NANO_CODESIZE $NANO_CONFSIZE $NANO_DATASIZE |
awk '
- {
+ {
printf "# %s\n", $0
# size of cylinder in sectors
@@ -297,7 +297,7 @@ create_i386_diskimage ( ) (
# size of config partition in full cylinders
csl = int (($6 + cs - 1) / cs)
- if ($3 == 5) {
+ if ($5 == 0) {
# size of image partition(s) in full cylinders
isl = int ((cyl - dsl - csl) / $2)
} else {
@@ -324,8 +324,12 @@ create_i386_diskimage ( ) (
print "p 4 165 " c, dsl * cs
} else if ($7 < 0 && $1 > $c) {
print "p 4 165 " c, $1 - $c
+ } else if ($1 < c) {
+ print "Disk space overcommitted by", \
+ c - $1, "sectors" > "/dev/stderr"
+ exit 2
}
- }
+ }
' > ${MAKEOBJDIRPREFIX}/_.fdisk
IMG=${MAKEOBJDIRPREFIX}/_.disk.full
@@ -388,7 +392,11 @@ create_i386_diskimage ( ) (
#
FlashDevice () {
- . ${NANO_TOOLS}/FlashDevice.sub
+ if [ -d ${NANO_TOOLS} ] ; then
+ . ${NANO_TOOLS}/FlashDevice.sub
+ else
+ . ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub
+ fi
sub_FlashDevice $1 $2
}
OpenPOWER on IntegriCloud