diff options
author | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-09-10 09:57:56 +0000 |
---|---|---|
committer | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2003-09-10 09:57:56 +0000 |
commit | 0a8a407187f5cd087c4bffea79fcdbffbc700431 (patch) | |
tree | 38fcb6dc958d38b28812b2be4fc348a90f27e444 /tools | |
parent | 8fb06dd59d2124273a1bb3089e1b8e5d5a23dea1 (diff) | |
download | xen-0a8a407187f5cd087c4bffea79fcdbffbc700431.tar.gz xen-0a8a407187f5cd087c4bffea79fcdbffbc700431.tar.bz2 xen-0a8a407187f5cd087c4bffea79fcdbffbc700431.zip |
bitkeeper revision 1.419 (3f5ef5a4mQpbOFAoUevuy5GY5BPNKA)
Add READMEs, along with the xen-clone script, which is now far less
site-specific.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/misc/xen-clone | 78 | ||||
-rw-r--r-- | tools/misc/xen-clone.README | 23 |
2 files changed, 101 insertions, 0 deletions
diff --git a/tools/misc/xen-clone b/tools/misc/xen-clone new file mode 100755 index 0000000000..8ea5958b4b --- /dev/null +++ b/tools/misc/xen-clone @@ -0,0 +1,78 @@ +#!/bin/sh -x + +# usage: xen-clone bk_repository dest_dir orig_linux_dir +# +# this script contains some CL site specific details, but can easily be adapted +# + +# test which site we're on +[ -d /usr/groups/xeno/ -a -d /usr/groups/srgboot ] && SITE=UCCL + +case "$SITE" in +UCCL) + BK_REP=${1:-/usr/groups/xeno/BK/xeno.bk} + # BK_REP=${1:-xeno-master/xeno.bk} + LINUX_DIR=${3:-/usr/groups/xeno/archive/} + ;; +*) + BK_REP=${1:-bk://xen.bkbits.net/xeno.bk} + # BK_REP=${1:-ssh://xen@xen.bkbits.net/xeno.bk} + LINUX_DIR=${3:-..} +;; +esac + +DEST_DIR=${2:-xeno-clone} +DEST_BK_REP=`basename ${BK_REP}` + +echo usage: xen-clone bk_repository dest_dir orig_linux_dir +echo Source BK Repository : ${BK_REP} +echo Destination Dir/Repository : ${DEST_DIR}/${DEST_BK_REP} +echo Pristine Linux Source directory : ${LINUX_DIR} + +mkdir -p ${DEST_DIR} +cd ${DEST_DIR} +TOP=`/bin/pwd` + +# site-specific set up of installation directories +case "$SITE" in +CL) + PATH=$PATH:/usr/groups/xeno/build_tools/bin + mkdir -p install/boot + cd install/boot + ln -sf ../../xeno-roots/roots . + ln -sf ../../xeno-roots/usr . + ln -sf /usr/groups/srgboot/${USER}/xenoboot.sh . + ln -sf `pwd` /usr/groups/srgboot/${USER}/${DEST_DIR} + cd ../.. + ;; +esac + +# clone the master repository (now checked-out by default) +bk clone ${BK_REP} ${DEST_BK_REP} + +# identify this version of linux +LINUX_VER=`/bin/ls -ld ${DEST_BK_REP}/xenolinux-sparse | sed -e 's!^.*xenolinux-\([0-9.]\+\)-sparse!\1!'` + +# copy in the master Linux tree for this kernel +tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.gz || tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tgz || cp -a ${LINUX_DIR}/linux-${LINUX_VER} . || wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-${LINUX_VER}.tar.gz -O- | tar -zxf - || exit -1 + +# build and install Xen and tools +cd ${DEST_BK_REP} +make install + +# Turn linux into xenolinux then build it +cd xenolinux-${LINUX_VER}-sparse +./mkbuildtree ../../linux-${LINUX_VER} +cd ../.. +mv linux-${LINUX_VER} xenolinux-${LINUX_VER} +cd xenolinux-${LINUX_VER} +export ARCH=xeno +export INSTALL_MOD_PATH=${TOP}/install +make oldconfig +make dep +make bzImage +make install +make modules +make modules_install +cd .. + diff --git a/tools/misc/xen-clone.README b/tools/misc/xen-clone.README new file mode 100644 index 0000000000..dfa86d1d75 --- /dev/null +++ b/tools/misc/xen-clone.README @@ -0,0 +1,23 @@ + +xen-clone + +usage: xen-clone <bk_repository> <dest_dir> <orig_linux_dir> + +This script can be used to 'bk clone' and build a xen and xenolinux image +from the master BK repository, either from a local copy, or from the +public repository bk://xen.bkbits.net/xeno.bk + +In many circumstances, it can be invoked without any arguments and +just `does the right thing'. + +The default dest_dir is 'xeno-clone', relative to the current directory. + +To build xenolinux, the script needs a pristine copy of the equivalent +linux tree. The script looks in a couple of places on the local filesystem, +then tries a download from from ftp://ftp.kernel.org/pub/linux/kernel/v2.4/ + +The script also tries a number of optional UCCL site-specific operations +that configure the test machine booting infrastructure to boot the +resultant image. + + |