Add support for loading bzip2-compressed kernels and modules. This support

is turned off by default and could be enabled by defining LOADER_BZIP2_SUPPORT
make variable. Also make gzip support optional (turned on by default) -
it could be turned off via LOADER_NO_GZIP_SUPPORT make variable.

Please note, that due to limit on the amount of memory available to the
loader(8), it is possible to load modules/kernels compressed with the smallest
block size supported by the bzip2 - 100k (`-1' bzip2(1) option), however
even in this mode bzip2(1) usually provides better compression ratio than
gzip(1) in its best compression mode.

MFC after:	1 month
This commit is contained in:
Maxim Sobolev 2001-09-18 14:52:36 +00:00
parent 33ae84b7c6
commit 0f2c85b335
2 changed files with 12 additions and 0 deletions

View file

@ -33,6 +33,13 @@ LIBFICL= ${.CURDIR}/../../ficl/libficl.a
.endif
.endif
.if defined(LOADER_BZIP2_SUPPORT)
CFLAGS+= -DLOADER_BZIP2_SUPPORT
.endif
.if !defined(LOADER_NO_GZIP_SUPPORT)
CFLAGS+= -DLOADER_GZIP_SUPPORT
.endif
# Always add MI sources
.PATH: ${.CURDIR}/../../common
.include <${.CURDIR}/../../common/Makefile.inc>

View file

@ -58,7 +58,12 @@ struct fs_ops *file_system[] = {
&ufs_fsops,
&ext2fs_fsops,
&dosfs_fsops,
#ifdef LOADER_GZIP_SUPPORT
&zipfs_fsops,
#endif
#ifdef LOADER_BZIP2_SUPPORT
&bzipfs_fsops,
#endif
#ifdef LOADER_NFS_SUPPORT
&nfs_fsops,
#endif