diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-08-20 22:12:25 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-08-20 22:12:25 +0100 |
commit | d7c9674faa1683c9008c9897ea6d6b1519d9af7f (patch) | |
tree | 66dd3f206e5f847e6ca7fcc1c5379b595eb63126 /tools/libxc/Makefile | |
parent | ce2fb297a8165963d47bc7eae5abbbf08399eef0 (diff) | |
download | xen-d7c9674faa1683c9008c9897ea6d6b1519d9af7f.tar.gz xen-d7c9674faa1683c9008c9897ea6d6b1519d9af7f.tar.bz2 xen-d7c9674faa1683c9008c9897ea6d6b1519d9af7f.zip |
domain builder: Implement bzip2 and LZMA loaders
Recent upstream kernels can be compressed using either gzip,
bzip2, or LZMA. However, the PV kernel loader in Xen currently only
understands gzip, and will fail on the other two types. The attached
patch implements kernel decompression for gzip, bzip2, and LZMA so
that kernels compressed with any of these methods can be launched.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/libxc/Makefile')
-rw-r--r-- | tools/libxc/Makefile | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index d3b7d5e8ee..2adf8e689d 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -114,7 +114,7 @@ TAGS: .PHONY: clean clean: - rm -rf *.rpm $(LIB) *~ $(DEPS) \ + rm -rf *.rpm $(LIB) *~ $(DEPS) .*.deps \ $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS) \ $(GUEST_LIB_OBJS) $(GUEST_PIC_OBJS) @@ -151,6 +151,26 @@ libxenguest.so: libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR) ln -sf $< $@ +.zlib.deps: + @(set -e; \ + . ../check/funcs.sh; \ + rm -f $@.new; \ + if has_header bzlib.h; then \ + echo "-DHAVE_BZLIB" >>$@.new; \ + echo "-lbz2" >>$@.new; \ + echo " - BZIP2 decompression supported"; \ + fi; \ + if has_header lzma.h; then \ + echo "-DHAVE_LZMA" >>$@.new; \ + echo "-llzma" >>$@.new; \ + echo " - LZMA decompression supported"; \ + fi; \ + mv $@.new $@) + +xc_dom_bzimageloader.o: .zlib.deps +xc_dom_bzimageloader.o: CFLAGS += $(shell grep D .zlib.deps) + +libxenguest.so.$(MAJOR).$(MINOR): LDFLAGS += $(shell grep l .zlib.deps) libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $(GUEST_PIC_OBJS) -lz -lxenctrl $(PTHREAD_LIBS) |