ia64/xen-unstable

changeset 16742:acb35c1088fd

tools: disable lomount and miniterm by default

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 17 15:18:38 2008 +0000 (2008-01-17)
parents 2773cdbecda5
children 76d88d1da324
files Config.mk tools/misc/Makefile tools/misc/lomount/Makefile tools/misc/miniterm/Makefile
line diff
     1.1 --- a/Config.mk	Thu Jan 17 15:17:22 2008 +0000
     1.2 +++ b/Config.mk	Thu Jan 17 15:18:38 2008 +0000
     1.3 @@ -88,5 +88,7 @@ XENSTAT_XENTOP     ?= y
     1.4  VTPM_TOOLS         ?= n
     1.5  LIBXENAPI_BINDINGS ?= n
     1.6  PYTHON_TOOLS       ?= y
     1.7 +CONFIG_MINITERM    ?= n
     1.8 +CONFIG_LOMOUNT     ?= n
     1.9  
    1.10  -include $(XEN_ROOT)/.config
     2.1 --- a/tools/misc/Makefile	Thu Jan 17 15:17:22 2008 +0000
     2.2 +++ b/tools/misc/Makefile	Thu Jan 17 15:18:38 2008 +0000
     2.3 @@ -13,6 +13,10 @@ TARGETS-y := xenperf
     2.4  TARGETS-$(CONFIG_X86) += xen-detect
     2.5  TARGETS := $(TARGETS-y)
     2.6  
     2.7 +SUBDIRS-$(CONFIG_LOMOUNT) += lomount
     2.8 +SUBDIRS-$(CONFIG_MINITERM) += miniterm
     2.9 +SUBDIRS := $(SUBDIRS-y)
    2.10 +
    2.11  INSTALL_BIN  = $(TARGETS) xencons
    2.12  INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview
    2.13  
    2.14 @@ -21,8 +25,7 @@ all: build
    2.15  
    2.16  .PHONY: build
    2.17  build: $(TARGETS)
    2.18 -	$(MAKE) -C miniterm
    2.19 -	$(MAKE) -C lomount
    2.20 +	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d; done
    2.21  
    2.22  .PHONY: install
    2.23  install: build
    2.24 @@ -30,15 +33,12 @@ install: build
    2.25  	[ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin
    2.26  	$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
    2.27  	$(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
    2.28 -	$(MAKE) -C lomount install
    2.29 -#       No sense in installing miniterm on the Xen box.
    2.30 -#	$(MAKE) -C miniterm install
    2.31 +	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
    2.32  
    2.33  .PHONY: clean
    2.34  clean:
    2.35  	$(RM) *.o $(TARGETS) *~
    2.36 -	$(MAKE) -C miniterm clean
    2.37 -	$(MAKE) -C lomount clean
    2.38 +	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d clean; done
    2.39  
    2.40  %.o: %.c $(HDRS) Makefile
    2.41  	$(CC) -c $(CFLAGS) -o $@ $<
     3.1 --- a/tools/misc/lomount/Makefile	Thu Jan 17 15:17:22 2008 +0000
     3.2 +++ b/tools/misc/lomount/Makefile	Thu Jan 17 15:18:38 2008 +0000
     3.3 @@ -15,7 +15,7 @@ all: build
     3.4  build: $(BIN)
     3.5  
     3.6  .PHONY: install
     3.7 -install: build
     3.8 +install install-recurse: build
     3.9  	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
    3.10  
    3.11  .PHONY: clean
     4.1 --- a/tools/misc/miniterm/Makefile	Thu Jan 17 15:17:22 2008 +0000
     4.2 +++ b/tools/misc/miniterm/Makefile	Thu Jan 17 15:18:38 2008 +0000
     4.3 @@ -11,6 +11,9 @@ install: all
     4.4  	[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
     4.5  	$(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin
     4.6  
     4.7 +.PHONY: install-recurse
     4.8 +	: No sense in installing miniterm on the Xen box.
     4.9 +
    4.10  .PHONY: clean
    4.11  clean:
    4.12  	$(RM) *.o $(TARGET) *~