Differences between revisions 2 and 3
Revision 2 as of 2013-05-04 19:38:13
Size: 3325
Comment: Link apt-cacher-ng
Revision 3 as of 2013-05-05 06:55:13
Size: 3396
Comment: Fixing some typo and spelling
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
You can create base images for all processor family (mostly i386 or amd64) and platforms (mostly Lenny, Squeeze, Testing/SID, Ubuntu xxx, ...) that your hardware can run on. You can create base images for all architectures (mostly i386 or amd64) and distribution (mostly Lenny, Squeeze, Testing/SID, Ubuntu xxx, ...) that your hardware can run on.
Line 11: Line 11:
The easiest usage is to call no further options, that will create a Testing/SID build environment with the processor family you are currently running on (if you are using i386, the environment will also be created for i386): The easiest usage is to call no further options, that will create a Testing/SID build environment with the architecture you are currently running on (if you are using i386, the environment will also be created for i386):
Line 17: Line 17:
=== Creating other Platforms === === Creating other Architecture ===
Line 25: Line 25:
Mainly package creating is done in the Testing release, sometime you want to create packages for the stable release, so you to tell this also while git-pbuilder is creating the environment. If you want to build for the Squeeze release then you have to git-pbuilder like this: Mainly package creating is done in the Testing distribution, sometimes you want to create packages for the stable or old-stable release, so you have to tell this also while `git-pbuilder` is creating the environment. If you want to build for the Squeeze distribution then you have to call `git-pbuilder` like this:
Line 32: Line 32:
If you use git-builder (or git-buildpackage) very offen it's better to use a local mirror to save downloadtime and reduce traffic. If you have set up a local Apt proxy the you can tell git-pbuilder to use it. Let's say you want to create a base image for Squeeze and i386 with a caching proxy with the IP 192.168.110.4 on port 3142 (like [[DebianEdu/HowTo/NetinstallWithAptCacher|apt-cacher-ng]]), so it's a combination of all variants from above: If you use `git-builder` (or `git-buildpackage`) very offen it's better to use a local mirror to save downloadtime and reduce traffic. If you have set up a local Apt proxy the you can tell `git-pbuilder` to use it. Let's say you want to create a base image for Squeeze and architecture i386 with a caching proxy with the IP 192.168.110.4 on port 3142 (like [[DebianEdu/HowTo/NetinstallWithAptCacher|apt-cacher-ng]]), so it's a combination of all variants from above:
Line 44: Line 44:
The update for the possible other distros or platforms is similar like the creation of it. Update the Squeeze environmnt for the same platform you are currently running on would be: The update for the possible other distributions or architectures is similar like the creation of it. Update the Squeeze environmnt for the same architecture you are currently running on would be:

This is a tutorial for git-builder. See also cowbuilder. git-pbuilder is part of the package git-buildpackage and the usage is very similar to cowbuilder. git-builder needs sudo rights!

Usage

Initialization and Variants

You can create base images for all architectures (mostly i386 or amd64) and distribution (mostly Lenny, Squeeze, Testing/SID, Ubuntu xxx, ...) that your hardware can run on.

Normal Usage

The easiest usage is to call no further options, that will create a Testing/SID build environment with the architecture you are currently running on (if you are using i386, the environment will also be created for i386):

git-pbuilder create

The base build image is created in /var/cache/pbuilder/base.cow/

Creating other Architecture

If you want explicitly create a environment for i386 (and running on amd64) you have to tell that git-pbuilder:

ARCH=amd64 git-pbuilder create

The base build image is created in /var/cache/pbuilder/base-sid-amd64.cow/

Creating Packages for other Distros

Mainly package creating is done in the Testing distribution, sometimes you want to create packages for the stable or old-stable release, so you have to tell this also while git-pbuilder is creating the environment. If you want to build for the Squeeze distribution then you have to call git-pbuilder like this:

DIST=squeeze git-pbuilder create

The base image is created in /var/cache/pbuilder/base-squeeze-[your-platform].cow/

Using a Mirror

If you use git-builder (or git-buildpackage) very offen it's better to use a local mirror to save downloadtime and reduce traffic. If you have set up a local Apt proxy the you can tell git-pbuilder to use it. Let's say you want to create a base image for Squeeze and architecture i386 with a caching proxy with the IP 192.168.110.4 on port 3142 (like apt-cacher-ng), so it's a combination of all variants from above:

DIST=squeeze ARCH=amd64 git-pbuilder create --mirror=http://192.168.110.4:3142/ftp.de.debian.org/debian

The base build image is created in /var/cache/pbuilder/base-squeeze-amd64.cow/

Updating

If the creation of your build environment is quite older you have to update it before you can use it. To update the base image just run:

git-pbuilder update

The update for the possible other distributions or architectures is similar like the creation of it. Update the Squeeze environmnt for the same architecture you are currently running on would be:

DIST=squeeze git-pbuilder update

or for Squeeze on i386

DIST=squeeze ARCH=i368 git-pbuilder update

If you have used a mirror while creating the base images it will be used! So remember that if you have various networks you working, the update will fail if the mirror isn't reachable.

Tips

Troubleshooting

Slow copying and removing of the COW directory

What cowbuilder does is:

cp -al /var/cache/pbuilder/base.cow /tmp/new
rm -rf /tmp/[new]

Of course cowbuilder uses a different location than /tmp/[new]. You need to optimize those 2 commands on your computer. They should take around 0.2s each. If not, try to use the ext3 filesystem, for more details, see our benchmarks.