Archive:Build Service adding build targets

Jump to: navigation, search
Icon-obsolete.png This article about the Open Build Service is obsolete!
You can find up to date information on

Adding build target repositories (distributions) to OBS

The easiest way to setup base distros as build targets in your Open Build Service instance is to "re-use" the distros publicly accessible on See Configuration of OBS Appliance for more information.

If does not offer the distro build target you require or your build system is not connected to the Internet, you can manually add the required distro as a build repository.

The following is a simple step-by-step process to manually add local build target repositories to an instance of the Open Build Service. It requires setting up a project for the new build target, and adding some files to the filesystem of the server that is hosting the OBS instance. Admin access to the server hosting the OBS instance is required.

In this example the build target "project" is named "my-distro" and the architectures setup are i586 and x86_64. File paths shown assumes a standard setup with the server backend installed under /srv/obs and frontend installed under /srv/www/obs.

1) Create the build target project.

Command line:

# osc meta -e prj my-distro

Web UI:

  • Create a new project with the name "my-distro".
  • Edit the project meta data:
    • [MENU] -> Advanced -> Raw Config1

In the project meta data add a repository:

 <repository name="standard">

<build> and <publish> can be set to "disable".

After the project setup, you should now have a file called my-distro.xml under the /srv/obs/projects directory of the build service server. You should also have the following directory structure under /srv/obs/build


1(OBS v2.3 or later: Advanced -> Meta)

2) Copy distro packages to the build repo.

On the build service server filesystem make ":full" subdirectories.

# mkdir /srv/obs/build/my-distro/standard/{i586,x86_64}/:full

Under these :full sub-directories, copy all the packages from the distro for the given arch required for building packages. Make sure all new files/directories have proper ownership/permissions for access by the obs server software (standard setup requires: user=obsrun, group=obsrun).

# cp <path-to-my-distro-i586-packages>/*.rpm /srv/obs/build/my-distro/standard/i586/:full/
# cp <path-to-my-distro-x86_64-packa
Icon-obsolete.png This article about the Open Build Service is obsolete!
You can find up to date information on {{{1}}}

ges>/*.rpm /srv/obs/build/my-distro/standard/x86_64/:full/

# chown -R obsrun.obsrun /srv/obs/build/my-distro

3) Add build config file

The build target project requires a project config file that is used by the build service backend to properly setup build environments. Example configs come with the build.rpm package. Check in /usr/lib/build/configs of the latest build.rpm package for a config that best matches your distro. Copy this file to the projects directory renaming it to my-distro.conf.

# osc -A meta prjconf MY_PROJECT -F /usr/lib/build/configs/debian.conf

If there is not a config file available for your target distro, pick the closest match and you might have to edit it to get things building properly.

Or take the project config of a matching build target on

Example: Project Config for SUSE Linux Enterprise 11:

Command Line:

# osc -A meta prjconf SUSE:SLE-11 > my-distro.conf

Web UI: On browse to Projects > SUSE:SLE-11 > [MENU] -> Advanced -> Project Config

4) Restart obs scheduler

The scheduler will scan and setup the new build repository on restart.

# obs_admin --rescan-repository MY_PROJECT MY_REPO ARCHITECTURE

5) Add a button to the "Add Repository" web ui to

For convienence you can add a repo button to the Add Repository page of your OBS frontend.

  • Pre-OBS 2.0: edit /srv/www/obs/webui/config/repositories.rb
  • OBS 2.0: edit /srv/www/obs/api/files/distributions.xml
  • OBS 2.6 and later: Edit the project meta data:
 [MENU] -> Advanced -> Meta


 <repository name="SLE_11_SP4">
   <path project="SUSE:SLE-11:SP4" repository="standard"/>

6) Build

You can now add the "my-distro" target as a repository in your projects.