Różnice pomiędzy wersjami 1 i 2
⇤ ← Wersja 1 z 2015-05-30 22:09:33 →
Rozmiar: 14353
Edytor: wtps0n
Komentarz: *** KREACJA ***
← Wersja 2 z 2015-05-31 10:32:43 → ⇥
Rozmiar: 14530
Edytor: wtps0n
Komentarz: + linki do sieci
Usunięcia zostały oznaczone w ten sposób. Dodatki zostały oznaczone w ten sposób.
Linia 501: Linia 501:
= Źródła w sieci internet =
 * http://www.neant.ro/2013/03/building-a-package-repository-for-freebsd-with-poudriere-and-pkgng/
 * http://www.bsdnow.tv/tutorials/poudriere


Jak korzystać z poudriere

Ten przepis dotyczy uruchomienia własnego jaila z podriere w celu budowania paczek dla pozostałych jail-i. Niemniej niektóre ogólne rzeczy są przydatne również dla serwerów bez jail-i.

Zainstalowanie poudriere

Sprawdzonym sposobem:

portupgrade -N pourdriere

Plik konfiguracyjny

--- poudriere.conf.sample       2015-04-11 04:30:18.000000000 +0000
+++ poudriere.conf      2015-05-30 21:01:21.732467588 +0000
@@ -9,14 +9,14 @@
 # You need at least 7GB of free space in this pool to have a working
 # poudriere.
 #
-#ZPOOL=tank
+ZPOOL=sys

 ### NO ZFS
 # To not use ZFS, define NO_ZFS=yes
 #NO_ZFS=yes

 # root of the poudriere zfs filesystem, by default /poudriere
-# ZROOTFS=/poudriere
+ZROOTFS=/data/pkg

 # the host where to download sets for the jails setup
 # You can specify here a host or an IP
@@ -26,7 +26,7 @@
 #
 # Also note that every protocols supported by fetch(1) are supported here, even
 # file:///
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=ftp://ftp.freebsd.org

 # By default the jails have no /etc/resolv.conf, you will need to set
 # RESOLV_CONF to a file on your hosts system that will be copied has
@@ -35,13 +35,13 @@
 RESOLV_CONF=/etc/resolv.conf

 # The directory where poudriere will store jails and ports
-BASEFS=/usr/local/poudriere
+BASEFS=/pkg

 # 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
+POUDRIERE_DATA=${BASEFS}/data

 # Use portlint to check ports sanity
 USE_PORTLINT=no
@@ -52,7 +52,7 @@
 # more mature and can have its memory usage capped.

 # If set WRKDIRPREFIX will be mdmfs of the given size (mM or gG)
-#MFSSIZE=4G
+MFSSIZE=2G

 # Use tmpfs(5)
 # This can be a space-separated list of options:
@@ -62,7 +62,7 @@
 # all       - Run the entire build in memory, including builder jails.
 # yes       - Only enables tmpfs(5) for wrkdir
 # EXAMPLE: USE_TMPFS="wrkdir data"
-USE_TMPFS=yes
+##USE_TMPFS=yes

 # How much memory to limit tmpfs size to for *each builder* in GiB
 # (default: none)
@@ -70,7 +70,7 @@

 # How much memory to limit jail processes to for *each builder*
 # in GiB (default: none)
-#MAX_MEMORY=8
+MAX_MEMORY=3

 # If set the given directory will be used for the distfiles
 # This allows to share the distfiles between jails and ports tree
@@ -84,7 +84,7 @@
 # mirror (default: svn0.us-west.FreeBSD.org)
 # The full mirror list is available here:
 # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/svn.html#svn-mirrors
-#SVN_HOST=svn0.us-west.FreeBSD.org
+SVN_HOST=svn0.us-east.FreeBSD.org

 # Automatic OPTION change detection
 # When bulk building packages, compare the options from kept packages to
@@ -92,7 +92,7 @@
 # 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=verbose
