poudriere个人使用记录,仅供参考
本帖最后由 linpay2000 于 2013-05-11 10:16 编辑由于对ports自己单个软件make常有问题发生,更新比较痛苦,在群里大大们的建议下(那個老寫繁體字的哥們,^_^),建议我试用poudriere和tingerbox。
自己看了一下网上的教程及相关说明,tinderbox不太适合我这种比较懒,水平不高的人哈。poudriere比较简单,目前的条件就是必须有zfs。
所以我弄了一个虚拟机,在虚拟机中配置poudriere与编译文件,虚拟机中zfs不是问题,我把我的配置分享一下,给想自己编译ports的人参考一下。
所有操作都用root用户:
0,建立虚拟机,安装基本系统,打开ssh(我喜欢用ssh操作),再新建一个虚拟机硬盘文件,格式化成zfs;
1,在虚拟机中设置好portsnap.conf,执行portsnap fetch extract
2, 安装poudriere与pkg make -C /usr/ports/ports-mgmt/poudriere install clean
make -C /usr/ports/ports-mgmt/pkg install clean3,下载ports文件,poudriere ports -c
4,编辑/usr/local/etc/poudriere.conf文件;cp /usr/local/etc/poudriere.conf.sample /usr/local/etc/poudriere.conf
vi /usr/local/etc/poudriere.conf
我的配置如下,没有改几个地方:
# The pool where poudriere will create all the filesystems it needs
# poudriere will use tank/${ZROOTFS} as its root
#
# You need at least 7GB of free space in this pool to have a working
# poudriere.
ZPOOL=tk1
# root of the poudriere zfs filesystem, by default /poudriere
ZROOTFS=/91amd64
# the host where to download setsfor the jails setup
# You can specify here a host or an IP
# replace _PROTO_ by http or ftp
# replace _CHANGE_THIS_ by the hostname of the mirrors where you want to fetch
# by default: ftp://ftp.freebsd.org
#
# Also not that every protocols supported by fetch(1) are supported here, even
# file:///
FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
# By default the jails have no /etc/resolv.conf, you will need to set
# REVOLV_CONF to a file on your hosts system that will be copied has
# /etc/resolv.conf for the jail, except if you don't need it (using an http
# proxy for example)
RESOLV_CONF=/etc/resolv.conf
# The directory where poudriere will store jails and ports
BASEFS=/91amd64
# The directory where the jail will store the packages and logs
# by default a zfs filesystem will be created and set to
# ${BASEFS}/data
#
POUDRIERE_DATA=${BASEFS}/data
# Use portlint to check ports sanity
USE_PORTLINT=no
# When building packages, a memory device can be used to speedup the build.
# Only one of MFSSIZE or USE_TMPFS is supported. TMPFS is generally faster
# and will expand to the needed amount of RAM. MFS is a bit slower, but is
# more mature and can have its memory usage capped.
# If set WRKDIRPREFIX will be mdmfs of the given size (mM or gG)
#MFSSIZE=4G
# If set WRKDIRPREFIX will be using tmpfs
USE_TMPFS=yes
# Use TMPFS the build pool/cache operations
# default: no (any value is seen as enabled)
#TMPFS_DATA=yes
# Use TMPFS for LOCALBASE
# default: no (any value is seen as enabled)
#TMPFS_LOCALBASE=yes
# If set the given directory will be used for the distfiles this allow the share
# the distfiles between jails and ports tree
DISTFILES_CACHE=/usr/ports/distfiles
# if set the ports tree marked to use csup method will use the defined mirror
#CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org
# if set the ports tree or source tree marked to use svn will use the defined
# mirror by default svn.FreeBSD.org
#SVN_HOST=svn.FreeBSD.org
# Automatic OPTION change detection
# When bulk building packages, compare the options from kept packages to
# the current options to be built. If they differ, the existing package
# will be deleted and the port will be rebuilt.
# Valid options: yes, no, verbose
# verbose will display the old and new options
#CHECK_CHANGED_OPTIONS=no
# Path to the RSA key to sign the PKGNG repo with. See pkg-repo(8)
#PKG_REPO_SIGNING_KEY=/etc/ssl/keys/repo.key
# ccache support. Supply the path to your ccache cache directory.
# It will be mounted into the jail and be shared among all jails.
#CCACHE_DIR=/var/cache/ccache
#
# parallel build support.
#
# By default poudriere uses hw.ncpu to determine the number of builders.
# You can override this default by changing PARALLEL_JOBS here, or
# by specifying the -J flag to bulk/testport.
#
# Example to define PARALLEL_JOBS to one single job
# PARALLEL_JOBS=1
# If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs
SAVE_WRKDIR=yes
# Choose the default format for the workdir packing: could be tar,tgz,tbz,txz
# default is tbz
# WRKDIR_ARCHIVE_FORMAT=tbz
# Disable linux support
# NOLINUX=yes
# by default poudriere set PACKAGE_BUILDING
# to disable it:
# NO_PACKAGE_BUILDING=yes
# If you are using a proxy define it here:
# export HTTP_PROXY=bla
# export FTP_PROXY=bla
#
# Cleanout the restricted packages
# NO_RESTRICTED=yes
# By default MAKE_JOBS is disabled to allow only one process per cpu
# Use the following to allow it anyway
# ALLOW_MAKE_JOBS=yes
5,建立一个jailpoudriere jail -c -j 91amd64 -v 9.1-RELEASE -a amd64让他自己到网下下载一个基本系统。
6,为jail建立一个make.conf文件,注意路径和文件名,如下:mkdir /usr/local/etc/poudriere.d
echo "WITH_PKGNG=yes" > /usr/local/etc/poudriere.d/91amd64-make.conf
vi /usr/local/etc/poudriere.d/91amd64-make.conf
可以加入一些配置,对于我这种对配置不太了解的,一般不要乱加,否则编译错误与编译时长,会很麻烦。
我自己的如下,从网上参考别人的:MASTER_SITE_OVERRIDE?=http://mirror.bjtu.edu.cn/freebsd/distfiles/${DIST_SUBDIR}/ \
http://mirrors.163.com/FreeBSD/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?=${MASTER_SITE_BACKUP}
WITH_PKGNG=YES
WITH_GTK2=YES
BATCH=YES
WITH_NEW_XORG=YES
DISABLE_VULNERABILITIES=YES
JAVA_VENDOR=openjdk
JAVA_VERSION=1.6
PERL_VERSION=5.14.2
WITH_MOZILLA=firefox
firefox_i18n_UNSET+=LANG_ALL
gimp_UNSET+=HELP
thunderbird_i18n_UNSET+=LANG_ALL
OPTIONS_SET+=MP3 MP4 FLAC
OPTIONS_UNSET+=QT QT4 KDE KDE4
libreoffice-i18n_UNSET+=ALL
libreoffice-i18n_SET+=en_US
libreoffice-i18n_SET+=zh_CN7,建立一个软件列表,根据自己的需要建立,可以先弄少一点,或者弄个小软件试一下,后面修改列表,可以增量,我的如下:
vi ~/mylistx11/xorg-minimal
x11-drivers/xf86-video-ati
x11/gnome2-lite
x11/gdm
x11-fonts/wqy
chinese/fcitx
chinese/fcitx-table-extra
editors/vim
www/apache24
列表中的先后顺序不会影响编译依赖,会自动找依赖。
8,开始编译:poudriere bulk -f ~/mylist -j 91amd649,经过漫长的等待,会在以下目录找到编译好的安装包:${POUDRIERE_DATA}/packages/91amd64-defaultPOUDRIERE_DATA是poudriere.conf中配置的位置。
10,准备安装环境,我建议利用编译好的apache24的安装包,在虚拟机中弄一个http服务,把packages目录发布出来。具体方法我就不说了。
11,在待安装的系统中(建议只有基本系统)安装软件:
设置packagesiteecho "packagesite: http://yoururl/91amd64-default" >> /usr/local/etc/pkg.conf
fetch http://yoururl/90amd64-default/Latest/pkg.txz
tar xf ./pkg.txz -s ",/.*/,,g" "*/pkg-static"
./pkg-static add ./pkg.txz
执行pkg install就可以进行安装了。pkg install gnome2-lite12,更新ports:poudriere ports -u
poudriere bulk -f ~/mylist -j 91amd6413,安装更新: pkg update 我的软件列表:archivers/unrar
x11/xorg-minimal
x11-drivers/xf86-video-ati
x11/gnome2-lite
x11/gdm
x11-fonts/wqy
shells/bash
chinese/fcitx
chinese/fcitx-table-extra
java/openjdk6
#java/netbeans
java/eclipse-devel
devel/subversion
x11-fm/worker
x11-fm/gnome-commander2
ftp/filezilla
www/chromium
www/firefox-i18n
multimedia/mplayer
multimedia/xmms
editors/vim
editors/libreoffice
ftp/axel
devel/git
graphics/gimp
ftp/wget
sysutils/ncdu
sysutils/lsof
sysutils/lxterminal
net/netcat
net/tcpdump
databases/mysql56-server
www/apache24
mail/thunderbird-i18n
security/sudo
emulators/virtualbox-ose
x11-fonts/webfonts
print/tex
print/latex poudriere 確實易上手,讚!
页:
[1]