diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 9589468d71..28c5f7f6fc 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -1506,17 +1506,26 @@ rule BuildFloppyBootImage image : haikuLoader : archive actions BuildFloppyBootImage1 { haiku_loader_size=`stat -c %s "$(>[1])"` + drivers_tgz_size=`stat -c %s "$(>[2])"` if [ $? -ne 0 ] ; then # FreeBSD's stat command don't support -c/--format option # and use %z specifier for file size haiku_loader_size=`stat -f %z "$(>[1])"` + drivers_tgz_size=`stat -f %z "$(>[2])"` fi archive_image_offset=`echo "$(ARCHIVE_IMAGE_OFFSET) * 1024" | bc` + floppy_tgz_size=\ + `echo "($(FLOPPY_IMAGE_SIZE) - $(ARCHIVE_IMAGE_OFFSET)) * 1024" | bc` if [ $haiku_loader_size -gt $archive_image_offset ] ; then echo "Error: $(>[1]) is too big ($haiku_loader_size) to fit " echo " before the boot archive starting at $archive_image_offset!" exit 1 fi + if [ $drivers_tgz_size -gt $floppy_tgz_size ] ; then + echo "Error: $(>[2]) is too big ($drivers_tgz_size) to fit " + echo " in the boot floppy ($floppy_tgz_size)!" + exit 1 + fi $(RM) $(<) # make an empty image dd if=/dev/zero of=$(<) bs=1k count=$(FLOPPY_IMAGE_SIZE)