ia64/xen-unstable

view linux-2.4.26-xen-sparse/mkbuildtree @ 1592:24e2bbb841b3

bitkeeper revision 1.1020.1.1 (40df4b94lJE4UbrmICQf_fatdqMCOw)

Quieten down console connections. Remove telnet control sequence.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jun 27 22:35:00 2004 +0000 (2004-06-27)
parents 793f5eb5d149
children cb0967db88bc 3d3f21585b96
line source
1 #!/bin/sh
3 # mkbuildtree <build tree>
4 #
5 # Creates symbolic links in <build tree> for the sparse tree
6 # in the current directory.
8 # Script to determine the relative path between two directories.
9 # Copyright (c) D. J. Hawkey Jr. 2002
10 # Fixed for Xen project by K. Fraser in 2003.
11 abs_to_rel ()
12 {
13 local CWD SRCPATH
15 if [ "$1" != "/" -a "${1##*[^/]}" = "/" ]; then
16 SRCPATH=${1%?}
17 else
18 SRCPATH=$1
19 fi
20 if [ "$2" != "/" -a "${2##*[^/]}" = "/" ]; then
21 DESTPATH=${2%?}
22 else
23 DESTPATH=$2
24 fi
26 CWD=$PWD
27 [ "${1%%[^/]*}" != "/" ] && cd $1 && SRCPATH=$PWD
28 [ "${2%%[^/]*}" != "/" ] && cd $2 && DESTPATH=$PWD
29 [ "$CWD" != "$PWD" ] && cd $CWD
31 BASEPATH=$SRCPATH
33 [ "$SRCPATH" = "$DESTPATH" ] && DESTPATH="." && return
34 [ "$SRCPATH" = "/" ] && DESTPATH=${DESTPATH#?} && return
36 while [ "$BASEPATH/" != "${DESTPATH%${DESTPATH#$BASEPATH/}}" ]; do
37 BASEPATH=${BASEPATH%/*}
38 done
40 SRCPATH=${SRCPATH#$BASEPATH}
41 DESTPATH=${DESTPATH#$BASEPATH}
42 DESTPATH=${DESTPATH#?}
43 while [ -n "$SRCPATH" ]; do
44 SRCPATH=${SRCPATH%/*}
45 DESTPATH="../$DESTPATH"
46 done
48 [ -z "$BASEPATH" ] && BASEPATH="/"
49 [ "${DESTPATH##*[^/]}" = "/" ] && DESTPATH=${DESTPATH%?}
50 }
52 # relative_lndir <target_dir>
53 # Creates a tree of symlinks in the current working directory that mirror
54 # real files in <target_dir>. <target_dir> should be relative to the current
55 # working directory. Symlinks in <target_dir> are ignored. Source-control files
56 # are ignored.
57 relative_lndir ()
58 {
59 local SYMLINK_DIR REAL_DIR pref i j
60 SYMLINK_DIR=$PWD
61 REAL_DIR=$1
62 (
63 cd $REAL_DIR
64 for i in `find . -type d | grep -v SCCS`; do
65 [ -d $SYMLINK_DIR/$i ] || mkdir -p $SYMLINK_DIR/$i
66 (
67 cd $i
68 pref=`echo $i | sed -e 's#/[^/]*#../#g' -e 's#^\.##'`
69 for j in `find . -type f -o -type l -maxdepth 1`; do
70 ln -sf ${pref}${REAL_DIR}/$i/$j ${SYMLINK_DIR}/$i/$j
71 done
72 )
73 done
74 )
75 }
77 [ "$1" == "" ] && { echo "Syntax: $0 <linux tree to xenify>"; exit 1; }
79 # Get absolute path to the destination directory
80 pushd . >/dev/null
81 cd ${1}
82 AD=$PWD
83 popd >/dev/null
85 # Get absolute path to the source directory
86 AS=`pwd`
88 # Get path to source, relative to destination
89 abs_to_rel ${AD} ${AS}
90 RS=$DESTPATH
92 # Remove old copies of files and directories at the destination
93 for i in `find . -type f -o -type l` ; do rm -f ${AD}/${i#./} ; done
95 # We now work from the destination directory
96 cd ${AD}
98 # Remove old symlinks
99 for i in `find . -type l`; do rm -f $i; done
101 # Create symlinks of files and directories which exist in the sparse source
102 relative_lndir ${RS}
103 rm -f mkbuildtree
105 ## There are a whole bunch of special symlinks, mostly for files
106 ## which are identical in the i386 and xen-i386 architecture-dependent
107 ## subdirectories.
109 # This first symlink is special: it links to shared files in Xen's source tree
110 rm -rf ${AD}/include/asm-xen/hypervisor-ifs
111 mkdir ${AD}/include/asm-xen/hypervisor-ifs
112 cd ${AD}/include/asm-xen/hypervisor-ifs
113 relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
115 # Another special symlink: to the shared definitions for the control interface
116 cd ..
117 ln -sf ../../${RS}/../tools/xend/lib/domain_controller.h
119 # The remainder are the i386 -> xen-i386 links
120 ln -sf ../asm-i386/a.out.h
121 ln -sf ../asm-i386/apicdef.h
122 ln -sf ../asm-i386/apic.h
123 ln -sf ../asm-i386/atomic.h
124 ln -sf ../asm-i386/bitops.h
125 ln -sf ../asm-i386/boot.h
126 ln -sf ../asm-i386/byteorder.h
127 ln -sf ../asm-i386/cache.h
128 ln -sf ../asm-i386/checksum.h
129 ln -sf ../asm-i386/cpufeature.h
130 ln -sf ../asm-i386/current.h
131 ln -sf ../asm-i386/debugreg.h
132 ln -sf ../asm-i386/delay.h
133 ln -sf ../asm-i386/div64.h
134 ln -sf ../asm-i386/dma.h
135 ln -sf ../asm-i386/elf.h
136 ln -sf ../asm-i386/errno.h
137 ln -sf ../asm-i386/fcntl.h
138 ln -sf ../asm-i386/floppy.h
139 ln -sf ../asm-i386/hardirq.h
140 ln -sf ../asm-i386/hdreg.h
141 ln -sf ../asm-i386/i387.h
142 ln -sf ../asm-i386/ide.h
143 ln -sf ../asm-i386/init.h
144 ln -sf ../asm-i386/io_apic.h
145 ln -sf ../asm-i386/ioctl.h
146 ln -sf ../asm-i386/ioctls.h
147 ln -sf ../asm-i386/ipcbuf.h
148 ln -sf ../asm-i386/ipc.h
149 ln -sf ../asm-i386/kmap_types.h
150 ln -sf ../asm-i386/ldt.h
151 ln -sf ../asm-i386/linux_logo.h
152 ln -sf ../asm-i386/locks.h
153 ln -sf ../asm-i386/math_emu.h
154 ln -sf ../asm-i386/mc146818rtc.h
155 ln -sf ../asm-i386/mca_dma.h
156 ln -sf ../asm-i386/mman.h
157 ln -sf ../asm-i386/mmu.h
158 ln -sf ../asm-i386/mmx.h
159 ln -sf ../asm-i386/mpspec.h
160 ln -sf ../asm-i386/msgbuf.h
161 ln -sf ../asm-i386/mtrr.h
162 ln -sf ../asm-i386/namei.h
163 ln -sf ../asm-i386/param.h
164 ln -sf ../asm-i386/parport.h
165 ln -sf ../asm-i386/pgtable-3level.h
166 ln -sf ../asm-i386/poll.h
167 ln -sf ../asm-i386/posix_types.h
168 ln -sf ../asm-i386/resource.h
169 ln -sf ../asm-i386/rwlock.h
170 ln -sf ../asm-i386/rwsem.h
171 ln -sf ../asm-i386/scatterlist.h
172 ln -sf ../asm-i386/semaphore.h
173 ln -sf ../asm-i386/sembuf.h
174 ln -sf ../asm-i386/serial.h
175 ln -sf ../asm-i386/setup.h
176 ln -sf ../asm-i386/shmbuf.h
177 ln -sf ../asm-i386/shmparam.h
178 ln -sf ../asm-i386/sigcontext.h
179 ln -sf ../asm-i386/siginfo.h
180 ln -sf ../asm-i386/signal.h
181 ln -sf ../asm-i386/smplock.h
182 ln -sf ../asm-i386/socket.h
183 ln -sf ../asm-i386/sockios.h
184 ln -sf ../asm-i386/softirq.h
185 ln -sf ../asm-i386/spinlock.h
186 ln -sf ../asm-i386/statfs.h
187 ln -sf ../asm-i386/stat.h
188 ln -sf ../asm-i386/string-486.h
189 ln -sf ../asm-i386/string.h
190 ln -sf ../asm-i386/termbits.h
191 ln -sf ../asm-i386/termios.h
192 ln -sf ../asm-i386/timex.h
193 ln -sf ../asm-i386/tlb.h
194 ln -sf ../asm-i386/types.h
195 ln -sf ../asm-i386/uaccess.h
196 ln -sf ../asm-i386/ucontext.h
197 ln -sf ../asm-i386/unaligned.h
198 ln -sf ../asm-i386/unistd.h
199 ln -sf ../asm-i386/user.h
201 cd ../../arch/xen/kernel
202 ln -sf ../../i386/kernel/i387.c
203 ln -sf ../../i386/kernel/init_task.c
204 ln -sf ../../i386/kernel/pci-dma.c
205 ln -sf ../../i386/kernel/pci-i386.c
206 ln -sf ../../i386/kernel/pci-i386.h
207 ln -sf ../../i386/kernel/ptrace.c
208 ln -sf ../../i386/kernel/semaphore.c
209 ln -sf ../../i386/kernel/sys_i386.c
210 cd ../lib
211 ln -sf ../../i386/lib/checksum.S
212 ln -sf ../../i386/lib/dec_and_lock.c
213 ln -sf ../../i386/lib/getuser.S
214 ln -sf ../../i386/lib/iodebug.c
215 ln -sf ../../i386/lib/memcpy.c
216 ln -sf ../../i386/lib/mmx.c
217 ln -sf ../../i386/lib/old-checksum.c
218 ln -sf ../../i386/lib/strstr.c
219 ln -sf ../../i386/lib/usercopy.c
220 cd ../mm
221 ln -sf ../../i386/mm/extable.c
222 ln -sf ../../i386/mm/pageattr.c