+CHECK_CHANGED_OPTIONS=yes

 # Automatic Dependency change detection
 # When bulk building packages, compare the dependencies from kept packages to
@@ -101,16 +101,16 @@
 # as DEFAULT_RUBY_VERSION, PERL_VERSION, WITHOUT_X11 that change dependencies
 # for many ports.
 # Valid options: yes, no
-#CHECK_CHANGED_DEPS=yes
+CHECK_CHANGED_DEPS=yes


 # Path to the RSA key to sign the PKGNG repo with. See pkg-repo(8)
-#PKG_REPO_SIGNING_KEY=/etc/ssl/keys/repo.key
+PKG_REPO_SIGNING_KEY=/usr/local/etc/pki/poudriere/poudriere.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
+CCACHE_DIR=/var/cache/ccache
 #

 # parallel build support.
@@ -120,11 +120,11 @@
 # by specifying the -J flag to bulk/testport.
 #
 # Example to define PARALLEL_JOBS to one single job
-# PARALLEL_JOBS=1
+PARALLEL_JOBS=2

 # How many jobs should be used for preparing the build? These tend to
 # be more IO bound and may be worth tweaking. Default: Same as PARALLEL_JOBS
-# PREPARE_PARALLEL_JOBS=1
+PREPARE_PARALLEL_JOBS=2


 # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs

Korzystanie z poudriere

ports

Utworzenie drzewa

poudriere ports -c

aktualizacja drzewa

Trzeba dopisać do zadania w crontabie:

poudriere ports -u

jails (ale dla poudriere, nie globalny dla systemu)

Utworzenie "jail" dla wybranego OS

poudriere jail -c -j 93x64 -v 9.3-RELEASE -a amd64

Aktualizacja wybranego OS

poudriere jail -u -j 91x64

Utworzenie odpowiedniego make.conf dla danego jaila

vi /usr/local/etc/poudriere.d/93x64-make.conf

Trzeba utworzyć na podstawie istniejącego w systemie pliku (a właściwie plików)

CPUTYPE?=       nocona

MASTER_SITE_BACKUP?=    \
        http://ftp.bsdserwis.com/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ \
        http://distcache.ath.pl/${DIST_SUBDIR}/ \
        http://distcache.FreeBSD.org/ports-distfiles/${DIST_SUBDIR}/

# --- domy/slne wersje dla wybranych aplikacji ----------------------------
#
DEFAULT_VERSIONS+=              apache=2.2
DEFAULT_VERSIONS+=              ruby=2.1
DEFAULT_VERSIONS+=              mysql=5.5
DEFAULT_VERSIONS+=              pgsql=9.2
DEFAULT_VERSIONS+=              perl=5.20

# --- opcje globalne dla wszystkich ports ---------------------------------
#
OPTIONS_UNSET+=                 X11

# --- opcje dla poszczeg/olnych ports -------------------------------------
#
security_apg_SET=               CRACKLIB
graphics_ImageMagick-nox11_UNSET=MODULES

# --- u/zycie pkgng -------------------------------------------------------
#
WITH_PKGNG=                     yes
NO_WARNING_PKG_INSTALL_EOL=     yes

# --- ustawienia dotycz/ace wydruk/ow (np. teTeX) -------------------------
#
PAPERSIZE=              a4
A4=                     yes

SVN_UPDATE=             yes
SVN=                    /usr/local/bin/svn

WANT_MYSQL_VER=         55
WITH_MYSQL_VER=         55
WITH_OPENSSL_PORT=      yes
WITH_OPENLDAP_VER=      24
WANT_OPENLDAP_VER=      24
WITH_BDB_VER=           5
WITH_SENDMAIL_BASE=     yes
X11BASE=                ${LOCALBASE}

# This setting to build kernel without -Werror:
WERROR=

# --- uz/ycie CLANG zamiast GCC -----------------------------------------------
#
CC=             clang
CXX=            clang++
CPP=            clang-cpp

Utworzenie listy pakietów do budowania

