
This picture has a lot to say, but it says nothing whatsoever about Ubuntu installer ISO's. Who cares. This picture is so awesome I am considering using it to illustrate every blog entry I do from now on. "On the latest humanitarian crises" illustration: Ike's middle finger. "On alternative energy" illustration: Ike flying the bird and Tina. "Google's newest web framework" illustration: Ike's studded leather belt and his middle finger. Tell you what. In the spirit of the illustration i'll try to keep this post as bad ass as possible.
Listen up: A while back I blogged about debian-cd and
creating a Debian net installer ISO. Imagine creating an entire operating system from scratch! Ok, not quite from scratch since you just download binaries, but hey, when you bake bread you don't mill your own flour do you? I didn't think so. So shut up. That previous debian-cd trip was just one stop along the road to creating a Xubuntu installer ISO from scratch and that is what this post will be about.
The most important thing to know about creating a Xubuntu installer is that there is a guy named Colin Watson who makes it all happen, ok so there is a whole army of people, but Colin's name is on everything. He is like the Ike Turner of the debian-installer set.
Here is a link to the back room of his fun house where all the image making magic happens. He has bazaar branches of the following projects: cdimage, debian-cd, germinate, britney. You should check out branches of all those things with bzr at the link I gave you. The next thing to do is put them together. cdimage is the set of scripts that drives the whole thing, it handles synchronization of your local repository, generating the debian-cd task lists from seeds, calling debian-cd to burn the ISO's, publishing the ISO's and some other good stuff. So to "put them together" just drop debian-cd, britney and germinate into the cdimage directory.
Unless you think you are some kinda hotshot it would do you good to read the README that comes with each of these four tools, especially the cdimage one. If you don't, you better not come crying to anyone on the mailing list, because they will rip your arms off and beat you with them. It happens. I wish I could try to give exact directions for making this work, but there are too many steps and I forget things, so my recommendation is to immediately start trying to run cdimage, and resolve all the problems and complaints it has one at a time. Mostly you will just be figuring out what environment variables need to be set. (There are about 6 or 8 I set. I created a script with an export for each one and I source that before I run cdimage.) Here is the command for running cdimage: ./for_project xubuntu ./cron.daily
Great! You scrolled this far down the page so you must still have arms, or you are working your mouse with your mouth, either way, good job. Once you get through the first few errors (for not having the right variables defined) you will notice that the command is going to take forever to run. This is because it tries to rsync your local mirror with a remote mirror (Mine is about 100 GB for all the i386 stuff). Since you probably don't have a local mirror you probably can't skip this step, just rest assured that once you have it, you can re-use it and things will happen much faster, say 5 minutes or less. If you already have a local mirror you can just point the script to use that one . (I just put a symlink in the cdimage directory called ftp and it points to my local mirror at /opt/mirror.) Try not to get frustrated if you get stuck. There are lots of moving parts in here! LOTS! You are probably just missing some environment variable or you have one set to point at the wrong directory. The best way to work through things it is to read the source. Most error messages are pretty descriptive, but RESIST the temptation to hack the code. Colin's stuff really works. I got it all working with only one minor change to build_all.sh in debian-cd. For posterity, here is a list of the changes, tips and tricks that might help:
- when debian-cd kicks off via the build_all.sh script it always complains that it can't find CONF.sh even though it is clearly in the right place. I change the ". CONF.sh" line at the beginning of the file to ". `pwd`/CONF.sh" and that fixes it.
- If you already have a local mirror you can skip all the rsync business. To do this edit anonftpsynch in the cdimage bin directory and comment out the two rsync lines. I also comment out the lines that synch the indicies and overrides.
- Britney is partially C code and you have to build it. Make sure you have the python-dev-all (I think that is the name) package as well as the one listed in the README. There is a step in there with some perl that I didn't do, but it didn't seem to matter.
- Getting a local copy of the seeds really speeds up your build time a lot, so do it! You can set the LOCAL_SEEDS environment variable to the path of your seeds. If you make changes to the seeds be sure to commit them or germinate ignores your changes.
- You can disable the creation of the Jigdo (stands for jigsaw domino, which is awesome) files if you don't care about them and save a bit of time and disk. Just edit debian-cd's CONF.sh and set the JIGDOsomething-something environment variable to 0.
- Obviously you don't need 100GB mirror to create a 700 MB CD image. There are techniques for creating small local mirrors. None of them very handy. I'm using extensive --exclude parameters in my rsync command to make sure I only get i386 binaries. Check out this wiki page for info on other techniques.
- It is imperative to use debian-cd and germinate from colin's repository. You can't mix and match the packaged versions with cdimage because colin has modified things quite a bit, so stick to his sources in bazaar for everything.
- Fri. June 13th Edit: Be sure you have your gpg keys in order and cdimage is properly configured to use them or your APT repo on the CD won't be trusted, so nothing will get installed, which is kind of a bummer.
- Make sure your GPG key you are using doesn't have a password, because GPG is running in batch mode when the CD is signed and thus won't be able to prompt you for a password.
Whatever you do don't get discouraged. I recommend asking questions on the ubuntu-installer IRC channel and mailing lists. People don't go out of their way to help you, mostly they ignore you, but sometimes you get lucky. Also, take time to pull back and understand the big picture about how the installer works and what all the files going onto the installer are for. That sort of context can help you avoid mistakes and direct your research. Good luck. And remember what Ike Turner said: "
In China, when you get to the airport everyone be talking in American slang."