newfs_hfs.diff 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff '--color=auto' -Naur diskdev_cmds-540.1.linux3_orig/Makefile diskdev_cmds-540.1.linux3/Makefile
  2. --- diskdev_cmds-540.1.linux3_orig/Makefile 2023-01-17 11:36:56.341279443 +0100
  3. +++ diskdev_cmds-540.1.linux3/Makefile 2023-01-17 11:44:12.496479981 +0100
  4. @@ -3,7 +3,7 @@
  5. CC := clang
  6. CFLAGS := -g3 -Wall -fblocks -I$(PWD)/BlocksRunTime -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\"$(VERSION)\"
  7. LDFLAGS := -Wl,--build-id -L$(PWD)/BlocksRunTime
  8. -SUBDIRS := BlocksRunTime newfs_hfs.tproj fsck_hfs.tproj
  9. +SUBDIRS := newfs_hfs.tproj
  10. all clean:
  11. for d in $(SUBDIRS); do $(MAKE) -C $$d -f Makefile.lnx $@; done
  12. diff '--color=auto' -Naur diskdev_cmds-540.1.linux3_orig/newfs_hfs.tproj/makehfs.c diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c
  13. --- diskdev_cmds-540.1.linux3_orig/newfs_hfs.tproj/makehfs.c 2023-01-17 11:36:56.341279443 +0100
  14. +++ diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c 2023-01-17 11:58:15.972059719 +0100
  15. @@ -38,8 +38,8 @@
  16. #endif
  17. #include <sys/errno.h>
  18. #include <sys/stat.h>
  19. -#include <sys/sysctl.h>
  20. #if !LINUX
  21. +#include <sys/sysctl.h>
  22. #include <sys/vmmeter.h>
  23. #endif
  24. @@ -571,8 +571,10 @@
  25. /* Adjust free blocks to reflect everything we have allocated. */
  26. hp->freeBlocks -= blocksUsed;
  27. - /* Generate and write UUID for the HFS+ disk */
  28. - GenerateVolumeUUID(&newVolumeUUID);
  29. + /* Use a deterministic UUID for reproducibility */
  30. + memset(&newVolumeUUID, 0, sizeof(newVolumeUUID));
  31. + strncpy(&newVolumeUUID, defaults->volumeName, sizeof(newVolumeUUID));
  32. +
  33. finderInfoUUIDPtr = (VolumeUUID *)(&hp->finderInfo[24]);
  34. finderInfoUUIDPtr->v.high = OSSwapHostToBigInt32(newVolumeUUID.v.high);
  35. finderInfoUUIDPtr->v.low = OSSwapHostToBigInt32(newVolumeUUID.v.low);