2 Joerg Sonnenberger's new bulk building interface is located in pkgtools/pbulk. On pkgbox, this is located in /archive/NetBSD-pkgsrc.
\r
4 To do this without affecting the existing pkgsrc setup on the machine you are using, you create a chroot and install pkgsrc twice inside it - once for pbulk and the various support programs, and once for the actual pkgsrc where everything is built.
\r
6 These notes are taken from Justin Sherrill's test builds on pkgbox.dragonflybsd.org, and from suggestions from Joerg. This reflects using version 0.36 of pbulk.
\r
8 ### Setting up the chroot
\r
9 If getting rid of an earlier install, delete all the files you can, adjust the permissions on the ones left, and then delete what remains.
\r
12 rm -rf /build/pbulk_chroot
\r
13 chflags -R noschg /build/pbulk_chroot
\r
14 rm -rf /build/pbulk_chroot
\r
16 Create dir for chroot
\r
19 mkdir /build/pbulk_chroot
\r
26 If there was no prior buildworld in this , you'll need to do this step
\r
29 make DESTDIR=/build/pbulk_chroot buildworld
\r
34 make DESTDIR=/build/pbulk_chroot installworld
\r
36 note that this is not /etc, but /usr/src/etc
\r
40 make DESTDIR=/build/pbulk_chroot distribution
\r
42 Additional files that will be needed in the chroot
\r
45 cp /etc/resolv.conf /build/pbulk_chroot/etc
\r
48 Make sure you've loaded the linux module if you don't want to get unnecessary messages about unknown ELF types.
\r
54 Jeremy C. Reed has a large repository of the distfiles for pkgsrc in another directory outside of the chroot; mounting it and adding it to DIST_PATH should make it available, saving the bulk build process (and Matt's bandwidth) from having to download more.
\r
57 mkdir /build/pbulk_chroot/archive
\r
58 mount_null /archive /build/pbulk_chroot/archive
\r
61 Should be ready to go...
\r
64 chroot /build/pbulk_chroot
\r
65 /etc/rc.d/ldconfig start
\r
67 ### Adding pkgsrc bootstrap
\r
68 Everything past this point is in the chroot!
\r
76 Grab the most recent quarterly release of pkgsrc:
\r
79 setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot
\r
82 cvs -q checkout -rpkgsrc-2008Q1 -P pkgsrc
\r
84 To update the pkgsrc files later
\r
89 Put this in /root/mk-base.conf, for use later when building the first bootstrap:
\r
92 WRKOBJDIR = /scratch
\r
93 PKGSRCDIR = /usr/pkgsrc
\r
94 DISTDIR = /distfiles
\r
95 DIST_PATH = /archive/distfiles
\r
96 PACKAGES = /packages
\r
101 ALLOW_VULNERABLE_PACKAGES= yes
\r
103 PKG_DEVELOPER?= yes
\r
105 We need to create a clean bootstrap kit for later. This installs pkgsrc tools into /usr/pkg_bulk, too.
\r
108 mkdir /usr/pkg_bulk/
\r
109 cd /usr/pkgsrc/bootstrap
\r
110 ./bootstrap --prefix#/usr/pkg_bulk --pkgdbdir/usr/pkg_bulk/.pkgdb
\r
112 cd /usr/pkgsrc/pkgtools/pbulk
\r
113 env PATH=/usr/pkg_bulk/bin:/usr/pkg_bulk/sbin:${PATH} bmake package
\r
115 cd /usr/pkgsrc/bootstrap
\r
117 ./bootstrap --gzip-binary-kit /usr/pkgsrc/bootstrap/bootstrap.tgz --mk-fragment=/root/mk-base.conf
\r
120 We need to make a binary kit with the corrected mk.conf so that pbulk is always set up with the right version as it builds/removes/adds packages
\r
123 cd /usr/pkgsrc/bootstrap
\r
125 mv bootstrap.tgz temp
\r
127 tar xf bootstrap.tgz
\r
128 cp /usr/pkg/etc/mk.conf usr/pkg/etc/mk.conf
\r
129 tar hzcf ../bootstrap.tar.gz usr var
\r
133 Edit /usr/pkg_bulk/etc/pbulk.conf and change these lines to what is needed. Be sure to put in a destination for the rsync command, as a side effect of that process is the removal of packages that are not for distribution due to various laws. If this is being performed on a single machine, nfsmount directories in the chroot so that you can still copy the files around. The rsync options below assume the packages and report are being copied around on the local machine.
\r
136 base_url=http://something/you_should_change_here
\r
139 pkg_rsync_args="-av --delete-excluded"
\r
140 pkg_rsync_target="/archive/packages/DragonFly-2.0/pkgsrc-current"
\r
141 report_rsync_args="-avz --delete-excluded"
\r
142 report_rsync_target="/archive/packages/DragonFly-2.0/pbulk_report"
\r
143 report_recipients="you@your.email"
\r
144 make=/usr/pkg/bin/bmake
\r
152 If the system you are building on is a slightly different version than the target for your packages, pkg_add will complain about the difference in uname. To fix this, change the UNAME_r and UNAME_v environment variables to the desired values before building.
\r
157 DragonFly 2.1.0-DEVELOPMENT #0: Wed Sep 24 04:26:56 PDT 2008 root@:/usr/obj/usr/src/sys/PKGBOX
\r
161 # setenv UNAME_v 'DragonFly 2.0.1-RELEASE #0: Wed Sep 24 04:26:56 PDT 2008 root@:/usr/obj/usr/src/sys/PKGBOX'
\r
162 # setenv UNAME_r 2.0.1-RELEASE
\r
166 DragonFly 2.0.1-RELEASE #0: Wed Sep 24 04:26:56 PDT 2008 root@:/usr/obj/usr/src/sys/PKGBOX
\r
171 Kick off the bulk build. It takes a LONG time, so it's worth doing this in a screen session. Unless you install screen in the same way as pbulk, it won't be available in the chroot, so you may need to get out of the chroot, enter a screen session, and re-enter the chroot before this step.
\r
174 /usr/pkg_bulk/bin/bulkbuild
\r
176 The line for setting up a rsync server for the mirrors: (do this outside the chroot)
\r
179 rsync --daemon --bwlimit#200 --config/usr/pkg/etc/rsync/rsyncd.conf
\r
181 If the build stops or pauses or whatever, this line will restart it, for versions 0.28 and older.
\r
184 /usr/pkg_bulk/libexec/pbulk/build
\r
186 Version 0.29 and later restart the build with this:
\r
189 /usr/pkg_bulk/bin/bulkbuild-restart
\r