ia64/xen-unstable

view linux-2.4.26-xen-sparse/mkbuildtree @ 2020:4fc62e2234f4

bitkeeper revision 1.1108.33.23 (410d0a8aWM5n48Ku4nUKCSOzCx9B2A)

sync with 2.4 block backend driver:
always print error messages
author cl349@freefall.cl.cam.ac.uk
date Sun Aug 01 15:21:46 2004 +0000 (2004-08-01)
parents cabecfa924ab
children 6f08c0b6c8cd 3b0ab2e570a0
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 LINUX_26=${RS}/../linux-2.6.7-xen-sparse
108 # Create links to the shared definitions of the hypervisor interface
109 rm -rf ${AD}/include/asm-xen/hypervisor-ifs
110 mkdir ${AD}/include/asm-xen/hypervisor-ifs
111 cd ${AD}/include/asm-xen/hypervisor-ifs
112 relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
114 # Create a link to the shared definitions for the control interface
115 cd ${AD}/include/asm-xen
116 ln -sf ../../${RS}/../tools/python/xen/lowlevel/xu/domain_controller.h
119 ## Symlinks for files:
120 ## - which are identical in the i386 and xen-i386 architecture-dependent
121 ## subdirectories.
122 ## - which are identical in the Linux 2.6 and Linux 2.4 ports.
124 cd ${AD}/include/asm-xen
125 ln -sf ../asm-i386/a.out.h
126 ln -sf ../asm-i386/apicdef.h
127 ln -sf ../asm-i386/apic.h
128 ln -sf ../asm-i386/atomic.h
129 ln -sf ../asm-i386/bitops.h
130 ln -sf ../asm-i386/boot.h
131 ln -sf ../asm-i386/byteorder.h
132 ln -sf ../asm-i386/cache.h
133 ln -sf ../asm-i386/checksum.h
134 ln -sf ../asm-i386/cpufeature.h
135 ln -sf ../asm-i386/current.h
136 ln -sf ../asm-i386/debugreg.h
137 ln -sf ../asm-i386/delay.h
138 ln -sf ../asm-i386/div64.h
139 ln -sf ../asm-i386/dma.h
140 ln -sf ../asm-i386/elf.h
141 ln -sf ../asm-i386/errno.h
142 ln -sf ../asm-i386/fcntl.h
143 ln -sf ../asm-i386/floppy.h
144 ln -sf ../asm-i386/hardirq.h
145 ln -sf ../asm-i386/hdreg.h
146 ln -sf ../asm-i386/i387.h
147 ln -sf ../asm-i386/ide.h
148 ln -sf ../asm-i386/init.h
149 ln -sf ../asm-i386/io_apic.h
150 ln -sf ../asm-i386/ioctl.h
151 ln -sf ../asm-i386/ioctls.h
152 ln -sf ../asm-i386/ipcbuf.h
153 ln -sf ../asm-i386/ipc.h
154 ln -sf ../asm-i386/kmap_types.h
155 ln -sf ../asm-i386/ldt.h
156 ln -sf ../asm-i386/linux_logo.h
157 ln -sf ../asm-i386/locks.h
158 ln -sf ../asm-i386/math_emu.h
159 ln -sf ../asm-i386/mc146818rtc.h
160 ln -sf ../asm-i386/mca_dma.h
161 ln -sf ../asm-i386/mman.h
162 ln -sf ../asm-i386/mmu.h
163 ln -sf ../asm-i386/mmx.h
164 ln -sf ../asm-i386/mpspec.h
165 ln -sf ../asm-i386/msgbuf.h
166 ln -sf ../asm-i386/mtrr.h
167 ln -sf ../asm-i386/namei.h
168 ln -sf ../asm-i386/param.h
169 ln -sf ../asm-i386/parport.h
170 ln -sf ../asm-i386/pgtable-3level.h
171 ln -sf ../asm-i386/poll.h
172 ln -sf ../asm-i386/posix_types.h
173 ln -sf ../asm-i386/resource.h
174 ln -sf ../asm-i386/rwlock.h
175 ln -sf ../asm-i386/rwsem.h
176 ln -sf ../asm-i386/scatterlist.h
177 ln -sf ../asm-i386/semaphore.h
178 ln -sf ../asm-i386/sembuf.h
179 ln -sf ../asm-i386/serial.h
180 ln -sf ../asm-i386/setup.h
181 ln -sf ../asm-i386/shmbuf.h
182 ln -sf ../asm-i386/shmparam.h
183 ln -sf ../asm-i386/sigcontext.h
184 ln -sf ../asm-i386/siginfo.h
185 ln -sf ../asm-i386/signal.h
186 ln -sf ../asm-i386/smplock.h
187 ln -sf ../asm-i386/socket.h
188 ln -sf ../asm-i386/sockios.h
189 ln -sf ../asm-i386/softirq.h
190 ln -sf ../asm-i386/spinlock.h
191 ln -sf ../asm-i386/statfs.h
192 ln -sf ../asm-i386/stat.h
193 ln -sf ../asm-i386/string-486.h
194 ln -sf ../asm-i386/string.h
195 ln -sf ../asm-i386/termbits.h
196 ln -sf ../asm-i386/termios.h
197 ln -sf ../asm-i386/timex.h
198 ln -sf ../asm-i386/tlb.h
199 ln -sf ../asm-i386/types.h
200 ln -sf ../asm-i386/uaccess.h
201 ln -sf ../asm-i386/ucontext.h
202 ln -sf ../asm-i386/unaligned.h
203 ln -sf ../asm-i386/unistd.h
204 ln -sf ../asm-i386/user.h
205 ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h
207 cd ${AD}/arch/xen/kernel
208 ln -sf ../../i386/kernel/i387.c
209 ln -sf ../../i386/kernel/init_task.c
210 ln -sf ../../i386/kernel/pci-dma.c
211 ln -sf ../../i386/kernel/pci-i386.c
212 ln -sf ../../i386/kernel/pci-i386.h
213 ln -sf ../../i386/kernel/ptrace.c
214 ln -sf ../../i386/kernel/semaphore.c
215 ln -sf ../../i386/kernel/sys_i386.c
216 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
218 cd ${AD}/arch/xen/lib
219 ln -sf ../../i386/lib/checksum.S
220 ln -sf ../../i386/lib/dec_and_lock.c
221 ln -sf ../../i386/lib/getuser.S
222 ln -sf ../../i386/lib/iodebug.c
223 ln -sf ../../i386/lib/memcpy.c
224 ln -sf ../../i386/lib/mmx.c
225 ln -sf ../../i386/lib/old-checksum.c
226 ln -sf ../../i386/lib/strstr.c
227 ln -sf ../../i386/lib/usercopy.c
228 ln -sf ../../../${LINUX_26}/arch/xen/kernel/xen_proc.c
230 cd ${AD}/arch/xen/mm
231 ln -sf ../../i386/mm/extable.c
232 ln -sf ../../i386/mm/pageattr.c
234 cd ${AD}/arch/xen/drivers/console
235 ln -sf ../../../../${LINUX_26}/drivers/xen/console/console.c
237 cd ${AD}/arch/xen/drivers/dom0
238 ln -sf ../../../../${LINUX_26}/drivers/xen/privcmd/privcmd.c core.c
240 cd ${AD}/arch/xen/drivers/netif/frontend
241 ln -sf ../../../../../${LINUX_26}/drivers/xen/netfront/netfront.c main.c
243 cd ${AD}/arch/xen/drivers/netif/backend
244 ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/common.h
245 ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/control.c
246 ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/interface.c
247 ln -sf ../../../../../${LINUX_26}/drivers/xen/netback/netback.c main.c