Page MenuHomeFreeBSD

makefs: Support st_flags even on Linux
AcceptedPublic

Authored by jrtc27 on Tue, Apr 29, 7:38 PM.

Details

Summary

Linux's struct stat does not have an st_flags member, but we still want
to be able to create FreeBSD disk images with non-zero st_flags. Add a
replacement member to struct fsinode to store it on Linux.

Note that we add a fallback definition of HAVE_STRUCT_STAT_ST_FLAGS for
makefs.h since etdump reaches into makefs and won't have it defined in
its CFLAGS like makefs itself does, and on FreeBSD we don't provide an
nbtool_config.h.

Note also that strtofflags is currently a stub on Linux so this doesn't
yet properly mirror the mtree, but that will change in a future commit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63784
Build 60668: arc lint + arc unit

Event Timeline

emaste added a subscriber: christos_netbsd.org.

This is fine with me. I'll cc @christos_netbsd.org in case NetBSD would like to make an equivalent change (or maybe they already have one?)

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

This is fine with me. I'll cc @christos_netbsd.org in case NetBSD would like to make an equivalent change (or maybe they already have one?)

I glanced at the NetBSD source and they still do the same as the old code here. Similarly they conflate host and target flags and have stub implementations.