ia64/xen-unstable

view tools/misc/xen-clone @ 2843:afb0d3c20bea

bitkeeper revision 1.1159.1.347 (4188db339oFjUH_ChIJw_1kGraz4Sw)

minor nightly build script fix
author iap10@labyrinth.cl.cam.ac.uk
date Wed Nov 03 13:20:51 2004 +0000 (2004-11-03)
parents 2d1404c193f4
children 0a4b76b6b5a0 eeffc4961eee
line source
1 #!/bin/sh -x
3 # usage: xen-clone bk_repository dest_dir orig_linux_dir
4 #
5 # this script contains some CL site specific details, but can easily be adapted
6 #
8 # test which site we're on
9 [ -d /usr/groups/xeno/ -a -d /usr/groups/srgboot ] && SITE=UCCL
11 case "$SITE" in
12 UCCL)
13 BK_REP=${1:-/usr/groups/xeno/BK/xeno.bk}
14 # BK_REP=${1:-xeno-master/xeno.bk}
15 LINUX_DIR=${3:-/usr/groups/xeno/archive/}
16 ;;
17 *)
18 BK_REP=${1:-bk://xen.bkbits.net/xeno-1.0.bk}
19 # BK_REP=${1:-ssh://xen@xen.bkbits.net/xeno-1.0.bk}
20 LINUX_DIR=${3:-.:..}
21 ;;
22 esac
24 DEST_DIR=${2:-xeno-clone}
25 DEST_BK_REP=`basename "${BK_REP}"`
26 DEST_VER=`basename ${DEST_BK_REP} .bk`
28 echo usage: xen-clone bk_repository dest_dir orig_linux_dir
29 echo Source BK Repository : ${BK_REP}
30 echo Destination Dir/Repository : ${DEST_DIR}/${DEST_BK_REP}
31 echo Pristine Linux Source directory : ${LINUX_DIR}
33 mkdir -p ${DEST_DIR}
34 cd ${DEST_DIR}
35 TOP=`/bin/pwd`
37 # site-specific set up of installation directories
38 case "$SITE" in
39 UCCL)
40 PATH=$PATH:/usr/groups/xeno/build_tools/bin
41 mkdir -p install/boot
42 cd install/boot
43 ln -sf ../../../xeno-roots/roots .
44 ln -sf ../../../xeno-roots/usr .
45 ln -sf ../lib .
46 ln -sf ../bin .
47 ln -sf /usr/groups/srgboot/${USER}/xenoboot.sh .
48 ln -sf `pwd` /usr/groups/srgboot/${USER}/${DEST_DIR}
49 ln -sf xen.gz image.gz
50 cd ../..
51 ;;
52 esac
54 # clone the master repository (now checked-out by default)
55 if [ ! -d ${DEST_BK_REP} ]
56 then
57 bk clone ${BK_REP} ${DEST_BK_REP}
58 else
59 cd ${DEST_BK_REP}
60 bk pull
61 cd ${TOP}
62 fi
65 if [ -d ${DEST_BK_REP}/linux-2.4.*-xen-sparse ]
66 then
67 # this is a new style Xen repository so building is dead easy
69 export LINUX_SRC_PATH=${LINUX_DIR}
71 cd ${DEST_BK_REP}
73 # Recent repositories install into 'dist/install' rather than 'install'.
74 if [ -f install.sh ]
75 then
76 mkdir -p dist
77 ln -sf ../../install dist/install
78 else
79 ln -sf ../install install
80 fi
82 make -j4 world
83 make -j4 linux24
84 cd ../install/boot
85 [ -r vmlinuz-2.6.*-xen0 ] && ln -s vmlinuz-2.6.*-xen0 xenolinux.gz
87 else
88 # old style repository without 'make world'
91 # identify this version of linux
92 LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/*xenolinux-sparse || /bin/ls -ld ${DEST_BK_REP}/*xenolinux-*-sparse ) 2>/dev/null | sed -e 's!^.*xenolinux-\(.\+\)-sparse!\1!'`
94 if [ -z "${LINUX_VER}" ]
95 then
96 echo Unable to identify Linux version. Bailing.
97 exit -1
98 fi
100 # copy in the master Linux tree for this kernel
101 if [ ! -d linux-${LINUX_VER} ]
102 then
103 tar -jxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.bz2 || 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
104 fi
106 # build and install Xen and tools
107 cd ${DEST_BK_REP}
108 make dist || make install
110 # Turn linux into xenolinux then build it
111 cd xenolinux-${LINUX_VER}-sparse
112 ./mkbuildtree ../../linux-${LINUX_VER}
113 cd ../..
114 mv linux-${LINUX_VER} xenolinux-${LINUX_VER}
115 cd xenolinux-${LINUX_VER}
117 # cope with the change from ARCH=xeno to ARCH=xen
118 cd arch; XEN=`/bin/ls -d xen*`; cd ..
120 # built it all
121 ARCH=$XEN make oldconfig
122 ARCH=$XEN make dep
123 ARCH=$XEN make bzImage
124 ARCH=$XEN make dist || ARCH=xen make install
125 ARCH=$XEN make modules
126 ARCH=$XEN make INSTALL_MOD_PATH=${TOP}/install modules_install
127 cd ..
129 fi