banner Debian GNU/Linux

Do It Yourself Xserver package

Knoppix style Xserver config for Debian (stable)


Roll you own

When you're discovering Linux, especially the system administration aspects of it, you'll sooner or later will want to create your own .deb packages. You can use packages to customize your configuration. In this tutorial, we'll go step by step through the pocess of creating .deb packages, building a package that installs and sets up Knoppix hardware recognition and X server configuration to add Knoppix's superior video cinfiguration to a basic Debian stable system.

Preparations

packaging
A debian package is basically a tar archive, and the essense of creating a debian package is that you create a directory structure in a directory called "debian", you populate the subdirectories of "debian" with files (binaries, configuration files, installation scripts, ...), add some additional 'control' files that contain information about the package itself (eg dependencies), and pack this "debian" directory in an "archive" : the deb package. Read this short introduction to debian packaging.
sources.list
the package your building will depend on the knoppix packages provided at debian-knoppix.alioth.debian.org. To install the package you've build, your sources.list will need to contain "deb http://debian-knoppix.alioth.debian.org/ ./".
optional : your own 'debian mirror'
Alternatively, you can download hwdata-knoppix, hwsetup, ddcxinfo-knoppix, xf86config-knoppix from http://debian-knoppix.alioth.debian.org/packages/ to your own (private) web server. If you also add the xserver-knoppix package you've build to that web server, you can use the web server as an additional source for apt-get. This way, you don't depend on the availability of debian-knoppix.alioth.debian.org and you limit the risk of version and dependency conflicts if the packages at debian-knoppix.alioth.debian.org are removed or updated. Dont forget to add this web server to your sources.list. See also some hints and tips to set up a minimal debian mirror on this page.

Dependencies : which packages will I use ?

Debian Sarge (the stable release at the time of writing) uses xserver-xfree (XFree86). You therefore need to use a xf86config-knoppix package that actually creates a xfree.conf, not the xorg.conf that more recent versions of Knoppix use. Take, for instance, xf86config-knoppix_0.8-6_i386.deb, and work out the dependencies from there, by reading the control files in the respective .deb packages or the Release file at debian-knoppix.alioth.debian.org/packages/.

  1. xf86config-knoppix_0.8-6_i386.deb depends on ddcxinfo-knoppix (no version specified).
  2. ddcxinfo-knoppix depends on libc6. libc6 in Debian Sarge is version 2.3.2, so you need a ddcxinfo-knoppix that requires libc6 <=2.3.2. Candidate : ddcxinfo-knoppix_0.6-6_i386.deb
  3. hwsetup depends on hwsetup-data (no version), libc6 and pciutils. pciutils in Debian Sarge is 2.1.11-15, so you need a hwsetup that depends on libc6 <=2.3.2 and pciutils <=2.1.11-15. Candidate: hwsetup_1.1-1_i386.deb
  4. hwdata-knoppix provides hwsetup-data for hwsetup, and has no specific dependencies, so any version will do

Therefore, the package we create will depend on xf86config-knoppix_0.8-6_i386.deb, ddcxinfo-knoppix_0.6-6_i386.deb, hwsetup_1.1-1_i386.deb and hwdata-knoppix (any version).
If you download only those, you don't need to specify the versions later on, because only those versions will be available. If you use a third party mirror, you'll need to specify the versions in your dependencies.

To apply this to Debian testing with xorg, find wich xf86config-knoppix packages create xorg.conf, set that as the minimal version, and work out that package's dependencies.

You only need to do this manual selection if you want to download packages of specific versions to your own web server. When you use the debian-knoppix.alioth mirror, apt will use the Release file to work out the dependencies and select the correct package according to the versions you've set for dependencies.

Creating a package with dependencies and scripts

The package we're building does not require you to compile source code, it merely bundles dependencies and some scripts.

create the following directories in your working directory :

	../
	  |- debian/
	           |-DEBIAN/
	

create a control file : .../debian/DEBIAN/control - with the following content :

	Package: xf86config-knoppix-kn
	Version: 0.1
	Section: extra
	Priority: optional
	Architecture: i386
	Depends: xf86config-knoppix, ddcxinfo-knoppix (<= 0.6-6), hwsetup (<=1.1-1), hwdata-knoppix
	Installed-Size: 1
	Maintainer: Koen Noens 
	Description: unofficial package -- exercise
	 meta-package to provide
	 KNOPPIX non-interactive setup of XFree86 3.x/4. on Debian (sarge).
	 may require http://debian-knoppix.alioth.debian.org in sources.list
	

Note the dependencies : the knoppix packages discussed earlier, with versioning.

build the package and install it (with dpkg -i or apt-get if you have the package on a http or ftp server)


Koen Noens
December 2006