Building Debian packages
From Xenomai
Contents |
Xenomai packages in Debian
First, please note that Xenomai is officially included in Debian. This means that the latest version of Xenomai will be directly incorporated into Debian "unstable" which from time to time migrates to the latest "stable" version of Debian. The latter will be stabilized and maintained for a whole Debian stable version lifetime without following the latest versions of "upstream" Xenomai. Please check the official Debian package page for Xenomai and the Debian development page for Xenomai.
Debian's "unstable" version of Xenomai is also tracked with the files in the debian/ directory in the Xenomai source code repository which means that you can also build a Xenomai package from the trunk. If you want to track the latest Xenomai repository developments that aren't yet in Debian, you should follow the instructions on this page to build Xenomai Debian packages.
Building Xenomai packages
This howto was written for Xenomai 2.5.6, please use the latest stable Xenomai release and adapt the version numbers accordingly.
prerequisites
Install the following packages:
# apt-get install devscripts debhelper dh-kpatches findutils
from a Git repository
To build from a git Repository install these additional packages and clone the Git repository:
# apt-get install git-core git-buildpackage $ git clone git://xenomai.org/xenomai-2.5.git
Change to the Xenomai Git working tree and update the repository:
$ cd xenomai-2.5 && git fetch origin
Create and checkout a new branch based on a git treeish object. In this example, we create a branch v2.5.6-deb based on git tag v2.5.6:
xenomai-2.5$ git checkout -b v2.5.6-deb v2.5.6
Create a new debian changelog entry:
xenomai-2.5$ DEBEMAIL="your@email" DEBFULLNAME="Your Name" debchange -v 2.5.6 Release 2.5.6
Commit the changelog to the v2.5.6-deb branch:
xenomai-2.5$ git commit -a --author="Your Name <your@email>" -m 2.5.6
Build the packages in the parent directory:
xenomai-2.5$ git-buildpackage \ --git-debian-branch=v2.5.6-deb \ --git-export-dir=.. \ -uc -us
Thats all folks. Switch back to the master branch and delete the branch v2.5.6-deb:
xenomai-2.5$ git checkout master && git branch -D v2.5.6-deb
from a tar.bz2 archive
Download and extract a Xenomai tar.bz2 release archive:
$ wget -O - http://download.gna.org/xenomai/stable/xenomai-2.5.6.tar.bz2 | tar -jxf -
Change to the extracted Xenomai tree:
$ cd xenomai-2.5.6
Create a new debian changelog entry:
xenomai-2.5.6$ DEBEMAIL="your@email" DEBFULLNAME="Your Name" debchange -v 2.5.6 Release 2.5.6
Build the packages in the parent directory:
xenomai-2.5.6$ debuild -uc -us
result
The build results in the following packages:
- xenomai-runtime - Xenomai runtime utilities
- libxenomai1 - Shared libraries for Xenomai
- libxenomai-dev - Headers and static libraries for Xenomai
- linux-patch-xenomai - Linux kernel patches for Xenomai
- xenomai-doc - Xenomai documentation
For development, linux-patch-xenomai and libxenomai-dev are needed, for "production" systems, you should just need xenomai-runtime und libxenomai1 (together with the self built kernel as described in the next section). The package xenomai-doc is optional, of course, but contains important documentation for developers using or developing Xenomai.
installation
Change to the build directory and use dpkg to install the packages:
# dpkg -i *.deb
Building a Xenomai patched Linux kernel package
This howto was written for Linux 2.6.35.9 and Xenomai 2.5.6, please use the latest stable Xenomai and kernel release and adapt the version numbers accordingly.
prerequisites
Install linux-patch-xenomai and the following packages:
# apt-get install kernel-package libncurses-dev fakeroot zlib1g-dev
The list of Xenomai supported kernels can be found in the package description of linux-patch-xenomai or under /usr/src/kernel-patches/diffs/xenomai:
$ dpkg-query -W -f'${Description}\n' linux-patch-xenomai | grep Patch-file | uniq
$ ls -1 /usr/src/kernel-patches/diffs/xenomai
Download the kernel source archive, extract it and change to the source tree:
$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.9.tar.bz2 && tar -jxf linux-2.6.35.9.tar.bz2 && cd linux-2.6.35.9
patch and configure the kernel
Apply the Xenomai adeos-ipipe patch:
linux-2.6.35.9$ /usr/src/kernel-patches/i386/apply/xenomai
Optional: To recycle a old config, copy it to the current directory and call make oldconfig:
linux-2.6.35.9$ cp /your/old/linux/config .config linux-2.6.35.9$ make oldconfig
Configure the kernel: Despite using Debian packages, you still have to configure the kernel. This may not be so easy especially on x86, please see the x86 kernel configuration checklist for more details, as well as the FAQs for the troublesome options.
linux-2.6.35.9$ make menuconfig
build the kernel
Build the kernel using make-kpkg: ( CONCURRENCY_LEVEL=x is optional, but saves time on multicore machines )
linux-2.6.35.9$ CONCURRENCY_LEVEL=2 CLEAN_SOURCE=no fakeroot make-kpkg --initrd --append-to-version -xenomai-2.5.6 --revision 1.0 kernel_image kernel_headers
result
The build results in the following packages:
- linux-image-2.6.35.9-xenomai-2.5.6
- linux-headers-2.6.35.9-xenomai-2.5.6
installation
Install the kernel with dpkg, the bootmanager is updated automatically:
# dpkg -i linux-image*.deb
Ubuntu 10.04: After installing the kernel with dpkg you have to build the initrd and update the bootmanager manually:
# update-initramfs -c -k 2.6.35.9-xenomai-2.5.6 && update-grub
Reboot the machine and select the kernel in your bootmanager.

