[BACK]Return to README.NetBSD CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / dist / pf

File: [cvs.NetBSD.org] / src / dist / pf / README.NetBSD (download)

Revision 1.1, Wed Dec 2 15:07:09 2009 UTC (12 years, 6 months ago) by martti
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, localcount-20160914, khorben-n900, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, cherry-xenmp-base, cherry-xenmp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver, HEAD

Initial version.

#
# $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.