From 0f2c85b335d8aafd901712f71c0d4debc20cfeb3 Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Tue, 18 Sep 2001 14:52:36 +0000 Subject: [PATCH] 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 --- sys/boot/i386/loader/Makefile | 7 +++++++ sys/boot/i386/loader/conf.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index 1b203fc5703..b5301213f41 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 bef1ed99680..ba8ebf680c3 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