vi /usr/local/etc/poudriere.list

Która to może powstać na podstawie zainstalowanych pakietów:

pkg info -o -aq | sort -d

i w wyniku powstanie plik:

databases/rrdtool
databases/ruby-bdb
databases/sqlite3
devel/apr1
devel/autoconf
devel/autoconf-wrapper
devel/automake
devel/automake-wrapper
devel/bison
dns/bind-tools
dns/idnkit
dns/ldns
dns/libidn
dns/unbound
editors/vim
ftp/curl
ftp/ncftp3
ftp/wget
graphics/cairo
graphics/graphite2
graphics/png
lang/ocaml
lang/perl5.20
lang/python2
lang/python27
lang/ruby21
misc/help2man
dns/nsd
lang/perl5.20
mail/postfix
net/liboping
net-mgmt/collectd5
net-mgmt/ipcalc
net-mgmt/net-snmp
net/mtr
net/netcat
net/openntpd
net/trafshow
net/unison
net-mgmt/collectd5
security/apg
security/ca_root_nss
security/clamav
security/cracklib
security/ipfmeta
security/libgcrypt
security/libgpg-error
security/libssh2
security/nmap
security/openssh-portable
security/openssl
security/sudo
security/xinetd
shells/bash
sysutils/afio
sysutils/daemontools
sysutils/dmidecode
sysutils/ezjail
sysutils/freebsd-snapshot
sysutils/lsof
sysutils/moreutils
sysutils/screen
sysutils/smartmontools
textproc/expat2
textproc/fex
www/apache22
www/nginx

Nie należy się martwić o zależności - zostaną odpowiednio uwzględnione. Tak więc lista może być o wiele krótsza - zawierać pakiety naprawdę niezbędne.

Wygenerowanie opcji dla każdego z budowanych pakietów

Dla pojedynczego pakietu:

poudriere options security/apg

Albo dla całej listy:

poudriere options -cf /usr/local/etc/poudriere.list

Budowanie pakietów

poudriere bulk -f /usr/local/etc/poudriere.list -j 93x64

Utworzenie własnego repozytorium

Wygenerowanie certyfikatu dla aktualizacji pakietów

mkdir -p /usr/local/etc/pki/poudriere
/usr/local/bin/openssl genrsa -out /usr/local/etc/pki/poudriere/poudriere.key 4096
/usr/local/bin/openssl rsa -in /usr/local/etc/pki/poudriere/poudriere.key -pubout -out /usr/local/etc/pki/poudriere/poudriere.crt

Konfiguracja witryny webowej z repozytorium

Można skorzystać z tego przepisu w celu uruchomienia nginx

Konfiguracja klienta

Przegranie klucza

Po pierwsze trzeba przegrać poudriere.crt na serwery, które mają korzystać z tego repozytorium. Forma dowolna, aby bezpieczna :)

Konfiguracja repozytorium

mkdir -p /usr/local/etc/pkg/repos

vi /usr/local/etc/pkg/repos/poudriere.conf

Zaś zawartość tego pliku jest następująca:

poudriere: {
  url: "http://your-web-server/path/to/repo",
  mirror_type: "http",
  signature_type: "pubkey",
  pubkey: "/usr/local/etc/ssl/certs/pkg.cert",
  enabled: yes
}

Aktualizacja pakietów

Już pozostaje tylko wykonać polecenie:

pkg update

Alternatywny konfig dla pourdiere na serwerze HQ

--- poudriere.conf.sample       2015-05-30 13:39:31.689236000 +0200
+++ poudriere.conf      2015-03-12 11:58:24.910000627 +0100
@@ -9,7 +9,7 @@
 # You need at least 7GB of free space in this pool to have a working
 # poudriere.
 #
-#ZPOOL=tank
+ZPOOL=tank

 ### NO ZFS
 # To not use ZFS, define NO_ZFS=yes
