ia64/xen-unstable

view linux-2.4.26-xen-sparse/mkbuildtree @ 1921:24ecc060e9d7

bitkeeper revision 1.1108.21.1 (41062740xHG36OEbpVAmVX5N9WCaNw)

make vmlinuz really stripped
author cl349@freefall.cl.cam.ac.uk
date Tue Jul 27 09:58:24 2004 +0000 (2004-07-27)
parents f26582ec895e
children bd0ea1284933 2afb533685cb
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
107 ## There are a whole bunch of special symlinks, mostly for files
108 ## which are identical in the i386 and xen-i386 architecture-dependent
109 ## subdirectories.
111 # This first symlink is special: it links to shared files in Xen's source tree
112 rm -rf ${AD}/include/asm-xen/hypervisor-ifs
113 mkdir ${AD}/include/asm-xen/hypervisor-ifs
114 cd ${AD}/include/asm-xen/hypervisor-ifs
115 relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
117 # Another special symlink: to the shared definitions for the control interface
118 cd ..
119 ln -sf ../../${RS}/../tools/python/xen/lowlevel/xu/domain_controller.h
121 # The remainder are the i386 -> xen-i386 links
122 ln -sf ../asm-i386/a.out.h
123 ln -sf ../asm-i386/apicdef.h
124 ln -sf ../asm-i386/apic.h
125 ln -sf ../asm-i386/atomic.h
126 ln -sf ../asm-i386/bitops.h
127 ln -sf ../asm-i386/boot.h
128 ln -sf ../asm-i386/byteorder.h
129 ln -sf ../asm-i386/cache.h
130 ln -sf ../asm-i386/checksum.h
131 ln -sf ../asm-i386/cpufeature.h
132 ln -sf ../asm-i386/current.h
133 ln -sf ../asm-i386/debugreg.h
134 ln -sf ../asm-i386/delay.h
135 ln -sf ../asm-i386/div64.h
136 ln -sf ../asm-i386/dma.h
137 ln -sf ../asm-i386/elf.h
138 ln -sf ../asm-i386/errno.h
139 ln -sf ../asm-i386/fcntl.h
140 ln -sf ../asm-i386/floppy.h
141 ln -sf ../asm-i386/hardirq.h
142 ln -sf ../asm-i386/hdreg.h
143 ln -sf ../asm-i386/i387.h
144 ln -sf ../asm-i386/ide.h
145 ln -sf ../asm-i386/init.h
146 ln -sf ../asm-i386/io_apic.h
147 ln -sf ../asm-i386/ioctl.h
148 ln -sf ../asm-i386/ioctls.h
149 ln -sf ../asm-i386/ipcbuf.h
150 ln -sf ../asm-i386/ipc.h
151 ln -sf ../asm-i386/kmap_types.h
152 ln -sf ../asm-i386/ldt.h
153 ln -sf ../asm-i386/linux_logo.h
154 ln -sf ../asm-i386/locks.h
155 ln -sf ../asm-i386/math_emu.h
156 ln -sf ../asm-i386/mc146818rtc.h
157 ln -sf ../asm-i386/mca_dma.h
158 ln -sf ../asm-i386/mman.h
159 ln -sf ../asm-i386/mmu.h
160 ln -sf ../asm-i386/mmx.h
161 ln -sf ../asm-i386/mpspec.h
162 ln -sf ../asm-i386/msgbuf.h
163 ln -sf ../asm-i386/mtrr.h
164 ln -sf ../asm-i386/namei.h
165 ln -sf ../asm-i386/param.h
166 ln -sf ../asm-i386/parport.h
167 ln -sf ../asm-i386/pgtable-3level.h
168 ln -sf ../asm-i386/poll.h
169 ln -sf ../asm-i386/posix_types.h
170 ln -sf ../asm-i386/resource.h
171 ln -sf ../asm-i386/rwlock.h
172 ln -sf ../asm-i386/rwsem.h
173 ln -sf ../asm-i386/scatterlist.h
174 ln -sf ../asm-i386/semaphore.h
175 ln -sf ../asm-i386/sembuf.h
176 ln -sf ../asm-i386/serial.h
177 ln -sf ../asm-i386/setup.h
178 ln -sf ../asm-i386/shmbuf.h
179 ln -sf ../asm-i386/shmparam.h
180 ln -sf ../asm-i386/sigcontext.h
181 ln -sf ../asm-i386/siginfo.h
182 ln -sf ../asm-i386/signal.h
183 ln -sf ../asm-i386/smplock.h
184 ln -sf ../asm-i386/socket.h
185 ln -sf ../asm-i386/sockios.h
186 ln -sf ../asm-i386/softirq.h
187 ln -sf ../asm-i386/spinlock.h
188 ln -sf ../asm-i386/statfs.h
189 ln -sf ../asm-i386/stat.h
190 ln -sf ../asm-i386/string-486.h
191 ln -sf ../asm-i386/string.h
192 ln -sf ../asm-i386/termbits.h
193 ln -sf ../asm-i386/termios.h
194 ln -sf ../asm-i386/timex.h
195 ln -sf ../asm-i386/tlb.h
196 ln -sf ../asm-i386/types.h
197 ln -sf ../asm-i386/uaccess.h
198 ln -sf ../asm-i386/ucontext.h
199 ln -sf ../asm-i386/unaligned.h
200 ln -sf ../asm-i386/unistd.h
201 ln -sf ../asm-i386/user.h
203 cd ../../arch/xen/kernel
204 ln -sf ../../i386/kernel/i387.c
205 ln -sf ../../i386/kernel/init_task.c
206 ln -sf ../../i386/kernel/pci-dma.c
207 ln -sf ../../i386/kernel/pci-i386.c
208 ln -sf ../../i386/kernel/pci-i386.h
209 ln -sf ../../i386/kernel/ptrace.c
210 ln -sf ../../i386/kernel/semaphore.c
211 ln -sf ../../i386/kernel/sys_i386.c
212 ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
213 cd ../lib
214 ln -sf ../../i386/lib/checksum.S
215 ln -sf ../../i386/lib/dec_and_lock.c
216 ln -sf ../../i386/lib/getuser.S
217 ln -sf ../../i386/lib/iodebug.c
218 ln -sf ../../i386/lib/memcpy.c
219 ln -sf ../../i386/lib/mmx.c
220 ln -sf ../../i386/lib/old-checksum.c
221 ln -sf ../../i386/lib/strstr.c
222 ln -sf ../../i386/lib/usercopy.c
223 cd ../mm
224 ln -sf ../../i386/mm/extable.c
225 ln -sf ../../i386/mm/pageattr.c
226 cd ../drivers/console
227 ln -sf ../../../../${LINUX_26}/drivers/xen/console/console.c
228 cd ../netif/frontend
229 ln -sf ../../../../../${LINUX_26}/drivers/xen/net/network.c main.c