Skip to main content

Customize or Remaster ubuntu 9.04 jaunty from an image file

This tutorial will show you how to customize and remaster your ubuntu 9.04 jaunty using a jaunty iso file.

1. Create a work directory

# mkdir jaunty

2. Create the following directoires
# mkdir jaunty/cdrom
# mkdir jaunty/tmp
# mkdir jaunty/root

3. Mount the jaunty iso image on jaunty/cdrom directory
# mount -o loop jaunty.iso jaunty/cdrom
4. Copy everything from the cdrom to jaunty/image directory
# cp -r jaunty/cdrom jaunty/image
5. Now the image directory has the content of your cdrom

We are going to rebuild filesystem.squashfs under jaunty/image/casper

Move the filesystem.squashfs image to jaunty/tmp directory

# mv jaunty/image/casper/filesystem.squashfs jaunty/tmp
6. Mount the filesystem.squashfs under jaunty/root direct
# mount -o loop jaunty/tmp/filesystem.squashfs jaunty/root
7. Copy the contents of fileystem.squashfs to jaunty/remaster
# cp -r jaunty/root jaunty/remaster
8. Copy resolv.conf and sources.list from the host system
# cp /etc/resolv.conf jaunty/remaster/etc/
9. Preserve original sources.list.
# cp jaunty/remaster/etc/apt/soures.list jaunty/remaster/etc/apt/soures.list.backup
# cp /etc/apt/sources.list /jaunty/remaster/etc/apt/

Make sure that sources.list points to jaunty archive

10. Now you can chroot to jaunty/remaster
# chroot jaunty/remaster
11. Now run the following ( You are inside chroot )
# mount /proc

# mount /sys

# mount -t devpts none /dev/pts
The above commands mount the respective directories inside chroot.

12. Now you can install/remove necessary packages using apt.

eg:
# apt-get install vlc
# apt-get remove gimp

13. Cleanup the unwanted files.

# apt-get clean
# rm -rf /tmp/*
# rm /etc/resolv.conf

# umount -l -f /proc

# umount -l -f /sys

#umount /dev/pts

14. Now replace the sources.list with the original sources.list

# cp jaunty/remaster/etc/apt/sources.list.backup jaunty/remaster/etc/apt/sources.list

15. Repack squashfs:
# mksquashfs remaster image/casper/filesystem.squashfs -e remaster/boot
16. Recreate filesystem.manifest& filesystem.manifest.desktop:

Run the following commands.

# chroot remaster dpkg-query -W --showformat='${Package} ${Version}\n' | tee image/casper/filesystem.manifest

# cp -v image/casper/filesystem.manifest{,-desktop}

# REMOVE='ubiquity casper live-initramfs user-setup discover xresprobe os-prober libdebian-installer4'

# for i in $REMOVE
do
sed -i "/${i}/d" image/casper/filesystem.manifest-desktop
done

17. Recreate md5sum

# cd image && find . -type f -print0 | xargs -0 md5sum > md5sum.txt

18. Copy filesytem.squashfs manifest to imag dirtorey

Recreate the iso image:

# mkisofs -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-jaunty-remix.iso .
# cd ..

Now your remastered ubuntu 9.04 jaunty is achived.

Now install the image on to a hard disk.

Comments

Ahmad Zakaria said…
thnx a million ,,, that seems to work....

p.s. before installing any software,, u need to : apt-get update,,,
Anonymous said…
I think is better idea use the Reconstruktor. http://www.reconstructor.org/
Dipin Krishna said…
This is what the reconstructer does...
Unknown said…
This is great, thank you.

Its cool to know how to do this without the GUI tools (such as Reconstruktor). I was always curious how they worked, and this method makes sense. I will try it soon.

I'm sure it will come in handy, as I make custom images just to save time doing installs on new computers!
No_Asylum said…
Some of us actually prefer to NOT use GUI programs.

The CLI isnt nearly as hard as people seem to think.
togum said…
I have about 1 GB iso file about ubuntu.
I want to make it in two CD.

How can i do that?
thanks
Dipin Krishna said…
It's not trivially possible to split an bootable DVD into multiple CDs, as the installation program(s) will expect all of the installation media to be coming from a single source. To support multiple sources the installation program would need modifying to know how the media is distributed across the CDs and prompt you to insert the correct one at each stage.

If you just want to Split ISO image into multiple archives that can later be extracted to the full ISO, then see http://blog.dipinkrishna.info/2009/08/split-iso-image-into-multiple-archives.html
Great Work sir, V r proud of with u
MAHESH said…
when i was trying to install my customized version on virtualbox it only as a livecd.But when trying to install it it says "gvfs-gdu-volume-monitor closed unexpectedly" and stop installation.Plz help me....

Popular posts from this blog

How to install Skype on Ubuntu 10.04 Lucid Lynx

UPDATE: Skype has now been uploaded to the "partner" official Ubuntu 10.04 Lucid Lynx repository. See Install Skype in Ubuntu 10.04 Lucid Lynx from official partner repository Command Line way Get the package: For 32-bit $ wget http://www.skype.com/go/getskype-linux-beta-ubuntu-32 For 64-bit $ wget http://www.skype.com/go/getskype-linux-beta-ubuntu-64 You will need to install the following libraries. $ sudo apt-get install libqt4-dbus libqt4-network libqt4-xml libasound2 Now install skype(the file u just downloaded, may be named intrepid-ibex) $ sudo dpkg -i skype-XXXXXXXXXXXX.deb If you still get some dependency error then just type the command below $ sudo apt-get -f install this will install the dependencies and the skype. Non - Terminal Download the setup 32 -bit 64 -bit You will these packages: libqt4-dbus libqt4-network libqt4-xml . Goto Synaptic manager and install them. Now Launch the Skype install .deb file (just double click it) and follow the on screen prompts....

gtalx: Howto Gtalk in ubuntu ( google talk )

Did you fail to use " gtalk in ubuntu " ... Now you can chat and talk to your gmail buddies in ubuntu... 1. check for gtk2.0 and qt4 $ sudo apt-get install libgtk2.0-dev $ sudo apt-get install libqt4-dev libogg-dev libtheora-dev $ sudo apt-get install libsdl-dev libavcodec-dev libswscale-dev $ sudo apt-get install libexpat-dev libraw1394-dev libvorbis-dev $ sudo apt-get install libgsm1-dev  libspeexdsp-dev libmediastreamer0-dev libortp-dev 2. Remove 'pulse audio sound server' Open synaptic package manager and remove pulse audio 3. "Download gtalx" from here Dowload it here 4. Extract the file.... $ tar -zxvf 0.0.4.tar.gz 5. Get into the directory.... $ cd 0.0.4 and then... $ sudo chmod u+x make $ ./make $ sudo ./make install 6. Enjoy..... Please comment about your installation(whether it was a success or not....) Take gtalx from Applications > Internet > gtalx Enter your gmail login information..and click connect... ...

How to install Skype on Ubuntu 9.10 Karmic Koala

The two methods  below doesn't work now. Please see http://blog.dipinkrishna.info/2009/11/how-to-download-and-install-skype-for_3060.html for a successfull installation of skype on ubuntu. I have provided two methods. Please do comment which one is successful. Follow these steps to install skype in ubuntu 9.10 (64 bit).         First add:             deb http://packages.medibuntu.org/ karmic free non-free         to your source.list Now open a terminal and type: $ sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list Then do an update: $ sudo apt-get update $ sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring $ sudo apt-get -q update And finally install Skype. $ sudo apt-get install skype Ready ... now start skype with $ skype OR Download the setup 32 -bit 64 -bit Launch the Skype i...