User Tools

Site Tools


howtos:building_a_custom_liveusb_2
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


howtos:building_a_custom_liveusb_2 [02/12/2018 21:34] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +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
 +
 +<code>
 +mkdir jaunty
 +</code>
 +
 +2. Create the following directoires
 +<code>
 +mkdir jaunty/cdrom
 +mkdir jaunty/tmp
 +mkdir jaunty/root
 +</code>
 +
 +3. Mount the jaunty iso image on jaunty/cdrom directory
 +
 +<code>
 +sudo mount -o loop jaunty.iso jaunty/cdrom
 +</code>
 +
 +4. Copy everything from the cdrom to jaunty/image directory
 +
 +<code>
 +cp -r jaunty/cdrom jaunty/image 
 +</code>
 +
 +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
 +
 +<code>
 +sudo mv jaunty/image/casper/filesystem.squashfs jaunty/tmp
 +</code>
 +
 +6. Mount the filesystem.squashfs under jaunty/root direct
 +
 +<code>
 +sudo mount -o loop jaunty/tmp/filesystem.squashfs jaunty/root
 +</code>
 +
 +7. Copy the contents of fileystem.squashfs to jaunty/remaster
 +<code>
 +sudo cp -r jaunty/root jaunty/remaster
 +</code>
 +
 +8. Copy resolv.conf and sources.list from the host system
 +
 +<code>
 +cp /etc/resolv.conf jaunty/remaster/etc/
 +</code>
 +
 +9. Preserve original sources.list.
 +
 +<code>
 +sudo cp jaunty/remaster/etc/apt/soures.list jaunty/remaster/etc/apt/soures.list.backup
 +sudo cp /etc/apt/sources.list jaunty/remaster/etc/apt/
 +</code>
 +
 +Make sure that sources.list points to jaunty archive
 +
 +10. Now you can chroot to jaunty/remaster
 +
 +<code>
 +chroot jaunty/remaster
 +</code>
 +
 +11. Now run the following ( You are inside chroot )
 +
 +<code>
 +mount /proc
 +mount /sys
 +mount -t devpts none /dev/pts
 +</code>
 +
 +The above commands mount the respective directories inside chroot.
 +
 +12. Now you can install/remove necessary packages using apt.
 +eg:
 +<code>
 +apt-get update
 +apt-get install vlc
 +apt-get remove gimp
 +</code>
 +
 +You can update the platform in general by running.
 +
 +<code>
 +apt-get update
 +apt-get dist-upgrade -y
 +</code>
 +
 +13. Cleanup the unwanted files.
 +
 +<code>
 +apt-get clean
 +rm -rf /tmp/*
 +rm /etc/resolv.conf
 +umount -l -f /proc
 +umount -l -f /sys
 +umount /dev/pts
 +</code>
 +
 +14. Now replace the sources.list with the original sources.list
 +
 +<code>
 +cp jaunty/remaster/etc/apt/sources.list.backup jaunty/remaster/etc/apt/sources.list
 +</code>
 +
 +15. Repack squashfs:
 +
 +<code>
 +mksquashfs remaster image/casper/filesystem.squashfs -e remaster/boot
 +</code>
 +
 +16. Recreate filesystem.manifest & filesystem.manifest.desktop:
 +
 +Run the following commands.
 +
 +<code>
 +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
 +</code>
 +
 +17. Recreate md5sum
 +
 +<code>
 +cd image && find . -type f -print0 | xargs -0 md5sum > md5sum.txt
 +</code>
 +
 +18. Copy filesytem.squashfs manifest to imag dirtorey
 +
 +Recreate the iso image:
 +
 +<code>
 +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 ..
 +</code>
 +
 +Now your remastered ubuntu 9.04 jaunty is achived.
 +
 +Now install the image on to a hard disk or use it as a liveCD/USB environment for recovery or general use.
 +----
 +You can also just use {{:howtos:reconstructor_2.9_all.deb|Reconstructor}}
 +
 +----
 +
 +Source: http://blog.dipinkrishna.info/2009/07/customise-or-remaster-ubuntu-904-jaunty.html
  
howtos/building_a_custom_liveusb_2.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1