Home | History | Annotate | only in /src/dist/pf
Up to higher level directory
NameDateSize
etc/09-Nov-2022
libexec/Today
pf2netbsd02-Dec-20096K
README.NetBSD02-Dec-20099.8K
sbin/09-Nov-2022
share/09-Nov-2022
usr.sbin/Today

README.NetBSD

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