Please review the README file for additional tips/help. (usually located at /usr/share/doc/simple-cdd/README)
To try Simple-CDD, on a Debian Lenny (5.0) system:
install simple-cdd (as root):
# apt-get install simple-cdd
create a working directory (as a user):
$ mkdir ~/my-simple-cdd $ cd ~/my-simple-cdd
Build a basic CD:
This will create a partial package mirror in the directory tmp/mirror, and if all goes well, an .iso CD image in the "images" dir when it is finished. By default, target CDD release version is the same as the host version. You can specify the optional argument --dist to change the targets version. For example, it can be etch, lenny, sid, etc. If this step doesn't work, you need to figure out why before trying more complicated things.
Note: on lenny, this worked for me:
build-simple-cdd --profiles-udeb-dist sid --debian-mirror \ http://ftp.uk.debian.org/debian --dist etch
--Enrico Note: ftp.it and ftp.de do not seem to work, but I did not manage to investigate why. --Enrico
--?HarryJede Note: If you use the HTTP protocol for apt, you _must_ set the FTP protocol for wget.
Create a profile named NAME:
$ mkdir profiles $ for p in list-of-packages-you-want-installed ; do echo $p >> profiles/NAME.packages ; done
Note that you should not include package dependencies, but only the packages you actually want.
Build the CD with selected profile NAME:
$ build-simple-cdd --profiles NAME
This should create an .iso CD image in the "images" dir when it is finished with your custom profile.
Use qemu to test:
# apt-get install qemu $ build-simple-cdd --qemu --profiles NAME
If you want debconf preseeding, put a debconf-set-selections compatible file into profiles/NAME.preseed.
If you want a custom post-install script, place it in profiles/NAME.postinst.
For more options:
$ build-simple-cdd --help
How to cache repeated downloads
If your bandwidth is limited, you can use approx to cache downloads: just invoke simple-cdd with --debian-mirror http://localhost:9999/debian.
--?NiklausGiger-- Be warned that other tools might not work. At least apt-cacher-ng did not work for me as it did not cache correctly directories like doc.
Howto build the install cd with current Daily Debian Installer
This step might be of some interest if you want build Debian ISO in short periods when Debian Installer in the repository does not work together with the rest of the packages. This might happen if the Debian Installer kernel version is older then the version in target distribution and only new .udeb files are available in the repository.
Add the following lines to your profile's conf file:
This will make debian-cd download latest Debian Installer from the default location and use it to build ISO images.
Howto build the install cd with a custom debian Installer (if you want to add a driver that is not yet supported by the official debian installer):
First build the custom DebianInstaller.
Add this value to the NAME.conf file of your profile: custom_installer="/path/to/debian/installer/"
In the provided path you should have this kind of directory tree: (architecture)/images/ where architecture could be i386 for instance.
Copy the contents of the dest directory in your debian installer build directory to /path/to/debian/installer/(architecture)/images/
Next specify a local packages directory (add the parameter --local-packages /path/to/localpackages/directory/ to build-simple-cdd). Copy all your custom udebs to that directory.
After that, you want to make sure the system will reboot correctly after installation and provide a custom kernel:
Build the custom kernel
Add it to the /path/to/localpackages/directory/ and add the package name to the NAME.packages file for your profile.
If the kernel package name exists in the official repositories, make sure its version is greater or equal to the version in the debian mirror, to prevent simple-cdd from downloading it.
How to deal with missing udeb modules for your d-i kernel
Due to the new etch update that uses a 2.6.18-5 kernel rather than 2.6.18-4, you may have problems building a lenny image, since 2.6.18-5 udeb modules are not in lenny repository. It means that your d-i is running the 2.6.18-5 kernel while you are trying to load 22.214.171.124 modules during the installation of your new debian image. To solve this problem, there is a new feature in simple-cdd version 0.3.4. Just pass 'etch' to extra_udeb_dist var before running simple-cdd:
$ export extra_udeb_dist=etch
or use the --extra-udeb-dist commandline option:
$ build-simple-cdd --extra-udeb-dist etch
Add self-built packages to CD
Note: I tried to solve this for a good while and this solution worked for me. However I'm not the expert here, so I wish someone with actual knowledge would check this chapter.
Start conditions with this chapter: I had an self-built .deb package which is on non-free -section. I wanted to apply that to my custom cd and have it installed. It took me a while to figure out what I'm doing wrong, but this approach worked for me.
First, add line
to your myprofile.conf. Obviously apply sections you need, I used non-free because my package is in that section. Then add your package name to myprofile.packages so that actually gets installed via Debian Installer.
After this you can build the package with
$ build-simple-cdd --local-packages /path/to/your/deb/files -p myprofile
-- ?TapioSalonsaari 2009-05-29 11:06:37
Add custom files onto your installer CD
To copy an arbitrary file into the /simple-cdd directory on the CD add a NAME.extra file (where NAME is the name of your profile). That file should contain one line per file that is to be added to the CD. If file paths are relative they are assumed to be relative to the directory with the config file and profiles subdirectory. Note that the .extra file can add files but not directories to the CD image.
If you get an error in the CD saying that the file Packages.gz is corrupted, it is a known bug of debian-cd version 3.0.2. See 423835, which contains the full explanation of what goes wrong and a patch to fix it.
If the build ends with an error such as:
ERROR: missing required packages from profile MyProfile: mplayer ...
To find you why this package could not be added refer to: tmp/cd-build/$dist/sort_deps.$arch.log
You may need to explicitly add indirect dependencies. For example, mplayer depends on mplayer-skin. Except there is no mplayer-skin package. There is, however, an mplayer-skin-blue package that provides mplayer-skin and satisfies the dependency. Same thing with some updated packages that provide a number of older packages such as the gtk2-engines-industrial package which is actually included in the gtk2-engines package. If you can determine which package you need, add it to the *.downloads configuration file of packages to be included on the cd. (note: provides should be handled more-or-less correctly as of simple-cdd 0.3.6) (note to the note: not so much. in one example, xpdf-utils is no longer a real package. It is a transitional package to poppler-utils. In upgrading the installer from lenny to squeeze, this kept holding me back until I explicitly added all the second level depends and the package causing the problem finally popped up in the error message. So to troubleshoot this, you need to start adding all the packages apt adds automatically to the *.packages files until you find a package that depends upon a transitional package.)
If simple-cdd does not handle the dependencies of a self build package correctly, check it with lintian first. It took me two days to figure out one of my packages which worked seamlessly with dpkg/apt/reprepro had a mis-formatted header.
You may want to edit the build-simple-cdd script to use sudo when running "/usr/bin/debconf-set-selections --checkonly" to verify a preseed file. This caused some confusion for me because the script itself resists being run as root, but you get an error on your preseed if you run debconf-set-selections as a normal user. (that is because the user cannot access the debconf password database, see 587380; it's still not a good idea to run it as root.)
There are two bugs in Debian that caused me literally hours of extra work. One is a bug in the partition size/offset calculations by the partman packages (See bug 516347). The second is an issue with incorrect permissions on /dev/null which cause packages like postgresql-8.3 to fail their postinstall scripts (See bugs 517389 and 510658). I got around the partition bug by including a small first partition. I got around the second bug by putting the packages in profile.downloads and doing the installation in the profile.postinst script after running a chmod on /dev/null to allow anyone to write to it. Once these bugs get closed, simple-cdd will be a lot easier to use.