2 # $NetBSD: README.NetBSD,v 1.2 2008/10/20 12:09:15 martti Exp $
4 # Author: Martti Kuparinen <martti@NetBSD.org>
6 # This file contains copy-pastable commands to import a new IPFilter release
7 # into the NetBSD repository. Before importing the code into the official
8 # NetBSD repository, you'll import the code into your own local test
9 # repository, resolve the conflicts and make sure everything works as expected.
11 # Steps in this document:
12 # 1) Get the IPFilter dist file and a copy of the CVS repository
13 # 2) Create a local test repository for the test imports
14 # 3) Import the new IPFilter release into the test repository
15 # 4) Resolve conflicts and make other adjustments
16 # 5) Save the required modifications
17 # 6) Re-create a local test repository for the final test import
18 # 7) Import the new IPFilter release into the test repository
20 # 9) Compile everything and make sure the new version really works
21 # 10) Update your /usr/src (cd /usr/src && cvs update -dPA)
22 # 11) Import the new IPFilter release into the NetBSD repository
24 # 13) Update your /usr/src one more time (cd /usr/src && cvs update -dPA)
25 # 14) Compile and install everything
26 # 15) Update src/doc/3RDPARTY and src/doc/CHANGES
27 # 16) Send an announcement to current-users
30 ###############################################################################
31 ###############################################################################
32 # COMMON SETTINGS FOR EVERYTHING BELOW
33 ###############################################################################
34 ###############################################################################
36 export NETBSDUSERNAME="fixthis"
37 export VERSION="4.1.34"
38 export VEROLD="v4-1-33"
39 export VERNEW="v4-1-34"
40 export VERTAG="`echo ${VERSION} | sed 's+\.+_+g'`"
41 export ORIG="${HOME}/netbsd/orig"
42 export WORK="${HOME}/netbsd/work"
43 export FIXES="${HOME}/netbsd/fixes/${VERSION}"
44 export EXTRACTED="/tmp/destdir"
45 export TGZ="${ORIG}/ip_fil${VERSION}.tar.gz"
46 export IPF="/tmp/ip_fil${VERSION}"
47 export RSYNC_RSH="ssh -4"
48 export RSYNC="rsync -avzr --delete"
50 ###############################################################################
51 ###############################################################################
52 # Fetch the official IPF distfile
53 ###############################################################################
54 ###############################################################################
57 ftp http://coombs.anu.edu.au/~avalon/ip_fil${VERSION}.tar.gz
59 ###############################################################################
60 ###############################################################################
61 # GET COPY OF THE CVS REPOSITORY FOR LOCAL TEST IMPORTS
62 ###############################################################################
63 ###############################################################################
66 RSYNC="rsync -avzr --delete -e ssh"
67 S="${NETBSDUSERNAME}@cvs.netbsd.org::cvsroot"
70 ${RSYNC} ${S}/src/ ${D}/src
71 ${RSYNC} --exclude 'commitlog*' --exclude 'history*' ${S}/CVSROOT/ ${D}/CVSROOT
73 ###############################################################################
74 ###############################################################################
76 ###############################################################################
77 ###############################################################################
79 # Get a new repository
81 ${RSYNC} ${ORIG}/cvsroot ${WORK}
82 rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
83 rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
84 touch ${WORK}/cvsroot/CVSROOT/commitinfo
85 touch ${WORK}/cvsroot/CVSROOT/loginfo
86 sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
87 > ${WORK}/cvsroot/CVSROOT/config.1
88 mv -f ${WORK}/cvsroot/CVSROOT/config.1 ${WORK}/cvsroot/CVSROOT/config
90 export CVSROOT="${WORK}/cvsroot"
93 # Checkout a working copy
101 rm -rf dist/ipf regress/sys/kern sys/lkm sys/dist/ipf sys/netinet usr.sbin/ipf
107 rm -rf dist/ipf regress/sys/kern sys/lkm sys/dist/ipf sys/netinet usr.sbin/ipf
108 cvs update -dPA dist/ipf regress/sys/kern sys/lkm sys/dist/ipf \
109 sys/netinet usr.sbin/ipf
112 # Prepare the files for import
114 tar xpzf ${TGZ} -C `dirname ${IPF}`
117 mkdir -p ${EXTRACTED}
119 /usr/src/dist/ipf/ipf2netbsd ${IPF} ${EXTRACTED}
124 for i in dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
125 regress/sys/kern/ipf usr.sbin/ipf
127 (cd $i && cvs tag BEFORE-IPF-${VERTAG})
131 # Import the new version
133 cvs import -I ! -I CVS -m "Import IPFilter ${VERSION}" src DARRENR ${VERNEW}
137 cd ${WORK}/src/dist/ipf
138 cvs update -kk -j${VEROLD} -j${VERNEW} -d
139 A=`cvs update | grep ^C | awk '{ print $2 }'`
142 ##for i in $A; do mkdir -p ${FIXES}/1/src/dist/ipf/`dirname $i`; done
143 ##for i in $A; do cp $i ${FIXES}/1/src/dist/ipf/$i; done
144 cvs diff -u -kk -rDARRENR $A | less
145 cvs diff -u -kk -rDARRENR | less
148 cd ${WORK}/src/sys/dist/ipf
149 cvs update -kk -j${VEROLD} -j${VERNEW} -d
150 B=`cvs update | grep ^C | awk '{ print $2 }'`
153 ##for i in $B; do mkdir -p ${FIXES}/1/src/sys/dist/ipf/`dirname $i`; done
154 ##for i in $B; do cp $i ${FIXES}/1/src/sys/dist/ipf/$i; done
155 cvs diff -u -rDARRENR $B | less
156 cvs diff -u -rDARRENR | less
158 # src/sys/lkm/netinet/if_ipl
159 cd ${WORK}/src/sys/lkm/netinet/if_ipl
160 cvs update -kk -j${VEROLD} -j${VERNEW} -d
161 C=`cvs update | grep ^C | awk '{ print $2 }'`
164 ##for i in $C; do mkdir -p ${FIXES}/1/src/sys/lkm/netinet/if_ipl/`dirname $i`; done
165 ##for i in $C; do cp $i ${FIXES}/1/src/sys/lkm/netinet/if_ipl/$i; done
166 cvs diff -u -rDARRENR | less
168 # src/regress/sys/kern/ipf
169 cd ${WORK}/src/regress/sys/kern/ipf
170 cvs update -kk -j${VEROLD} -j${VERNEW} -d
171 D=`cvs update | grep ^C | awk '{ print $2 }'`
174 ##for i in $D; do mkdir -p ${FIXES}/1/src/regress/sys/kern/ipf/`dirname $i`; done
175 ##for i in $D; do cp $i ${FIXES}/1/src/regress/sys/kern/ipf/$i; done
176 cvs diff -u -rDARRENR | less
181 cvs ci -m "Upgraded IPFilter to ${VERSION}" \
182 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf
183 cvs update -dPA dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
188 cvs diff -u -kk -rDARRENR \
189 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf \
192 ###############################################################################
193 ###############################################################################
195 ###############################################################################
196 ###############################################################################
199 export WORK="${HOME}/netbsd/work"
200 export CVSROOT="${WORK}/cvsroot"
202 # Get a new repository
204 ${RSYNC} ${ORIG}/cvsroot ${WORK}
205 rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
206 rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
207 touch ${WORK}/cvsroot/CVSROOT/commitinfo
208 touch ${WORK}/cvsroot/CVSROOT/loginfo
209 sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
210 > ${WORK}/cvsroot/CVSROOT/config.1
211 mv -f ${WORK}/cvsroot/CVSROOT/config.1 ${WORK}/cvsroot/CVSROOT/config
212 mkdir -p /tmp/cvslock
213 export CVSROOT="${WORK}/cvsroot"
216 rm -rf dist/ipf regress/sys/kern sys/lkm sys/dist/ipf sys/netinet usr.sbin/ipf
217 cvs update -dPA dist/ipf regress/sys/kern sys/lkm sys/dist/ipf \
218 sys/netinet usr.sbin/ipf
222 for i in dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
223 regress/sys/kern/ipf usr.sbin/ipf
225 (cd $i && cvs tag BEFORE-IPF-${VERTAG})
228 # Prepare the files for import
230 tar xpzf ${TGZ} -C `dirname ${IPF}`
233 mkdir -p ${EXTRACTED}
235 /usr/src/dist/ipf/ipf2netbsd ${IPF} ${EXTRACTED}
237 # Import the new version
239 cvs import -I ! -I CVS -m "Import IPFilter ${VERSION}" src DARRENR ${VERNEW}
241 # Merge and fix conflicts
242 cd ${WORK}/src/dist/ipf
243 cvs update -kk -j${VEROLD} -j${VERNEW} -d
246 cd ${WORK}/src/sys/dist/ipf
247 cvs update -kk -j${VEROLD} -j${VERNEW} -d
250 cd ${WORK}/src/sys/lkm/netinet/if_ipl
251 cvs update -kk -j${VEROLD} -j${VERNEW} -d
254 cd ${WORK}/src/regress/sys/kern/ipf
255 cvs update -kk -j${VEROLD} -j${VERNEW} -d
258 cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
260 cvs ci -m "Upgraded IPFilter to ${VERSION}" \
261 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf
262 cvs update -dPA dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
265 cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
267 cvs ci -m "Sync with official IPFilter" \
268 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf
270 # Now build and verify everything before doing the real import...
272 ###############################################################################
273 ###############################################################################
274 # FINAL IMPORT INTO THE NETBSD REPOSITORY
275 ###############################################################################
276 ###############################################################################
280 export CVSROOT="${NETBSDUSERNAME}@cvs.netbsd.org:/cvsroot"
282 # Update the local copy first
284 cvs update -dPA dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
289 for i in dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
290 regress/sys/kern/ipf usr.sbin/ipf
292 (cd $i && cvs tag BEFORE-IPF-${VERTAG})
295 # Prepare the files for import
297 tar xpzf ${TGZ} -C `dirname ${IPF}`
300 mkdir -p ${EXTRACTED}
302 /usr/src/dist/ipf/ipf2netbsd ${IPF} ${EXTRACTED}
304 # Import the new version
306 cvs import -I ! -I CVS -m "Import IPFilter ${VERSION}" src DARRENR ${VERNEW}
308 # Merge and fix conflicts
309 cd ${WORK}/src/dist/ipf
310 cvs update -kk -j${VEROLD} -j${VERNEW} -d
313 cd ${WORK}/src/sys/dist/ipf
314 cvs update -kk -j${VEROLD} -j${VERNEW} -d
317 cd ${WORK}/src/sys/lkm/netinet/if_ipl
318 cvs update -kk -j${VEROLD} -j${VERNEW} -d
321 cd ${WORK}/src/regress/sys/kern/ipf
322 cvs update -kk -j${VEROLD} -j${VERNEW} -d
325 cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
327 cvs ci -m "Upgraded IPFilter to ${VERSION}" \
328 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf
329 cvs update -dPA dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl \
332 cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
334 cvs ci -m "Sync with official IPFilter" \
335 dist/ipf sys/dist/ipf sys/lkm/netinet/if_ipl regress/sys/kern/ipf
337 # fix doc/3RDPARTY and doc/CHANGES
338 # send mail to current-users@
345 I have just upgraded IPFilter to the latest version (4.1.31) on
346 NetBSD -current. You must recompile kernel and the ipf tools to
350 ./build.sh tools kernel=GENERIC
351 ./build.sh releasekernel=GENERIC
352 (cd share/mk && make install)
353 (cd sys && make includes)
354 (cd usr.sbin/ipf && make dependall install)
356 After reboot you may want to check the version number and run the
360 (cd regress/sys/kern/ipf && make && make clean)
362 If you detect errors (or have improvements), please send a problem
363 report with the send-pr tool.