freebsd-dev/usr.sbin/makefs
Adrian Chadd a08b904c5e makefs: introduce a new option to specify what to round the resulting
image up to.

From ticket:

While trying to run FreeBSD/mips on some device having very small flash media,
one is forced to compress file system with mkulzma(8) utility. It is desirable
to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8)
and big compression block size like 65535 bytes to mkulzma at the same time.
Then one obtains very good comression ratios (like 75% and more) but faces
the following problem.

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 file system that leads to other
problems, f.e. geom_label kernel module does not like this and skips the
file system while tasting the GEOM and looking for UFS label.

This makes it impossible to refer to the file system using known UFS label
instead of something like /dev/map/rootfs.uncompress.

The following patch introduces new command line option "-r roundup" for makefs
that makes it round up the image to specified block size. Hence, geom_uncompress
does not change GEOM media size for images rounded that way and geom_label
accepts such GEOMs just fine.

With the patch applied, one can use following commands:

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

PR:		bin/203707
Submitted by:	<eugen@grosbein.net>
2015-10-13 02:32:15 +00:00
..
cd9660 Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number, 2013-12-29 16:43:35 +00:00
ffs convert to using the _daddr_t types like newfs was... 2014-05-31 20:26:34 +00:00
cd9660.c - Set the System Identifier in the Primary Volume Descriptor to FreeBSD 2013-07-27 15:28:31 +00:00
cd9660.h
ffs.c makefs: introduce a new option to specify what to round the resulting 2015-10-13 02:32:15 +00:00
ffs.h
Makefile Convert makefs to LIBADD 2014-11-24 22:15:30 +00:00
Makefile.depend Add META_MODE support. 2015-06-13 19:20:56 +00:00
makefs.8 makefs: introduce a new option to specify what to round the resulting 2015-10-13 02:32:15 +00:00
makefs.c makefs: introduce a new option to specify what to round the resulting 2015-10-13 02:32:15 +00:00
makefs.h makefs: introduce a new option to specify what to round the resulting 2015-10-13 02:32:15 +00:00
mtree.c Don't leak 'var'. 2015-09-03 01:15:23 +00:00
walk.c Remove duplicated copies of various NetBSD compatibility shims used by 2013-05-09 14:43:36 +00:00