diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 0115c453c7..50b39c0546 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -1531,6 +1531,16 @@ rule BuildFloppyBootImage image : haikuLoader : archive #MakeLocateDebug $(image) ; FLOPPY_IMAGE_SIZE on $(image) = $(HAIKU_BOOT_FLOPPY_IMAGE_SIZE) ; ARCHIVE_IMAGE_OFFSET on $(image) = $(HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET) ; + + # FreeBSD's stat command doesn't support -c/--format option + # and use %z specifier for file size + if $(HOST_PLATFORM) = freebsd || $(HOST_PLATFORM) = darwin + || $(HOST_PLATFORM) = openbsd { + STAT_GET_SIZE = "stat -f %z" ; + } else { + STAT_GET_SIZE = "stat -c %s" ; + } + BuildFloppyBootImage1 $(image) : $(haikuLoader) $(archive) ; if $(HAIKU_KERNEL_PLATFORM) = atari_m68k { Depends $(image) : fixup_tos_boot_checksum ; @@ -1546,14 +1556,9 @@ 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 + haiku_loader_size=`$(STAT_GET_SIZE) "$(>[1])"` + drivers_tgz_size=`$(STAT_GET_SIZE) "$(>[2])"` + archive_image_offset=`echo "$(ARCHIVE_IMAGE_OFFSET) * 1024" | bc` floppy_tgz_size=\ `echo "($(FLOPPY_IMAGE_SIZE) - $(ARCHIVE_IMAGE_OFFSET)) * 1024" | bc` diff --git a/src/add-ons/kernel/file_systems/fat/encodings.cpp b/src/add-ons/kernel/file_systems/fat/encodings.cpp index 3b8e5873c6..d6c76bbc78 100644 --- a/src/add-ons/kernel/file_systems/fat/encodings.cpp +++ b/src/add-ons/kernel/file_systems/fat/encodings.cpp @@ -6,8 +6,8 @@ #include #include -#include #include +#include #include #include "encodings.h"