4 # $Id: make-uml.sh,v 1.14.2.1 2002/04/07 17:33:30 mcr Exp $
10 # fail if any command fails
14 1) FREESWANSRCDIR=$1; shift;;
18 # configuration for this file has moved to $FREESWANSRCDIR/umlsetup.sh
19 # By default, that file does not exist. A sample is at umlsetup-sample.sh
20 # in this directory. Copy it to $FREESWANSRCDIR and edit it.
22 FREESWANSRCDIR=${FREESWANSRCDIR-../..}
23 if [ ! -f ${FREESWANSRCDIR}/umlsetup.sh ]
25 echo No umlsetup.sh. Please read instructions in umlsetup-sample.sh.
29 . ${FREESWANSRCDIR}/umlsetup.sh
30 . ${FREESWANSRCDIR}/testing/utils/uml-functions.sh
32 # set this to a freshly checked out repository/snapshot
33 FREESWANSRCDIR=${FREESWANSRCDIR-/c2/freeswan/sandbox}
35 # make absolute so that we can reference it from POOLSPACE
36 FREESWANSRCDIR=`cd $FREESWANSRCDIR && pwd`;export FREESWANSRCDIR
38 if [ -d $FREESWANSRCDIR/testing/kernelconfigs ]
40 TESTINGROOT=$FREESWANSRCDIR/testing
42 TESTINGROOT=${TESTINGROOT-/c2/freeswan/sandbox/testing}
44 # okay, copy the kernel, apply the UML patches, and build a plain kernel.
45 UMLPLAIN=$POOLSPACE/plain
48 if [ ! -x $UMLPLAIN/linux ]
51 lndir -silent $KERNPOOL .
55 bzcat $UMLPATCH | patch -p1
60 cp ${TESTINGROOT}/kernelconfigs/umlplain.config .config
62 (make ARCH=um oldconfig && make ARCH=um dep && make ARCH=um linux ) || exit 1
65 # now, setup up root dir
66 for host in $REGULARHOSTS
68 setup_host $host $UMLPLAIN/linux
71 # now, copy the kernel, apply the UML patches.
72 # then, make FreeSWAN patches as well.
74 UMLSWAN=$POOLSPACE/swan
76 # we could copy the UMLPLAIN to make this tree. This would be faster, as we
77 # already built most everything. We could also just use a FreeSWAN-enabled
78 # kernel on sunrise/sunset. We avoid this as we actually want them to always
81 # where to install FreeSWAN tools
82 DESTDIR=$POOLSPACE/root
84 # do not generate .depend by default
89 if [ ! -x $UMLSWAN/linux ]
92 lndir -silent $KERNPOOL .
96 bzcat $UMLPATCH | patch -p1
99 # copy the config file
101 cp ${TESTINGROOT}/kernelconfigs/umlswan.config .config
103 # make the kernel here for good luck
104 make ARCH=um oldconfig
107 make ARCH=um dep >umlswan.make.dep.out
109 make ARCH=um linux >umlswan.make.plain.out
111 # we have to copy it again, because "make oldconfig" above, blew
112 # away options that it didn't know about.
114 cp ${TESTINGROOT}/kernelconfigs/umlswan.config .config
116 # nuke final executable here since we will do FreeSWAN in a moment.
121 grep CONFIG_IPSEC $UMLSWAN/.config || exit 1
123 #if [ ! -f $FREESWANSRCDIR/Makefile ] || [ ! -f $FREESWANSRCDIR/pluto/version.c ]
124 if [ ! -f $FREESWANSRCDIR/Makefile ]
126 if [ ! -f $FREESWANSRCDIR/top/Makefile ]
128 echo "No Makefile and no top/Makefile. You must check out 'all'!"
131 (cd $FREESWANSRCDIR/top && make devready )
134 if [ ! -x $UMLSWAN/linux ]
136 cd $FREESWANSRCDIR || exit 1
138 make KERNMAKEOPTS='ARCH=um' KERNELSRC=$UMLSWAN KERNCLEAN='' KERNDEP=$KERNDEP KERNEL=linux DESTDIR=$DESTDIR oldgo || exit 1
141 cd $FREESWANSRCDIR || exit 1
145 # now, setup up root dir
146 for host in $FREESWANHOSTS
148 setup_host $host $UMLSWAN/linux
149 cd $FREESWANSRCDIR && make DESTDIR=$POOLSPACE/$host/root install
150 cd $FREESWANSRCDIR/utils && make DESTDIR=$POOLSPACE/$host/root setup4
160 # $Log: make-uml.sh,v $
161 # Revision 1.14.2.1 2002/04/07 17:33:30 mcr
162 # fixes for make-uml desires for building static UML kernels
164 # Revision 1.15 2002/04/05 01:21:39 mcr
165 # make-uml script was building statically linked FreeSWAN kernels
166 # only by fluke - turns out that "make oldconfig" blows away
167 # any options in .config that weren't defined. Thus, the initial
168 # build of a non-SWAN kernel before building FreeSWAN would
169 # blow away the CONFIG_IPSEC options- specifically the CONFIG_IPSEC=y
170 # (vs =m). This worked before because "make insert" put the
171 # options back in, but now that the default has changed to modules,
172 # the it defaults the wrong way.
173 # Solution: copy the .config file in again after the plain build.
175 # Revision 1.14 2002/04/03 23:42:18 mcr
176 # force copy of swan kernel config file to get right IPSEC=y options.
177 # redirect some build output to a local file.
179 # Revision 1.13 2002/02/16 20:56:06 rgb
180 # Force make programs so UML does not depend on top level make programs.
182 # Revision 1.12 2002/02/13 21:39:16 mcr
183 # change to use uml*.config files instead.
184 # uml*.config files have been updated for 2.4.7-10 UML patch.
186 # Revision 1.11 2002/01/11 05:26:03 rgb
187 # Fixed missing semicolon bug.
189 # Revision 1.10 2001/11/27 05:36:30 mcr
190 # just look for a kernel in build directory. This
191 # type of "optomization" is dumb - it should be a makefile.
193 # Revision 1.9 2001/11/23 00:36:01 mcr
194 # take $FREESWANDIR as command line argument.
195 # use HS's "devready" instead of fudging our own.
197 # Revision 1.8 2001/11/22 05:46:07 henry
198 # new version stuff makes version.c obsolete
200 # Revision 1.7 2001/11/07 20:10:20 mcr
201 # revised setup comments after RGB consultation.
202 # removed all non-variables from umlsetup-sample.sh.
204 # Revision 1.6 2001/11/07 19:25:17 mcr
205 # split out some functions from make-uml.
207 # Revision 1.5 2001/10/28 23:52:22 mcr
208 # pathnames need to be fully qualified.
210 # Revision 1.4 2001/10/23 16:32:08 mcr
211 # make log files unique to each UML.
213 # Revision 1.3 2001/10/15 05:41:46 mcr
214 # moved variables for UML setup to common file.
215 # provided sample of this file.
217 # Revision 1.2 2001/09/25 01:09:53 mcr
218 # some minor changes to whether to run "KERNDEP"
220 # Revision 1.1 2001/09/25 00:52:16 mcr
221 # a script to build a UML+FreeSWAN testing environment.