File:  [NetBSD Developer Wiki] / wikisrc / users / ryoon / pbulk_non-netbsd.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Fri Jan 6 21:43:46 2012 UTC (8 years, 6 months ago) by ryoon
Branches: MAIN
CVS tags: HEAD
Add draft version of "pbulk in chroot on non-NetBSD platform".

    1: ## pbulk in chroot on non-NetBSD platform
    2: 
    3: This documentation describes how to run pkgsrc/pkgtools/pbulk in chroot on non-NetBSD platform.
    4: This is based on [[Using pbulk to create a pkgsrc binary repository|pbulk]] and [[pbulk-HOWTO|http://wiki-static.aydogan.net/pbulk-HOWTO]].
    5: 
    6: ### Bootstrap pkgsrc on non-chrooted environment for getting bmake
    7: 
    8: For making sandbox, bmake is needed.
    9: 
   10: 	# ./bootstrap --varbase /usr/pkg/var --workdir /tmp/bs
   11: 
   12: ### Making sandbox using script
   13: 
   14: Make sure you have pkgsrc tree for bulk buld as /usr/pkgsrc.
   15: If you have pkgsrc tree at another place, you can use --pkgsrc=/some/where/pkgsrc option.
   16: 
   17: And I will setup sandbox under /home/bulk.
   18: 
   19: 	# pkgsrc/mk/bulk/mksandbox --without-x /home/bulk
   20: 
   21: If you get the following message, you can modify pkgsrc/mk/bulk/mksandbox script.
   22: 
   23: 	Unknown Operating System ($opsys) - good luck
   24: 
   25: ### Entering to chroot
   26: 
   27: 	# chroot /home/bulk /bin/sh
   28: 
   29: ### Adding unprivileged user for build stage
   30: 
   31: 	# pw useradd bulk # for FreeBSD
   32: 	# useradd -M bulk # for CentOS (Linux)
   33: 
   34: ### Creating some directories to store packages and logs.
   35: 
   36: 	# mkdir /scratch /bulklog /packages
   37: 
   38: 	# chown bulk /scratch
   39: 	/scratch must be writable for bulk user.
   40: 
   41: ### Creating the environment for pbulk program
   42: 
   43: 	# ./bootstrap --prefix /usr/pkg_bulk --varbase /usr/pkg_bulk/var --workdir /tmp/bs
   44: 
   45: 	# rm -r /tmp/bs
   46: 
   47: 	# vi /usr/pkg_bulk/etc/mk.conf
   48: 	Add the following lines.
   49: 
   50: 	WRKOBJDIR=/usr/tmp
   51: 	PACKAGES=/scratch/pbulk_packages
   52: 
   53: 	# export PATH=/usr/pkg_bulk/bin:/usr/pkg_bulk/sbin:${PATH}
   54: 
   55: 	# cd /usr/pkgsrc/pkgtools/pbulk
   56: 
   57: 	# bmake install
   58: 
   59: 	# rm -r /usr/tmp/*
   60: 
   61: ### Configuring pbulk
   62: 
   63: 	# vi /usr/pkg_bulk/etc/pbulk.conf
   64: 	Add the following lines to header.
   65: 
   66: 	ulimit -t 1800 # set the limit on CPU time (in seconds)
   67: 	ulimit -v 2097152 # limits process address space
   68: 
   69: 	Modify the following lines.
   70: 
   71: 	base_url=http://www.NetBSD.org/~ryo_on/FreeBSD-i386-9.0-RC3
   72: 	master_mode=no
   73: 	bootstrapkit=/bootstrap.tar.gz
   74: 	unprivileged_user=bulk
   75: 	bulklog=/bulklog
   76: 	packages=/packages
   77: 	prefix=/usr/pkg
   78: 	pkgsrc=/usr/pkgsrc
   79: 	pkgdb=/usr/pkg/var/db/pkg
   80: 	varbase=/usr/pkg/var
   81: 	mail=:
   82: 	rsync=:
   83: 
   84: ### Preparing bootstrap kit
   85: 
   86: 	# cd /usr/pkgsrc/bootstrap
   87: 
   88: 	# ./bootstrap --varbase /usr/pkg/var --workdir /tmp/bsi
   89: 
   90: 	# rm -r /tmp/bsi
   91: 
   92: 	# vi /usr/pkg/etc/mk.conf
   93: 	Add the following lines.
   94: 
   95: 	WRKOBJDIR=/scratch
   96: 	PKGSRCDIR=/usr/pkgsrc
   97: 	DISTDIR=/usr/distfiles
   98: 	PACKAGES=/packages
   99: 	SKIP_LICENSE_CHECK=yes
  100: 	ALLOW_VULNERABLE_PACKAGES=yes
  101: 	PKG_DEVELOPER=yes
  102: 	X11_TYPE=modular
  103: 
  104: 	# tar zvfc /bootstrap.tar.gz /usr/pkg
  105: 
  106: ### Running the bulk build
  107: 
  108: 	# /usr/pkg_bulk/bin/bulkbuild
  109: 
  110: Or to restart
  111: 
  112: 	# /usr/pkg_bulk/libexec/pbulk/build

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb