| 1 |
Building Debian Installer images with a custom kernel.
|
| 2 |
|
| 3 |
So you want to build a custom version of the Debian Installer? This
|
| 4 |
document assumes basic familiarity with building Debian packages and the
|
| 5 |
linux kernel from source. The techniques described here are aimed mostly at
|
| 6 |
replacing the kernel, which is the most common piece to need to replace,
|
| 7 |
but similar techniques can be used to replace any other udeb used by this
|
| 8 |
modular installer with a custom version.
|
| 9 |
|
| 10 |
If you have questions about this document, mail the Debian Installer team
|
| 11 |
at: <debian-boot@lists.debian.org>.
|
| 12 |
|
| 13 |
Step 1. Kernel deb
|
| 14 |
|
| 15 |
You need to find or produce a kernel deb for the kernel you want to use
|
| 16 |
with d-i. This can be built in the standard Debian way with make-kpkg. The
|
| 17 |
kernel should be built with the following things built in:
|
| 18 |
|
| 19 |
devfs (does not need to automount on boot)
|
| 20 |
initrd support
|
| 21 |
tmpfs
|
| 22 |
ext2
|
| 23 |
|
| 24 |
Most everything else can be modular, and it's a good idea to enable pretty
|
| 25 |
much everything. A good starting place is the kernel config from an
|
| 26 |
existing official Debian kernel.
|
| 27 |
|
| 28 |
Once you have the kernel-image.deb, install it for the next step. On i386,
|
| 29 |
you should also install the kernel-pcmcia-modules file. You do not need to
|
| 30 |
boot into the new kernel.
|
| 31 |
|
| 32 |
Step 2. Kernel udebs
|
| 33 |
|
| 34 |
Unpack the source package linux-kernel-di-i386 (other arches, replace i386
|
| 35 |
with your arch). If you're working with 2.6 kernels, use
|
| 36 |
linux-kernel-di-i386-2.6 instead. In its source tree, edit the
|
| 37 |
kernel-versions file. Each line in this file is a kernel version, you can
|
| 38 |
comment out all but one, and modify that one to match the version of your
|
| 39 |
custom kernel.
|
| 40 |
|
| 41 |
If your custom kernel includes new kernel modules that are not in the
|
| 42 |
standard kernel, you'll need to add them to a list in modules/i386/. See
|
| 43 |
the kernel-wedge documentation for details.
|
| 44 |
|
| 45 |
Make sure the build dependencies of linux-kernel-di-i386 are satisfied
|
| 46 |
(you will need to install the kernel-wedge package), and build the package.
|
| 47 |
This will produce several udebs.
|
| 48 |
|
| 49 |
Step 3. Initrds and images
|
| 50 |
|
| 51 |
Unpack the debian-installer source package. Make sure the many build
|
| 52 |
dependencies are satisfied. Check that build/config/i386.cfg has a
|
| 53 |
KERNELVERSION field that matches the version of your custom kernel (other
|
| 54 |
arches, replace i386 with your arch). Note that this version includes the
|
| 55 |
kernel flavour. For example, if your kernel-image*.udeb produced in the
|
| 56 |
previous step is named kernel-image-2.6.4-1-386-di_0.57_i386.udeb, then
|
| 57 |
set KERNELVERSION to 2.6.4-1-386
|
| 58 |
|
| 59 |
Copy the udebs that were produced in step 2 into the build/localudebs
|
| 60 |
directory. Go to the build directory and type "make list" to see a list
|
| 61 |
of possible targets. For example, if you want to build floppy images, use
|
| 62 |
this command:
|
| 63 |
|
| 64 |
fakeroot make build_floppy_boot build_floppy_root
|
| 65 |
|
| 66 |
If you're looking to build a complete Debian CD, the target to use is
|
| 67 |
"build_cdrom_isolinux" (and see step 4).
|
| 68 |
|
| 69 |
It turns out to be much easier to build a mini CD containing just d-i,
|
| 70 |
which you can do with the "build_monolithic" target. You will need a
|
| 71 |
network connection to install using this image.
|
| 72 |
|
| 73 |
Look in the build/dest directory for the images. The MANIFEST file will
|
| 74 |
list every file you built and its purpose. Note that the
|
| 75 |
build_cdrom_isolinux target does not produce an entire ISO image, but just
|
| 76 |
the initrd to go on one. However, the build_monolithic target does produce
|
| 77 |
a bootable ISO image, and the floppy targets do produce floppy images.
|
| 78 |
|
| 79 |
Step 4. Building a full Debian CD image
|
| 80 |
|
| 81 |
If you have an initrd for a CD, and some kernel udebs, and a kernel deb,
|
| 82 |
you probably want to stick them all on a Debian CD. There are two ways to
|
| 83 |
do this. You can install the debian-cd package and read its documentation.
|
| 84 |
Be warned that using debian-cd is difficult, and requires a local Debian
|
| 85 |
mirror. Or you could try to remaster an existing Debian ISO using the
|
| 86 |
technique described here:
|
| 87 |
http://wiki.debian.net/index.cgi?DebianInstallerModify
|
| 88 |
|
| 89 |
Neither of these routes will be as relatively polished or easy as steps
|
| 90 |
1-3. We recommend that you don't try to build a full Debian CD unless you
|
| 91 |
really absolutely need one, and have plenty of time to set up debian-cd. An
|
| 92 |
alternative is to build a monolithic mini iso (as described in step 3).
|