免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2451 | 回复: 2

[FreeBSD] poudriere个人使用记录,仅供参考 [复制链接]

论坛徽章:
0
发表于 2013-05-11 10:08 |显示全部楼层
本帖最后由 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
  1.      make -C /usr/ports/ports-mgmt/poudriere install clean
  2.      make -C /usr/ports/ports-mgmt/pkg install clean
复制代码
3,下载ports文件,poudriere ports -c
4,编辑/usr/local/etc/poudriere.conf文件;
  1. cp /usr/local/etc/poudriere.conf.sample /usr/local/etc/poudriere.conf
  2. vi /usr/local/etc/poudriere.conf
复制代码
我的配置如下,没有改几个地方:

  1. # The pool where poudriere will create all the filesystems it needs
  2. # poudriere will use tank/${ZROOTFS} as its root
  3. #
  4. # You need at least 7GB of free space in this pool to have a working
  5. # poudriere.
  6. ZPOOL=tk1

  7. # root of the poudriere zfs filesystem, by default /poudriere
  8. ZROOTFS=/91amd64

  9. # the host where to download sets  for the jails setup
  10. # You can specify here a host or an IP
  11. # replace _PROTO_ by http or ftp
  12. # replace _CHANGE_THIS_ by the hostname of the mirrors where you want to fetch
  13. # by default: ftp://ftp.freebsd.org
  14. #
  15. # Also not that every protocols supported by fetch(1) are supported here, even
  16. # file:///
  17. FREEBSD_HOST=_PROTO_://_CHANGE_THIS_

  18. # By default the jails have no /etc/resolv.conf, you will need to set
  19. # REVOLV_CONF to a file on your hosts system that will be copied has
  20. # /etc/resolv.conf for the jail, except if you don't need it (using an http
  21. # proxy for example)
  22. RESOLV_CONF=/etc/resolv.conf

  23. # The directory where poudriere will store jails and ports
  24. BASEFS=/91amd64

  25. # The directory where the jail will store the packages and logs
  26. # by default a zfs filesystem will be created and set to
  27. # ${BASEFS}/data
  28. #
  29. POUDRIERE_DATA=${BASEFS}/data

  30. # Use portlint to check ports sanity
  31. USE_PORTLINT=no

  32. # When building packages, a memory device can be used to speedup the build.
  33. # Only one of MFSSIZE or USE_TMPFS is supported. TMPFS is generally faster
  34. # and will expand to the needed amount of RAM. MFS is a bit slower, but is
  35. # more mature and can have its memory usage capped.

  36. # If set WRKDIRPREFIX will be mdmfs of the given size (mM or gG)
  37. #MFSSIZE=4G

  38. # If set WRKDIRPREFIX will be using tmpfs
  39. USE_TMPFS=yes

  40. # Use TMPFS the build pool/cache operations
  41. # default: no (any value is seen as enabled)
  42. #TMPFS_DATA=yes

  43. # Use TMPFS for LOCALBASE
  44. # default: no (any value is seen as enabled)
  45. #TMPFS_LOCALBASE=yes

  46. # If set the given directory will be used for the distfiles this allow the share
  47. # the distfiles between jails and ports tree
  48. DISTFILES_CACHE=/usr/ports/distfiles

  49. # if set the ports tree marked to use csup method will use the defined mirror
  50. #CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org

  51. # if set the ports tree or source tree marked to use svn will use the defined
  52. # mirror by default svn.FreeBSD.org
  53. #SVN_HOST=svn.FreeBSD.org

  54. # Automatic OPTION change detection
  55. # When bulk building packages, compare the options from kept packages to
  56. # the current options to be built. If they differ, the existing package
  57. # will be deleted and the port will be rebuilt.
  58. # Valid options: yes, no, verbose
  59. # verbose will display the old and new options
  60. #CHECK_CHANGED_OPTIONS=no


  61. # Path to the RSA key to sign the PKGNG repo with. See pkg-repo(8)
  62. #PKG_REPO_SIGNING_KEY=/etc/ssl/keys/repo.key


  63. # ccache support. Supply the path to your ccache cache directory.
  64. # It will be mounted into the jail and be shared among all jails.
  65. #CCACHE_DIR=/var/cache/ccache
  66. #
  67. # parallel build support.
  68. #
  69. # By default poudriere uses hw.ncpu to determine the number of builders.
  70. # You can override this default by changing PARALLEL_JOBS here, or
  71. # by specifying the -J flag to bulk/testport.
  72. #
  73. # Example to define PARALLEL_JOBS to one single job
  74. # PARALLEL_JOBS=1


  75. # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs
  76. SAVE_WRKDIR=yes

  77. # Choose the default format for the workdir packing: could be tar,tgz,tbz,txz
  78. # default is tbz
  79. # WRKDIR_ARCHIVE_FORMAT=tbz

  80. # Disable linux support
  81. # NOLINUX=yes


  82. # by default poudriere set PACKAGE_BUILDING
  83. # to disable it:
  84. # NO_PACKAGE_BUILDING=yes

  85. # If you are using a proxy define it here:
  86. # export HTTP_PROXY=bla
  87. # export FTP_PROXY=bla
  88. #
  89. # Cleanout the restricted packages
  90. # NO_RESTRICTED=yes

  91. # By default MAKE_JOBS is disabled to allow only one process per cpu
  92. # Use the following to allow it anyway
  93. # ALLOW_MAKE_JOBS=yes

