From 8895336d36bbd9b98a09628549485b22e826c71a Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:23:10 +0000 Subject: [PATCH 01/19] bitkeeper revision 1.1159.223.15 (41f2c43e5U8GurDCsAUaiGJ2VOmnUQ) Description: Use proper targets in makefiles A rule in make should produce only what it's target allows. When it produces side-effects, things like ctrl-c and parallellism break it oddly. From Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- xen/Makefile | 9 +++++---- xen/arch/x86/Makefile | 14 ++++++++++---- xen/common/Makefile | 3 ++- xen/drivers/acpi/Makefile | 3 ++- xen/drivers/char/Makefile | 3 ++- xen/drivers/pci/Makefile | 3 ++- 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/xen/Makefile b/xen/Makefile index 0c5c85e0f3..7eb1d17847 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -9,14 +9,15 @@ export BASEDIR := $(shell pwd) include Rules.mk -default: $(TARGET) - gzip -f -9 < $(TARGET) > $(TARGET).gz +default: $(TARGET).gz +$(TARGET).gz: $(TARGET) + gzip -f -9 < $< > $@.new + mv $@.new $@ debug: objdump -D -S $(TARGET)-syms > $(TARGET).s -install: $(TARGET) - gzip -f -9 < $(TARGET) > $(TARGET).gz +install: $(TARGET).gz mkdir -p $(prefix)/boot install -m0644 $(TARGET).gz $(prefix)/boot install -m0644 $(TARGET)-syms $(prefix)/boot diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 0062ce7678..574b0c35a5 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -12,12 +12,18 @@ OBJS += $(patsubst %.c,%.o,$(wildcard mtrr/*.c)) OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS)) -default: boot/$(TARGET_SUBARCH).o $(OBJS) boot/mkelf32 - $(LD) $(LDFLAGS) -r -o arch.o $(OBJS) - $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \ - boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $(TARGET)-syms +default: $(TARGET) + +$(TARGET): $(TARGET)-syms boot/mkelf32 ./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 +$(CURDIR)/arch.o: $(OBJS) + $(LD) $(LDFLAGS) -r -o $@ $(OBJS) + +$(TARGET)-syms: boot/$(TARGET_SUBARCH).o $(ALL_OBJS) $(TARGET_SUBARCH)/xen.lds + $(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \ + boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $@ + asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(CC) $(CFLAGS) -S -o $@ $< diff --git a/xen/common/Makefile b/xen/common/Makefile index b764c1598a..1ae6148be2 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -21,7 +21,8 @@ ifneq ($(trace),y) OBJS := $(subst trace.o,,$(OBJS)) endif -default: $(OBJS) +default: common.o +common.o: $(OBJS) $(LD) $(LDFLAGS) -r -o common.o $(OBJS) clean: diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 2b80430148..fec92eb405 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -6,7 +6,8 @@ include $(BASEDIR)/Rules.mk OBJS := acpi_ksyms.o tables.o -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile index f938f87017..957a4bc5a2 100644 --- a/xen/drivers/char/Makefile +++ b/xen/drivers/char/Makefile @@ -1,7 +1,8 @@ include $(BASEDIR)/Rules.mk -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: diff --git a/xen/drivers/pci/Makefile b/xen/drivers/pci/Makefile index 7fd6c1705f..040d5aaccd 100644 --- a/xen/drivers/pci/Makefile +++ b/xen/drivers/pci/Makefile @@ -28,7 +28,8 @@ OBJS := pci.o quirks.o compat.o names.o setup-res.o #obj-y += syscall.o #endif -default: $(OBJS) +default: driver.o +driver.o: $(OBJS) $(LD) $(LDFLAGS) -r -o driver.o $(OBJS) clean: From 7ebea330c936f8beca2e3fa3ec47d7228b421f63 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:30:03 +0000 Subject: [PATCH 02/19] bitkeeper revision 1.1159.223.16 (41f2c5dbDRm_plztIOBiTaL3Nj5qAQ) Description: support PIC code generation Libraries have 2 methods of being compiled; a .so must contain non-pic objects, while the .a can contain standard objects. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- tools/libxc/Makefile | 34 +++++++++++++++++++++------------- tools/libxutil/Makefile | 11 ++++++++--- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index 6ee078644c..c8960c2a51 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -1,7 +1,8 @@ -MAJOR = 2.0 -MINOR = 0 -SONAME = libxc.so.$(MAJOR) +MAJOR := 2.0 +MINOR := 0 +LIB_NAME := libxc +SONAME := $(LIB_NAME).so.$(MAJOR) CC = gcc @@ -35,9 +36,10 @@ CFLAGS += $(INCLUDES) -I. CFLAGS += -Wp,-MD,.$(@F).d DEPS = .*.d -OBJS = $(patsubst %.c,%.o,$(SRCS)) +OBJS := $(patsubst %.c,%.o,$(SRCS)) +PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS)) -LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR) +LIB := $(LIB_NAME).a $(LIB_NAME).so $(LIB_NAME).so.$(MAJOR) $(LIB_NAME).so.$(MAJOR).$(MINOR) all: check-for-zlib mk-symlinks $(MAKE) $(LIB) @@ -65,12 +67,12 @@ install: all mkdir -p $(prefix)/usr/lib mkdir -p $(prefix)/usr/include install -m0755 $(LIB) $(prefix)/usr/lib - ln -sf libxc.so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/libxc.so.$(MAJOR) - ln -sf libxc.so.$(MAJOR) $(prefix)/usr/lib/libxc.so + ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) + ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so install -m0644 xc.h $(prefix)/usr/include clean: - rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen + rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen rpm: all rm -rf staging @@ -81,11 +83,17 @@ rpm: all mv staging/i386/*.rpm . rm -rf staging -libxc.so: - ln -sf libxc.so.$(MAJOR) $@ -libxc.so.$(MAJOR): - ln -sf libxc.so.$(MAJOR).$(MINOR) $@ -libxc.so.$(MAJOR).$(MINOR): $(OBJS) +$(PIC_OBJS): %.opic: %.c + $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< + +$(LIB_NAME).a: $(OBJS) + $(AR) rc $@ $^ + +$(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR) + ln -sf $< $@ +$(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR) + ln -sf $< $@ +$(LIB_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz -include $(DEPS) diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile index b9034b5b8f..ae1b26ef6b 100644 --- a/tools/libxutil/Makefile +++ b/tools/libxutil/Makefile @@ -19,6 +19,7 @@ LIB_SRCS += sys_string.c LIB_SRCS += util.c LIB_OBJS := $(LIB_SRCS:.c=.o) +LIB_PIC_OBJS := $(LIB_SRCS:.c=.opic) CFLAGS += -Wall CFLAGS += -Werror @@ -33,6 +34,7 @@ DEPS = .*.d MAJOR := 2.0 MINOR := 0 LIB_NAME := libxutil +SO_NAME := $(LIB_NAME).so.$(MAJOR) LIB := $(LIB_NAME).so LIB += $(LIB_NAME).so.$(MAJOR) LIB += $(LIB_NAME).so.$(MAJOR).$(MINOR) @@ -41,14 +43,17 @@ LIB += $(LIB_NAME).a all: check-for-zlib $(MAKE) $(LIB) +$(LIB_PIC_OBJS): %.opic: %.c + $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $< + $(LIB_NAME).so: $(LIB_NAME).so.$(MAJOR) ln -sf $^ $@ $(LIB_NAME).so.$(MAJOR): $(LIB_NAME).so.$(MAJOR).$(MINOR) ln -sf $^ $@ -$(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_OBJS) - $(CC) -Wl,-soname -Wl,$(LIB_NAME).so.$(MAJOR) -shared -o $@ $^ +$(LIB_NAME).so.$(MAJOR).$(MINOR): $(LIB_PIC_OBJS) + $(CC) -Wl,-soname -Wl,$(SO_NAME) -shared -o $@ $^ $(LIB_NAME).a: $(LIB_OBJS) $(AR) rc $@ $^ @@ -68,7 +73,7 @@ install: all ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so clean: - $(RM) *.a *.so *.so.* *.o *.rpm + $(RM) *.a *.so *.so.* *.o *.opic *.rpm $(RM) *~ $(RM) $(DEPS) From dbaf99ecd4456954accb1e84013d857bb0ac2808 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:32:44 +0000 Subject: [PATCH 03/19] bitkeeper revision 1.1159.223.17 (41f2c67c7vKsSLIzqLuYY24HOjsC5w) Description: Use vars for complex programs It's generally standard to call complex programs indirectly thru make variables. This allows them to be replaced easily with alternative versions, without editting each makefile. Additionally, this patch makes use of $(pkgdocdir) in docs/Makefile. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- docs/Makefile | 53 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 86b5d8f1b1..f489fd776b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,8 +1,21 @@ +#!/usr/bin/make -f -DOC_TEX := $(wildcard src/*.tex) -DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX)) -DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX)) -DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) + +PS2PDF := ps2pdf +DVIPS := dvips +LATEX := latex +FIG2DEV := fig2dev +TGIF := tgif +LATEX2HTML := latex2html + +package = xen +docdir = /usr/share/doc +pkgdocdir = $(docdir)/$(package) + +DOC_TEX := $(wildcard src/*.tex) +DOC_PS := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX)) +DOC_PDF := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX)) +DOC_HTML := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) GFX = $(patsubst %.obj, %.eps, $(wildcard figs/*.obj)) GFX += $(patsubst %.fig, %.eps, $(wildcard figs/*.fig)) @@ -22,30 +35,34 @@ clean: rm -rf $(GFX) ps pdf html install: all - rm -rf $(prefix)/usr/share/doc/xen - mkdir -p $(prefix)/usr/share/doc/xen - cp -dR ps $(prefix)/usr/share/doc/xen - cp -dR pdf $(prefix)/usr/share/doc/xen - cp -dR html $(prefix)/usr/share/doc/xen + rm -rf $(prefix)$(pkgdocdir) + mkdir -p $(prefix)$(pkgdocdir) + cp -dR ps $(prefix)$(pkgdocdir) + cp -dR pdf $(prefix)$(pkgdocdir) + cp -dR html $(prefix)$(pkgdocdir) pdf/%.pdf: ps/%.ps - mkdir -p pdf ; ps2pdf $< $@ + mkdir -p $(@D) + $(PS2PDF) $< $@.new + mv $@.new $@ ps/%.ps: %.dvi - mkdir -p ps ; dvips -Ppdf -G0 -o $@ $< + mkdir -p $(@D) + $(DVIPS) -Ppdf -G0 -o $@.new $< + mv $@.new $@ %.dvi: src/%.tex $(GFX) - latex $< >/dev/null - if [ -e $*.toc ] ; then latex $< >/dev/null ; fi + $(LATEX) $< >/dev/null + if [ -e $*.toc ] ; then $(LATEX) $< >/dev/null ; fi %.eps: %.fig - fig2dev -L eps $< $@ + $(FIG2DEV) -L eps $< $@ %.eps: %.obj - tgif -print -color -eps $< + $(TGIF) -print -color -eps $< html/%/index.html: src/%.tex - mkdir -p html/$* - latex2html -split 0 -show_section_numbers -toc_depth 3 -nonavigation \ - -numbered_footnotes -local_icons -noinfo -math -dir html/$* \ + mkdir -p $(@D) + $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \ + -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \ $< 1>/dev/null 2>/dev/null From 6b422c28fad9b0c0a9caf5c98eb8db1d7914e976 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:34:34 +0000 Subject: [PATCH 04/19] bitkeeper revision 1.1159.223.18 (41f2c6eamwtTkjdrv4CuL1WnOy4iGw) Description: use INSTALL everywhere Use install(by way of INSTALL variables) to create directories, install programs, and install data files. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- Makefile | 22 +++++++++++++--------- tools/examples/Makefile | 20 ++++++++++++-------- tools/libxc/Makefile | 12 ++++++++---- tools/libxutil/Makefile | 9 +++++++-- tools/misc/Makefile | 11 +++++++---- tools/misc/miniterm/Makefile | 7 +++++-- tools/sv/Makefile | 18 ++++++++++-------- tools/xentrace/Makefile | 16 ++++++++++------ tools/xfrd/Makefile | 8 ++++++-- xen/Makefile | 17 ++++++++++------- 10 files changed, 88 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index 7332978f99..ecbc022e10 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ DIST_DIR ?= $(shell pwd)/dist INSTALL_DIR ?= $(DIST_DIR)/install +INSTALL := install +INSTALL_DIR := $(INSTALL) -d -m0755 +INSTALL_DATA := $(INSTALL) -m0644 +INSTALL_PROG := $(INSTALL) -m0755 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU @@ -35,21 +39,21 @@ install-tools: $(MAKE) -C tools install install-kernels: - $(shell cp -a $(INSTALL_DIR)/boot/* /boot/) - $(shell cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/) - $(shell cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/) - $(shell cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/) + cp -a $(INSTALL_DIR)/boot/* /boot/ + cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/ + cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/ + cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/ install-docs: sh ./docs/check_pkgs && $(MAKE) -C docs install || true # build and install everything into local dist directory dist: xen tools kernels docs - install -m0644 ./COPYING $(DIST_DIR) - install -m0644 ./README $(DIST_DIR) - install -m0755 ./install.sh $(DIST_DIR) - mkdir -p $(DIST_DIR)/check - install -m0755 tools/check/chk tools/check/check_* $(DIST_DIR)/check + $(INSTALL_DIR) $(DIST_DIR)/check + $(INSTALL_DATA) ./COPYING $(DIST_DIR) + $(INSTALL_DATA) ./README $(DIST_DIR) + $(INSTALL_PROG) ./install.sh $(DIST_DIR) + $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DIST_DIR)/check xen: $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install diff --git a/tools/examples/Makefile b/tools/examples/Makefile index 14f18ae84f..b19b9710ba 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DATA = $(INSTALL) -m0644 # Init scripts. XEND_INITD = init.d/xend @@ -21,23 +25,23 @@ all: install: all install-initd install-configs install-scripts install-initd: - install -d $(prefix)/etc/init.d - install -m0755 $(XEND_INITD) $(prefix)/etc/init.d - install -m0755 $(XENDOMAINS_INITD) $(prefix)/etc/init.d + $(INSTALL_DIR) $(prefix)/etc/init.d + $(INSTALL_PROG) $(XEND_INITD) $(prefix)/etc/init.d + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(prefix)/etc/init.d install-configs: - install -d $(prefix)$(XEN_CONFIG_DIR) - install -d $(prefix)$(XEN_CONFIG_DIR)/auto + $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR) + $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR)/auto for i in $(XEN_CONFIGS); \ do [ -a $(prefix)/$(XEN_CONFIG_DIR)/$$i ] || \ - install -m0644 $$i $(prefix)$(XEN_CONFIG_DIR); \ + $(INSTALL_DATA) $$i $(prefix)$(XEN_CONFIG_DIR); \ done install-scripts: - install -d $(prefix)$(XEN_SCRIPT_DIR) + $(INSTALL_DIR) $(prefix)$(XEN_SCRIPT_DIR) for i in $(XEN_SCRIPTS); \ do [ -a $(prefix)/$()/$$i ] || \ - install -m0755 $$i $(prefix)$(XEN_SCRIPT_DIR); \ + $(INSTALL_PROG) $$i $(prefix)$(XEN_SCRIPT_DIR); \ done clean: diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index c8960c2a51..c77b5c2767 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_DIR = $(INSTALL) -d -m0755 MAJOR := 2.0 MINOR := 0 @@ -64,12 +68,12 @@ mk-symlinks: ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . ) install: all - mkdir -p $(prefix)/usr/lib - mkdir -p $(prefix)/usr/include - install -m0755 $(LIB) $(prefix)/usr/lib + $(INSTALL_DIR) $(prefix)/usr/lib + $(INSTALL_DIR) $(prefix)/usr/include + $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so - install -m0644 xc.h $(prefix)/usr/include + $(INSTALL_DATA) xc.h $(prefix)/usr/include clean: rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile index ae1b26ef6b..f576251224 100644 --- a/tools/libxutil/Makefile +++ b/tools/libxutil/Makefile @@ -1,4 +1,9 @@ XEN_ROOT = ../.. +INSTALL = install +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 + include $(XEN_ROOT)/tools/Make.defs CC = gcc @@ -67,8 +72,8 @@ check-for-zlib: fi install: all - mkdir -p $(prefix)/usr/lib - install -m0755 $(LIB) $(prefix)/usr/lib + $(INSTALL_DIR) -p $(prefix)/usr/lib + $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 7c20e8d1b0..ab67ba8198 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 XEN_ROOT=../.. include $(XEN_ROOT)/tools/Make.defs @@ -20,10 +23,10 @@ all: $(TARGETS) $(MAKE) -C miniterm install: all - mkdir -p $(prefix)/usr/bin - mkdir -p $(prefix)/usr/sbin - install -m0755 $(INSTALL_BIN) $(prefix)/usr/bin - install -m0755 $(INSTALL_SBIN) $(prefix)/usr/sbin + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/sbin + $(INSTALL_PROG) $(INSTALL_BIN) $(prefix)/usr/bin + $(INSTALL_PROG) $(INSTALL_SBIN) $(prefix)/usr/sbin $(MAKE) -C miniterm install clean: diff --git a/tools/misc/miniterm/Makefile b/tools/misc/miniterm/Makefile index 86e1bf0ccf..fbe4a5bcee 100644 --- a/tools/misc/miniterm/Makefile +++ b/tools/misc/miniterm/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 CC = gcc CFLAGS = -Wall -O3 @@ -6,8 +9,8 @@ TARGET = miniterm all: $(TARGET) install: all - mkdir -p $(prefix)/usr/bin - install -m0755 $(TARGET) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_PROG) $(TARGET) $(prefix)/usr/bin clean: $(RM) *.o $(TARGET) *~ diff --git a/tools/sv/Makefile b/tools/sv/Makefile index 8ae9a93f87..a285dc15d5 100755 --- a/tools/sv/Makefile +++ b/tools/sv/Makefile @@ -1,4 +1,7 @@ -sv_insdir := $(prefix)/var/xen/sv +sv_insdir := $(prefix)/var/xen/sv +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DATA = $(INSTALL) -m0644 all: @@ -14,17 +17,16 @@ IMAGES += next.png previous.png finish.png install: # copy XenSV Main.rpy file - @mkdir -p $(sv_insdir) - @install -m0644 Main.rpy $(sv_insdir) + @$(INSTALL_DIR) $(sv_insdir) + @$(INSTALL_DATA) Main.rpy $(sv_insdir) # copy XenSV images - @mkdir -p $(sv_insdir)/images - @(cd images && install -m0644 $(IMAGES) $(sv_insdir)/images) + @($(INSTALL_DIR) $(sv_insdir)/images + @(cd images && $(INSTALL_DATA) $(IMAGES) $(sv_insdir)/images) # copy XenSV stylesheet - @mkdir -p $(sv_insdir)/inc - @install -m0644 inc/style.css $(sv_insdir)/inc - @install -m0644 inc/script.js $(sv_insdir)/inc + @$(INSTALL_DIR) $(sv_insdir)/inc + @$(INSTALL_DATA) inc/style.css inc/script.js $(sv_insdir)/inc clean: diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index 1b13bd9d8b..c2545762a3 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DATA = $(INSTALL) -m0644 XEN_ROOT=../.. include $(XEN_ROOT)/tools/Make.defs @@ -20,12 +24,12 @@ MAN8 = $(wildcard *.8) all: $(BIN) install: all - mkdir -p $(prefix)/usr/bin - mkdir -p $(prefix)/usr/man/man1 - mkdir -p $(prefix)/usr/man/man8 - install -m0755 $(BIN) $(SCRIPTS) $(prefix)/usr/bin - install -m0644 $(MAN1) $(prefix)/usr/man/man1 - install -m0644 $(MAN8) $(prefix)/usr/man/man8 + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/man/man1 + $(INSTALL_DIR) $(prefix)/usr/man/man8 + $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(prefix)/usr/bin + $(INSTALL_DATA) $(MAN1) $(prefix)/usr/man/man1 + $(INSTALL_DATA) $(MAN8) $(prefix)/usr/man/man8 clean: $(RM) *.a *.so *.o *.rpm $(BIN) diff --git a/tools/xfrd/Makefile b/tools/xfrd/Makefile index 2330d829c4..07c17a3f35 100644 --- a/tools/xfrd/Makefile +++ b/tools/xfrd/Makefile @@ -4,6 +4,10 @@ # Mike Wray #============================================================================ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 + XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Make.defs @@ -68,8 +72,8 @@ xfrd: $(XFRD_PROG_OBJ) .PHONY: install install: xfrd - mkdir -p $(prefix)/$(XFRD_INSTALL_DIR) - install -m 0755 xfrd $(prefix)/$(XFRD_INSTALL_DIR) + $(INSTALL_DIR) $(prefix)/$(XFRD_INSTALL_DIR) + $(INSTALL_PROG) xfrd $(prefix)/$(XFRD_INSTALL_DIR) .PHONY: libutil libutil: $(UTIL_LIB) diff --git a/xen/Makefile b/xen/Makefile index 7eb1d17847..28d8368464 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_DIR = $(INSTALL) -d -m0755 # This is the correct place to edit the build version. # All other places this is stored (eg. compile.h) should be autogenerated. @@ -18,13 +21,13 @@ debug: objdump -D -S $(TARGET)-syms > $(TARGET).s install: $(TARGET).gz - mkdir -p $(prefix)/boot - install -m0644 $(TARGET).gz $(prefix)/boot - install -m0644 $(TARGET)-syms $(prefix)/boot - mkdir -p $(prefix)/usr/include/xen/io - install -m0644 include/public/*.h $(prefix)/usr/include/xen - install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io - install -m0644 include/public/COPYING $(prefix)/usr/include/xen + $(INSTALL_DIR) $(prefix)/boot + $(INSTALL_DATA) $(TARGET).gz $(prefix)/boot + $(INSTALL_DATA) $(TARGET)-syms $(prefix)/boot + $(INSTALL_DIR) $(prefix)/usr/include/xen/io + $(INSTALL_DATA) include/public/*.h $(prefix)/usr/include/xen + $(INSTALL_DATA) include/public/io/*.h $(prefix)/usr/include/xen/io + $(INSTALL_DATA) include/public/COPYING $(prefix)/usr/include/xen dist: $(TARGET) $(MAKE) prefix=`pwd`/../dist/install dist=yes install From 174b817ebc5c8c8ab34a822528ea74dc93697168 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:37:24 +0000 Subject: [PATCH 05/19] bitkeeper revision 1.1159.223.19 (41f2c794WPLLpYdW32MPpAaBhBhL0A) Description: mkbuildtree requires bash From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- linux-2.4.29-xen-sparse/mkbuildtree | 2 +- linux-2.6.10-xen-sparse/mkbuildtree | 2 +- netbsd-2.0-xen-sparse/mkbuildtree | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-2.4.29-xen-sparse/mkbuildtree b/linux-2.4.29-xen-sparse/mkbuildtree index a0e52c2c5c..d586153418 100755 --- a/linux-2.4.29-xen-sparse/mkbuildtree +++ b/linux-2.4.29-xen-sparse/mkbuildtree @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # mkbuildtree # diff --git a/linux-2.6.10-xen-sparse/mkbuildtree b/linux-2.6.10-xen-sparse/mkbuildtree index d353015ff2..8ab2d42a7c 100755 --- a/linux-2.6.10-xen-sparse/mkbuildtree +++ b/linux-2.6.10-xen-sparse/mkbuildtree @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # mkbuildtree # diff --git a/netbsd-2.0-xen-sparse/mkbuildtree b/netbsd-2.0-xen-sparse/mkbuildtree index 1877db8a5e..0d5330d115 100755 --- a/netbsd-2.0-xen-sparse/mkbuildtree +++ b/netbsd-2.0-xen-sparse/mkbuildtree @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # mkbuildtree # From 273e434815f5930823933b876dd987395bd18f01 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:39:35 +0000 Subject: [PATCH 06/19] bitkeeper revision 1.1159.223.20 (41f2c8174klQJ8mMgM3YDtJ6GQBXjw) Missing prat of earlier patch. Description: use INSTALL everywhere Use install(by way of INSTALL variables) to create directories, install programs, and install data files. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- docs/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index f489fd776b..e0b15b35a6 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,7 @@ #!/usr/bin/make -f +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 PS2PDF := ps2pdf DVIPS := dvips @@ -36,18 +38,18 @@ clean: install: all rm -rf $(prefix)$(pkgdocdir) - mkdir -p $(prefix)$(pkgdocdir) + $(INSTALL_DIR) $(prefix)$(pkgdocdir) cp -dR ps $(prefix)$(pkgdocdir) cp -dR pdf $(prefix)$(pkgdocdir) cp -dR html $(prefix)$(pkgdocdir) pdf/%.pdf: ps/%.ps - mkdir -p $(@D) + $(INSTALL_DIR) $(@D) $(PS2PDF) $< $@.new mv $@.new $@ ps/%.ps: %.dvi - mkdir -p $(@D) + $(INSTALL_DIR) $(@D) $(DVIPS) -Ppdf -G0 -o $@.new $< mv $@.new $@ @@ -62,7 +64,7 @@ ps/%.ps: %.dvi $(TGIF) -print -color -eps $< html/%/index.html: src/%.tex - mkdir -p $(@D) + $(INSTALL_DIR) $(@D) $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \ -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \ $< 1>/dev/null 2>/dev/null From 2f2710b791a3061fab60d13491b1df26d79e2b5c Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:43:33 +0000 Subject: [PATCH 07/19] bitkeeper revision 1.1159.223.21 (41f2c905sBZq8YH0a-M9_-ucSA_KAQ) Description: support parallellism better Using shell for loops doesn't allow make to run it the most parallel modes. Use patsubst/addsuffix tricks to make this work. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- Makefile | 58 +++++++++++++++++++++------------------------------- xen/Makefile | 9 ++++---- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index ecbc022e10..230af6db05 100644 --- a/Makefile +++ b/Makefile @@ -30,25 +30,25 @@ all: dist # install everything into the standard system directories # NB: install explicitly does not check that everything is up to date! -install: install-tools install-xen install-kernels install-docs +install: xen.install tools.install kernels docs.install -install-xen: - $(MAKE) -C xen install - -install-tools: - $(MAKE) -C tools install - -install-kernels: +kernels.install: cp -a $(INSTALL_DIR)/boot/* /boot/ cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/ cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/ cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/ -install-docs: - sh ./docs/check_pkgs && $(MAKE) -C docs install || true +docs.install: + sh ./docs/check_pkgs && $(MAKE) -C docs install || true + +xen.install tools.install: %.install: + $(MAKE) -C $* install + +xen.dist tools.dist: %.dist: + $(MAKE) -C $* dist # build and install everything into local dist directory -dist: xen tools kernels docs +dist: xen.dist tools.dist kernels docs.install $(INSTALL_DIR) $(DIST_DIR)/check $(INSTALL_DATA) ./COPYING $(DIST_DIR) $(INSTALL_DATA) ./README $(DIST_DIR) @@ -61,8 +61,7 @@ xen: tools: $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install -kernels: - for i in $(XKERNELS) ; do $(MAKE) $$i-build ; done +kernels: $(addsuffix -build,$(XKERNELS)) docs: sh ./docs/check_pkgs && \ @@ -72,17 +71,13 @@ docs: kbuild: kernels # Delete the kernel build trees entirely -kdelete: - for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done +kdelete: $(addsuffix -clean,$(XKERNELS)) # Clean the kernel build trees -kclean: - for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done +kclean: $(addsuffix -clean,$(XKERNELS)) # Make patches from kernel sparse trees -mkpatches: - for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch ; done - +mkpatches: $(addsuffix -xen.patch,$(ALLSPARSETREES)) # build xen, the tools, and a domain 0 plus unprivileged linux-xen images, # and place them in the install directory. 'make install' should then @@ -93,16 +88,14 @@ world: $(MAKE) dist # clean doesn't do a kclean -clean: - $(MAKE) -C xen clean - $(MAKE) -C tools clean - $(MAKE) -C docs clean +clean: xen.clean tools.clean docs.clean + +xen.clean tools.clean docs.clean: %.clean: + $(MAKE) -C $* clean # clean, but blow away kernel build tree plus tar balls -mrproper: clean +mrproper: clean $(addsuffix -delete,$(ALLKERNELS)) $(addsuffix -mrproper,$(ALLSPARSETREES)) rm -rf dist patches/tmp - for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done - for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done install-twisted: wget http://www.twistedmatrix.com/products/get-current.epy @@ -165,13 +158,8 @@ uninstall: rm -rf "/usr/lib/python2.?/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.?/site-packages/Xc*" # Legacy targets for compatibility -linux24: - $(MAKE) linux-2.4-xen0-build - $(MAKE) linux-2.4-xenU-build +linux24: linux-2.4-xen0-build linux-2.4-xenU-build -linux26: - $(MAKE) linux-2.6-xen0-build - $(MAKE) linux-2.6-xenU-build +linux26: linux-2.6-xen0-build linux-2.6-xenU-build -netbsd20: - $(MAKE) netbsd-2.0-xenU-build +netbsd20: netbsd-2.0-xenU-build diff --git a/xen/Makefile b/xen/Makefile index 28d8368464..4aa6330310 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -32,14 +32,13 @@ install: $(TARGET).gz dist: $(TARGET) $(MAKE) prefix=`pwd`/../dist/install dist=yes install -clean: - $(MAKE) -C tools clean - $(MAKE) -C common clean - $(MAKE) -C drivers clean - $(MAKE) -C arch/$(TARGET_ARCH) clean +clean: tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h rm -f include/asm-*/asm-offsets.h +tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean : %.clean: + $(MAKE) -C $* clean + $(TARGET): delete-unfresh-files [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm $(MAKE) -C tools From bce79d6f9804897cef40c7e42f9b9cbe87b8a3f1 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:45:39 +0000 Subject: [PATCH 08/19] bitkeeper revision 1.1159.223.22 (41f2c983tNSS8-VlWIzF9A78zTQx-w) Description: add force-reload option Debian policy requires init scripts to implement force-reload. So, alias that to restart. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- tools/examples/init.d/xend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/examples/init.d/xend b/tools/examples/init.d/xend index 39324c7930..fc94c17dd2 100755 --- a/tools/examples/init.d/xend +++ b/tools/examples/init.d/xend @@ -32,14 +32,14 @@ case "$1" in status) xend status ;; - restart|reload) + restart|reload|force-reload) xend restart await_daemons_up ;; *) # do not advertise unreasonable commands that there is no reason # to use with this device - echo $"Usage: $0 {start|stop|status|restart|reload}" + echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" exit 1 esac From 41df713e0177952d6b3b27effa780acc4aad9e69 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:47:15 +0000 Subject: [PATCH 09/19] bitkeeper revision 1.1159.223.23 (41f2c9e33H5dJn6K7RN-o2UASMwI3Q) Description: Use FHS-compatible paths From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- tools/python/xen/sv/params.py | 4 ++-- tools/python/xen/xend/XendRoot.py | 2 +- tools/sv/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/python/xen/sv/params.py b/tools/python/xen/sv/params.py index 16b764f088..beed647a4f 100644 --- a/tools/python/xen/sv/params.py +++ b/tools/python/xen/sv/params.py @@ -1,3 +1,3 @@ SV_PORT = 8080 -SV_ROOT = "/var/xen/sv/" -PID_FILE = "/var/xen/sv.pid" \ No newline at end of file +SV_ROOT = "/var/lib/xen/sv/" +PID_FILE = "/var/run/xen-sv.pid" diff --git a/tools/python/xen/xend/XendRoot.py b/tools/python/xen/xend/XendRoot.py index c9cc9a2279..dea3eeeb2f 100644 --- a/tools/python/xen/xend/XendRoot.py +++ b/tools/python/xen/xend/XendRoot.py @@ -20,7 +20,7 @@ class XendRoot: """Root of the management classes.""" """Default path to the root of the database.""" - dbroot_default = "/var/xen/xend-db" + dbroot_default = "/var/lib/xen/xend-db" """Default path to the config file.""" config_default = "/etc/xen/xend-config.sxp" diff --git a/tools/sv/Makefile b/tools/sv/Makefile index a285dc15d5..dc47b71e09 100755 --- a/tools/sv/Makefile +++ b/tools/sv/Makefile @@ -1,4 +1,4 @@ -sv_insdir := $(prefix)/var/xen/sv +sv_insdir := $(prefix)/var/lib/xen/sv INSTALL = install INSTALL_DIR = $(INSTALL) -d -m0755 INSTALL_DATA = $(INSTALL) -m0644 From 7f493a93051f8c2bf8700f084dfb812fcec56305 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:52:47 +0000 Subject: [PATCH 10/19] bitkeeper revision 1.1159.223.24 (41f2cb2floBkEBE6cfn2iLK2ZpPfhA) Description: conditionally call modules targets for 2.4 There was a complaint on the mailing list about linux 2.6 not building if module support was disabled; a patch was done to fix this. However, the same change was not done to the 2.4 files. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- buildconfigs/mk.linux-2.4-xen0 | 6 ++++-- buildconfigs/mk.linux-2.4-xenU | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/buildconfigs/mk.linux-2.4-xen0 b/buildconfigs/mk.linux-2.4-xen0 index b9f852eff8..e4a4537bc5 100644 --- a/buildconfigs/mk.linux-2.4-xen0 +++ b/buildconfigs/mk.linux-2.4-xen0 @@ -13,8 +13,10 @@ include buildconfigs/Rules.mk # The real action starts here! build: $(LINUX_DIR)/include/linux/autoconf.h - $(MAKE) -C $(LINUX_DIR) ARCH=xen modules - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install + if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + fi $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install patches/tmp/ebtables.diff: diff --git a/buildconfigs/mk.linux-2.4-xenU b/buildconfigs/mk.linux-2.4-xenU index a0937de4f6..86d38bb9d5 100644 --- a/buildconfigs/mk.linux-2.4-xenU +++ b/buildconfigs/mk.linux-2.4-xenU @@ -13,8 +13,10 @@ include buildconfigs/Rules.mk # The real action starts here! build: $(LINUX_DIR)/include/linux/autoconf.h - $(MAKE) -C $(LINUX_DIR) ARCH=xen modules - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install + if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + fi $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER) From 84a280c8928e988f7e8fac3fe69f1b1e67d95da5 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:54:34 +0000 Subject: [PATCH 11/19] bitkeeper revision 1.1159.223.25 (41f2cb9aEKMZkZbvqBE0eXhpljlV4Q) Description: fix path to python There is no python2 in debian. Instead, use python. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- tools/python/xen/xend/server/SrvServer.py | 2 +- tools/python/xen/xend/sxp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/server/SrvServer.py b/tools/python/xen/xend/server/SrvServer.py index 28ddaa7e48..353d6eed24 100644 --- a/tools/python/xen/xend/server/SrvServer.py +++ b/tools/python/xen/xend/server/SrvServer.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python # Copyright (C) 2004 Mike Wray """Example xend HTTP and console server. diff --git a/tools/python/xen/xend/sxp.py b/tools/python/xen/xend/sxp.py index 35b24aa8aa..e2c0de5c5b 100644 --- a/tools/python/xen/xend/sxp.py +++ b/tools/python/xen/xend/sxp.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python # Copyright (C) 2004 Mike Wray """ Input-driven parsing for s-expression (sxp) format. From d2f5d53621f141ce1be63eeeae4a8a9e289498d8 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 22:03:34 +0000 Subject: [PATCH 12/19] bitkeeper revision 1.1159.223.26 (41f2cdb6LNpheOtPoAKEUn-czlZFig) Description: use DESTDIR correctly Standard makefiles always attempt to install to the root(/). Setting DESTDIR is the normal way to install to an alternative location. Setting prefix has the possibility of breaking programs, as the prefix may have been embedded inside a compiled binary. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- Makefile | 11 ++++++----- buildconfigs/mk.linux-2.4-xen0 | 4 ++-- buildconfigs/mk.linux-2.4-xenU | 4 ++-- buildconfigs/mk.linux-2.6-xen0 | 4 ++-- buildconfigs/mk.linux-2.6-xenU | 4 ++-- docs/Makefile | 13 +++++++------ tools/examples/Makefile | 20 ++++++++++---------- tools/libxc/Makefile | 12 ++++++------ tools/libxutil/Makefile | 8 ++++---- tools/misc/Makefile | 8 ++++---- tools/misc/miniterm/Makefile | 4 ++-- tools/python/Makefile | 6 +++++- tools/sv/Makefile | 14 +++++++------- tools/xentrace/Makefile | 12 ++++++------ tools/xfrd/Makefile | 4 ++-- xen/Makefile | 20 ++++++++++---------- 16 files changed, 77 insertions(+), 71 deletions(-) diff --git a/Makefile b/Makefile index 230af6db05..2e7d05cd19 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,9 @@ # Grand Unified Makefile for Xen. # -DIST_DIR ?= $(shell pwd)/dist -INSTALL_DIR ?= $(DIST_DIR)/install +DIST_DIR := $(CURDIR)/dist +DESTDIR := $(DIST_DIR)/install + INSTALL := install INSTALL_DIR := $(INSTALL) -d -m0755 INSTALL_DATA := $(INSTALL) -m0644 @@ -18,7 +19,7 @@ ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse)) XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) ) -export INSTALL_DIR +export DESTDIR include buildconfigs/Rules.mk @@ -56,10 +57,10 @@ dist: xen.dist tools.dist kernels docs.install $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DIST_DIR)/check xen: - $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install + $(MAKE) dist=yes -C xen install tools: - $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install + $(MAKE) dist=yes -C tools install kernels: $(addsuffix -build,$(XKERNELS)) diff --git a/buildconfigs/mk.linux-2.4-xen0 b/buildconfigs/mk.linux-2.4-xen0 index e4a4537bc5..c4f7fc359a 100644 --- a/buildconfigs/mk.linux-2.4-xen0 +++ b/buildconfigs/mk.linux-2.4-xen0 @@ -15,9 +15,9 @@ include buildconfigs/Rules.mk build: $(LINUX_DIR)/include/linux/autoconf.h if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \ fi - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install patches/tmp/ebtables.diff: mkdir -p patches/tmp diff --git a/buildconfigs/mk.linux-2.4-xenU b/buildconfigs/mk.linux-2.4-xenU index 86d38bb9d5..1c589faba2 100644 --- a/buildconfigs/mk.linux-2.4-xenU +++ b/buildconfigs/mk.linux-2.4-xenU @@ -15,9 +15,9 @@ include buildconfigs/Rules.mk build: $(LINUX_DIR)/include/linux/autoconf.h if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \ fi - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER) rm -rf $(LINUX_DIR) diff --git a/buildconfigs/mk.linux-2.6-xen0 b/buildconfigs/mk.linux-2.6-xen0 index 82179c6c74..eda5bb46d8 100644 --- a/buildconfigs/mk.linux-2.6-xen0 +++ b/buildconfigs/mk.linux-2.6-xen0 @@ -15,9 +15,9 @@ include buildconfigs/Rules.mk build: $(LINUX_DIR)/include/linux/autoconf.h if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \ fi - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER) rm -rf $(LINUX_DIR) diff --git a/buildconfigs/mk.linux-2.6-xenU b/buildconfigs/mk.linux-2.6-xenU index fa6e1109b3..ff6b47ff29 100644 --- a/buildconfigs/mk.linux-2.6-xenU +++ b/buildconfigs/mk.linux-2.6-xenU @@ -15,9 +15,9 @@ include buildconfigs/Rules.mk build: $(LINUX_DIR)/include/linux/autoconf.h if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \ $(MAKE) -C $(LINUX_DIR) ARCH=xen modules ; \ - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(INSTALL_DIR) modules_install ; \ + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \ fi - $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install + $(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install $(LINUX_DIR)/include/linux/autoconf.h: pristine-linux-$(LINUX_VER) rm -rf $(LINUX_DIR) diff --git a/docs/Makefile b/docs/Makefile index e0b15b35a6..46c2d38c59 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -11,7 +11,8 @@ TGIF := tgif LATEX2HTML := latex2html package = xen -docdir = /usr/share/doc +prefix = /usr +docdir = $(prefix)/share/doc pkgdocdir = $(docdir)/$(package) DOC_TEX := $(wildcard src/*.tex) @@ -37,11 +38,11 @@ clean: rm -rf $(GFX) ps pdf html install: all - rm -rf $(prefix)$(pkgdocdir) - $(INSTALL_DIR) $(prefix)$(pkgdocdir) - cp -dR ps $(prefix)$(pkgdocdir) - cp -dR pdf $(prefix)$(pkgdocdir) - cp -dR html $(prefix)$(pkgdocdir) + rm -rf $(DESTDIR)$(pkgdocdir) + $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir) + cp -dR ps $(DESTDIR)$(pkgdocdir) + cp -dR pdf $(DESTDIR)$(pkgdocdir) + cp -dR html $(DESTDIR)$(pkgdocdir) pdf/%.pdf: ps/%.ps $(INSTALL_DIR) $(@D) diff --git a/tools/examples/Makefile b/tools/examples/Makefile index b19b9710ba..0fb4950476 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -25,23 +25,23 @@ all: install: all install-initd install-configs install-scripts install-initd: - $(INSTALL_DIR) $(prefix)/etc/init.d - $(INSTALL_PROG) $(XEND_INITD) $(prefix)/etc/init.d - $(INSTALL_PROG) $(XENDOMAINS_INITD) $(prefix)/etc/init.d + $(INSTALL_DIR) $(DESTDIR)/etc/init.d + $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d install-configs: - $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR) - $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR)/auto + $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR) + $(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)/auto for i in $(XEN_CONFIGS); \ - do [ -a $(prefix)/$(XEN_CONFIG_DIR)/$$i ] || \ - $(INSTALL_DATA) $$i $(prefix)$(XEN_CONFIG_DIR); \ + do [ -a $(DESTDIR)/$(XEN_CONFIG_DIR)/$$i ] || \ + $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_CONFIG_DIR); \ done install-scripts: - $(INSTALL_DIR) $(prefix)$(XEN_SCRIPT_DIR) + $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR) for i in $(XEN_SCRIPTS); \ - do [ -a $(prefix)/$()/$$i ] || \ - $(INSTALL_PROG) $$i $(prefix)$(XEN_SCRIPT_DIR); \ + do [ -a $(DESTDIR)/$()/$$i ] || \ + $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \ done clean: diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index c77b5c2767..20714e0452 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -68,12 +68,12 @@ mk-symlinks: ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . ) install: all - $(INSTALL_DIR) $(prefix)/usr/lib - $(INSTALL_DIR) $(prefix)/usr/include - $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib - ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) - ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so - $(INSTALL_DATA) xc.h $(prefix)/usr/include + $(INSTALL_DIR) $(DESTDIR)/usr/lib + $(INSTALL_DIR) $(DESTDIR)/usr/include + $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/lib + ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR) + ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so + $(INSTALL_DATA) xc.h $(DESTDIR)/usr/include clean: rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile index f576251224..9efb826b0b 100644 --- a/tools/libxutil/Makefile +++ b/tools/libxutil/Makefile @@ -72,10 +72,10 @@ check-for-zlib: fi install: all - $(INSTALL_DIR) -p $(prefix)/usr/lib - $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib - ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) - ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so + $(INSTALL_DIR) -p $(DESTDIR)/usr/lib + $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/lib + ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so.$(MAJOR) + ln -sf $(LIB_NAME).so.$(MAJOR) $(DESTDIR)/usr/lib/$(LIB_NAME).so clean: $(RM) *.a *.so *.so.* *.o *.opic *.rpm diff --git a/tools/misc/Makefile b/tools/misc/Makefile index ab67ba8198..84166c72fc 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -23,10 +23,10 @@ all: $(TARGETS) $(MAKE) -C miniterm install: all - $(INSTALL_DIR) $(prefix)/usr/bin - $(INSTALL_DIR) $(prefix)/usr/sbin - $(INSTALL_PROG) $(INSTALL_BIN) $(prefix)/usr/bin - $(INSTALL_PROG) $(INSTALL_SBIN) $(prefix)/usr/sbin + $(INSTALL_DIR) $(DESTDIR)/usr/bin + $(INSTALL_DIR) $(DESTDIR)/usr/sbin + $(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin + $(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin $(MAKE) -C miniterm install clean: diff --git a/tools/misc/miniterm/Makefile b/tools/misc/miniterm/Makefile index fbe4a5bcee..e85ee3738e 100644 --- a/tools/misc/miniterm/Makefile +++ b/tools/misc/miniterm/Makefile @@ -9,8 +9,8 @@ TARGET = miniterm all: $(TARGET) install: all - $(INSTALL_DIR) $(prefix)/usr/bin - $(INSTALL_PROG) $(TARGET) $(prefix)/usr/bin + $(INSTALL_DIR) $(DESTDIR)/usr/bin + $(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin clean: $(RM) *.o $(TARGET) *~ diff --git a/tools/python/Makefile b/tools/python/Makefile index a3f4face53..9d39bd85b4 100644 --- a/tools/python/Makefile +++ b/tools/python/Makefile @@ -3,7 +3,11 @@ all: python setup.py build install: all - python setup.py install --home="$(prefix)/usr" + if [ "$(DESTDIR)" = "" ]; then \ + python setup.py install; \ + else \ + python setup.py install --root="$(DESTDIR)"; \ + fi clean: rm -rf build *.pyc *.pyo *.o *.a *~ diff --git a/tools/sv/Makefile b/tools/sv/Makefile index dc47b71e09..c2b4e92dfc 100755 --- a/tools/sv/Makefile +++ b/tools/sv/Makefile @@ -1,4 +1,4 @@ -sv_insdir := $(prefix)/var/lib/xen/sv +sv_insdir := /var/lib/xen/sv INSTALL = install INSTALL_DIR = $(INSTALL) -d -m0755 INSTALL_DATA = $(INSTALL) -m0644 @@ -17,16 +17,16 @@ IMAGES += next.png previous.png finish.png install: # copy XenSV Main.rpy file - @$(INSTALL_DIR) $(sv_insdir) - @$(INSTALL_DATA) Main.rpy $(sv_insdir) + @$(INSTALL_DIR) $(DESTDIR)$(sv_insdir) + @$(INSTALL_DATA) Main.rpy $(DESTDIR)$(sv_insdir) # copy XenSV images - @($(INSTALL_DIR) $(sv_insdir)/images - @(cd images && $(INSTALL_DATA) $(IMAGES) $(sv_insdir)/images) + @$(INSTALL_DIR) $(DESTDIR)$(sv_insdir)/images + @(cd images && $(INSTALL_DATA) $(IMAGES) $(DESTDIR)$(sv_insdir)/images) # copy XenSV stylesheet - @$(INSTALL_DIR) $(sv_insdir)/inc - @$(INSTALL_DATA) inc/style.css inc/script.js $(sv_insdir)/inc + @$(INSTALL_DIR) $(DESTDIR)$(sv_insdir)/inc + @$(INSTALL_DATA) inc/style.css inc/script.js $(DESTDIR)$(sv_insdir)/inc clean: diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index c2545762a3..9133271b66 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -24,12 +24,12 @@ MAN8 = $(wildcard *.8) all: $(BIN) install: all - $(INSTALL_DIR) $(prefix)/usr/bin - $(INSTALL_DIR) $(prefix)/usr/man/man1 - $(INSTALL_DIR) $(prefix)/usr/man/man8 - $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(prefix)/usr/bin - $(INSTALL_DATA) $(MAN1) $(prefix)/usr/man/man1 - $(INSTALL_DATA) $(MAN8) $(prefix)/usr/man/man8 + $(INSTALL_DIR) $(DESTDIR)/usr/bin + $(INSTALL_DIR) $(DESTDIR)/usr/man/man1 + $(INSTALL_DIR) $(DESTDIR)/usr/man/man8 + $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin + $(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/man/man1 + $(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/man/man8 clean: $(RM) *.a *.so *.o *.rpm $(BIN) diff --git a/tools/xfrd/Makefile b/tools/xfrd/Makefile index 07c17a3f35..6ca1a1d12f 100644 --- a/tools/xfrd/Makefile +++ b/tools/xfrd/Makefile @@ -72,8 +72,8 @@ xfrd: $(XFRD_PROG_OBJ) .PHONY: install install: xfrd - $(INSTALL_DIR) $(prefix)/$(XFRD_INSTALL_DIR) - $(INSTALL_PROG) xfrd $(prefix)/$(XFRD_INSTALL_DIR) + $(INSTALL_DIR) $(DESTDIR)/$(XFRD_INSTALL_DIR) + $(INSTALL_PROG) xfrd $(DESTDIR)/$(XFRD_INSTALL_DIR) .PHONY: libutil libutil: $(UTIL_LIB) diff --git a/xen/Makefile b/xen/Makefile index 4aa6330310..b560ac1822 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -8,7 +8,8 @@ export XEN_VERSION = 2 export XEN_SUBVERSION = 0 export XEN_EXTRAVERSION = "" -export BASEDIR := $(shell pwd) +export BASEDIR := $(CURDIR) +DESTDIR := $(CURDIR)/../dist/install include Rules.mk @@ -21,16 +22,15 @@ debug: objdump -D -S $(TARGET)-syms > $(TARGET).s install: $(TARGET).gz - $(INSTALL_DIR) $(prefix)/boot - $(INSTALL_DATA) $(TARGET).gz $(prefix)/boot - $(INSTALL_DATA) $(TARGET)-syms $(prefix)/boot - $(INSTALL_DIR) $(prefix)/usr/include/xen/io - $(INSTALL_DATA) include/public/*.h $(prefix)/usr/include/xen - $(INSTALL_DATA) include/public/io/*.h $(prefix)/usr/include/xen/io - $(INSTALL_DATA) include/public/COPYING $(prefix)/usr/include/xen + $(INSTALL_DIR) $(DESTDIR)/boot + $(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot + $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot + $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io + $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen + $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io + $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen -dist: $(TARGET) - $(MAKE) prefix=`pwd`/../dist/install dist=yes install +dist: install clean: tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h From feebe377b8dae7c5aae0900f0d9007f9366f47f2 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 22:05:19 +0000 Subject: [PATCH 13/19] bitkeeper revision 1.1159.223.27 (41f2ce1fr2yuEH_MHLrdXsDbSjsMJA) Description: fix non-standard make/shell syntax Fix use of `pwd`, &&, and || true. Also, remove (). From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- Makefile | 16 ++++++++-------- tools/Makefile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2e7d05cd19..5fcdc9f74c 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,8 @@ kernels.install: cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/ docs.install: - sh ./docs/check_pkgs && $(MAKE) -C docs install || true + sh ./docs/check_pkgs + -$(MAKE) -C docs install xen.install tools.install: %.install: $(MAKE) -C $* install @@ -65,8 +66,8 @@ tools: kernels: $(addsuffix -build,$(XKERNELS)) docs: - sh ./docs/check_pkgs && \ - $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C docs install || true + sh ./docs/check_pkgs + -$(MAKE) dist=yes -C docs install # Build all the various kernels and modules kbuild: kernels @@ -101,20 +102,19 @@ mrproper: clean $(addsuffix -delete,$(ALLKERNELS)) $(addsuffix -mrproper,$(ALLSP install-twisted: wget http://www.twistedmatrix.com/products/get-current.epy tar -zxf Twisted-*.tar.gz - ( cd Twisted-* ; python setup.py install ) + cd Twisted-* && python setup.py install install-logging: LOGGING=logging-0.4.9.2 install-logging: [ -f $(LOGGING).tar.gz ] || wget http://www.red-dove.com/$(LOGGING).tar.gz tar -zxf $(LOGGING).tar.gz - ( cd $(LOGGING) && python setup.py install ) + cd $(LOGGING) && python setup.py install # handy target to upgrade iptables (use rpm or apt-get in preference) install-iptables: wget http://www.netfilter.org/files/iptables-1.2.11.tar.bz2 - tar -jxf iptables-*.tar.bz2 - ( cd iptables-* ; \ - make PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install) + tar -jxf iptables-1.2.11.tar.bz2 + $(MAKE) -C iptables-1.2.11 PREFIX= KERNEL_DIR=../linux-$(LINUX_VER)-xen0 install help: @echo 'Installation targets:' diff --git a/tools/Makefile b/tools/Makefile index 6c9855bed7..a05c196d37 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,7 +23,7 @@ endif $(MAKE) -C sv install dist: $(TARGET) - $(MAKE) prefix=`pwd`/../../install dist=yes install + $(MAKE) prefix=$(CURDIR)/../../install dist=yes install clean: From 323114c5b34149b3b648ebdee08b24c78b0128de Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 22:07:37 +0000 Subject: [PATCH 14/19] bitkeeper revision 1.1159.223.28 (41f2cea9tkhheORopsoScolnVoBxgw) Description: split banner.h Split banner.h, to make it easier to edit, and more properly fit in with normal build systems. Also, inline the rules to actually build figlet. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- .rootkeys | 2 ++ xen/Makefile | 48 +++++++++++++++++++----------------- xen/include/xen/banner.h | 12 +++++++++ xen/include/xen/compile.h.in | 13 ++++++++++ 4 files changed, 53 insertions(+), 22 deletions(-) create mode 100644 xen/include/xen/banner.h create mode 100644 xen/include/xen/compile.h.in diff --git a/.rootkeys b/.rootkeys index 0e6a0705b5..0dca6858e0 100644 --- a/.rootkeys +++ b/.rootkeys @@ -852,7 +852,9 @@ 3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/public/xen.h 3e397e66m2tO3s-J8Jnr7Ws_tGoPTg xen/include/xen/ac_timer.h 40715b2epYl2jBbxzz9CI2rgIca7Zg xen/include/xen/acpi.h +41f2cea7ZvnB9JC4qkiq1K8H7xJw5Q xen/include/xen/banner.h 3ddb79c0c0cX_DZE209-Bb-Rx1v-Aw xen/include/xen/cache.h +41f2cea7Yna7xc0X9fyavIjoSFFeVg xen/include/xen/compile.h.in 3f840f12CkbYSlwMrY2S11Mpyxg7Nw xen/include/xen/compiler.h 3ddb79c259jh8hE7vre_8NuE7nwNSA xen/include/xen/config.h 3eb165e0eawr3R-p2ZQtSdLWtLRN_A xen/include/xen/console.h diff --git a/xen/Makefile b/xen/Makefile index b560ac1822..df01937245 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -35,14 +35,13 @@ dist: install clean: tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h rm -f include/asm-*/asm-offsets.h + rm -f tools/figlet/*.o tools/figlet/figlet tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean : %.clean: $(MAKE) -C $* clean -$(TARGET): delete-unfresh-files +$(TARGET): delete-unfresh-files include/xen/compile.h [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm - $(MAKE) -C tools - $(MAKE) include/xen/compile.h $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s $(MAKE) include/asm-$(TARGET_ARCH)/asm-offsets.h $(MAKE) -C common @@ -54,25 +53,30 @@ delete-unfresh-files: rm -f include/xen/compile.h common/kernel.o # compile.h contains dynamic build info. Rebuilt on every 'make' invocation. -include/xen/compile.h: - @LANG=C echo /\* Autogenerated by root Makefile. Do not edit. \*/ > $@ - @LANG=C echo >> $@ - @LANG=C echo \#define XEN_COMPILE_DATE \"`date`\" >> $@ - @LANG=C echo \#define XEN_COMPILE_TIME \"`date +%T`\" >> $@ - @LANG=C echo \#define XEN_COMPILE_BY \"`whoami`\" >> $@ - @LANG=C echo \#define XEN_COMPILE_DOMAIN \"`([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown])`\" >> $@ - @LANG=C echo \#define XEN_COMPILE_HOST \"`hostname`\" >> $@ - @LANG=C echo \#define XEN_COMPILER \"`$(CC) $(CFLAGS) -v 2>&1 | tail -n 1`\" >> $@ - @LANG=C echo >> $@ - @LANG=C echo \#define XEN_VERSION\ \ \ \ \ \ $(XEN_VERSION) >> $@ - @LANG=C echo \#define XEN_SUBVERSION\ \ \ $(XEN_SUBVERSION) >> $@ - @LANG=C echo \#define XEN_EXTRAVERSION \"$(XEN_EXTRAVERSION)\" >> $@ - @LANG=C echo >> $@ - @LANG=C echo \#define XEN_CHANGESET \"`bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo "information unavailable"`\" >> $@ - @LANG=C echo >> $@ - @LANG=C echo \#define XEN_BANNER \\ >> $@ - ( cd ./tools/figlet && ./figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) 1>>../../$@ ) - @LANG=C echo >> $@ +include/xen/compile.h: LANG=C +include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h + sed -e 's/@@date@@/$(shell date)/g' \ + -e 's/@@time@@/$(shell date +%T)/g' \ + -e 's/@@whoami@@/$(shell whoami)/g' \ + -e 's/@@domain@@/$(shell ([ -x /bin/dnsdomainname ] && /bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo [unknown]))/g' \ + -e 's/@@hostname@@/$(shell hostname)/g' \ + -e 's/@@compiler@@/$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)/g' \ + -e 's/@@version@@/$(XEN_VERSION)/g' \ + -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \ + -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \ + -e 's/@@changeset@@/$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)/g' \ + < include/xen/compile.h.in > $@.new + cat include/xen/banner.h >> $@.new + mv $@.new $@ + +tools/figlet/figlet: tools/figlet/figlet.o + $(CC) -o $@ $< +tools/figlet/figlet.o: tools/figlet/figlet.c + $(CC) -o $@ -c $< + +include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf + tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new + mv $@.new $@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s @(set -e; \ diff --git a/xen/include/xen/banner.h b/xen/include/xen/banner.h new file mode 100644 index 0000000000..f9d5f90f06 --- /dev/null +++ b/xen/include/xen/banner.h @@ -0,0 +1,12 @@ +"\040\137\137\040\040\137\137\040\040\040\040\040\040\040\040\040\040\040" \ +"\040\137\137\137\137\040\040\040\040\137\137\137\040\040\012\040\134\040" \ +"\134\057\040\057\137\137\137\040\137\040\137\137\040\040\040\174\137\137" \ +"\137\040\134\040\040\057\040\137\040\134\040\012\040\040\134\040\040\057" \ +"\057\040\137\040\134\040\047\137\040\134\040\040\040\040\137\137\051\040" \ +"\174\174\040\174\040\174\040\174\012\040\040\057\040\040\134\040\040\137" \ +"\137\057\040\174\040\174\040\174\040\040\057\040\137\137\057\040\174\040" \ +"\174\137\174\040\174\012\040\057\137\057\134\137\134\137\137\137\174\137" \ +"\174\040\174\137\174\040\174\137\137\137\137\137\050\137\051\137\137\137" \ +"\057\040\012\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040" \ +"\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\012" \ + diff --git a/xen/include/xen/compile.h.in b/xen/include/xen/compile.h.in new file mode 100644 index 0000000000..e5179509fb --- /dev/null +++ b/xen/include/xen/compile.h.in @@ -0,0 +1,13 @@ +#define XEN_COMPILE_DATE "@@date@@" +#define XEN_COMPILE_TIME "@@time@@" +#define XEN_COMPILE_BY "@@whoami@@" +#define XEN_COMPILE_DOMAIN "@@domain@@" +#define XEN_COMPILE_HOST "@@hostname@@" +#define XEN_COMPILER "@@compiler@@" + +#define XEN_VERSION @@version@@ +#define XEN_SUBVERSION @@subversion@@ +#define XEN_EXTRAVERSION @@extraversion@@ + +#define XEN_CHANGESET "@@changeset@@" +#define XEN_BANNER \ From aac66e34a6f0fd9a3e084945cf5e6a4b9eb9fd56 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Mon, 24 Jan 2005 20:37:34 +0000 Subject: [PATCH 15/19] bitkeeper revision 1.1159.226.3 (41f55c8er11pRwXCJ66we1vDzrEZ9Q) With ipv6, every network interface always has a link local address. This fools the network script into thinking that xen-br0 already has a network address, and it refuses to transfer over eth0's IP address to xen-br0. By grepping for 'inet ' instead of just 'inet', the network script is no longer fooled and does the right thing. This patch makes Xen networking work again on my Fedora system. Signed-off-by: Rik van Riel Signed-off-by: ian.pratt@cl.cam.ac.uk --- tools/examples/network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/examples/network b/tools/examples/network index b679b93e43..229881d737 100755 --- a/tools/examples/network +++ b/tools/examples/network @@ -61,13 +61,13 @@ transfer_addrs () { local src=$1 local dst=$2 # Don't bother if $dst already has IP addresses. - if ip addr show dev ${dst} | egrep -q '^ *inet' ; then + if ip addr show dev ${dst} | egrep -q '^ *inet ' ; then return fi # Address lines start with 'inet' and have the device in them. # Replace 'inet' with 'ip addr add' and change the device name $src # to 'dev $src'. Remove netmask as we'll add routes later. - ip addr show dev ${src} | egrep '^ *inet' | sed -e " + ip addr show dev ${src} | egrep '^ *inet ' | sed -e " s/inet/ip addr add/ s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)/[0-9]\+@\1@ s/${src}/dev ${dst}/ From eab8489a4970a3ad8b03d6b81499401e363c7ebb Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Mon, 24 Jan 2005 22:34:15 +0000 Subject: [PATCH 16/19] bitkeeper revision 1.1159.223.29 (41f577e7ZJYpBbgJi8udTXWyfHvSYg) Cset exclude: iap10@labyrinth.cl.cam.ac.uk|ChangeSet|20050122214333|39257 --- Makefile | 57 ++++++++++++++++++++++++++++++++-------------------- xen/Makefile | 9 +++++---- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 5fcdc9f74c..924fbfbaca 100644 --- a/Makefile +++ b/Makefile @@ -31,26 +31,27 @@ all: dist # install everything into the standard system directories # NB: install explicitly does not check that everything is up to date! -install: xen.install tools.install kernels docs.install +install: install-tools install-xen install-kernels install-docs -kernels.install: +install-xen: + $(MAKE) -C xen install + +install-tools: + $(MAKE) -C tools install + +install-kernels: cp -a $(INSTALL_DIR)/boot/* /boot/ cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/ cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/ cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/ -docs.install: +install-docs: + sh ./docs/check_pkgs && $(MAKE) -C docs install || true sh ./docs/check_pkgs -$(MAKE) -C docs install -xen.install tools.install: %.install: - $(MAKE) -C $* install - -xen.dist tools.dist: %.dist: - $(MAKE) -C $* dist - # build and install everything into local dist directory -dist: xen.dist tools.dist kernels docs.install +dist: xen tools kernels docs $(INSTALL_DIR) $(DIST_DIR)/check $(INSTALL_DATA) ./COPYING $(DIST_DIR) $(INSTALL_DATA) ./README $(DIST_DIR) @@ -63,7 +64,8 @@ xen: tools: $(MAKE) dist=yes -C tools install -kernels: $(addsuffix -build,$(XKERNELS)) +kernels: + for i in $(XKERNELS) ; do $(MAKE) $$i-build ; done docs: sh ./docs/check_pkgs @@ -73,13 +75,17 @@ docs: kbuild: kernels # Delete the kernel build trees entirely -kdelete: $(addsuffix -clean,$(XKERNELS)) +kdelete: + for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done # Clean the kernel build trees -kclean: $(addsuffix -clean,$(XKERNELS)) +kclean: + for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done # Make patches from kernel sparse trees -mkpatches: $(addsuffix -xen.patch,$(ALLSPARSETREES)) +mkpatches: + for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-xen.patch ; done + # build xen, the tools, and a domain 0 plus unprivileged linux-xen images, # and place them in the install directory. 'make install' should then @@ -90,14 +96,16 @@ world: $(MAKE) dist # clean doesn't do a kclean -clean: xen.clean tools.clean docs.clean - -xen.clean tools.clean docs.clean: %.clean: - $(MAKE) -C $* clean +clean: + $(MAKE) -C xen clean + $(MAKE) -C tools clean + $(MAKE) -C docs clean # clean, but blow away kernel build tree plus tar balls -mrproper: clean $(addsuffix -delete,$(ALLKERNELS)) $(addsuffix -mrproper,$(ALLSPARSETREES)) +mrproper: clean rm -rf dist patches/tmp + for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done + for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done install-twisted: wget http://www.twistedmatrix.com/products/get-current.epy @@ -159,8 +167,13 @@ uninstall: rm -rf "/usr/lib/python2.?/site-packages/xen* /usr/lib/libxc* /usr/lib/python2.?/site-packages/Xc*" # Legacy targets for compatibility -linux24: linux-2.4-xen0-build linux-2.4-xenU-build +linux24: + $(MAKE) linux-2.4-xen0-build + $(MAKE) linux-2.4-xenU-build -linux26: linux-2.6-xen0-build linux-2.6-xenU-build +linux26: + $(MAKE) linux-2.6-xen0-build + $(MAKE) linux-2.6-xenU-build -netbsd20: netbsd-2.0-xenU-build +netbsd20: + $(MAKE) netbsd-2.0-xenU-build diff --git a/xen/Makefile b/xen/Makefile index df01937245..52810f207a 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -32,14 +32,15 @@ install: $(TARGET).gz dist: install -clean: tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean +clean: + $(MAKE) -C tools clean + $(MAKE) -C common clean + $(MAKE) -C drivers clean + $(MAKE) -C arch/$(TARGET_ARCH) clean rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h rm -f include/asm-*/asm-offsets.h rm -f tools/figlet/*.o tools/figlet/figlet -tools.clean common.clean drivers.clean arch/$(TARGET_ARCH).clean : %.clean: - $(MAKE) -C $* clean - $(TARGET): delete-unfresh-files include/xen/compile.h [ -e include/asm ] || ln -sf asm-$(TARGET_ARCH) include/asm $(MAKE) -C arch/$(TARGET_ARCH) asm-offsets.s From cb43f93e4858c324e60916667f0cc724e620480f Mon Sep 17 00:00:00 2001 From: "iap10@freefall.cl.cam.ac.uk" Date: Tue, 25 Jan 2005 00:58:36 +0000 Subject: [PATCH 17/19] bitkeeper revision 1.1159.223.31 (41f599bcklevTYwPtWQUZ7QK-azDbg) Fix recent patch to change the way the version string is generated. Signed-off-by: ian.pratt@cl.cam.ac.uk --- xen/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/Makefile b/xen/Makefile index 52810f207a..78d903eca6 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -65,7 +65,7 @@ include/xen/compile.h: include/xen/compile.h.in include/xen/banner.h -e 's/@@version@@/$(XEN_VERSION)/g' \ -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \ -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \ - -e 's/@@changeset@@/$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)/g' \ + -e 's!@@changeset@@!$(shell bk changes -nd':D: :T: :REV: :MD5KEY:' -r+ 2>/dev/null || echo information unavailable)!g' \ < include/xen/compile.h.in > $@.new cat include/xen/banner.h >> $@.new mv $@.new $@ From ffa6a8cdbc10cc1dfbb44c2344d82daa22b25c97 Mon Sep 17 00:00:00 2001 From: "iap10@freefall.cl.cam.ac.uk" Date: Tue, 25 Jan 2005 01:00:05 +0000 Subject: [PATCH 18/19] bitkeeper revision 1.1159.223.32 (41f59a1519YIchUo4ggA1xTruDvUZg) Bitkeeper ignore *.opic Signed-off-by: ian.pratt@cl.cam.ac.uk --- BitKeeper/etc/ignore | 1 + 1 file changed, 1 insertion(+) diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index de77ccebfc..e4c0509b45 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -1,6 +1,7 @@ *.a *.d *.o +*.opic *.pyc *.so *.so.* From ae69d44b66bcb017ab2d05f929f87a5a5c09826e Mon Sep 17 00:00:00 2001 From: "iap10@freefall.cl.cam.ac.uk" Date: Tue, 25 Jan 2005 01:25:26 +0000 Subject: [PATCH 19/19] bitkeeper revision 1.1159.223.33 (41f5a006O57aqVcLmvmGSgDN2Chvbw) install.sh now creates vmlinuz-2.6.99-xen0 -> vmlinuz-2.6-xen0 links etc Signed-off-by: pl@us.ibm.com Signed-off-by: ian.pratt@cl.cam.ac.uk --- install.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install.sh b/install.sh index f21294f5f7..611e6e6417 100755 --- a/install.sh +++ b/install.sh @@ -23,6 +23,15 @@ if ! [ -d $dst ]; then fi echo "Installing Xen from '$src' to '$dst'..." +cd $src/boot +(echo '2.6.*' -2.6; echo '2.4.*' -2.4; echo '2.*.*' '') | while read mv +do + l=$(eval ls -t vmlinuz-$m-xen0 2>/dev/null | head -n 1) + [ -e "$l" ] && ln -fs "$l" vmlinuz${v}-xen0 + l=$(eval ls -t vmlinuz-$m-xenU 2>/dev/null | head -n 1) + [ -e "$l" ] && ln -fs "$l" vmlinuz${v}-xenU +done +cd - cp -fdR $src/* $dst echo "All done."