Page MenuHomeFreeBSD

release: Support GNU stat in mkisoimages.sh
ClosedPublic

Authored by jrtc27 on Jul 14 2022, 12:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 2 2024, 2:00 PM
Unknown Object (File)
Dec 2 2024, 1:47 PM
Unknown Object (File)
Oct 29 2024, 12:54 PM
Unknown Object (File)
Oct 25 2024, 4:39 AM
Unknown Object (File)
Oct 25 2024, 4:39 AM
Unknown Object (File)
Oct 25 2024, 4:38 AM
Unknown Object (File)
Oct 25 2024, 4:29 AM
Unknown Object (File)
Oct 2 2024, 7:13 AM
Subscribers

Details

Summary

BSD stat and GNU stat differ significantly when it comes to using a
custom format string, both in the option name and in the format string
itself. Handle both here (assuming Linux means GNU stat rather than BSD
stat).

Obtained from: CheriBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Can we just make mkimg(1) to accept a filename as its parameter, basically by stat'ing the file and use that size as capacity instead?

gjb added a subscriber: gjb.

I do not object to the change, but I would prefer to test uname -s against "FreeBSD" and reverse the if/else logic. But I will not complain too loudly about this nit.

This revision is now accepted and ready to land.Jul 14 2022, 3:03 PM
In D35814#812882, @gjb wrote:

I do not object to the change, but I would prefer to test uname -s against "FreeBSD" and reverse the if/else logic. But I will not complain too loudly about this nit.

macOS wants the FreeBSD behaviour; currently Linux is the exception. I could flip it with != Linux, but if != .. else feels wrong to write.

In D35814#812882, @gjb wrote:

I do not object to the change, but I would prefer to test uname -s against "FreeBSD" and reverse the if/else logic. But I will not complain too loudly about this nit.

macOS wants the FreeBSD behaviour; currently Linux is the exception. I could flip it with != Linux, but if != .. else feels wrong to write.

Nope, that's fine then. I didn't realize the macOS behavior. So you can ignore my suggestion. :)

Can we just make mkimg(1) to accept a filename as its parameter, basically by stat'ing the file and use that size as capacity instead?

It's a bit of an unusual thing to want, and --capacity file would then be strange (especially if the file is of the form [0-9]+, it's then ambiguous). Adding an option just for mkisoimages.sh's use seems a little overkill.

This revision was automatically updated to reflect the committed changes.