Commit 1a870ed3 authored by Martin Pitt's avatar Martin Pitt
Browse files

Explain patch management in debian/README.source

parent c3c95bf4
To build systemd from source, install “git-buildpackage” and run the following
Building from source
Install “git-buildpackage” and run the following steps:
gbp-clone git+ssh://
cd systemd
......@@ -7,3 +8,70 @@ git-buildpackage
We recommend you use pbuilder to make sure you build in a clean environment:
git-buildpackage --git-pbuilder
Patch handling
The official form of modifications to the upstream source are quilt patches in
debian/patches/, like most Debian packages do. You are welcome to use quilt to
add or modify patches, but you might prefer using a git commit based approach.
gbp-pq provides that by synthesizing a "patch-queue/<branch>" local branch
which represents each quilt patch as git commit. You create this with
gbp-pq import --force
Then you are in the patch-queue branch and can git log, commit, cherry-pick
upstream commits, rebase, etc. there. After you are done, run
gbp-pq export --no-patch-numbers
which will put you back into master and update debian/patches/ (including
series). You need to git add etc. new patches, add a changelog and other
packaging changes, and then debcommit as usual.
Rebasing patches to a new upstream version
gbp-pq's "rebase" command does not work very conveniently as it fails on merge
conflicts. First, ensure you are in the master branch:
git checkout master # in case you aren't already
Now, do one of
(1) To import a new upstream release into the existing master branch for unstable,
gbp-pq import --force
gbp-pq switch # switch back to master from patch-queue/master
git-import-orig [...]
gbp-pq switch # switch to patch-queue/master
git rebase master
(2) To import a new upstream release into a new branch for Debian experimental, do:
git branch experimental
git checkout experimental
editor debian/gbp.conf # set "debian-branch=experimental"
git-import-orig [...]
git branch patch-queue/experimental patch-queue/master
git checkout patch-queue/experimental
git rebase experimental
Now resolve all the conflicts, skip obsolete patches, etc. When you are done, run
gbp-pq export --no-patch-numbers
Cherry-picking upstream patches
You can add the systemd upstream branch as an additional remote to the Debian
packaging branch. Call it "fdo" or "systemd" or similar to avoid confusing it
with the already existing "upstream" branch from git-buildpackage:
git remote add fdo git:://
git fetch fdo -n
Now you can look at the upstream log and cherry-pick patches into the
patch-queue branch:
gbp-pq import --force
git log fdo/master
git cherry-pick 123DEADBEEF
systemd (204-11) UNRELEASED; urgency=medium
* Explain patch management in debian/README.source.
-- Martin Pitt <> Sun, 27 Apr 2014 12:51:55 +0200
systemd (204-10) unstable; urgency=medium
* In the udeb's udev.startup, make sure that /dev/pts exists.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment