Hello Henrik,
I have a (relatively large) set of patches for your ms-sys program that I would like to submit for your consideration. I created them in the process of making my own fork here. I have made the following changes:
Added two new boot records supporting Windows7/8/10 for FAT32 and EXFAT. Both are useful for creating legacy bootable USB flash media. However EXFAT does not have the 4GB file size limit of FAT32 and is useful for current Windows 10 install media.
The program is now fully functional on macOS. I improved support on FreeBSD and OpenBSD such that the partition information feature now writes the correct information (specifically hidden sectors and heads), the disk and floppy and partition device detection functions now return the correct values so the force switch is no longer required to write the correct boot records, the device path is now passed to functions that require it due to the usage of default disklabels for MBR disks on OpenBSD, the smart select function now works (previously failed on both due to incorrect device detection).
The partition information feature now supports EXFAT, NTFS and FAT16.
OEM ID can now only be changed on FAT filesystems because NTFS and EXFAT require this to identify their Bios Parameter Blocks.
Altered makefile so debug build works and install is functional on Linux/BSD/Mac.
Did my best to update the language files (man and po) with some new information using comparison, online translation tools and educated guesses.
The program version has been incremented to 2.6.2 after my two separate development/testing episodes. (if that matters at all)
The program has been tested with partitioned and non-partitioned media (flash drives and mounted hard disk and floppy images) on the following operating system versions:
Linux: Ubuntu LTS 18.04
BSD: FreeBSD 12.1 and OpenBSD 6.6
Apple: macOS Catalina 10.15.4 and macOS High Sierra 10.13.6
The attached archive contains all the patch files for each source file and a script. To apply them all copy the ms-sys-2.6.0 source folder into the patch folder and run the script.
Well that's everything I have to offer at this point so hopefully at least some of this will be worth adding to your next release. Let me know if you have questions too.
Thanks alot for you contribution! One more file which I really think should be updated is the file CONTRIBUTORS, what would you like to write there?
I really appreciate contributions to support more targets like FreeBSD and macOS and that you were able to test on so many targets, but I hope that you realize that I will not now or in the future be able to test my future versions on those targets. Future versions of ms-sys will probably be marked as "unstable development" and after some year without any bug report a stable version will be release without any changes since the old unstable version which then will be assumed to have been tested by many different users on many different targets. So the next version with this patch and other contributions since 2.6.0 will probably be named development version 2.7.0.
It seems as if your work has been done in two steps, 2.6.1 and 2.6.2. Is it possible to download 2.6.1 from anywhere? I will probably not mention 2.6.1 and 2.6.2 in the changelog as I don't provide source packages for those versions and don't have their history in my svn repo, it will all go into upcoming version 2.7.0.
Is install missing the -D option on some of your target(s)? Would you mind if I change $(dir $@) to $(@D) for those rows?
It was nice that you found and fixed that "make uninstall" didn't remove the compressed man pages! I must admit that I haven't uninstalled the software so often...
At least it is still possible to write OEM ID with the switch -f. The fact that the OEM ID has to identify the BPB might indeed be the reason that someone wan'ts to write it to fix a broken system.
Thanks again for your patch! Unfortunately I am short of time and can't say for sure when I will get the time to commit the changes into my svn repo and make a new version.
I'm glad my contribution is helpful, that's awesome! Below is my suggested addition to the CONTRIBUTORS file:
Joseph Zeller contributed macOS/OS X support and improved FreeBSD and
OpenBSD support, added and tested NT6.0 FAT32 and EXFAT boot
records, patched Makefile and tested install on Mac/BSD/Linux
and updated man pages and po files with new information
I understand you don't have access to (and I did not assume) you could test on all supported platforms and so I don't have a problem with that. I have attached an archive containing the 2.6.1 source code (if you want to see it) since I never posted it online.
background/history:
When I worked on that version, I was focused first on full support for Mac followed by adding and testing the new boot records, then making sure the install would work, which is when I discovered the Mac install command had no -D switch (unlike Linux and BSD) so I removed it and created the directory first, that way looks compatible with probably all Unix type operating systems then after a few other changes I updated the various text files. I incremented the version number and planned to stop at that point.
I came back to it later (before posting anywhere) and thought I'd test the program under FreeBSD and OpenBSD, which already had some support in the program, but it looked incomplete (especially OpenBSD) compared to what was required for Mac. That was when I found that disk/floppy/partition identification didn't work properly requiring the force switch for all boot records, the partition information option didn't work properly (hidden sectors and heads values were incorrect or absent) and smart select didn't work either. I then researched and implemented code to bring both to full functionality and incremented the version number again when finished.
Feel free to change $(dir $@) to $(@D) it works fine, I just used the first example I found.
Also, as you indicated, the OEM ID can still be force written to NTFS/EXFAT boot records. Probably safer that way.
You're welcome sir and thank you for your time!
Now closing this ticket as the patch has been merged into the svn repository. I can't say for sure when I will get the time to make a new official development release.