Changes

Build Server

1,788 bytes added, 07:51, 1 June 2015
{{Cmd
|git clone "$YOURGITREPO {PORTAGE_GIT_REPO}" portage
|cd portage
|PORTAGE_RSYNC_EXTRA_OPTS{{=}}"--exclude{{=}}/.git--exclude{{=}}/.gitignore" PORTDIR{{=}}"${PWD}" emerge-webrsync
|output=<pre>
Fetching most recent snapshot ...Trying to retrieve 20140819 20140821 snapshot from http://mirror.switch.ch/mirror/gentoo ...Fetching file portage-2014081920140821.tar.xz.md5sum ...Fetching file portage-2014081920140821.tar.xz.gpgsig ...Fetching file portage-2014081920140821.tar.xz ...
Checking digest ...
Getting snapshot timestamp ...
</pre>}}
{{Warning|If you instead get the following instead then there is no newer snapshot available:}} 
{{Cmd
|PORTAGE_RSYNC_EXTRA_OPTS{{=}}"--exclude{{=}}/.git --exclude{{=}}/.gitignore" PORTDIR{{=}}"${PWD}/portage" emerge-webrsync
|output=<pre>
Fetching most recent snapshot ...
|cd portage/
|git add -A
|snapshot_date{{=}}$(date --date{{=}}@$(( $(cut -f 1 -d " " portage/metadata/timestamp.x) - 86400 )) +%Y-%m-%d)|git commit -m "Update portage tree to ${snapshot_date}"
|git tag -a -m "Tagging ${snapshot_date}" ${snapshot_date}
|git push && git push --tags
}}
The subtraction of 86400 (1 day in seconds) above is to account for the fact that the snapshot for a given day is taken at 00:45 UTC on the following day and the timestamp contained in the tarball therefore is one day ahead (see {{Path|/usr/bin/emerge-webrsync}}).
 
The meaning of the tag is therefore: contains at least all changes from that day (and possibly a bit more).
== Chroot Setup ==
=== Setup ===
* Create a staging root directory and extract a stage3 or stage4 tarball
* Mount proc, sys and dev (required for portage to control the tty, determine available storage space, etc.)
* Copy {{Path|/etc/resolv.conf}}
* Checkout the versioned portage tree (since you probably won't have git yet in the tree)
* Enter the chroot
|mount --rbind /sys/ "${stagingRoot}/sys/"
|cp -af /etc/resolv.conf "${stagingRoot}/etc/"
|git clone "${PORTAGE_GIT_REPO}" "${stagingRoot}/usr/portage"
|chmod -R a+rX "${stagingRoot}/usr/portage"
|chroot "${stagingRoot}" /usr/bin/env -i HOME{{=}}"/root" TERM{{=}}"${TERM}" /bin/bash --login
|}}
{{Note|We are deliberately using a special command to enter for entering the chroot to avoid leaking environment variables}} * Install {{Package|app-portage/layman}} and probably {{Package|dev-vcs/git}} to install overlays* You may want to add a mirror configuration if you have local mirrors:{{File|/etc/portage/make.conf||<source lang='bash'>GENTOO_MIRRORS="https://mirror.example.com/public/gentoo"</source>}} * If needed, put the mirror for fetch restricted ebuilds in a local mirror definition:{{File|/etc/portage/mirrors||<pre>local https://mirror.example.com/restricted/gentoo</pre>}} * Add the following to generate binary packages during installation:{{File|/etc/portage/make.conf||<source lang='bash'>FEATURES="${FEATURES} buildpkg cgroup ipc-sandbox network-sandbox parallel-fetch"</source>}} * Make sure that the repository configuration points to your git mirror as well:{{File|/etc/portage/repos.conf/gentoo.conf||<source lang='ini'>[DEFAULT]main-repo = gentoo [gentoo]location = /usr/portagesync-type = gitsync-uri = https://mirror.example.com/versioned/portage.git</source>}}
* Rebuild everything:
{{RootCmd|emerge -e world}}
[[Category:Infrastructure]]
SLB
17
edits