复制代码
5,建立一个jail
  1. poudriere jail -c -j 91amd64 -v 9.1-RELEASE -a amd64
复制代码
让他自己到网下下载一个基本系统。
6,为jail建立一个make.conf文件,注意路径和文件名,如下:
  1. mkdir /usr/local/etc/poudriere.d
  2. echo "WITH_PKGNG=yes" > /usr/local/etc/poudriere.d/91amd64-make.conf
  3. vi /usr/local/etc/poudriere.d/91amd64-make.conf
复制代码
可以加入一些配置,对于我这种对配置不太了解的,一般不要乱加,否则编译错误与编译时长,会很麻烦。
我自己的如下,从网上参考别人的:
  1. MASTER_SITE_OVERRIDE?=http://mirror.bjtu.edu.cn/freebsd/distfiles/${DIST_SUBDIR}/ \
  2. http://mirrors.163.com/FreeBSD/distfiles/${DIST_SUBDIR}/
  3. MASTER_SITE_OVERRIDE?=${MASTER_SITE_BACKUP}
  4. WITH_PKGNG=YES
  5. WITH_GTK2=YES
  6. BATCH=YES
  7. WITH_NEW_XORG=YES
  8. DISABLE_VULNERABILITIES=YES
  9. JAVA_VENDOR=openjdk
  10. JAVA_VERSION=1.6
  11. PERL_VERSION=5.14.2
  12. WITH_MOZILLA=firefox
  13. firefox_i18n_UNSET+=LANG_ALL
  14. gimp_UNSET+=HELP
  15. thunderbird_i18n_UNSET+=LANG_ALL
  16. OPTIONS_SET+=MP3 MP4 FLAC
  17. OPTIONS_UNSET+=QT QT4 KDE KDE4


  18. libreoffice-i18n_UNSET+=ALL
  19. libreoffice-i18n_SET+=en_US
  20. libreoffice-i18n_SET+=zh_CN
复制代码
7,建立一个软件列表,根据自己的需要建立,可以先弄少一点,或者弄个小软件试一下,后面修改列表,可以增量,我的如下:
vi ~/mylist
  1. x11/xorg-minimal
  2. x11-drivers/xf86-video-ati
  3. x11/gnome2-lite
  4. x11/gdm
  5. x11-fonts/wqy
  6. chinese/fcitx
  7. chinese/fcitx-table-extra
  8. editors/vim
  9. www/apache24
复制代码
列表中的先后顺序不会影响编译依赖,会自动找依赖。
8,开始编译:
  1. poudriere bulk -f ~/mylist -j 91amd64
复制代码
9,经过漫长的等待,会在以下目录找到编译好的安装包:
  1. ${POUDRIERE_DATA}/packages/91amd64-default
复制代码
POUDRIERE_DATA是poudriere.conf中配置的位置。
10,准备安装环境,我建议利用编译好的apache24的安装包,在虚拟机中弄一个http服务,把packages目录发布出来。具体方法我就不说了。
11,在待安装的系统中(建议只有基本系统)安装软件:
设置packagesite
  1. echo "packagesite: http://yoururl/91amd64-default" >> /usr/local/etc/pkg.conf
  2. fetch http://yoururl/90amd64-default/Latest/pkg.txz
  3. tar xf ./pkg.txz -s ",/.*/,,g" "*/pkg-static"
  4. ./pkg-static add ./pkg.txz
复制代码
执行pkg install就可以进行安装了。
  1. pkg install gnome2-lite
复制代码
12,更新ports:
  1. poudriere ports -u
  2. poudriere bulk -f ~/mylist -j 91amd64
复制代码
13,安装更新:
  1. pkg update
复制代码

评分

参与人数 1可用积分 +2 收起 理由
ulovko + 2 赞一个!

查看全部评分

论坛徽章:
0
发表于 2013-05-11 10:21 |显示全部楼层
我的软件列表:
  1. archivers/unrar
  2. x11/xorg-minimal
  3. x11-drivers/xf86-video-ati
  4. x11/gnome2-lite
  5. x11/gdm
  6. x11-fonts/wqy
  7. shells/bash
  8. chinese/fcitx
  9. chinese/fcitx-table-extra
  10. java/openjdk6
  11. #java/netbeans
  12. java/eclipse-devel
  13. devel/subversion
  14. x11-fm/worker
  15. x11-fm/gnome-commander2
  16. ftp/filezilla
  17. www/chromium
  18. www/firefox-i18n
  19. multimedia/mplayer
  20. multimedia/xmms
  21. editors/vim
  22. editors/libreoffice
  23. ftp/axel
  24. devel/git
  25. graphics/gimp
  26. ftp/wget
  27. sysutils/ncdu
  28. sysutils/lsof
  29. sysutils/lxterminal
  30. net/netcat
  31. net/tcpdump
  32. databases/mysql56-server
  33. www/apache24
  34. mail/thunderbird-i18n
  35. security/sudo
  36. emulators/virtualbox-ose
  37. x11-fonts/webfonts
  38. print/tex
  39. print/latex
复制代码

论坛徽章:
0
发表于 2013-05-11 16:04 来自手机 |显示全部楼层
poudriere 確實易上手,讚!

评分

参与人数 1可用积分 +2 收起 理由
ulovko + 2 赞一个!

查看全部评分

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP