Size: 11549
Comment: imported from the old wiki
|
Size: 257
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= LiveCDCustomizationHowTo = = How To Customize the New Ubuntu Live CD = Here we try to explain how to build a customized Ubuntu LiveCD based on the new Live CD infrastructure (first used in the HoaryHedgehog development cycle). The method will be to modify an already existing CD and re-build it. This way is less flexible, but avoids most of the (really unnecessary) complexity of building CDs from scratch. Why? Well, because some people want to create specialized Live CDs to show off a particular application or localized to a certain language. If you can think of anything else that can be done, put it on the wiki. == System Setup and Requirements == * About 3 gigabytes of available disk space * `cloop-utils` - tools to compress and decompress the filesystem image * `mkisofs` * An Ubuntu kernel, version `2.6.9-7` or later (for the `cloop` module) Copy and paste: {{{ $ sudo apt-get install cloop-utils mkisofs $ echo "Kernel version is" $(dpkg-query -W --showformat '${Version}' linux-image-$(uname -r)) }}} == The Process == First you will need to extract the loopback compressed file system image - [http://build.lnx-bbc.org/packages/kernel/cloop.html Cloop], so we would be able to customize it as we see fit - this could usually mean setting up packages and software we would like to have available from the LiveCD, presetting some of its configuration and more. After all our good work is done, we would put everything back, and a new LiveCD is born. Simple. === The Extraction Process === NOTE: Before starting make sure your locale is set to C (avoiding Unicode - but don't do this everywhere unless you know what you're doing), this just makes life easier: {{{ $ export LC_ALL=C }}} Grab a CD image from from http://cdimage.ubuntu.com/ and put it into an empty directory. Make sure it is a Hoary image (Warty uses a different system). 1. Mount the image() as a loop device: {{{ $ mkdir mnt $ sudo mount hoary-live-i386.iso mnt -o loop }}} 1. Extract everything except the compressed filesystem to a temporary directory: {{{ $ rsync --exclude=/casper/filesystem.cloop -a mnt/ extracted_cd }}} 1. Then we uncompress and extract the compressed filesystem: {{{ $ extract_compressed_fs mnt/casper/filesystem.cloop > extracted_fs }}} (Cup of tea time, because this takes a while) 1. After all this, we are done with the original CD and can unmount it (maybe also delete it if you are short of disk space): {{{ $ sudo umount mnt }}} === Customizations === To do the customizations we mount the now uncompressed filesystem image, use chroot to do our modifications and then start putting everything back together again. ==== Preparing the chroot ==== 1. So, to mount the uncompressed filesystem we do: {{{ $ sudo mount extracted_fs mnt -o loop }}} 1. Mounting proc and sysfs can also be a good idea: {{{ $ sudo mount -t proc proc mnt/proc $ sudo mount -t sysfs sysfs mnt/sys }}} 1. If you want to transfer data from your home directory, the easiest way is a bind mount: {{{ $ sudo mount -o bind /home mnt/home }}} NOTE: Obviously saving space on the compressed filesystem is a a good idea, so during these customizations some parts of the filesystem can be temporarily mounted with tmpfs and unmounted later. That way a lot of space can be saved. Some good targets for these mounts are var/log var/run var/cache/apt var/lib/apt tmp. Just remember to unmount them all before unmounting extracted_fs!!! ==== Language Localizations ==== To add support for a specific language to a liveCD, follow the 'Updating Specific Packages' section below to install the appropriate {{{language-support}}} and {{{language-pack}}} packages for the desired languages. You can pre-select a language at boot time with the following process: Edit {{{extracted_cd/isolinux/isolinux.cfg}}} to add {{{preseed/locale=foo_BAR}}} to the APPEND section. This will skip the language selection section in the installer, and presumes that you've installed the appropriate language/locale packages. For example, to support greek, install {{{language-pack-el}}}, {{{language-support-el}}}, and add {{{preseed/locale=el_GR}}} to the isolinux.cfg. Note that the installed files generally require only the language (en, es, el, etc.) while the isolinux.cfg requires the full locale (en_US, en_GB, etc.) To also set the default keymap, add {{{preseed/locale=en_US kbd-chooser/method=us}}} to isolinux.cfg. TODO - * Helping to translate with Rosetta ==== Updating Specific Packages ==== 1. If you need to test an additional package on a live CD, it's this easy: {{{ $ sudo chroot mnt/ /bin/sh # cd dir-holding-all-packages/ # dpkg -BOGiE *.deb }}} This will only update packages that are already installed on the live CD, but have newer versions available. ==== Installing Additional Packages ==== A common use for a LiveCD is to show off an application, normally not already installed on the CD. NOTE: The default user is created on startup, so if you want to copy a file to the default users home directory, you could place the file in `mnt/etc/skel`. 1. Copy in `resolv.conf`: {{{ $ sudo cp /etc/resolv.conf mnt/etc }}} 1. If the packages you wish to add are not available with the default `sources.list`, you may modify it, or copy in your own: {{{ $ sudo vi mnt/etc/apt/sources.list }}} 1. Finally, we chroot into the chroot and install some packages, updating the apt cache along the way, and making sure to purge instead of just remove anything we want to get rid of: {{{ $ sudo chroot mnt /bin/bash # apt-get update # apt-get install banana deadly-weapon # apt-get clean # dpkg --purge foobaz # exit }}} 1. Re-generate the manifest to reflect any changes you have made: {{{ $ sudo chroot mnt dpkg-query -W --showformat='${Package} ${Version}\n' > extracted_cd/casper/filesystem.manifest }}} TODO : * Help removing stuff. How to remove extra languages and everything that takes a lot of space so you can put your own apps on the CD. ==== GNOME Customizations ==== A list of GNOME-specific customizations (changing gconf keys, making GDM colors match, etc.) is at [http://live.gnome.org/GnomeLiveCd_2fHowTo the GNOME Wiki.] ==== Closing up the chroot ==== 1. Make sure to unmount everything mounted when setting up the chroot (tmp?? var/log??): {{{ $ sudo umount mnt/proc $ sudo umount mnt }}} ==== Customizing the bootsplash ==== To create a custom splash screen: 1. Create an image that is 640 pixels wide by somewhere between 200 and 300 pixels high, with 16 colors. (You can convert to 16 colors in GIMP with the Image->Mode->Indexed... menu item. Unselect "dithering" while converting, for a better result.). As a starting point, you may use [http://www.inkscape.com Inkscape] and this [http://planet.hellug.gr/misc/gnome-greek-logo.svg example file]. 1. Save the image as BMP, or if that is not possible, save to .png and run {{{convert splash.png splash.bmp}}} 1. Convert the BMP to RLE format: {{{bmptoppm < splash.bmp | ppmtolss16 > splash.rle}}} If you're missing these tools, {{{bmptoppm}}} is in the {{{netpbm}}} package, and ppmtolss16 is in the {{{syslinux}}} package. 1. copy the output ({{{splash.rle}}}) into {{{extracted_cd/isolinux/}}} === Putting the CD back together === OK, almost done. We only have to pack up the CD. 1. First compress the compressed filesystem and put it back on the CD (Another cup of tea required here): {{{ $ sudo create_compressed_fs extracted_fs 65536 > extracted_cd/casper/filesystem.cloop }}} 1. Then generate md5sum.txt file: {{{ $ (cd extracted_cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt) }}} 1. Then we re-build the cd. '''NOTE: ''' This procedure is specific to the Intel x86 (i386) and x86_64 (amd64) live CDs. Other architectures, such as PowerPC and IA64, will require different command line options. {{{ $ sudo mkisofs -r -V "Custom Ubuntu Live CD" \ -cache-inodes \ -J -l -b isolinux/isolinux.bin \ -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table \ -o custom-hoary-live-i386.iso extracted_cd }}} On PowerPC, download [http://people.ubuntu.com/~cjwatson/hfs.map], then use the following command: {{{ $ sudo mkisofs -r -V "Custom Ubuntu Live CD" \ --netatalk -hfs -probe -map hfs.map \ -part -no-desktop \ -hfs-bless extracted_cd/install \ -hfs-volid Ubuntu/PowerPC_hoary \ -o custom-hoary-live-powerpc.iso extracted_cd }}} And we are done! == More information == The LiveCD is based on the Ubuntu installer and uses its infrastructure to bootstrap the system. An additional installer component (`casper`) is used to load the live environment after bootstrap is complete. Perhaps you can find more information here: LiveCDDesign, LiveCD. Or look at the code by downloading casper and the debian installer (apt-get source casper debian-installer). NOTE: no source code modifications of any kind are necessary in order to customize live environment (for example, installing additional packages). This is purely informational. From GrantEmsley Tue Apr 12 17:31:58 +0100 2005 From: Grant Emsley Date: Tue, 12 Apr 2005 17:31:58 +0100 Subject: Live DVD Message-ID: <20050412173158+0100@www.ubuntulinux.org> Would I do the same thing to make a Live DVD? I assume some steps (esp. the mkisofs command) would be different for a DVD. From unknown Sun May 8 05:34:13 +0100 2005 From: Date: Sun, 08 May 2005 05:34:13 +0100 Subject: Message-ID: <20050508053413+0100@www.ubuntulinux.org> This page belongs in Releases >> HoaryHedgehog >> LiveCD >> not in Releases >> WartyWarthog >> LiveCD >> From unknown Sun May 8 05:37:34 +0100 2005 From: Date: Sun, 08 May 2005 05:37:34 +0100 Subject: InstallCDCustomizationHowTo InstallDVDCustomizationHowTo liveDVDCustomizationHowTo Message-ID: <20050508053734+0100@www.ubuntulinux.org> are the InstallCDCustomizationHowTo, InstallDVDCustomizationHowTo, liveDVDCustomizationHowTo available,.. planned? From JordiMassaguerPla Tue Jun 7 18:14:34 +0100 2005 From: Jordi Massaguer Pla Date: Tue, 07 Jun 2005 18:14:34 +0100 Subject: needed enough swap space Message-ID: <20050607181434+0100@https://www.ubuntulinux.org> In order to use the "create_compressed_fs" tool, you must have enough swap space. Having enough swap space, means having a big swap partition and, in some cases, cleaning it. By having enough I mean around 5Gb (at least). Cleaning the swap parition could be done like this (before using the create_compressed_fs): sudo mkswap /dev/hda4 sudo swapon -a Replace /dev/hda4 by your swap partition Be very careful when cleaning your partition. Make sure that you do it on your swap partition and that you are not running any crucial programs that could be using your swap space. Also, be very careful if you resize your swap partition, and thus, you change your partition table. From LuisVilla Tue Jun 7 18:24:55 +0100 2005 From: Luis Villa Date: Tue, 07 Jun 2005 18:24:55 +0100 Subject: swap space size Message-ID: <20050607182455+0100@https://www.ubuntulinux.org> Jordi, are you sure on that? I've been making liveCDs with only 1.5G of swap (though tons of other free space.) Are you sure you're not confusing swap and other free space? |
Hi, guys. I would like to modify a Live distro of Lucid Lynx to revert grub2 to grub1. I also need to make this substitution persistent, to use this new cd like live or installer, and with the ever grub1 instead of grub2! Can you help me about? Thanks |
Hi, guys. I would like to modify a Live distro of Lucid Lynx to revert grub2 to grub1. I also need to make this substitution persistent, to use this new cd like live or installer, and with the ever grub1 instead of grub2! Can you help me about? Thanks