Custom Build Ubuntu Kernel for PPA Upload

When working with the kernel git tree the regular method of building a source package for upload to a PPA isn't suitable. Additionally, the usual debian/rules can't be used either. Instead, Ubuntu provides a script for preparing a kernel source package for uploading to PPA.

Git Workflow

This example is taken from my work on bug #191137 and, although not essential for the PPA issue, shows my workflow that leads to uploading the kernel source to the PPA.

$ pwd

# start topic for this bug
$ git-branch lp/191137
# work on bug
# ...

# commit changes of work-in-progress on this branch
$ git-commit -asm "LP #191137 - description of changes"

# more work ...

# identified upstream commit that solves the issue, prepare to cherry-pick
# if the upstream repository isn't already set up as a remote, do it now:
$ git-remote add linux-2.6  git://

# fetch the latest upstream changes into a remote tracking branch
$ git-fetch linux-2.6

# cherry-pick the commit(s) needed, (-x references the original commit hash)
$ git-cherry-pick -x 3e71a87
$ git-cherry-pick -x b3b233c

# Create a 'no-change' commit recording the fix using the Ubuntu patch template
# Note: save the file and *close* gedit when finished editing
$ export GIT_EDITOR=gedit
$ git commit --allow-empty -st debian/commit-templates/patch

Locate the prepare-personal-ppa-source Script

$ ls debian/scripts/misc/prepare*

If the script hasn't been included in the Ubuntu kernel git repository you are working with as yet, download prepare-personal-ppa-source from this article and put it in a directory outside the git working directory (otherwise it will be deleted by the git-checkout -f statement - unless you also git-commit it into your repository).

$ wget
# install the script somewhere and make it executable
$ chmod a+x prepare-personal-ppa-source
$ mv prepare-personal-ppa-source ~/scripts/

Build the Source Package

Setup any required environment variables:

$ export DEBEMAIL=""

Run the script (in this example I'm using the script included in my git repository):

$ debian/scripts/misc/prepare-personal-ppa-source

If everything goes okay you'll see the mass of messages as usual when dpkg-buildpackage is executed. At the end of it all the script will report:

Source package "linux_2.6.24-19.35~ppa1_source.changes" is available in the parent directory
Exit code: 0

You'll find the files in the parent directory:

ls -1 ../linux_2.6.24*

Upload Kernel Package to Personal PPA

Configure dput

Configure user-specific upload target in ~/

$ cat ~/ 
fqdn =
method = ftp
incoming = ~intuitivenipple/ubuntu/
login = anonymous
allow_unsigned_uploads = 0

Note: All PPA uploads must be signed with the digital GPG key registered in the matching Launchpad account.


$ dput intuitivenipple-ppa ../linux_2.6.24-19.35~ppa1_source.changes 
Checking Signature on .changes
gpg: Signature made Sat 12 Jul 2008 19:43:40 BST using DSA key ID 29CD6080
gpg: Good signature from "TJ (Ubuntu contributions) <>"
gpg:                 aka "XXXX TJ (Ubuntu Launchpad) <>"
Good signature on ../linux_2.6.24-19.35~ppa1_source.changes.
Checking Signature on .dsc
gpg: Signature made Sat 12 Jul 2008 19:43:39 BST using DSA key ID 29CD6080
gpg: Good signature from "TJ (Ubuntu contributions) <>"
gpg:                 aka "XXXX TJ (Ubuntu Launchpad) <>"
Good signature on ../linux_2.6.24-19.35~ppa1.dsc.
Uploading to intuitivenipple-ppa (via ftp to
  linux_2.6.24-19.35~ppa1.dsc: done.
  linux_2.6.24-19.35~ppa1.tar.gz: done.        
  linux_2.6.24-19.35~ppa1_source.changes: done.
Successfully uploaded packages.
Not running dinstall.

Wait For Results

Wait for the status emails from Launchpad. It can take several hours (4-6) to build so best to do it overnight.