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