Remastering an “Ubuntu alternate” ISO with Ubuntu Customization Kit – the complete guide

You have an Ubuntu alternate ISO and you want to customize it, to do things with ease you choose to do that with which will handle most of the tasks for you.

Preamble

This guide is written with the SVN version of Ubuntu Customization Kit, thus somethings (actually only minor things such as log messages) could be different from the ones you’ll get with your copy of UCK.

Prerequisites

To remaster an Ubuntu alternate ISO you need to:

  • be running an Ubuntu based distro on your host system in order to install and run UCK successfully
  • have UCK installed in your Ubuntu box. In order to install it go to the , click download and select the debian package. After downloading the package install it with the usual tools (dpkg or gdebi or whatever).
  • have an Ubuntu alternate ISO downloaded somewhere in your hard disks.

First step: extract the ISO

An ISO image is a single file, you can’t modify it in any way keeping it “as is”, thus you’ll use UCK to extract its contents to a directory with this command:

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-unpack-iso ubuntu-7.10-server-i386.iso
Mounting ISO image…
Unpacking ISO image…
Unmounting ISO image…

Ok all went perfectly, now you’ll find the contents of your ISO in the “~/tmp/remaster-iso” directory

Second step: prepare the remastering environment

This step creates a new package repository inside your remastering directory (~/tmp/remaster-iso/pool/extras), in that repository you can now put all the packages you want to be added to the new ISO.

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-prepare-alternate
now you can copy your packages in /home/fabrizio/tmp/remaster-iso/pool/extras, customize preseed files or do other customizations

Third step: adding new software

Alternate ISO system only manages deb packages thus you need to have deb packages for all the software you need to add to your new ISO.
There’s only one thing you have to do, copy the deb packages to the ~/tmp/remaster-iso/pool/extras directory, that’s all.

IMPORTANT: Added packages are not automatically installed by the Ubuntu installer on my target system

If you add software to the extras pool you can have two reasons:

  • you want those packages to be automatically installed into your target system
  • you want those packages to be available on cd/dvd to be optionally installed into your target system after a choice of the user (Ubuntu text installer handle this within “tasksel”)

If your option is the first then adding the deb packages to the extras directory won’t be enough, you’ll have to modify the preesed file, what is a preseed file? It’s a file which tells the Ubuntu installer what to do, it’s a way to script it.

Preseed files have their own syntax but for the purpose of this small guide I suggest you to take a deep read of the “” guide.

The “” guide is really big but you don’t need to study it all, you can read only the “” section just because UCK covers all other sections for you.

Forth step: modify software that already was in the original ISO

Sometimes you could want to modify default configurations of software which is bundled with the default ISO, in order to do that you’ve to:

  • locate the original deb package within the remaster-iso/pool tree
  • delete it
  • create a new deb package for the software, with all your customizations inside it
  • copy your new deb package to the position where the original one was (eg: ~/tmp/remaster-iso/pool/main/a/apache2)

You need to delete the original package to avoid possible conflicts.

Fifth step: finalize the remastering environment

Ubuntu alternate ISO system works with signed Ubuntu repository thus you’ll have to regenerate all the metadata files for your updated/new repositories and than sign it with GPG. If one of these conditions are not met the installer will hang telling that your ISO is corrupted.

When I was writing alternate support for UCK this was one of the most difficult part to code and this would be difficult for you too if you were not using UCK :)

If you don’t have it, before going ahead. Remember also to write down the ID of GPG key, it should be printed by the key generation process or you can read it with the gpg --list-keys command.

Now simply let UCK do the work for you with:

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-finalize-alternate 691D19E1

UCK will then do a lot of things, download files from the Internet and do all the tasks we were talking before, the operation could last a few minutes and you’ll see a lot of log lines. You’ll be asked to type the password for your GPG key, this should happed 3 times.

When the process will be finished you’ll be ready to repack your ISO.

Sixth step: pack your new ISO

fabrizio@fabrizio-laptop:~$ sudo uck-remaster-pack-iso

A lot of log lines will be printed in this phase too, don’t worry about those if you don’t see any strange error message.
Ok that’s all, finally you did it, where’s your new ISO file? Here:

fabrizio@fabrizio-laptop:~$ ls -lah ~/tmp/remaster-new-files/
totale 501M
drwxr-xr-x 2 root root 4,0K 2007-11-27 11:49 .
drwxr-xr-x 5 root root 4,0K 2007-11-27 11:49 ..
-rw-r–r– 1 root root 500M 2007-11-27 11:49 livecd.iso

Now you’re free to burn it, test it with qemu/virtualbox/vmware or whatever ;-)

Closing notes

This guide should be pretty exhaustive, if you encounter errors, misspellings or have any suggestion, please feel free to drop a comment!

And… remember to DIGG this guide using the button here below :-)

