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)
Tue, Apr 16, 5:43 PM
Unknown Object (File)
Feb 6 2024, 4:53 AM
Unknown Object (File)
Jan 14 2024, 10:18 AM
Unknown Object (File)
Dec 28 2023, 7:06 AM
Unknown Object (File)
Dec 20 2023, 4:28 AM
Unknown Object (File)
Nov 18 2023, 11:38 PM
Unknown Object (File)
Nov 18 2023, 9:32 PM
Unknown Object (File)
Nov 18 2023, 9:15 PM
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.