Page MenuHomeFreeBSD

cross-build: Provide real fflagstostr/strtofflags on Linux
ClosedPublic

Authored by jrtc27 on Apr 29 2025, 7:39 PM.
Tags
None
Referenced Files
F134999418: D50080.diff
Wed, Nov 5, 6:00 PM
Unknown Object (File)
Thu, Oct 30, 12:00 AM
Unknown Object (File)
Mon, Oct 27, 12:37 PM
Unknown Object (File)
Thu, Oct 23, 3:36 AM
Unknown Object (File)
Sun, Oct 19, 3:48 AM
Unknown Object (File)
Sun, Oct 19, 12:42 AM
Unknown Object (File)
Sat, Oct 18, 10:52 AM
Unknown Object (File)
Fri, Oct 17, 6:10 AM
Subscribers

Details

Summary

These are used by mtree and makefs, so in order to be able to set schg
on /var/empty in METALOG and set schg on various files and directories
in the resulting disk images we need to have a real implementation
rather than always giving no flags.

Ideally mtree wouldn't rely on round-tripping the textual flags field
via the "native" flags encoding using these functions, and ideally
makefs wouldn't rely on the "native" flags encoding matching FreeBSD's,
but in practice macOS's schg is the same and we can pretend Linux has
the same.

This fixes Linux-produced disk images lacking schg on any files or
directories, and Linux-produced distribution tarballs lacking schg on
/var/empty (note though that they do set schg on files, as install
already preserves file flags on Linux).

Diff Detail

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

Event Timeline

tools/build/Makefile
216

in practice macOS's schg is the same and we can pretend Linux has
the same.

IMO it'd be good to have this information in the src as well, making it clear that we're conflating host and target flags but in practice it works.

Add comment about host vs target

This revision is now accepted and ready to land.Apr 29 2025, 8:38 PM