summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2001-09-18 14:52:36 +0000
committersobomax <sobomax@FreeBSD.org>2001-09-18 14:52:36 +0000
commit5597a20c9346cc84fb0c8647b3ba65fe53d4dbd3 (patch)
tree217cc58c250850b5b2c914394d3b7054c3aa6372 /sys
parentaa9b71c68d5365c328006a547c4a3500f975a1b7 (diff)
downloadFreeBSD-src-5597a20c9346cc84fb0c8647b3ba65fe53d4dbd3.zip
FreeBSD-src-5597a20c9346cc84fb0c8647b3ba65fe53d4dbd3.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/i386/loader/Makefile7
-rw-r--r--sys/boot/i386/loader/conf.c5
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 1b203fc..b530121 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -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>
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index bef1ed9..ba8ebf6 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -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
OpenPOWER on IntegriCloud