Some makefs(8) improvements

Eugene Grosbein egrosbein at rdtc.ru
Sun Oct 11 19:53:05 UTC 2015


Hi!

While building my own FreeBSD/mips image for device having 8MB flash inly,
I've faced two problems with makefs(8) utility.

First, there is a bug in makefs: it fails to initialise fs_providersize
in a superblock while making UFS file system. This leads to other problems
with geom_label. The (trivial) patch is attached to the PR I just submited:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203704

Then, makefs is not quite compatible with mkulzma/geom_uncompress feature:
geom_uncompress kernel module reports GEOM provider size rounded up to
its compression block size. Generally, this changes original media size
and now it fails to match the size of embedded UFS that  again
leads to problems with geom_label kernel module. This module does not like
the mismatch and skips the file system while tasting the GEOM and looking for
UFS label.

I've added new option "-r" to makefs to round up generated image to specified
block size, f.e.:

makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs

geom_uncompress does not change GEOM media size for images rounded that way
and geom_label accepts such GEOMs just fine.

The patch is attached to another PR I just submited:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203707

Hope there PRs won't hand around for years :-)


More information about the freebsd-mips mailing list