Page MenuHomeFreeBSD

D49510.1784036165.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D49510.1784036165.diff

diff --git a/contrib/blocklist/FreeBSD-upgrade b/contrib/blocklist/FreeBSD-upgrade
new file mode 100644
--- /dev/null
+++ b/contrib/blocklist/FreeBSD-upgrade
@@ -0,0 +1,97 @@
+FreeBSD maintainer's guide to blocklist
+=======================================
+
+These instructions describe the blocklist vendor import procedure,
+following the Committer's Guide
+(https://docs.freebsd.org/en/articles/committers-guide/#vendor-import-git).
+
+> [!NOTE]
+> This guide follows the convention that a `freebsd` remote is pointing
+> to gitrepo.FreeBSD.org/src.git.
+
+1. Grab our top level directory:
+
+ freebsd=$(git rev-parse --show-toplevel)
+
+2. Create a Git worktree under a temporary directory:
+
+ worktree=$(mktemp -d -t blocklist)
+ git worktree add ${worktree} vendor/blocklist
+
+3. Clone the blocklist repo (https://github.com/zoulasc/blocklist.git):
+
+ blocklist_repo=$(mktemp -d -t blocklist-repo)
+ git clone https://github.com/zoulasc/blocklist.git ${blocklist_repo}
+ cd ${blocklist_repo}
+ commit=$(git rev-parse HEAD)
+ commit_short=$(git rev-parse --short HEAD)
+ date=$(git show -s --format=%cd --date=format:%Y-%m-%d)
+ tag=$(git show -s --format=%cd --date=format:%Y%m%d)
+
+4. Copy to the vendor branch using rsync (net/rsync):
+
+ rsync -va --del --exclude=".git" ${blocklist_repo}/ ${worktree}
+
+5. Take care of added/deleted files:
+
+ cd ${worktree}
+ git add -A ${worktree}
+ git status
+ git diff --staged
+
+6. Commit:
+
+ message=$(cat <<-EOM
+ blocklist ${date} (${commit_short})
+
+ Upstream hash ${commit}.
+
+ Obtained from: https://github.com/zoulasc/blocklist
+ EOM
+ )
+ git commit -e -m "Vendor import of ${message}"
+
+7. Tag:
+
+ git tag -a -e -m "Tag ${message}" vendor/blocklist/${tag}
+
+ At this point, the vendor branch can be pushed to the FreeBSD
+ repo via:
+
+ git push --follow-tags freebsd vendor/blocklist
+
+8. Merge from the vendor branch:
+
+ cd ${freebsd}
+ git subtree merge -P contrib/blocklist vendor/blocklist
+
+ Some files may have been deleted from FreeBSD's copy of
+ blocklist. When git prompts for these deleted files during the
+ merge, choose 'd' (leaving them deleted).
+
+9. Resolve conflicts.
+
+10. Diff against the vendor branch:
+
+ git diff --diff-filter=M vendor/blocklist/${tag} HEAD:contrib/blocklist
+
+ Review the diff for any unexpected changes.
+
+11. Run the FreeBSD changes script:
+
+ cd contrib/blocklist
+ sh ./freebsd-changes.sh
+
+12. If source files have been added or removed, update the
+ appropriate makefiles to reflect changes in the vendor's
+ Makefile.in.
+
+13. Build and install world, reboot, test. Pay particular attention
+ to the fingerd(8) and sshd(8) integration.
+
+14. Commit.
+
+15. Cleanup:
+
+ rm -fr ${blocklist_repo} ${worktree}
+ git worktree prune
diff --git a/contrib/blocklist/freebsd-changes.sh b/contrib/blocklist/freebsd-changes.sh
new file mode 100644
--- /dev/null
+++ b/contrib/blocklist/freebsd-changes.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+#
+# FreeBSD-specific changes from upstream
+#
+
+# Remove Debian port
+rm -fr port/debian
+
+# /libexec -> /usr/libexec
+sed -i "" -e 's| /libexec| /usr/libexec|g' bin/blocklistd.8
+sed -i "" -e 's|"/libexec|"/usr/libexec|g' bin/internal.h
+
+# NetBSD: RT_ROUNDUP -> FreeBSD: SA_SIZE (from net/route.h)
+sed -i "" -e 's/RT_ROUNDUP/SA_SIZE/g' bin/conf.c
+
+# npfctl(8) -> ipf(8), ipfw(8), pfctl(8)
+sed -i "" -e 's/npfctl 8 ,/ipf 8 ,\n.Xr ipfw 8 ,\n.Xr pfctl 8 ,/g' bin/blocklistd.8

File Metadata

Mime Type
text/plain
Expires
Tue, Jul 14, 1:36 PM (6 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29130285
Default Alt Text
D49510.1784036165.diff (3 KB)

Event Timeline