ia64/xen-unstable

view Config.mk @ 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 04d3ca600f74
children 226de1674b2f
line source
1 # -*- mode: Makefile; -*-
3 # A debug build of Xen and tools?
4 debug ?= n
6 XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
7 -e s/ppc/powerpc/ -e s/i86pc/x86_32/ \
8 -e s/amd64/x86_64/)
9 XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)
10 XEN_OS ?= $(shell uname -s)
12 ifeq ($(XEN_TARGET_ARCH),x86_32)
13 XEN_TARGET_X86_PAE ?= y
14 endif
16 CONFIG_$(XEN_OS) := y
18 SHELL ?= /bin/sh
20 # Tools to run on system hosting the build
21 HOSTCC = gcc
22 HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
23 HOSTCFLAGS += -fno-strict-aliasing
24 HOSTCFLAGS_x86_32 = -m32
25 HOSTCFLAGS_x86_64 = -m64
26 HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
28 DISTDIR ?= $(XEN_ROOT)/dist
29 DESTDIR ?= /
31 include $(XEN_ROOT)/config/$(XEN_OS).mk
32 include $(XEN_ROOT)/config/$(XEN_TARGET_ARCH).mk
34 ifneq ($(EXTRA_PREFIX),)
35 EXTRA_INCLUDES += $(EXTRA_PREFIX)/include
36 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
37 endif
39 # cc-option: Check if compiler supports first option, else fall back to second.
40 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
41 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
42 /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
44 # cc-ver: Check compiler is at least specified version. Return boolean 'y'/'n'.
45 # Usage: ifeq ($(call cc-ver,$(CC),0x030400),y)
46 cc-ver = $(shell if [ $$((`$(1) -dumpversion | awk -F. \
47 '{ printf "0x%02x%02x%02x", $$1, $$2, $$3}'`)) -ge $$(($(2))) ]; \
48 then echo y; else echo n; fi ;)
50 # cc-ver-check: Check compiler is at least specified version, else fail.
51 # Usage: $(call cc-ver-check,CC,0x030400,"Require at least gcc-3.4")
52 cc-ver-check = $(eval $(call cc-ver-check-closure,$(1),$(2),$(3)))
53 define cc-ver-check-closure
54 ifeq ($$(call cc-ver,$$($(1)),$(2)),n)
55 override $(1) = echo "*** FATAL BUILD ERROR: "$(3) >&2; exit 1;
56 cc-option := n
57 endif
58 endef
60 ifeq ($(debug),y)
61 CFLAGS += -g
62 endif
64 CFLAGS += -fno-strict-aliasing
66 CFLAGS += -std=gnu99
68 CFLAGS += -Wall -Wstrict-prototypes
70 # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
71 # result of any casted expression causes a warning.
72 CFLAGS += -Wno-unused-value
74 HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
75 CFLAGS += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
77 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i))
78 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
80 # Enable XSM security module. Enabling XSM requires selection of an
81 # XSM security module (FLASK_ENABLE or ACM_SECURITY).
82 XSM_ENABLE ?= n
83 FLASK_ENABLE ?= n
84 ACM_SECURITY ?= n
86 # Optional components
87 XENSTAT_XENTOP ?= y
88 VTPM_TOOLS ?= n
89 LIBXENAPI_BINDINGS ?= n
90 PYTHON_TOOLS ?= y
91 CONFIG_MINITERM ?= n
92 CONFIG_LOMOUNT ?= n
94 -include $(XEN_ROOT)/.config