tools: disable lomount and miniterm by default
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Jan 2008 15:18:38 +0000 (15:18 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Jan 2008 15:18:38 +0000 (15:18 +0000)
lomount is a tool which reads and parses a partition table in a disk
image block device and then uses mount -o ...offset=... to mount it.
This is not an ideal approach.  For example, if the intended
filesystem has corrupted metadata the kernel's filesystem driver may
start to write outside of the intended region.  This might even be
exploitable in some perverse circumstances.

Nowadays people wanting to do this should use kpartx, which uses
devmapper to create appropriate range mappings.  So lomount should be
disabled.

miniterm may well be useful but it is a clone-and-hack of an upstream
project and is currently built but not installed by default, partly
because it doesn't make sense to install on the dom0 which it might be
trying to debug.

It is probably useful to retain these two programs in the source tree
but IMO they should no longer be built by default.

The attached patch does these things:
 * CONFIG_LOMOUNT and CONFIG_MINITERM in Config.mk
   can enable and disable these programs
 * They are disabled by default
 * If CONFIG_MINITERM=y it is still built but not installed.
   make -C tools/misc/miniterm install  will install it.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Config.mk
tools/misc/Makefile
tools/misc/lomount/Makefile
tools/misc/miniterm/Makefile

index fbd65436da4df67b15130da22d6959065487d864..fe390bf18285505792892c31ff23ed5587e388b8 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -88,5 +88,7 @@ XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
 LIBXENAPI_BINDINGS ?= n
 PYTHON_TOOLS       ?= y
+CONFIG_MINITERM    ?= n
+CONFIG_LOMOUNT     ?= n
 
 -include $(XEN_ROOT)/.config
index c3e4d914f06c5d1919be354a89f03d52b320f768..f9dcbb22ad653a3b58d622d73305e45e7c0486f0 100644 (file)
@@ -13,6 +13,10 @@ TARGETS-y := xenperf
 TARGETS-$(CONFIG_X86) += xen-detect
 TARGETS := $(TARGETS-y)
 
+SUBDIRS-$(CONFIG_LOMOUNT) += lomount
+SUBDIRS-$(CONFIG_MINITERM) += miniterm
+SUBDIRS := $(SUBDIRS-y)
+
 INSTALL_BIN  = $(TARGETS) xencons
 INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview
 
@@ -21,8 +25,7 @@ all: build
 
 .PHONY: build
 build: $(TARGETS)
-       $(MAKE) -C miniterm
-       $(MAKE) -C lomount
+       set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
 
 .PHONY: install
 install: build
@@ -30,15 +33,12 @@ install: build
        [ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin
        $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
        $(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
-       $(MAKE) -C lomount install
-#       No sense in installing miniterm on the Xen box.
-#      $(MAKE) -C miniterm install
+       set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
 
 .PHONY: clean
 clean:
        $(RM) *.o $(TARGETS) *~
-       $(MAKE) -C miniterm clean
-       $(MAKE) -C lomount clean
+       set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
 
 %.o: %.c $(HDRS) Makefile
        $(CC) -c $(CFLAGS) -o $@ $<
index 04c928d66f3857f4b672866f8c8d4ddac6d8a0ce..77ba4f80df738a225659de0cfceb76018148b6e3 100644 (file)
@@ -15,7 +15,7 @@ all: build
 build: $(BIN)
 
 .PHONY: install
-install: build
+install install-recurse: build
        $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
 
 .PHONY: clean
index 1fe35f810c77fbc54e6aea2f77b975d7ebf3096f..ec063746f48d47ac07cd15b397860fe75803afce 100644 (file)
@@ -11,6 +11,9 @@ install: all
        [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
        $(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin
 
+.PHONY: install-recurse
+       : No sense in installing miniterm on the Xen box.
+
 .PHONY: clean
 clean:
        $(RM) *.o $(TARGET) *~