aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xm-test/ramdisk
diff options
context:
space:
mode:
authordan@localhost.localdomain <dan@localhost.localdomain>2005-11-18 13:00:13 +0100
committerdan@localhost.localdomain <dan@localhost.localdomain>2005-11-18 13:00:13 +0100
commite198273e0e055ee90a64252d09c22e8f0df1204f (patch)
tree1e5329be3f7fda8ebbe0a745edf2e9cd9af6ded3 /tools/xm-test/ramdisk
parent600918671a9a37b862e3c15625caef73b1185f89 (diff)
downloadxen-e198273e0e055ee90a64252d09c22e8f0df1204f.tar.gz
xen-e198273e0e055ee90a64252d09c22e8f0df1204f.tar.bz2
xen-e198273e0e055ee90a64252d09c22e8f0df1204f.zip
Add hping to the ramdisk. Also, do some very simple versioning.
This is the first change to the ramdisk since v0.1.0. So, we now build the image as initrd-X.Y.img, and link initrd.img to it. This lets us have a few checks to make sure that people rebuild their ramdisks when necessary.
Diffstat (limited to 'tools/xm-test/ramdisk')
-rw-r--r--tools/xm-test/ramdisk/Makefile.am18
-rw-r--r--tools/xm-test/ramdisk/configs/buildroot1
-rw-r--r--tools/xm-test/ramdisk/patches/buildroot/hping.patch67
3 files changed, 83 insertions, 3 deletions
diff --git a/tools/xm-test/ramdisk/Makefile.am b/tools/xm-test/ramdisk/Makefile.am
index cddc397262..be0636fa74 100644
--- a/tools/xm-test/ramdisk/Makefile.am
+++ b/tools/xm-test/ramdisk/Makefile.am
@@ -1,5 +1,5 @@
-EXTRA_DIST = skel configs
+EXTRA_DIST = skel configs patches
BR_TAR = buildroot-20050823.tar.bz2
BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
@@ -9,6 +9,9 @@ BR_IMG = $(BR_SRC)/rootfs.i386.ext2
BR_ROOT = build_i386/root
+XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
+XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
+
all: initrd.img
$(BR_TAR):
@@ -21,12 +24,21 @@ $(BR_IMG): $(BR_SRC)
cp configs/buildroot $(BR_SRC)/.config
cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
+ (for i in patches/buildroot/*.patch; do \
+ cd $(BR_SRC) && patch -p1 <../$$i; done )
cd $(BR_SRC) && make oldconfig && make
-initrd.img: $(BR_IMG)
+$(XMTEST_VER_IMG): $(BR_IMG)
(cd skel; tar cf - .) | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -)
cd $(BR_SRC) && make
- cp $(BR_IMG) initrd.img
+ cp $(BR_IMG) initrd-$(XMTEST_MAJ_VER).img
+
+initrd.img: $(XMTEST_VER_IMG)
+ ln -sf $(XMTEST_VER_IMG) initrd.img
+
+existing:
+ @[ -f $(XMTEST_VER_IMG) ] && ln -sf $(XMTEST_VER_IMG) initrd.img || \
+ echo Error, $(XMTEST_VER_IMG) not found
clean-local: am_config_clean-local
diff --git a/tools/xm-test/ramdisk/configs/buildroot b/tools/xm-test/ramdisk/configs/buildroot
index c80c2c8472..64938194b2 100644
--- a/tools/xm-test/ramdisk/configs/buildroot
+++ b/tools/xm-test/ramdisk/configs/buildroot
@@ -225,6 +225,7 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
# BR2_PACKAGE_WIRELESS_TOOLS is not set
# BR2_PACKAGE_XORG is not set
# BR2_PACKAGE_ZLIB is not set
+BR2_PACKAGE_HPING=y
#
# Target Options
diff --git a/tools/xm-test/ramdisk/patches/buildroot/hping.patch b/tools/xm-test/ramdisk/patches/buildroot/hping.patch
new file mode 100644
index 0000000000..bcd5cd0caf
--- /dev/null
+++ b/tools/xm-test/ramdisk/patches/buildroot/hping.patch
@@ -0,0 +1,67 @@
+diff -Naur buildroot.orig/package/Config.in buildroot/package/Config.in
+--- buildroot.orig/package/Config.in 2005-11-15 07:30:21.000000000 -0800
++++ buildroot/package/Config.in 2005-11-15 07:30:54.000000000 -0800
+@@ -118,6 +118,6 @@
+ source "package/wireless-tools/Config.in"
+ source "package/xorg/Config.in"
+ source "package/zlib/Config.in"
+-
++source "package/hping/Config.in"
+
+ endmenu
+diff -Naur buildroot.orig/package/hping/Config.in buildroot/package/hping/Config.in
+--- buildroot.orig/package/hping/Config.in 1969-12-31 16:00:00.000000000 -0800
++++ buildroot/package/hping/Config.in 2005-11-14 14:13:20.000000000 -0800
+@@ -0,0 +1,5 @@
++config BR2_PACKAGE_HPING
++ bool "hping"
++ default y
++ help
++ This is the hping package
+diff -Naur buildroot.orig/package/hping/hping.mk buildroot/package/hping/hping.mk
+--- buildroot.orig/package/hping/hping.mk 1969-12-31 16:00:00.000000000 -0800
++++ buildroot/package/hping/hping.mk 2005-11-14 15:11:06.000000000 -0800
+@@ -0,0 +1,43 @@
++# Taken from the buildroot examples
++
++HPING_VERSION = 2.0.0-rc3
++HPING_TBALL = hping$(HPING_VERSION).tar.gz
++HPING_URL = http://www.hping.org/$(HPING_TBALL)
++HPING_DIR = $(BUILD_DIR)/hping2-rc3
++HPING_TARGET_BINARY = usr/bin/hping
++HPING_BINARY = hping
++
++$(DL_DIR)/$(HPING_TBALL):
++ $(WGET) -P $(DL_DIR) $(HPING_URL)
++
++$(HPING_DIR)/.source: $(DL_DIR)/$(HPING_TBALL)
++ tar xzf $(DL_DIR)/$(HPING_TBALL) -C $(BUILD_DIR)
++ touch $(HPING_DIR)/.source
++
++$(HPING_DIR)/.configured: $(HPING_DIR)/.source
++ (cd $(HPING_DIR); \
++ ./configure; )
++ cat $(HPING_DIR)/Makefile | grep -v './hping2 -v' > $(HPING_DIR)/foo
++ mv $(HPING_DIR)/foo $(HPING_DIR)/Makefile
++ touch $(HPING_DIR)/.configured
++
++$(HPING_DIR)/$(HPING_BINARY): $(HPING_DIR)/.configured
++ $(MAKE) CC=$(TARGET_CC) -C $(HPING_DIR)
++
++$(TARGET_DIR)/$(HPING_TARGET_BINARY): $(HPING_DIR)/$(HPING_BINARY)
++ cp $(HPING_DIR)/hping2 $(TARGET_DIR)/bin
++
++hping: $(TARGET_DIR)/$(HPING_TARGET_BINARY)
++
++hping-clean:
++ $(MAKE) prefix=$(TARGET_DIR)/usr -C $(HPING_DIR) uninstall
++ -$(MAKE) -C $(HPING_DIR) clean
++
++hping-dirclean:
++ rm -Rf $(HPING_DIR)
++
++ifeq ($(strip $(BR2_PACKAGE_HPING)),y)
++TARGETS += hping
++endif
++
++