Różnice pomiędzy wersjami 7 i 13 (Spinanie 6 wersji)
⇤ ← Wersja 7 z 2015-06-13 20:19:18 →
Rozmiar: 16339
Edytor: wtps0n
Komentarz: co warto zrobić po stronie klienta; doszlifowanie linków zewnętrznych
← Wersja 13 z 2016-08-21 17:47:36 → ⇥
Rozmiar: 30416
Edytor: wtps0n
Komentarz: * aktualizacja 2016.08.21: uruchomienie poudriere w jail; aktualizacje po upgrade serwera; rozbudowa plików konfiguracyjnych
Usunięcia zostały oznaczone w ten sposób. Dodatki zostały oznaczone w ten sposób.
Linia 7: Linia 7:
Ten przepis dotyczy [[UruchomienieJails|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.
Ten przepis dotyczy [[UruchomienieJails|uruchomienia]] własnego jaila z poudriere 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.

= Konfiguracja poudriere jail inside =

== Konfiguracja zfs na potrzeby poudriere w jail ==
{{{#!highlight bash numbers=off
zfs create -o jailed=on -o mountpoint=/usr/jails/pkg.wtp3.local sys/data/u/jails/pkg.wtp3.local
zfs create -o jailed=on -o canmount=on -o mountpoint=/pkg sys/data/pkg
zfs create -p -o poudriere:type=data -o atime=off -o mountpoint=/pkg/data sys/data/pkg/data
zfs create -o exec=on sys/data/pkg/data/.m
zfs create -o compression=off sys/data/pkg/data/cache
zfs create -o compression=lz4 sys/data/pkg/data/logs
zfs create -o compression=off sys/data/pkg/data/packages
zfs create -o compression=off sys/data/pkg/data/wrkdirs
zfs create -p -o compression=lz4 -o atime=off -o mountpoint=/pkg/ports/default sys/data/pkg/ports/default
}}}

== /etc/fstab ==
{{{
# --- JAILS ---------------------------------------------------------------------------
#
sys/data/u/jails/pkg.wtp3.local /usr/jails/pkg.wtp3.local zfs rw,noatime,nfsv4acls 0 0

# --- Dodatki do JAILS -----------------------------------------------------------------
#
sys/data/pkg /usr/jails/pkg.wtp3.local/pkg zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data /usr/jails/pkg.wtp3.local/pkg/data zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data/.m /usr/jails/pkg.wtp3.local/pkg/data/.m zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data/cache /usr/jails/pkg.wtp3.local/pkg/data/cache zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data/logs /usr/jails/pkg.wtp3.local/pkg/data/logs zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data/packages /usr/jails/pkg.wtp3.local/pkg/data/packages zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/data/wrkdirs /usr/jails/pkg.wtp3.local/pkg/data/wrkdirs zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/jails /usr/jails/pkg.wtp3.local/pkg/jails zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/ports /usr/jails/pkg.wtp3.local/pkg/ports zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
sys/data/pkg/ports/default /usr/jails/pkg.wtp3.local/pkg/ports/default zfs rw,noexec,nosuid,noatime,nfsv4acls 0 0
/usr/src /usr/jails/pkg.wtp3.local/usr/src nullfs ro,late 0 0
/usr/obj /usr/jails/pkg.wtp3.local/usr/obj nullfs ro,late 0 0
}}}
Zamontowanie katalogów `/usr/src` oraz `/usr/obj` potrzebne w celu wykonania jaila ze źródeł systemu (własna konfiguracja)

{{{#!wiki comment
Linia 10: Linia 49:
Pierwsze uruchomienie niestety się nie powiodło. Przeszkadza temu kawałek kodu z pliku `/usr/local/share/poudriere/common.sh` wywołujący funkcję '''injail id'''. Na razie obejście poprzez zakomentowanie tego kawałka kodu. Albo jednak uruchomienie poudriere poza jail. Zważywszy, że próba wykonania pierwszego polecenia "bulk" powoduje problemy. Zresztą trzeba patrzeć na [[https://github.com/freebsd/poudriere/issues/101|komentarz|target="_blank"]] autorów programu. Pierwsze uruchomienie niestety się nie powiodło. Przeszkadza temu kawałek kodu z pliku `/usr/local/share/poudriere/common.sh` wywołujący funkcję '''injail id'''. Na razie obejście poprzez zakomentowanie tego kawałka kodu. Albo jednak uruchomienie poudriere poza jail. Zważywszy, że próba wykonania pierwszego polecenia "bulk" powoduje problemy. Zresztą trzeba patrzeć na [[https://github.com/freebsd/poudriere/issues/101|komentarz|target="_blank"]]<<FootNote(Otwiera się w nowym oknie/nowej karcie przeglądarki.)>> autorów programu.
}}}

== Konfiguracja /etc/jail.conf ==
{{{
pkg_wtp3_local {
        host.hostname = "pkg.stenda.jails";
        path = "/usr/jails/pkg.wtp3.local";
        ip4.addr += "10.20.11.32/32";
        ip4.addr += "127.0.0.1/32";
        allow.raw_sockets = 0;
        exec.clean;
        exec.consolelog = "/var/log/jails/pkg.wtp3.local_console.log";
        mount += "procfs /usr/jails/pkg.wtp3.local/proc procfs rw 0 0";
        allow.set_hostname = 0;
        persist;
        children.max=10;
        allow.mount;
        allow.mount.tmpfs;
        allow.mount.devfs;
        allow.mount.procfs;
        allow.mount.zfs;
        allow.mount.nullfs;
        allow.raw_sockets;
        allow.socket_af;
        allow.sysvipc;
        allow.chflags;
        enforce_statfs=1;
        ip6=inherit;
        ip4=inherit;
}
}}}
/!\ '''WAŻNE''' poudriere wymaga, aby interfejs ''lo0'' posiadała adres ''127.0.0.1''. W przeciwnym przypadku nie ma możliwości uruchomienia budowania paczek.

== Utworzenie brakujących katalogów ==
Poprzez konsolę jaila należy utworzyć brakujące katalogi:
{{{#!highlight bash numbers=off
mkdir -p /var/cache/ccache /var/cache/distfiles
}}}

== Załadowanie potrzebnych modułów jądra ==
Ręcznie w celu pierwszego uruchomienia:
{{{#!highlight bash numbers=off
kldload tmpfs
}}}

W pliku `/boot/loader.conf` w celu uruchomienia przy uruchamianiu serwera:
{{{#!highlight bash numbers=off
# TMPFS na potrzeby poudriere
#
tmpfs_load="YES"
}}}

= Instalacja oraz konfiguracja poudriere =
Linia 13: Linia 105:
Sprawdzonym sposobem:
{{{#!shell numbers=off
portupgrade -N pourdriere
{{{#!highlight bash numbers=off
pkg install -y pourdriere
Linia 19: Linia 110:
{{{#!diff numbers=off
--- 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 @@

=== Wersja dla jail ===
{{{#!highlight diff numbers=off
--- poudriere.conf.sample 2016-08-14 01:59:19.000000000 +0200
+++ poudriere.conf 2016-08-17 23:56:33.541134000 +0200
@@ -9,7 +9,7 @@
Linia 27: Linia 120:
+ZPOOL=sys +ZPOOL=sys/data
Linia 31: Linia 124:
 #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 @@
@@ -26,17 +26,16 @@
Linia 43: Linia 128:
-# Suggested: https://download.FreeBSD.org
Linia 47: Linia 133:
 # RESOLV_CONF to a file on your hosts system that will be copied has
@@ -35,13 +35,13 @@
-# 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)
Linia 57: Linia 145:
 # ${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.
@@ -49,8 +48,8 @@ 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 slower since it
-# uses UFS and several abstraction layers.
+# 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.
Linia 68: Linia 155:
-#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 @@
 #MFSSIZE=4G
@@ -71,17 +70,21 @@ USE_TMPFS=yes
Linia 87: Linia 161:
+MAX_MEMORY=3 +MAX_MEMORY=2
Linia 91: Linia 165:
@@ -84,7 +84,7 @@
 # mirror (default: svn0.us-west.FreeBSD.org)
-DISTFILES_CACHE=/usr/ports/distfiles
+DISTFILES_CACHE=/var/cache/distfiles
+
+# If set the ports or source tree marked to use csup method will use the defined mirror
+# Note: csup is deprecated. Use svn instead.
+#CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org

 # If set the ports tree or source tree marked to use svn will use the defined
-# mirror (default: svn.FreeBSD.org)
+# mirror (default: svn0.us-west.FreeBSD.org)
Linia 95: Linia 177:
-#SVN_HOST=svn0.us-west.FreeBSD.org -#SVN_HOST=svn.FreeBSD.org
Linia 100: Linia 182:
@@ -92,7 +92,7 @@ @@ -89,7 +92,7 @@ DISTFILES_CACHE=/usr/ports/distfiles
Linia 109: Linia 191:
@@ -101,16 +101,16 @@ @@ -98,16 +101,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
Linia 119: Linia 201:
+PKG_REPO_SIGNING_KEY=/usr/local/etc/pki/poudriere/poudriere.key +PKG_REPO_SIGNING_KEY=/usr/local/etc/ssl/poudriere/pkg.bsdserwis.com.key
Linia 129: Linia 211:
@@ -120,11 +120,11 @@ @@ -117,11 +120,11 @@ DISTFILES_CACHE=/usr/ports/distfiles
Linia 139: Linia 221:
+PREPARE_PARALLEL_JOBS=2 +PREPARE_PARALLEL_JOBS=1
Linia 143: Linia 225:
@@ -129,10 +132,10 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
+NOLINUX=yes

 # By default poudriere sets FORCE_PACKAGE
 # To disable it (useful when building public packages):
@@ -160,21 +163,21 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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=https://pkg.wtp3.local/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
@@ -233,11 +236,11 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
}}}

=== Wersja bez jail ===
{{{#!highlight diff numbers=off
--- poudriere.conf.sample 2016-07-01 01:50:31.000000000 +0200
+++ poudriere.conf 2016-06-28 02:21:49.699957000 +0200
@@ -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,17 +26,16 @@
 #
 # Also note that every protocols supported by fetch(1) are supported here, even
 # file:///
-# Suggested: https://download.FreeBSD.org
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=http://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
@@ -49,8 +48,8 @@ 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 slower since it
-# uses UFS and several abstraction layers.
+# 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
@@ -77,11 +76,15 @@ USE_TMPFS=yes
 # This allows to share the distfiles between jails and ports tree
 DISTFILES_CACHE=/usr/ports/distfiles

+# If set the ports or source tree marked to use csup method will use the defined mirror
+# Note: csup is deprecated. Use svn instead.
+#CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org
+
 # If set the ports tree or source tree marked to use svn will use the defined
-# mirror (default: svn.FreeBSD.org)
+# 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=svn.FreeBSD.org
+SVN_HOST=svn0.us-east.FreeBSD.org

 # Automatic OPTION change detection
 # When bulk building packages, compare the options from kept packages to
@@ -89,7 +92,7 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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
@@ -98,16 +101,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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/ssl/poudriere/pkg.bsdserwis.com.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.
@@ -117,11 +120,11 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # by specifying the -J flag to bulk/testport.
 #
 # Example to define PARALLEL_JOBS to one single job
-# PARALLEL_JOBS=1
+PARALLEL_JOBS=5

 # 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=1


 # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs
@@ -129,7 +132,7 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
@@ -160,21 +163,21 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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=https://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
@@ -233,11 +236,11 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
Linia 150: Linia 442:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 156: Linia 448:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 163: Linia 455:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 168: Linia 460:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 172: Linia 464:
=== Utworzenie "jail" na postawie źródeł serwera ===
{{{#!highlight bash numbers=off
poudriere jail -c -a amd64 -j 10x64 -m src=/usr/src -f 10x64 -v 10.3-STABLE
}}}

=== Aktualizacja OS na podstawie źródeł ===
{{{#!highlight bash numbers=off
poudriere jail -u -j 10x64
}}}

/!\ Aktualizacja nie podmienia pliku konfiguracyjnego `login.conf` dla danego jail. Dlatego też konieczne jest aktualizacja pliku "''ręcznie''", aby budowane pakiety były poprawnie oznaczone
{{{
default:\
        :passwd_format=sha512:\
        :copyright=/etc/COPYRIGHT:\
        :welcome=/etc/motd:\
        :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,UNAME_r=10.3-STABLE,UNAME_v=FreeBSD 10.3-STABLE,OSVERSION=1003503:\
[...]
}}}

Dodatkowo może być konieczna modyfikacja pliku konfiguracyjnego samego `poudriere`:
{{{#!highlight bash numbers=off
echo "10.3-STABLE" > /usr/local/etc/poudriere.d/jails/10x64/version
}}}
Linia 173: Linia 490:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 178: Linia 495:
{{{#!bsdmake numbers=off {{{#!highlight bsdmake numbers=off
Linia 237: Linia 554:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 242: Linia 559:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 323: Linia 640:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 328: Linia 645:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 333: Linia 650:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 340: Linia 657:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 348: Linia 665:
{{{ {{{#!highlight apache numbers=off
Linia 365: Linia 682:
Po pierwsze trzeba przegrać poudriere.crt na serwery, które mają korzystać z tego repozytorium. Forma dowolna, aby bezpieczna :) Po pierwsze trzeba przegrać poudriere.crt na serwery, które mają korzystać z tego repozytorium:
{{{#!highlight bash numbers=off
mkdir -p /usr/local/etc/ssl/certs/
fetch http://ca.bsdserwis.com/pkg.bsdserwis.com.crt -o /usr/local/etc/ssl/certs/pkg.bsdserwis.com.crt
}}}
Linia 368: Linia 689:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 377: Linia 698:
  url: "http://pkg.bsdserwis.com/a1amd64-default",   url: "http://pkg.bsdserwis.com/10x64-default",
Linia 386: Linia 707:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 392: Linia 713:
{{{#!shell numbers=off {{{#!highlight bash numbers=off
Linia 402: Linia 723:
{{{#!diff numbers=off {{{#!highlight diff numbers=off
Linia 530: Linia 851:
= Jak poprawić zawartość jail dla poudriere =
Zgodnie z dokumentacją `poudriere` montując jaila korzysta ze snapshota o nazwie ''clean'' dla danego jaila. Może być w tym pomocne polecenie (skrypt) `snapshot`:
{{{#!highlight bash numbers=off
snapshot list | grep poudriere
/opt/poudriere/jails/93amd64 777MB 0.0% 0KB 0.0% clean
/opt/poudriere/jails/a1amd64 881MB 0.1% 140KB 0.0% clean
/opt/poudriere/jails/10x64 704MB 0.0% 0KB 0.0% clean
}}}

Zatem po modyfikacji jaila (np. ręcznym dograniu bibliotek związanych z libmilter) należy wykonać następujące polecenia:
{{{#!highlight bash numbers=off
zfs destroy tank/poudriere/jails/10x64@clean
zfs snapshot tank/poudriere/jails/10x64@clean
}}}

Potem już będzie poprawnie działać `poudriere bulk`.
Linia 531: Linia 869:
 * [[http://www.neant.ro/2013/03/building-a-package-repository-for-freebsd-with-poudriere-and-pkgng/||target=_blank]]^Otwiera się w nowym oknie/nowej karcie^
 * [[http://www.bsdnow.tv/tutorials/poudriere||target=_blank]]^Otwiera się w nowym oknie/nowej karcie^
 * [[http://savagedlight.me/2014/03/09/freebsd-package-builder-with-poudriere/||target=_blank]]^Otwiera się w nowym oknie/nowej karcie^
 * [[http://www.neant.ro/2013/03/building-a-package-repository-for-freebsd-with-poudriere-and-pkgng/||target=_blank]]<<FootNote(Otwiera się w nowym oknie/nowej karcie przeglądarki.)>>
 * [[http://www.bsdnow.tv/tutorials/poudriere||target=_blank]]<<FootNote(Otwiera się w nowym oknie/nowej karcie przeglądarki.)>>
 * [[http://savagedlight.me/2014/03/09/freebsd-package-builder-with-poudriere/||target=_blank]]<<FootNote(Otwiera się w nowym oknie/nowej karcie przeglądarki.)>>
Linia 536: Linia 874:
{i} (c) 2004 - 2015 BSD Serwis Krzysztof Stryjek. Wszelkie uwagi proszę zgłaszać do administratora wiki. {i} <<GetVal(SlownikNewBsd,adm-podpis)>>
----


Jak korzystać z poudriere

Ten przepis dotyczy uruchomienia własnego jaila z poudriere 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.

Konfiguracja poudriere jail inside

Konfiguracja zfs na potrzeby poudriere w jail

zfs create -o jailed=on  -o mountpoint=/usr/jails/pkg.wtp3.local sys/data/u/jails/pkg.wtp3.local
zfs create -o jailed=on -o canmount=on -o mountpoint=/pkg sys/data/pkg
zfs create -p -o poudriere:type=data -o atime=off -o mountpoint=/pkg/data sys/data/pkg/data
zfs create -o exec=on sys/data/pkg/data/.m
zfs create -o compression=off sys/data/pkg/data/cache
zfs create -o compression=lz4 sys/data/pkg/data/logs
zfs create -o compression=off sys/data/pkg/data/packages
zfs create -o compression=off sys/data/pkg/data/wrkdirs
zfs create -p -o compression=lz4 -o atime=off -o mountpoint=/pkg/ports/default sys/data/pkg/ports/default

/etc/fstab

# --- JAILS ---------------------------------------------------------------------------
#
sys/data/u/jails/pkg.wtp3.local /usr/jails/pkg.wtp3.local zfs   rw,noatime,nfsv4acls    0 0

# --- Dodatki do JAILS -----------------------------------------------------------------
#
sys/data/pkg                    /usr/jails/pkg.wtp3.local/pkg           zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data               /usr/jails/pkg.wtp3.local/pkg/data      zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data/.m            /usr/jails/pkg.wtp3.local/pkg/data/.m   zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data/cache         /usr/jails/pkg.wtp3.local/pkg/data/cache zfs    rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data/logs          /usr/jails/pkg.wtp3.local/pkg/data/logs zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data/packages      /usr/jails/pkg.wtp3.local/pkg/data/packages zfs rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/data/wrkdirs       /usr/jails/pkg.wtp3.local/pkg/data/wrkdirs zfs  rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/jails              /usr/jails/pkg.wtp3.local/pkg/jails     zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/ports              /usr/jails/pkg.wtp3.local/pkg/ports     zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
sys/data/pkg/ports/default      /usr/jails/pkg.wtp3.local/pkg/ports/default zfs rw,noexec,nosuid,noatime,nfsv4acls      0 0
/usr/src                        /usr/jails/pkg.wtp3.local/usr/src               nullfs  ro,late                         0 0
/usr/obj                        /usr/jails/pkg.wtp3.local/usr/obj               nullfs  ro,late                         0 0

Zamontowanie katalogów /usr/src oraz /usr/obj potrzebne w celu wykonania jaila ze źródeł systemu (własna konfiguracja)

Konfiguracja /etc/jail.conf

pkg_wtp3_local {
        host.hostname = "pkg.stenda.jails";
        path = "/usr/jails/pkg.wtp3.local";
        ip4.addr += "10.20.11.32/32";
        ip4.addr += "127.0.0.1/32";
        allow.raw_sockets = 0;
        exec.clean;
        exec.consolelog = "/var/log/jails/pkg.wtp3.local_console.log";
        mount +=  "procfs /usr/jails/pkg.wtp3.local/proc procfs rw 0 0";
        allow.set_hostname = 0;
        persist;
        children.max=10;
        allow.mount;
        allow.mount.tmpfs;
        allow.mount.devfs;
        allow.mount.procfs;
        allow.mount.zfs;
        allow.mount.nullfs;
        allow.raw_sockets;
        allow.socket_af;
        allow.sysvipc;
        allow.chflags;
        enforce_statfs=1;
        ip6=inherit;
        ip4=inherit;
}

/!\ WAŻNE poudriere wymaga, aby interfejs lo0 posiadała adres 127.0.0.1. W przeciwnym przypadku nie ma możliwości uruchomienia budowania paczek.

Utworzenie brakujących katalogów

Poprzez konsolę jaila należy utworzyć brakujące katalogi:

mkdir -p /var/cache/ccache /var/cache/distfiles

Załadowanie potrzebnych modułów jądra

Ręcznie w celu pierwszego uruchomienia:

kldload tmpfs

W pliku /boot/loader.conf w celu uruchomienia przy uruchamianiu serwera:

# TMPFS na potrzeby poudriere
#
tmpfs_load="YES"

Instalacja oraz konfiguracja poudriere

Zainstalowanie poudriere

pkg install -y pourdriere

Plik konfiguracyjny

Wersja dla jail

--- poudriere.conf.sample       2016-08-14 01:59:19.000000000 +0200
+++ poudriere.conf      2016-08-17 23:56:33.541134000 +0200
@@ -9,7 +9,7 @@
 # You need at least 7GB of free space in this pool to have a working
 # poudriere.
 #
-#ZPOOL=tank
+ZPOOL=sys/data

 ### NO ZFS
 # To not use ZFS, define NO_ZFS=yes
@@ -26,17 +26,16 @@
 #
 # Also note that every protocols supported by fetch(1) are supported here, even
 # file:///
-# Suggested: https://download.FreeBSD.org
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=http://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=/pkg

 # The directory where the jail will store the packages and logs
 # by default a zfs filesystem will be created and set to
@@ -49,8 +48,8 @@ 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 slower since it
-# uses UFS and several abstraction layers.
+# 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
@@ -71,17 +70,21 @@ USE_TMPFS=yes

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

 # If set the given directory will be used for the distfiles
 # This allows to share the distfiles between jails and ports tree
-DISTFILES_CACHE=/usr/ports/distfiles
+DISTFILES_CACHE=/var/cache/distfiles
+
+# If set the ports or source tree marked to use csup method will use the defined mirror
+# Note: csup is deprecated. Use svn instead.
+#CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org

 # If set the ports tree or source tree marked to use svn will use the defined
-# mirror (default: svn.FreeBSD.org)
+# 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=svn.FreeBSD.org
+SVN_HOST=svn0.us-east.FreeBSD.org

 # Automatic OPTION change detection
 # When bulk building packages, compare the options from kept packages to
@@ -89,7 +92,7 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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
@@ -98,16 +101,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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/ssl/poudriere/pkg.bsdserwis.com.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.
@@ -117,11 +120,11 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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=1


 # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs
@@ -129,10 +132,10 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
+NOLINUX=yes

 # By default poudriere sets FORCE_PACKAGE
 # To disable it (useful when building public packages):
@@ -160,21 +163,21 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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=https://pkg.wtp3.local/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
@@ -233,11 +236,11 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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

Wersja bez jail

--- poudriere.conf.sample       2016-07-01 01:50:31.000000000 +0200
+++ poudriere.conf      2016-06-28 02:21:49.699957000 +0200
@@ -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,17 +26,16 @@
 #
 # Also note that every protocols supported by fetch(1) are supported here, even
 # file:///
-# Suggested: https://download.FreeBSD.org
-FREEBSD_HOST=_PROTO_://_CHANGE_THIS_
+FREEBSD_HOST=http://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
@@ -49,8 +48,8 @@ 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 slower since it
-# uses UFS and several abstraction layers.
+# 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
@@ -77,11 +76,15 @@ USE_TMPFS=yes
 # This allows to share the distfiles between jails and ports tree
 DISTFILES_CACHE=/usr/ports/distfiles

+# If set the ports or source tree marked to use csup method will use the defined mirror
+# Note: csup is deprecated. Use svn instead.
+#CSUP_HOST=cvsup._CHANGE_THIS_.freebsd.org
+
 # If set the ports tree or source tree marked to use svn will use the defined
-# mirror (default: svn.FreeBSD.org)
+# 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=svn.FreeBSD.org
+SVN_HOST=svn0.us-east.FreeBSD.org

 # Automatic OPTION change detection
 # When bulk building packages, compare the options from kept packages to
@@ -89,7 +92,7 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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
@@ -98,16 +101,16 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # 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/ssl/poudriere/pkg.bsdserwis.com.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.
@@ -117,11 +120,11 @@ DISTFILES_CACHE=/usr/ports/distfiles
 # by specifying the -J flag to bulk/testport.
 #
 # Example to define PARALLEL_JOBS to one single job
-# PARALLEL_JOBS=1
+PARALLEL_JOBS=5

 # 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=1


 # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs
@@ -129,7 +132,7 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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
@@ -160,21 +163,21 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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=https://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
@@ -233,11 +236,11 @@ DISTFILES_CACHE=/usr/ports/distfiles

 # 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

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 "jail" na postawie źródeł serwera

poudriere jail -c -a amd64 -j 10x64 -m src=/usr/src -f 10x64 -v 10.3-STABLE

Aktualizacja OS na podstawie źródeł

poudriere jail -u -j 10x64

/!\ Aktualizacja nie podmienia pliku konfiguracyjnego login.conf dla danego jail. Dlatego też konieczne jest aktualizacja pliku "ręcznie", aby budowane pakiety były poprawnie oznaczone

default:\
        :passwd_format=sha512:\
        :copyright=/etc/COPYRIGHT:\
        :welcome=/etc/motd:\
        :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,UNAME_r=10.3-STABLE,UNAME_v=FreeBSD 10.3-STABLE,OSVERSION=1003503:\
[...]

Dodatkowo może być konieczna modyfikacja pliku konfiguracyjnego samego poudriere:

echo "10.3-STABLE" > /usr/local/etc/poudriere.d/jails/10x64/version

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.d/93x64.pkglist

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

pkg info -o -aq | sort -d

i w wyniku powstanie plik:

ports-mgmt/dialog4ports
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
mail/ssmtp
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.d/93x64.pkglist

Budowanie pakietów

poudriere bulk -f /usr/local/etc/poudriere.d/93x64.pkglist -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. W przypadku konfiguracji apache wygląda to następująco:

<Directory /opt/poudriere/data/packages>
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

<VirtualHost 188.165.252.223:80 2001:41d0:2:c7df::1:80>
    ServerName pkg.bsdserwis.com
    DocumentRoot /opt/poudriere/data/packages
    ErrorLog /var/log/httpd/pkg.bsdserwis.com/error.log
    CustomLog /var/log/httpd/pkg.bsdserwis.com/access.log combined
</VirtualHost>

Konfiguracja klienta

Przegranie klucza

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

mkdir -p /usr/local/etc/ssl/certs/
fetch http://ca.bsdserwis.com/pkg.bsdserwis.com.crt -o /usr/local/etc/ssl/certs/pkg.bsdserwis.com.crt

Konfiguracja repozytorium

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

vi /usr/local/etc/pkg/repos/pkg.bsdserwis.com.conf

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

pkg.bsdserwis.com: {
  url: "http://pkg.bsdserwis.com/10x64-default",
  mirror_type: "http",
  signature_type: "pubkey",
  pubkey: "/usr/local/etc/ssl/certs/pkg.bsdserwis.com.crt",
  enabled: yes
}

Dodatkowo można wyłączyć repozytorium globalne:

echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf

Aktualizacja ustawień pkg

Już pozostaje tylko wykonać polecenie:

# poniższą linijkę warto dopisać do zadania /etc/daily.local
#
pkg update -q && pkg version -vRL=

Instalowanie wybranych pakietów

Co warto zainstalować w środowisku jail to już jest opisane w instrukcji uruchamiania środowiska jail.

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

Jak poprawić zawartość jail dla poudriere

Zgodnie z dokumentacją poudriere montując jaila korzysta ze snapshota o nazwie clean dla danego jaila. Może być w tym pomocne polecenie (skrypt) snapshot:

snapshot list | grep poudriere
/opt/poudriere/jails/93amd64    777MB    0.0%      0KB    0.0%  clean
/opt/poudriere/jails/a1amd64    881MB    0.1%    140KB    0.0%  clean
/opt/poudriere/jails/10x64    704MB    0.0%      0KB    0.0%  clean

Zatem po modyfikacji jaila (np. ręcznym dograniu bibliotek związanych z libmilter) należy wykonać następujące polecenia:

zfs destroy tank/poudriere/jails/10x64@clean
zfs snapshot tank/poudriere/jails/10x64@clean

Potem już będzie poprawnie działać poudriere bulk.

Źródła w sieci internet


{i} (c) 2004 - 2026 BSD Serwis Krzysztof Stryjek. W przypadku błędów, poprawek proszę kontaktować się z administratorem wiki.


  1. Otwiera się w nowym oknie/nowej karcie przeglądarki. (1 2 3 4)

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