31 thoughts on “Remastering an “Ubuntu alternate” ISO with Ubuntu Customization Kit – the complete guide

  1. matcheux

    This is wonderfull exactly what I was looking for to create an installation CD for the Highschool I am working at.
    Should I make a suggestion ?
    It would be great to send this page to a wiki where users of UCK could share there experience of the UCK and translate this page in other languages (i’m french ;) )
    You do a really great job
    Thanks a lot
    Matcheux

  2. tobias

    Hallo,
    nice guide.
    But I have one question left. Is it possible to replace the Kernel when building a new alternate image.
    I have tried modifying the initrd, but replacing it with a newer version with newer Kernels let the boot-process quit with an error message.

    Thank you so far…

  3. Fabrizio Balliano

    @tobias: thank you, for the kernel thing… i haven’t tried that, i’ll do it asap and post the results

  4. thanks for your work, minibuntu, now i can remaster and create my own linux… thanks

    NB: may I add your link in my blog?

  5. Fabrizio Balliano Post author

    @Thowie: first read the netiquette, using multiple question marks is simply disappointing. second, I didn’t try this guide with hardy, I’ll try when hardy will be released.

    @agung: it’s really hard, the only way I know (maybe there are others but I don’t know) it to find which packages contain the configuration files that will be placed in /etc and rebuild those packages…

  6. Omid

    very nice guide
    It would be great if you could write a more detailed guide for Remastering liveCD with UCK

  7. Juri

    Ciao,
    gran bel lavoro. Sto cercando di modificare una Ubuntu Gutsy per aggiungervi il supporto real-time (RTAI Linux). Ho dei problemi con il kernel per quanto riguarda il cd live. Come devo fare per usare il kernel con le patch di RTAI nel mio cd? Seguendo la guida di RTAI ho usato un kernel vanilla, ma ho aggiunto il supporto a squashfs usando la patch, ci sono problemi rispetto ad usare il kernel di Ubuntu?
    Grazie mille, rispondimi pure tramite e-mail se vuoi.

  8. Fabrizio Balliano Post author

    @Juri: ciao guarda sostituire il kernel non è una cosa semplice, ti consiglio di spulciare le questions/answers di uck su launchpad, qualcuno ne ha già parlato, io non ho moltissima esperienza a riguardo e comunque non su alternate ma solo su live. ciao!

  9. Pingback:

  10. Harish

    Hi!,
    Thanks man… it was Zero error method.

    One thing which we all missed is managing preseed file for addition of packages.

    Thanks
    Harish

  11. There is a longer discussion on the preseed file over at:

    Over there, URM was based on UCK and some other sources.
    So, what is posted there, should be applicable to those that use UCK as well.

  12. Pingback:

  13. I’ve managed to replace MBR (linux headers generic )of unbuntu 10.04 Lucid to use the old grub boot kernel from 9.10 karmic. After that avoid updates to keep your settings intact. See my blog.

  14. hey I was wondering if It was possible to make the iso larger, or the filesystem.squashfs larger, My image burned is only 2.1 GB, I would like to make that extra 2.6 reserved for the /home or /Desktop. I have tried adding swap files, and empty files, none of them seem to make the iso larger.

  15. Alejandro Calampuca

    Fabrizio

    estoy tratando de instalar ubuntu 11.04 en una notebook asus G51j series, dificil.
    para la instalación es vital poder incluir en la distribución los drivers nouveau galio, de lo contrario ubuntu no inicia. ¿puedo crear esa distro con UCK?
    gracias, estoy probando en este momento, la interfaz de uck es en ingles, ¿puedo verla en español?. gracias nuevamente

  16. Alejandro Calampuca

    gracias fabrizio, lamentablenete no hablo inglés.
    use UCK exitosamente, felicitaciones!!!!

  17. hi fabrizio,

    i’ve searched this simple question without success.

    i’m remastering a 10.02.2 alternate ISO.

    is there any way to disable language menu that appears at the very begining of ISO booting?

    i know i can preseed language options, but i would like to disable that popup.

    thanks.

  18. Fabrizio Balliano Post author

    @muzzol: actually you should look into the gfxboot documentation cause (if I’m not wrong) this is the component that manage that part of the boot process.

  19. apater

    Thanks a bunch for this application and instructions.

    A couple of questions.

    Is there a way to install some packages after rebooting the system?

    If updates are in the pool/extras folder, will they get installed? Or can they go into the pool/main folder, replacing the original package?

    Ok, a triple of questions …

    How to remove packages? Can unused packages be simply deleted from pool/main?

  20. Pingback:

  21. greatsouls

    Hello Fabrizio,

    You guys have done great job remastering and compiling such a small ubuntu distribution! And all the customization tools…

    Currently I am trying to use Ubuntu Mini Remix 11.04 (i386) to create bootable USB key that will automatically run couple different scripts. I have been using so far SLAX and as it is using ‘root’ as default user it was easy with stuff like mounting and unmounting and creating directories. Switching to ubuntu now it is using ‘ubuntu’ account and all the scripts need to be corrected (added sudo in front of commands like mount).
    Is it possible to modify Ubuntu Mini Remix 11.04 so it will be using ‘root’ account instead?
    I tried to run ‘sudo su’, ‘su -s’, ‘su -i’, ‘su -u’ from inside the script, but they switch to a different shell(?) and my program stops.
    Ho can I overcome this?
    If not I will need to modify all scripts (it is a lot of work!) and to add ‘sudo’ in front of each command that requires elevated permissions.
    I googled for days with no avail.
    Could you please point me to a source or give me an advice, please?
    Really appreciate your advise and help.

    Best regards,

  22. Roshan

    ” now you can copy your packages in /home/fabrizio/tmp/remaster-iso/pool/extras, customize preseed files or do other customizations ”

    Can you explain this a bit? How to customize the preseed and how to change the themes and wallpapers ?

  23. Valone

    Hello Fabrizio,

    Thank you very much for your guide. It has been very usefull to me.
    However, my goal is to generate a customized ISO from Ubuntu 10.04 including a single debian package into the pool/extras directory. And I want this package to be installed during the ISO installation. You redirect to help.ubuntu.com for resolving it but I do not find any part which explains how to install a debian package which is already into the ISO’s extra folder.

    Could you explain how to do it please ?

    Regards

Leave a Reply

Your email address will not be published. Required fields are marked *