bitkeeper revision 1.911 (40ab2cffAo2gg718_vwy__3wfyTAeg)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 19 May 2004 09:46:39 +0000 (09:46 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Wed, 19 May 2004 09:46:39 +0000 (09:46 +0000)
tools/misc/fakei386xen:

Run at the root of a xenolinux build tree, it 'renames' the xen
architecture directories to be 'i386', so that you can get a xen
build of the tree just by typing 'make'.

The main reason for wanting to do this is if you've got some
other package that wants to patch the kernel and has some complex
build system that you can't be bothered to figure out and make
work with ARCH=xen (e.g. OpenAFS or Freeswan/IPSEC). This script
will make the tree look just like an i386 tree, so unless the
patch conflicts with arch Xen (which is pretty unlikely) the
package's normal make procedure should just work.

.rootkeys
tools/misc/fakei386xen [new file with mode: 0755]

index 3a60ca432809e06d83ecaabd25eaedcffcb12dda..a799c9ffafd10961ec1e620bcad6a6f458593b55 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
@@ -55,6 +55,7 @@
 403b7cf7J7FsSSoEPGhx6gXR4pIdZg tools/examples/xc_physinfo.py
 401d7e16X4iojyKopo_j63AyzYZd2A tools/examples/xc_vd_tool.py
 3f776bd2Xd-dUcPKlPN2vG89VGtfvQ tools/misc/Makefile
+40ab2cfawIw8tsYo0dQKtp83h4qfTQ tools/misc/fakei386xen
 3f6dc136ZKOjd8PIqLbFBl_v-rnkGg tools/misc/miniterm/Makefile
 3f6dc140C8tAeBfroAF24VrmCS4v_w tools/misc/miniterm/README
 3f6dc142IHaf6XIcAYGmhV9nNSIHFQ tools/misc/miniterm/miniterm.c
diff --git a/tools/misc/fakei386xen b/tools/misc/fakei386xen
new file mode 100755 (executable)
index 0000000..e1462c2
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+cln () {
+while [ $# -gt 0 ]; do
+  (
+    test -f "$1" || { echo "$1: No such file or directory" 1>&2; exit 1; }
+    { cp $1 cln$$ && rm $1 && mv cln$$ $1; } || { rm -f cln$$; exit 1; }
+  )
+  shift
+done
+}
+
+
+for i in `find include/asm-xen arch/xen -type l | xargs ls -l | egrep '../(asm-)?i386/' | awk '{print $9}'`
+do
+  echo $i
+  cln $i
+done
+
+mv include/asm-i386 include/asm-Xi386
+mv include/asm-xen include/asm-i386
+ln -s asm-i386 include/asm-xen
+rm include/asm
+ln -s asm-i386 include/asm
+mv arch/i386 arch/Xi386
+mv arch/xen arch/i386
+ln -s i386 arch/xen
+
+mv Makefile XMakefile
+#sed -e 's/^EXTRAVERSION =.*/EXTRAVERSION = -xen/' <XMakefile >Makefile
+echo ARCH=i386 >Makefile ; cat XMakefile >>Makefile
+