Difference between revisions of "Build Server"
From stoney cloud
[unchecked revision] | [unchecked revision] |
Line 17: | Line 17: | ||
=== Setup === | === Setup === | ||
− | Create a staging root and extract a stage3 or stage4 tarball | + | * Create a staging root 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}} | ||
+ | * Enter the chroot | ||
{{RootCmd | {{RootCmd | ||
− | | | + | |stagingRoot{{=}}/var/staging/staging-base |
− | |tar -xjpf /var/tmp/your-stage4.tbz2 -C / | + | |mkdir -p "${stagingRoot}" |
+ | |tar -xjpf /var/tmp/your-stage4.tbz2 -C "${stagingRoot}" | ||
+ | |mount -t proc none "${stagingRoot}/proc" | ||
+ | |mount --rbind /dev/ "${stagingRoot}/dev/" | ||
+ | |mount --rbind /sys/ "${stagingRoot}/sys/" | ||
+ | |cp -af /etc/resolv.conf "${stagingRoot}/etc/" | ||
+ | |chroot "${stagingRoot}" /usr/bin/env -i HOME{{=}}"/root" TERM{{=}}"${TERM}" /bin/bash --login | ||
+ | |}} | ||
+ | |||
+ | {{Note|We are deliberately using a special command to enter the chroot to avoid leaking environment variables}} | ||
+ | |||
[[Category:Infrastructure]] | [[Category:Infrastructure]] |
Revision as of 09:27, 22 August 2014
Overview
- Base chroot environment for the creation of most binary packages which will be copied to the Binary Package Server.
- Packages, which don't need to be built, for example Oracle's Java SE Development Kit (JDK), can be fetched from the Mirror Server.
- Software stacks built upon specialized binary packages, require their own chroot environment. If possible, avoid this.
- For reproducibility, Portage and Profiles are frozen with the help of version control system (git in our case). This is only done on the Mirror Server.
- When building packages in a chroot environment, the portage and overlay versions need to set.
Chroot Setup
Preparation
At least the following is required beforehand to ensure reproducible building:
- a versioned portage tree
- versioned overlays (if any)
Setup
- Create a staging root 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 /etc/resolv.conf
- Enter the chroot
Note
We are deliberately using a special command to enter the chroot to avoid leaking environment variables