@@ -26,16 +26,16 @@
 #
 # Also note that every protocols supported by fetch(1) are supported here, even
 # file:///
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=ftp://ftp.freebsd.org

 # By default the jails have no /etc/resolv.conf, you will need to set
-# RESOLV_CONF to a file on your hosts system that will be copied has
+# 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=/usr/local/poudriere
+BASEFS=/opt/poudriere

 # The directory where the jail will store the packages and logs
 # by default a zfs filesystem will be created and set to
@@ -84,7 +84,7 @@
 # mirror (default: svn0.us-west.FreeBSD.org)
 # The full mirror list is available here:
 # http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/svn.html#svn-mirrors
-#SVN_HOST=svn0.us-west.FreeBSD.org
+SVN_HOST=svn0.us-east.FreeBSD.org

 # Automatic OPTION change detection
 # When bulk building packages, compare the options from kept packages to
@@ -92,7 +92,7 @@
 # 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=verbose
+CHECK_CHANGED_OPTIONS=yes

 # Automatic Dependency change detection
 # When bulk building packages, compare the dependencies from kept packages to
@@ -101,7 +101,7 @@
 # as DEFAULT_RUBY_VERSION, PERL_VERSION, WITHOUT_X11 that change dependencies
 # for many ports.
 # Valid options: yes, no
-#CHECK_CHANGED_DEPS=yes
+CHECK_CHANGED_DEPS=yes


 # Path to the RSA key to sign the PKGNG repo with. See pkg-repo(8)
@@ -110,7 +110,7 @@

 # 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
+CCACHE_DIR=/var/cache/ccache
 #

 # parallel build support.
@@ -120,7 +120,7 @@
 # by specifying the -J flag to bulk/testport.
 #
 # Example to define PARALLEL_JOBS to one single job
-# PARALLEL_JOBS=1
+#PARALLEL_JOBS=1

 # How many jobs should be used for preparing the build? These tend to
 # be more IO bound and may be worth tweaking. Default: Same as PARALLEL_JOBS
@@ -132,7 +132,7 @@

 # Choose the default format for the workdir packing: could be tar,tgz,tbz,txz
 # default is tbz
-# WRKDIR_ARCHIVE_FORMAT=tbz
+WRKDIR_ARCHIVE_FORMAT=tar

 # Disable linux support
 # NOLINUX=yes
@@ -163,21 +163,21 @@

 # Timestamp every line of build logs
 # Default: no
-#TIMESTAMP_LOGS=no
+TIMESTAMP_LOGS=yes

 # URL where your POUDRIERE_DATA/logs are hosted
 # This will be used for giving URL hints to the HTML output when
 # scheduling and starting builds
-#URL_BASE=http://yourdomain.com/poudriere/
+URL_BASE=http://rtm.bsdserwis.com/poudriere/


 # This defines the max time (in seconds) that a command may run for a build
 # before it is killed for taking too long. Default: 86400
-#MAX_EXECUTION_TIME=86400
+MAX_EXECUTION_TIME=86400

 # This defines the time (in seconds) before a command is considered to
 # be in a runaway state for having no output on stdout. Default: 7200
-#NOHANG_TIME=7200
+NOHANG_TIME=7200


 # The repository is updated atomically if set yes. This leaves the
@@ -236,11 +236,11 @@

 # Define format for build duration times
 # Default: %H:%M:%S
-#DURATION_FORMAT="%H:%M:%S"
+DURATION_FORMAT="%H:%M:%S"

 # Use colors when in a TTY
 # Default: yes
-#USE_COLORS=yes
+USE_COLORS=yes

 # Only build what is requested. Do not rebuild build deps if nothing requested
 # depends on them. This can create an inconsistent repository if you often

Źródła w sieci internet


{i} (c) 2004 - 2015 BSD Serwis Krzysztof Stryjek. Wszelkie uwagi proszę zgłaszać do administratora wiki.

PoudriereBinaryPkg (ostatnio edytowane 2019-02-09 20:03:45 przez wtps0n)