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
2. Create the following directoires# mkdir jaunty
# mkdir jaunty/cdrom3. Mount the jaunty iso image on jaunty/cdrom directory
# mkdir jaunty/tmp
# mkdir jaunty/root
# mount -o loop jaunty.iso jaunty/cdrom4. Copy everything from the cdrom to jaunty/image directory
# cp -r jaunty/cdrom jaunty/image5. 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/tmp6. Mount the filesystem.squashfs under jaunty/root direct
# mount -o loop jaunty/tmp/filesystem.squashfs jaunty/root7. Copy the contents of fileystem.squashfs to jaunty/remaster
# cp -r jaunty/root jaunty/remaster8. 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.backupMake sure that sources.list points to jaunty archive
# cp /etc/apt/sources.list /jaunty/remaster/etc/apt/
10. Now you can chroot to jaunty/remaster
# chroot jaunty/remaster11. Now run the following ( You are inside chroot )
# mount /procThe above commands mount the respective directories inside chroot.# mount /sys
# mount -t devpts none /dev/pts
12. Now you can install/remove necessary packages using apt.
eg:# apt-get install vlc
# apt-get remove gimp
13. Cleanup the unwanted files.
14. Now replace the sources.list with the original sources.list# apt-get clean
# rm -rf /tmp/*
# rm /etc/resolv.conf# umount -l -f /proc
# umount -l -f /sys
#umount /dev/pts
15. Repack squashfs:# cp jaunty/remaster/etc/apt/sources.list.backup jaunty/remaster/etc/apt/sources.list
# mksquashfs remaster image/casper/filesystem.squashfs -e remaster/boot16. Recreate filesystem.manifest& filesystem.manifest.desktop:
Run the following commands.
17. Recreate md5sum# 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
18. Copy filesytem.squashfs manifest to imag dirtorey# cd image && find . -type f -print0 | xargs -0 md5sum > md5sum.txt
Recreate the iso image:
Now your remastered ubuntu 9.04 jaunty is achived.# 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 install the image on to a hard disk.
Comments
p.s. before installing any software,, u need to : apt-get update,,,
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!
The CLI isnt nearly as hard as people seem to think.
I want to make it in two CD.
How can i do that?
thanks
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