Fix a bug in disk geometry calculation.

Fix NANO_TOOLS usage in FlashDevice()
This commit is contained in:
Poul-Henning Kamp 2005-09-29 16:06:59 +00:00
parent ccb7a62ef7
commit 8ec7a2f521

View File

@ -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,6 +324,10 @@ 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
@ -388,7 +392,11 @@ create_i386_diskimage ( ) (
#
FlashDevice () {
if [ -d ${NANO_TOOLS} ] ; then
. ${NANO_TOOLS}/FlashDevice.sub
else
. ${NANO_SRC}/${NANO_TOOLS}/FlashDevice.sub
fi
sub_FlashDevice $1 $2
}