forked from IIJ-NetBSD/netbsd-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.NetBSD
301 lines (254 loc) · 9.78 KB
/
README.NetBSD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#
# $NetBSD: README.NetBSD,v 1.1 2009/12/02 15:07:09 martti Exp $
#
# Author: Martti Kuparinen <martti@NetBSD.org>
#
# This file contains copy-pastable commands to import a new PF release
# into the NetBSD repository. Before importing the code into the official
# NetBSD repository, you'll import the code into your own local test
# repository, resolve the conflicts and make sure everything works as expected.
#
# Steps in this document:
# 1) Get the PF dist files and a copy of the CVS repository
# 2) Create a local test repository for the test imports
# 3) Import the new PF release into the test repository
# 4) Resolve conflicts and make other adjustments
# 5) Save the required modifications
# 6) Re-create a local test repository for the final test import
# 7) Import the new PF release into the test repository
# 8) Apply the fixes
# 9) Compile everything and make sure the new version really works
# 10) Update your /usr/src (cd /usr/src && cvs update -dPA)
# 11) Import the new PF release into the NetBSD repository
# 12) Apply the fixes
# 13) Update your /usr/src one more time (cd /usr/src && cvs update -dPA)
# 14) Compile and install everything
# 15) Update src/doc/3RDPARTY and src/doc/CHANGES
# 16) Send an announcement to current-users
#
###############################################################################
###############################################################################
# COMMON SETTINGS FOR EVERYTHING BELOW
###############################################################################
###############################################################################
export NETBSDUSERNAME="fixthis"
export VERSION="4.6"
export VERTAG="`echo ${VERSION} | sed 's+\.+_+g'`"
export VEROLD="v4_2"
export VERNEW="v4_6"
export ORIG="${HOME}/netbsd/orig"
export WORK="${HOME}/netbsd/work"
export FIXES="${HOME}/netbsd/fixes/${VERSION}"
export RSYNC_RSH="ssh -4"
export RSYNC="rsync -avzr --delete"
###############################################################################
###############################################################################
# Fetch the official PF sources
###############################################################################
###############################################################################
mkdir -p ${ORIG}/openbsd-${VERSION}
cd ${ORIG}/openbsd-${VERSION}
if [ ! -f src.tar.gz ]; then
ftp ftp://ftp.df.lth.se/pub/OpenBSD/${VERSION}/src.tar.gz
fi
if [ ! -f sys.tar.gz ]; then
ftp ftp://ftp.df.lth.se/pub/OpenBSD/${VERSION}/sys.tar.gz
fi
###############################################################################
###############################################################################
# GET COPY OF THE CVS REPOSITORY FOR LOCAL TEST IMPORTS
###############################################################################
###############################################################################
RSYNC_RSH="ssh -4"
RSYNC="rsync -avzr --delete -e ssh"
S="${NETBSDUSERNAME}@cvs.netbsd.org::cvsroot"
D="${ORIG}/cvsroot"
if [ "${NETBSDUSERNAME}" = "fixthis" ]; then
echo "You MUST use your real NetBSD user name..."
sleep 86400
fi
${RSYNC} ${S}/src/ ${D}/src
${RSYNC} --exclude 'commitlog*' --exclude 'history*' ${S}/CVSROOT/ ${D}/CVSROOT
###############################################################################
###############################################################################
# TEST IMPORT 1
###############################################################################
###############################################################################
# Get a new repository
mkdir -p ${WORK}
${RSYNC} ${ORIG}/cvsroot ${WORK}
rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
touch ${WORK}/cvsroot/CVSROOT/commitinfo
touch ${WORK}/cvsroot/CVSROOT/loginfo
chmod 644 ${WORK}/cvsroot/CVSROOT/config
sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
> ${WORK}/cvsroot/CVSROOT/config.1
grep -v -e tag= -e AdminGroup= -e AdminOptions= \
< ${WORK}/cvsroot/CVSROOT/config.1 > ${WORK}/cvsroot/CVSROOT/config
chmod 444 ${WORK}/cvsroot/CVSROOT/config
rm -f ${WORK}/cvsroot/CVSROOT/config.1
mkdir -p /tmp/cvslock
export CVSROOT="${WORK}/cvsroot"
# Checkout a working copy
cd ${WORK}
rm -rf src
cvs co -P src
or
cd ${WORK}/src
rm -rf dist/pf sys/dist/pf
cvs update -dPA
or
cd ${WORK}/src
rm -rf dist/pf sys/dist/pf
cvs update -dPA dist/pf sys/dist/pf
# cvs tag
cd ${WORK}/src
cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
# Prepare the files for import
rm -rf /tmp/openbsd-${VERSION}
mkdir -p /tmp/openbsd-${VERSION}
cd /tmp/openbsd-${VERSION}
tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
rm -rf /tmp/netbsd-${VERSION}
${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
cd /tmp/netbsd-${VERSION}
# Import the new version
cd /tmp/netbsd-${VERSION}
cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
src OPENBSD ${VERNEW}
# src/dist/pf
cd ${WORK}/src/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
A=`cvs update | grep ^C | awk '{ print $2 }'`
cvs update | grep ^C
##vim $A
##for i in $A; do mkdir -p ${FIXES}/1/src/dist/pf/`dirname $i`; done
##for i in $A; do cp $i ${FIXES}/1/src/dist/pf/$i; done
cvs diff -u -kk -rOPENBSD $A | less
cvs diff -u -kk -rOPENBSD | less
cvs update -dPA
# src/sys/dist/pf
cd ${WORK}/src/sys/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
B=`cvs update | grep ^C | awk '{ print $2 }'`
cvs update | grep ^C
##vim $B
##for i in $B; do mkdir -p ${FIXES}/1/src/sys/dist/pf/`dirname $i`; done
##for i in $B; do cp $i ${FIXES}/1/src/sys/dist/pf/$i; done
cvs diff -u -kk -rOPENBSD $B | less
cvs diff -u -kk -rOPENBSD | less
# Commit changes
cd ${WORK}/src
cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
# See the changes
cd ${WORK}/src
cvs diff -u -kk -rOPENBSD dist/pf sys/dist/pf | less
###############################################################################
###############################################################################
# TEST IMPORT 2
###############################################################################
###############################################################################
# Get a new repository
mkdir -p ${WORK}
${RSYNC} ${ORIG}/cvsroot ${WORK}
rm -f ${WORK}/cvsroot/CVSROOT/commitinfo*
rm -f ${WORK}/cvsroot/CVSROOT/loginfo*
touch ${WORK}/cvsroot/CVSROOT/commitinfo
touch ${WORK}/cvsroot/CVSROOT/loginfo
chmod 644 ${WORK}/cvsroot/CVSROOT/config
sed 's+/cvslock+/tmp/cvslock+' < ${WORK}/cvsroot/CVSROOT/config \
> ${WORK}/cvsroot/CVSROOT/config.1
grep -v -e tag= -e AdminGroup= -e AdminOptions= \
< ${WORK}/cvsroot/CVSROOT/config.1 > ${WORK}/cvsroot/CVSROOT/config
chmod 444 ${WORK}/cvsroot/CVSROOT/config
rm -f ${WORK}/cvsroot/CVSROOT/config.1
mkdir -p /tmp/cvslock
export CVSROOT="${WORK}/cvsroot"
# Checkout a working copy
cd ${WORK}/src
rm -rf dist/pf sys/dist/pf
cvs update -dPA dist/pf sys/dist/pf
# cvs tag
cd ${WORK}/src
cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
# Prepare the files for import
rm -rf /tmp/openbsd-${VERSION}
mkdir -p /tmp/openbsd-${VERSION}
cd /tmp/openbsd-${VERSION}
tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
rm -rf /tmp/netbsd-${VERSION}
${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
cd /tmp/netbsd-${VERSION}
# Import the new version
cd /tmp/netbsd-${VERSION}
cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
src OPENBSD ${VERNEW}
# Merge and fix conflicts
cd ${WORK}/src/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
cvs update | grep ^C
cd ${WORK}/src/sys/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
cvs update | grep ^C
cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
cd ${WORK}/src
cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
cd ${WORK}/src
cvs ci -m "Sync with official PF" dist/pf sys/dist/pf
###############################################################################
###############################################################################
# FINAL IMPORT IN TO NETBSD REPOSITORY
###############################################################################
###############################################################################
# Settings
if [ "${NETBSDUSERNAME}" = "fixthis" ]; then
echo "You MUST use your real NetBSD user name..."
sleep 86400
fi
export WORK="/usr"
export CVSROOT="${NETBSDUSERNAME}@cvs.netbsd.org:/cvsroot"
# Update the local copy first
cd ${WORK}/src
cvs update -dPA dist/pf sys/dist/pf
# cvs tag
cvs tag BEFORE-PF-${VERTAG} dist/pf sys/dist/pf
# Prepare the files for import
rm -rf /tmp/openbsd-${VERSION}
mkdir -p /tmp/openbsd-${VERSION}
cd /tmp/openbsd-${VERSION}
tar -xzf ${ORIG}/openbsd-${VERSION}/src.tar.gz
tar -xzf ${ORIG}/openbsd-${VERSION}/sys.tar.gz
rm -rf /tmp/netbsd-${VERSION}
${WORK}/src/dist/pf/pf2netbsd /tmp/openbsd-${VERSION} /tmp/netbsd-${VERSION}
cd /tmp/netbsd-${VERSION}
# Import the new version
cd /tmp/netbsd-${VERSION}
cvs import -I ! -I CVS -m "Import PF from OpenBSD ${VERSION}" \
src OPENBSD ${VERNEW}
# Merge and fix conflicts
cd ${WORK}/src/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
cvs update | grep ^C
cd ${WORK}/src/sys/dist/pf
cvs update -kk -j${VEROLD} -j${VERNEW} -d
cvs update | grep ^C
cd ${FIXES}/1 && tar cf - * | tar xvf - -C ${WORK}
cd ${WORK}/src
cvs ci -m "Upgraded PF to ${VERSION}" dist/pf sys/dist/pf
cd ${FIXES}/2 && tar cf - * | tar xvf - -C ${WORK}
cd ${WORK}/src
cvs ci -m "Sync with official PF" dist/pf sys/dist/pf
# fix doc/3RDPARTY and doc/CHANGES
# send mail to current-users@
HEADSUP
=======
Hi!
I have just upgraded PF to the latest version on NetBSD -current. I've
tested this by building i386 and amd64 release and installed the sets
on my test hosts.
If you detect any errors (or have improvements), please send a problem
report with the send-pr tool.