个人工具

“UbuntuHelp:LiveCDCustomization”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/LiveCDCustomization}} {{Languages|UbuntuHelp:LiveCDCustomization}} == How To Customize the Hoary/Breezy Ubuntu Live CD == * '''This page is valid...)
 
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/LiveCDCustomization}}
 
{{From|https://help.ubuntu.com/community/LiveCDCustomization}}
 
{{Languages|UbuntuHelp:LiveCDCustomization}}
 
{{Languages|UbuntuHelp:LiveCDCustomization}}
== How To Customize the Hoary/Breezy Ubuntu Live CD ==
 
  
* '''This page is valid for Ubuntu 5.04 (Hoary Hedgehog) and 5.10 (Breezy Badger).'''
 
* '''For Ubuntu 6.06 LTS (Dapper Drake), see the page [[UbuntuHelp:/6.06]]'''
 
  
=== Introduction ===
 
  
Here we try to explain how to build a customized Ubuntu LiveCD
+
== How to customize the Ubuntu Desktop CD ==
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
+
You may wish to customize the Ubuntu desktop (live) CD, possibly to show off a particular application, or localize to a certain language. Here's how.
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.
+
  
The [http://reconstructor.aperantis.com/ Reconstructor] tool can create custom GNOME-based Ubuntu LiveCDs from existing LiveCDs as well. There is also a [https://wiki.ubuntu.com/LiveCDCreator LiveCDCreator] specification that may or may not get implemented.
+
https://help.ubuntu.com/community/IconsPage?action=AttachFile&do=get&target=warning.png This guide is for the Desktop/Live CD; there is another page referrring to [[UbuntuHelp:InstallCDCustomization| customization of the Alternative Install or Server Install CD]].
  
=== System Setup and Requirements ===
+
== System Requirements ==
  
* About 3 gigabytes of available disk space
+
* About 3-5 gigabytes of free space
* `cloop-utils` - tools to compress and decompress the filesystem image
+
* Recommended at least 512 MB RAM and 1 GB swap
 +
* `squashfs-tools`
 
* `mkisofs`
 
* `mkisofs`
* An Ubuntu kernel, version `2.6.9-7` or later (for the `cloop` module)
+
* An Ubuntu kernel with `squashfs` support (the stock kernel in DapperDrake has it)
* A massive amount of swap space (3-5GB). You should be able to store the unextracted FS image in swap TWICE. Else, the recompression process will fail.
+
* QEMU, VirtualBox or VMware for testing
 +
 
 +
== The Process ==
 +
 
 +
First, make sure that you have installed the needed tools:
  
If you don't have enough swap, do:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo dd if=/dev/zero of=/tmp/swap bs=1M count=3000
+
sudo apt-get install squashfs-tools mkisofs qemu
$ sudo mkswap /tmp/swap
+
$ sudo swapon /tmp/swap
+
 
</nowiki></pre>
 
</nowiki></pre>
  
Copy and paste:
+
Load the squashfs module
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo apt-get install cloop-utils mkisofs
+
sudo modprobe squashfs
$ echo "Kernel version is" $(dpkg-query -W --showformat '${Version}' linux-image-$(uname -r))
+
 
</nowiki></pre>
 
</nowiki></pre>
  
 +
You need to download an official Desktop CD from http://releases.ubuntu.com/.
  
=== The Process ===
+
Move or copy it into an empty directory:
  
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.
+
<pre><nowiki>
 +
mkdir ~/live
 +
mv ubuntu-6.06.1-desktop-i386.iso ~/live
 +
cd ~/live
 +
</nowiki></pre>
  
Simple.
+
=== Extracting the CD contents ===
  
==== The Extraction Process ====
+
Mount the Desktop .iso
  
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:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ export LC_ALL=C
+
mkdir mnt
 +
sudo mount -o loop ubuntu-6.06.1-desktop-i386.iso mnt
 
</nowiki></pre>
 
</nowiki></pre>
  
Grab a CD image from from http://mirror.mcs.anl.gov/pub/ubuntu-iso/ and put it into an empty directory. Make sure it is a Hoary image (Warty uses a different system).
+
Extract .iso contents into dir 'extract-cd'
  
* Mount the image() as a loop device:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ mkdir mnt
+
mkdir extract-cd
$ sudo mount ubuntu-5.04-live-i386.iso mnt -o loop
+
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
 
</nowiki></pre>
 
</nowiki></pre>
  
* Extract everything except the compressed filesystem to a temporary directory:
+
=== Extracting the Desktop system ===
<pre><nowiki>
+
 
$ rsync --exclude=/casper/filesystem.cloop -a mnt/ extracted_cd
+
Mount the squashfs filesystem
</nowiki></pre>
+
  
* Then we uncompress and extract the compressed filesystem:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ extract_compressed_fs mnt/casper/filesystem.cloop > extracted_fs
+
mkdir squashfs
 +
sudo mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
 
</nowiki></pre>
 
</nowiki></pre>
  
(Cup of tea time, because this takes a while)
+
Extract squashfs contents into dir 'edit'
 
+
* 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):
+
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo umount mnt
+
mkdir edit
 +
sudo cp -a squashfs/* edit/
 
</nowiki></pre>
 
</nowiki></pre>
  
==== Customizations ====
+
'''Warning: Do not use `unsquashfs` command from Ubuntu 6.10 (Edgy)''', because it doesn't honour set-id bits (https://launchpad.net/bugs/89417). The version in Ubuntu 7.04 (Feisty) is fine.
  
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.
+
=== Prepare and chroot ===
  
===== Preparing the chroot =====
+
If you need the network connection within chroot:
  
* So, to mount the uncompressed filesystem we do:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mount extracted_fs mnt -o loop
+
sudo cp /etc/resolv.conf edit/etc/
 
</nowiki></pre>
 
</nowiki></pre>
  
* Mounting proc and sysfs can also be a good idea:  
+
Depending on your configuration, you ''may'' also need to copy the '''hosts''' file:
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mount -t proc proc mnt/proc
+
sudo cp /etc/hosts edit/etc/
$ sudo mount -t sysfs sysfs mnt/sys
+
 
</nowiki></pre>
 
</nowiki></pre>
  
* If you want to transfer data from your home directory, the easiest way is a bind mount:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mount -o bind /home mnt/home
+
sudo chroot edit
 +
mount -t proc none /proc
 +
mount -t sysfs none /sys
 
</nowiki></pre>
 
</nowiki></pre>
  
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!!!
+
To avoid locale issues and in order to import GPG keys, set:
  
===== Language Localizations (hoary) =====
+
<pre><nowiki>
 +
export HOME=/root
 +
export LC_ALL=C
 +
</nowiki></pre>
  
To add support for a specific language to a liveCD, follow the 'Updating Specific Packages' section below to install the appropriate <code><nowiki>language-support</nowiki></code> and <code><nowiki>language-pack</nowiki></code> packages for the desired languages.
+
=== Customizations ===
  
You can pre-select a language at boot time with the following process: Edit <code><nowiki>extracted_cd/isolinux/isolinux.cfg</nowiki></code> to add <code><nowiki>preseed/locale=foo_BAR</nowiki></code> 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.
+
Few example customizations, and tips
  
For example, to support greek, install <code><nowiki>language-pack-el</nowiki></code>, <code><nowiki>language-support-el</nowiki></code>, and add <code><nowiki>preseed/locale=el_GR</nowiki></code> 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.)
+
==== Apt-get ====
 +
To view installed packages by size:
 +
<pre><nowiki>
 +
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
 +
</nowiki></pre>
 +
When you want to remove packages remember to use purge
 +
<pre><nowiki>
 +
apt-get remove --purge package name
 +
</nowiki></pre>
  
To also set the default keymap, add <code><nowiki>preseed/locale=en_US kbd-chooser/method=us</nowiki></code> to isolinux.cfg.
+
==== Custom Background for GNOME ====
  
TODO -
+
Generally background files are located in '''/usr/share/backgrounds'''. Copy your png file there and edit the files:
* Helping to translate with Rosetta
+
* '''/usr/share/gnome-background-properties/ubuntu-wallpapers.xml''' and
 +
* '''/etc/gconf/gconf.xml.defaults/%gconf-tree.xml'''
 +
by changing the string '''/usr/share/backgrounds/warty-final-ubuntu.png''' to point to your file. [http://ubuntuforums.org/showthread.php?t=462810&highlight=warty-final-ubuntu.png More...]
  
===== Language Localizations (breezy) =====
+
==== Change gconf values (fonts, panels etc.) ====
Same as above, except replace <code><nowiki>preseed/locale</nowiki></code> with <code><nowiki>debian-installer/locale</nowiki></code>, and additionally install <code><nowiki>language-pack-gnome-foo_BAR-base</nowiki></code> or <code><nowiki>language-pack-kde-foo_BAR-base</nowiki></code> besides the language packs above.
+
  
===== Updating Specific Packages =====
+
To make any change on the gconf attributes you must add the value that you want in the file '''/etc/gconf/gconf.xml.defaults/%gconf-tree.xml'''. Adding a value in that file will change the default values of Gnome or other applications, so you can change fonts, backgrounds, themes, cursors etc.
  
* If you need to test an additional package on a live CD, it's this easy:  
+
Instead of editing the file with '''gedit''' or another text editor, you can use the '''gconftool-2''', under the chroot environment, running the following line:
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo chroot mnt/ /bin/sh
+
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set yourkey "yourvalue"
# cd dir-holding-all-packages/
+
# dpkg -BOGiE *.deb
+
 
</nowiki></pre>
 
</nowiki></pre>
  
This will only update packages that are already installed on the live CD, but have newer versions available.
+
where ''string'', ''yourkey'' and ''yourvalue'' must be the type, key and value that you want to change...
 
+
===== Installing Additional Packages =====
+
  
A common use for a LiveCD is to show off an application, normally not already installed on the CD.
+
==== Change default language of gfxboot ====
  
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`.
+
This customization must be done outside the chroot.
  
* Copy in `resolv.conf` (containing already-resolved DNS addresses, because DNS doesn't work inside chroot):
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo cp /etc/resolv.conf mnt/etc
+
sudo -s
 +
apt-get install dpkg-dev
 +
apt-get source gfxboot-theme-ubuntu gfxboot
 +
cd gfxboot-theme-ubuntu*/
 +
make DEFAULT_LANG=fi
 +
sudo cp -af boot/* ../extract-cd/isolinux/
 +
exit
 
</nowiki></pre>
 
</nowiki></pre>
  
* If the packages you wish to add are not available with the default `sources.list`, you may modify it, or copy in your own:  
+
Change "fi" to your preferred locale. Note that this does not change which languages are available in the F2 menu. For more info about gfxboot customization, see [http://uck.sourceforge.net/ Ubuntu Customization Kit].
 +
 
 +
* A other way to change the default language of gfxboot without rebuild the packages is to create a file name '''lang''' in the isolinux directory containing your locale's name.
 +
 
 +
==== Customization limits ====
 +
 
 +
After customization make sure that there are no users with an UID >= 1000. Otherwise your image won't boot because no initial user is available (see /usr/lib/user-setup/functions.sh and /usr/lib/user-setup/user-setup-apply). While in chroot:
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo vi mnt/etc/apt/sources.list
+
grep '<sup>[^:]*:[</sup>:]*:[1-9][0-9][0-9][0-9]:' /etc/passwd
 +
grep '<sup>[^:]*:[</sup>:]*:[12][0-9][0-9][0-9][0-9]:' /etc/passwd
 
</nowiki></pre>
 
</nowiki></pre>
  
* 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:  
+
If you get any hits, try changing the uid:
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo chroot mnt /bin/bash
+
usermod -u 500 $hit
# apt-get update
+
# apt-get install banana deadly-weapon
+
# apt-get clean
+
# dpkg --purge foobaz
+
# exit
+
 
</nowiki></pre>
 
</nowiki></pre>
  
* To re-generate the manifest to reflect any changes you have made, you must become root or use sudo.
 
  
Then you can re-generate the manifest to reflect any changes you have made.
+
=== Advanced Customizations ===
 +
 
 +
==== Live CD Kernel ====
 +
If you want to customize further the boot process, you can change the livecd kernel, by copying the vmlinuz and initrd you want in place of the ones you find in extract-cd/casper (don't forget to apt-get the right kernel, the one that matches the livecd one, once chrooted into edit).
 +
 
 +
i.e.
 
<pre><nowiki>
 
<pre><nowiki>
$ chroot mnt dpkg-query -W --showformat='${Package} ${Version}\n' > extracted_cd/casper/filesystem.manifest
+
sudo cp /boot/vmlinuz-2.6.15-26-k7 extract-cd/casper/vmlinuz
# exit
+
sudo cp /boot/initrd.img-2.6.15-26-k7 extract-cd/casper/initrd.gz
 
</nowiki></pre>
 
</nowiki></pre>
  
===== Finding Packages to Remove =====
+
==== Boot init ====
  
Obviously removing packages is dangerous; proceed at your own risk :) However, you can find the biggest packages (and hence sometimes the best to remove if you need space) with this command, run in the chroot:
+
You have to edit the files in edit/usr/share/initramfs-tools/scripts/casper-bottom/*
 +
For example you can change the hostname or the livecd user.
  
<code><nowiki>dpkg-query -W --showformat='${Installed-Size;10} ${Package}\n' | sort -gr | less</nowiki></code>
+
i.e.
  
TODO :
+
<pre><nowiki>
 +
sudo nano edit/usr/share/initramfs-tools/scripts/casper
 +
</nowiki></pre>
  
* Help removing stuff- 'recommended' list of packages to remove, including extra languages and everything that takes a lot of space so you can put your own apps on the CD. Note that you can see what the GNOME liveCD removes in: http://cvs.gnome.org/viewcvs/livecd-project/livecd.conf?view=markup
+
and edit the username or hostname
  
===== GNOME Customizations =====
+
<pre><nowiki>
 +
sudo nano edit/usr/share/initramfs-tools/scripts/casper-bottom/10adduser
 +
</nowiki></pre>
  
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.]
+
to edit even the livecd user's password.
  
===== User-Mode bootsplash customizations =====
+
P.S. in order to obtain an encrypted password, you have to use the mkpasswd program that's shipped with whois package!
  
You can also customize the colors and the image presented to the user while the services are load. You can even customize the scrollbar colors! For further information, see [[UbuntuHelp:USplashCustomizationHowto]].
+
==== Rebuilding initrd ====
  
/!\ Notice that this this is different than the image showed just after the CD boots up. That image is loaded by the bootload and its customization process is described [[isolinuxsplash just below]].
+
After you've modified the kernel, init scripts or added new kernel modules, you need to rebuild the initrd.gz file and substitute it into the casper directory.
  
===== Closing up the chroot =====
 
 
* Make sure to unmount everything mounted when setting up the chroot (tmp?? var/log??):
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo umount mnt/proc
+
sudo chroot edit
$ sudo umount mnt/sys
+
mkinitramfs -o /initrd.gz 2.6.15-26-k7
$ sudo umount mnt
+
 
</nowiki></pre>
 
</nowiki></pre>
 +
(replace the kernel version with the one that the CD will boot with - this can be found in edit/lib/modules)
  
===== Customizing the bootsplash =====
+
Exit from the chroot jail and move this file to extract-cd/casper:
[[Anchor(isolinuxsplash)]]
+
  
To create a custom splash screen:
+
<pre><nowiki>
* 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.org Inkscape] and this [http://planet.hellug.gr/misc/gnome-greek-logo.svg example file].
+
exit
* Save the image as BMP, or if that is not possible, save to .png and run <code><nowiki>convert splash.png splash.bmp</nowiki></code>
+
mv edit/initrd.gz extract-cd/casper/
* Convert the BMP to RLE format: <code><nowiki>bmptoppm < splash.bmp | ppmtolss16 > splash.rle</nowiki></code> If you're missing these tools, <code><nowiki>bmptoppm</nowiki></code> is in the <code><nowiki>netpbm</nowiki></code> package, and ppmtolss16 is in the <code><nowiki>syslinux</nowiki></code> package.
+
</nowiki></pre>
* copy the output (<code><nowiki>splash.rle</nowiki></code>) into <code><nowiki>extracted_cd/isolinux/</nowiki></code>
+
  
==== Cleaning up the extracted image ====
+
=== Cleanup ===
  
Ok, here's the deal: If you deleted files, the corresponding blocks in the extracted_fs file aren't zeroed. Therefore, as far as the create_compressed_fs program (which compresses the extracted_fs image) is concerned, the files are still there. As a result, files you delete won't really improve the amount of free space :(.
+
Be sure to remove any temporary files which are no longer needed, as space on a CD is limited. A classic example is downloaded package files, which can be cleaned out using:
 +
<pre><nowiki>
 +
apt-get clean
 +
</nowiki></pre>
 +
Or delete temporary files
 +
<pre><nowiki>
 +
rm -rf /tmp/*
 +
</nowiki></pre>
 +
Or nameserver settings
 +
<pre><nowiki>
 +
rm /etc/resolv.conf
 +
</nowiki></pre>
  
So, a quick workaround is to copy the old image onto a new one:
+
now umount (unmount) special filesystems and exit chroot
  
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mkdir mnt.new
+
umount /proc
$ sudo dd if=/dev/zero of=extracted_fs.new bs=1M count=2000
+
umount /sys
$ sudo mkfs.ext2 extracted_fs.new
+
exit
$ sudo mount -o loop,noatime,nodiratime extracted_fs mnt
+
$ sudo mount -o loop,noatime,nodiratime extracted_fs.new mnt.new
+
$ sudo rsync -avx --progress mnt/. mnt.new/.
+
$ sudo umount mnt mnt.new
+
 
</nowiki></pre>
 
</nowiki></pre>
  
Now, you have a new image, extracted_fs.new, that's both defragmented and cleaned with zeros.
+
=== Putting the CD together ===
  
==== Putting the CD back together ====
+
Regenarate manifest
 +
<pre><nowiki>
 +
chmod +w extract-cd/casper/filesystem.manifest
 +
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
 +
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
 +
sudo sed -ie '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
 +
</nowiki></pre>
  
OK, almost done. We only have to pack up the CD.
+
Compress filesystem
 +
<pre><nowiki>
 +
sudo rm extract-cd/casper/filesystem.squashfs
 +
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs
 +
</nowiki></pre>
  
* First compress the compressed filesystem and put it back on the CD (Another cup of tea required here):
+
Set an image name in extract-cd/README.diskdefines
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo create_compressed_fs extracted_fs.new -B 65536 extracted_cd/casper/filesystem.cloop
+
sudo vim extract-cd/README.diskdefines
</nowiki></pre> TIP: If you'd like better compression (MantasKriaučiūnas: don't use cloop-utils from Ubuntu 5.10 with --best, because this version doesn't use 7zip compression and doesn't produce better compression), but with a SIGNIFICANTLY SLOWER (5-fold, at least) process, use:
+
</nowiki></pre>
 +
 
 +
Remove old md5sum.txt and calculate new md5 sums
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo create_compressed_fs --best extracted_fs.new -B 65536 extracted_cd/casper/filesystem.cloop
+
sudo -s
 +
rm extract-cd/md5sum.txt
 +
(cd extract-cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
 +
exit
 
</nowiki></pre>
 
</nowiki></pre>
  
* Then generate md5sum.txt file:
+
Create Iso
 
<pre><nowiki>
 
<pre><nowiki>
$ (cd extracted_cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
+
cd extract-cd
 +
sudo 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-6.06.1-desktop-i386-custom.iso .
 
</nowiki></pre>
 
</nowiki></pre>
  
* 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.
+
=== Testing the CD ===
 +
 
 +
Test using qemu emulator
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mkisofs -r -V "Custom Ubuntu Live CD" \
+
qemu -cdrom ubuntu-6.06.1-desktop-i386-custom.iso -boot d
-cache-inodes \
+
-J -l -b isolinux/isolinux.bin \
+
-c isolinux/boot.cat -no-emul-boot \
+
-boot-load-size 4 -boot-info-table \
+
-o custom-breezy-live-i386.iso extracted_cd
+
 
</nowiki></pre>
 
</nowiki></pre>
  
On PowerPC, download [http://people.ubuntu.com/~cjwatson/hfs.map], then use the following command:  
+
You can also test with vmplayer (which is free for Linux) which is a little faster than qemu, albeit not free and open source software.
 +
 
 +
=== Burning the image to CD ===
 +
 
 +
Simple! Just do:
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mkisofs -r -V "Custom Ubuntu Live CD" \
+
cdrecord dev=/dev/cdrom ubuntu-6.06.1-desktop-i386-custom.iso
--netatalk -hfs -probe -map hfs.map \
+
-chrp-boot -iso-level 2 -part -no-desktop \
+
-hfs-bless extracted_cd/install \
+
-hfs-volid Ubuntu/PowerPC_breezy \
+
-o custom-breezy-live-powerpc.iso extracted_cd
+
 
</nowiki></pre>
 
</nowiki></pre>
  
On ia64:  
+
== Comments ==
 +
 
 +
If you have any comments or questions, please feel free to add them here.
 +
 
 +
I have created an small Customization Example (named Firebird Live CD) by adding an firebird-super-server and flamerobin packages (this apply to ubuntu dapper drake)
 +
http://flamerobin.blogspot.com/2006/05/creating-flamerobinfirebird-live-cd.html
 +
I created an updated guide with Ubuntu Festy Fawn also with an iso download for the Firebird/Flamerobin live cd
 +
http://flamerobin.blogspot.com/2007/09/creating-flamerobinfirebird-livecd-with.html
 +
 
 +
----
 +
 
 +
I have created tool for automatic remastering of live CD images. See http://uck.sourceforge.net/ .
 +
 
 +
Features:
 +
** GUI for simple creation of localized CDs (including changing gfxboot and installing language packs)
 +
** Script for customization of ISO, SquashFS and initrd on live CD.
 +
 
 +
----
 +
http://www.atworkonline.it/~bibe/ubuntu/custom-livecd.htm seems to have some nice info. no license that I can see so we would need to ask permission from the author to us its material.
 +
 
 +
----
 +
 
 +
If you want to make the CD boot faster, you might try sorting the files so that they are in the CD in the order that they are accessed: http://lichota.net/%7Ekrzysiek/projects/kubuntu/dapper-livecd-optimization/
 +
 
 +
----
 +
 
 +
Great How To.  I am having one issue however.  I would like to use custom xorg.conf and sources.list files.  Any tips on doing this?  Thanks.
 +
* Simply, copy the files to edit/etc/ in the same way (and at the same time) that you copy in the resolv.conf and hosts files.
 +
* I have found that copying xorg.conf doesn't work, as the boot-time scripts overwrite it. Besides, you can't guarantee that a particular xorg.conf will run on all hosts. I'm currently trying to get the binary NVIDIA drivers to work out of the box if an NVIDIA card is present. If I figure out how to fix the xorg.conf, I'll post it here. --JeremyVisser
 +
 
 +
----
 +
 
 +
I've managed to get Synaptic running from within the chroot environment, but it does hang when I try to apply packages.
 +
What you do is run "Xnest -ac :1" to get an Xnest server to run on display :1 without access control so anyone can connect to it. Then, in the chroot environment, run "export DISPLAY=:1" to get programs to use the display. Then, type "metacity &" to be able to move windows. Finally, run "synaptic".
 +
 
 +
It works fine until you try to apply packages, where it hangs for me. --JeremyVisser
 +
 
 +
----
 +
 
 +
Shouldn't the mkinitramfs command use the casper scripts, like "mkinitramfs -o initrd.gz 2.6.15-23-386 -d /usr/share/initramfs-tools"?
 +
 
 +
----
 +
 
 +
There are tricks on how you can get to feel the GNOME system in your chroot environment.
 +
 
 +
1. Copy your xorg.conf in the chrooted "etc/X11/" directory.
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
$ sudo mkisofs -r -V 'Custom Ubuntu 5.10 live ia64' \
+
cp /etc/X11/xorg.conf edit/etc/X11/
-o custom-breezy-live-ia64.iso -no-emul-boot \
+
-J -b boot/boot.img -c boot/boot.catalog extracted_cd
+
 
</nowiki></pre>
 
</nowiki></pre>
  
And we are done!
+
2. Create generic devices on your chroot system using MAKEDEV
  
=== Useful scripts: livecd_tools ===
+
<pre><nowiki>
 +
cd /dev/
 +
MAKEDEV generic
 +
</nowiki></pre>
  
All the above commands are resumed in this set of scripts: [https://help.ubuntu.com/community/LiveCDCustomization?action=AttachFile&do=get&target=livecd_tools-0.0.1.tgz livecd_tools v0.0.1]. This package includes the following commands:
+
3. Start X or restart gdm
  
livecd_extractcd:
+
<pre><nowiki>
Extracts the Live CD content and uncompress the compresed filesystem.  
+
/etc/init.d/gdm start
Needs to run as root, it mounts the iso using the loop device
+
</nowiki></pre>
  
livecd_createcd:
+
Supposed you want to make modifications on the Desktop, that will be used by all the new users,
Compress the filesystem and creates the Live CD iso image.  
+
just change your $HOME to /etc/skel/ and start gdm or X.
  
livecd_mountfs:
+
<pre><nowiki>
Mount a filesystem with a linux instalation, mounting
+
export HOME=/etc/skel/
temporal directories with tmpfs.
+
</nowiki></pre>
  
livecd_umountfs:
+
If you want to load all the other stuff GNOME needs (i.e, dbus, avahi, network-manager),
umount a filesystem with a linux instalation, umounting temporal directories
+
just boot as (single-user mode), and start dbus in your chrooted environment.
 +
 
 +
<pre><nowiki>
 +
/etc/init.d/dbus start
 +
</nowiki></pre>
  
livecd_swap:
+
An example of the whole procedure. (under single-user mode)
Creates and activates a temporal swap file
+
  
With this tools you can do:
 
 
<pre><nowiki>
 
<pre><nowiki>
# ./livecd_tools-0.0.1/livecd_extractcd ubuntu-live.iso
+
sudo /etc/init.d/networking restart
# ./livecd_tools-0.0.1/livecd_mountfs -t livecd_fs.ext2 mnt
+
sudo cp /etc/resolv.conf edit/etc/
... Modify the instalation ...
+
sudo cp /etc/X11/xorg.conf edit/etc/X11/
# ./livecd_tools-0.0.1/livecd_umountfs mnt
+
sudo chroot edit
# ./livecd_tools-0.0.1/livecd_swap start
+
mount -o none /proc
# ./livecd_tools-0.0.1/livecd_createcd myubuntu-live.iso
+
mount -o none /sys
 +
export HOME=/etc/skel/
 +
cd /dev/
 +
MAKEDEV generic
 +
/etc/init.d/dbus start
 +
/etc/init.d/gdm start
 
</nowiki></pre>
 
</nowiki></pre>
  
This scripts accept options to tune paths. Read `Readme.txt`
 
  
 +
--- [[UbuntuHelp:joelbryan]]
  
 +
----
  
 +
Hello,
  
=== More information ===
+
I am about to build a new Livecd and have a question:
 +
When I change the username, hostname and the user's password the user login automatically during booting the livesystem. But this is not desired. Is it correct, that I have to enter a password under a Desktop LiveCD when I delet the encrypted password in /usr/share/initramfs-tools/scripts/casper-bottom/10adduser ?
  
The LiveCD is based on the Ubuntu installer and uses its infrastructure to
+
Thanks
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
+
Changing username and password will not change login behaviour, because this is done in /usr/share/initramfs-tools/scripts/casper-bottom/15autologin
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
+
--- [[UbuntuHelp:Alexander Hosfeld]]
From: Grant Emsley
+
Date: Tue, 12 Apr 2005 17:31:58 +0100
+
Subject: Live DVD
+
Message-ID: <[email protected]>
+
  
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
+
Having trouble starting a MySQL server from within the chroot jail. Any suggestions?
From:
+
Date: Sun, 08 May 2005 05:34:13 +0100
+
Subject:
+
Message-ID: <20050508053413+0100@www.ubuntulinux.org>
+
  
This page belongs in
+
- Dave
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: <[email protected]>
 
  
are the InstallCDCustomizationHowTo, InstallDVDCustomizationHowTo, liveDVDCustomizationHowTo available,.. planned?
+
Hey,
  
From JordiMassaguerPla Tue Jun 7 18:14:34 +0100 2005
+
I am trying to make a customized live cd of Kubuntu 6.06 that will be completly preconfigured, so that when the user clicks on the install icon on KDE the installer should do everything by itself, meaning that the installer should not ask any questions to the user.
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):
+
To do this I am trying to write a preseed file to tell the installer the information that it needs.
  
sudo mkswap /dev/hda4
+
The problem is that even with this preseed file I could only tell the installer what is the username that it should use, the rest of the information is simply ignored by the installer.
sudo swapon -a
+
  
Replace /dev/hda4 by your swap partition
+
I must be doing something wrong and would appreciate any and all help given me.
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.
+
  
 +
Thanks,
 +
Komyg
  
 +
PS: Should I post my preseed file here?
  
From LuisVilla Tue Jun 7 18:24:55 +0100 2005
+
----
From: Luis Villa
+
If the livecd is not going to be used for the purposes of installing what files can be removed? Can the "pool" files containing the .debs be removed too?
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?
+
- Mike
  
  
 +
----
 +
If I want to put in my LiveCD applications that aren't in the sources.list (like ooffice 2.2 or perl audio converter), what cain I do?
  
From ArneCaspari2 ( Arne Caspari )
 
  
===== Debconf Questions =====
+
- Isoldanne
To skip all questions during startup ( ie. let the CD not to ask for the screen resolution ), add <code><nowiki>DEBCONF_PRIORITY=critical</nowiki></code> to the APPEND string in <code><nowiki>extracted_cd/isolinux/isolinux.cfg</nowiki></code>.
+
  
===== Default User =====
+
----
The easiest way to create a usefull default for the live CD user is to boot once with the customized CD, then do all the actions to create the default settings ( ie. change the desktop background; create symlinks on the Desktop and so on ). Then log out and select "Save current setup" on the logout window ( this will save the session obviously so all windows that are still open while logging off will be opened when the CD starts ). After logout, change to a console ( eg. by pressing CTRL+ALT+F1 ) and create a TAR archive of the user's home directory. Copy this archive to a permanent storage ( ie. a network share or onto an USB stick ). Put the contents of the TAR archive into mnt.extracted_fs/etc/skel and recreate the CD. The new defaults will be copied when the user is created during the boot process.
+
  
===== Accelerate the CD Creation Process =====
+
To get desired <code><nowiki>/etc/X11/xorg.conf</nowiki></code> one can modify the <code><nowiki>/usr/bin/dexconf</nowiki></code>.
This sounds strange and your mileage may vary according to your system/graphics card: I build the CD on a system with an SIS chipset which is possibly not too well accelerated. The actions that give plenty of output to the console ( ie. the ''rsync'' step or the ''create_compressed_fs'' step ) run significantly slower because the terminal takes up too much time drawing the text. They run way faster if the terminal is minimized while they run but if you want to see the progress of these commands, resizing the window to show only two lines of text also helps. ( Maybe running the commands on a text only console might also perform better ).
+
This script generates xorg.conf automatically in liveCD session
 +
according to the booted machine.
 +
 
 +
For example:
  
===== Testing the CD =====
 
The obvious tip to test the CD is to use '''rewritable''' CDs until you are realy happy with the result. But another tip to just check if the CD still boots correctly after making big changes is to boot the ISO image with '''qemu'''. QEMU is available in the ''universe'' repository. Run it like this:
 
 
<pre><nowiki>
 
<pre><nowiki>
$ qemu -cdrom liveimage.iso -boot d
+
# diff ~/bin/dexconf /usr/bin/dexconf
 +
268,269c268
 +
< Option "XkbLayout" "us,il"
 +
< Option          "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"
 +
---
 +
> Option "XkbLayout" "$XKB_LAYOUT"
 
</nowiki></pre>
 
</nowiki></pre>
  
It might be a bit slow but at least it squares a burn/reboot/test/reboot cycle.
+
-- yotam
 +
----
 +
 
 +
 
 +
I cant do chroot. When i run it a get this error
 +
 
 +
chroot: cannot run command `/bin/bash': No such file or directory
  
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
+
Please help me out
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月22日 (四) 13:24的版本



How to customize the Ubuntu Desktop CD

You may wish to customize the Ubuntu desktop (live) CD, possibly to show off a particular application, or localize to a certain language. Here's how.

IconsPage?action=AttachFile&do=get&target=warning.png This guide is for the Desktop/Live CD; there is another page referrring to customization of the Alternative Install or Server Install CD.

System Requirements

  • About 3-5 gigabytes of free space
  • Recommended at least 512 MB RAM and 1 GB swap
  • `squashfs-tools`
  • `mkisofs`
  • An Ubuntu kernel with `squashfs` support (the stock kernel in DapperDrake has it)
  • QEMU, VirtualBox or VMware for testing

The Process

First, make sure that you have installed the needed tools:

sudo apt-get install squashfs-tools mkisofs qemu

Load the squashfs module

sudo modprobe squashfs

You need to download an official Desktop CD from http://releases.ubuntu.com/.

Move or copy it into an empty directory:

mkdir ~/live
mv ubuntu-6.06.1-desktop-i386.iso ~/live
cd ~/live

Extracting the CD contents

Mount the Desktop .iso

mkdir mnt
sudo mount -o loop ubuntu-6.06.1-desktop-i386.iso mnt

Extract .iso contents into dir 'extract-cd'

mkdir extract-cd
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd

Extracting the Desktop system

Mount the squashfs filesystem

mkdir squashfs
sudo mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs

Extract squashfs contents into dir 'edit'

mkdir edit
sudo cp -a squashfs/* edit/

Warning: Do not use `unsquashfs` command from Ubuntu 6.10 (Edgy), because it doesn't honour set-id bits (https://launchpad.net/bugs/89417). The version in Ubuntu 7.04 (Feisty) is fine.

Prepare and chroot

If you need the network connection within chroot:

sudo cp /etc/resolv.conf edit/etc/

Depending on your configuration, you may also need to copy the hosts file:

sudo cp /etc/hosts edit/etc/
sudo chroot edit
mount -t proc none /proc
mount -t sysfs none /sys

To avoid locale issues and in order to import GPG keys, set:

export HOME=/root
export LC_ALL=C

Customizations

Few example customizations, and tips

Apt-get

To view installed packages by size:

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less

When you want to remove packages remember to use purge

apt-get remove --purge package name

Custom Background for GNOME

Generally background files are located in /usr/share/backgrounds. Copy your png file there and edit the files:

  • /usr/share/gnome-background-properties/ubuntu-wallpapers.xml and
  • /etc/gconf/gconf.xml.defaults/%gconf-tree.xml

by changing the string /usr/share/backgrounds/warty-final-ubuntu.png to point to your file. More...

Change gconf values (fonts, panels etc.)

To make any change on the gconf attributes you must add the value that you want in the file /etc/gconf/gconf.xml.defaults/%gconf-tree.xml. Adding a value in that file will change the default values of Gnome or other applications, so you can change fonts, backgrounds, themes, cursors etc.

Instead of editing the file with gedit or another text editor, you can use the gconftool-2, under the chroot environment, running the following line:

gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set yourkey "yourvalue"

where string, yourkey and yourvalue must be the type, key and value that you want to change...

Change default language of gfxboot

This customization must be done outside the chroot.

sudo -s
apt-get install dpkg-dev
apt-get source gfxboot-theme-ubuntu gfxboot
cd gfxboot-theme-ubuntu*/
make DEFAULT_LANG=fi
sudo cp -af boot/* ../extract-cd/isolinux/
exit

Change "fi" to your preferred locale. Note that this does not change which languages are available in the F2 menu. For more info about gfxboot customization, see Ubuntu Customization Kit.

  • A other way to change the default language of gfxboot without rebuild the packages is to create a file name lang in the isolinux directory containing your locale's name.

Customization limits

After customization make sure that there are no users with an UID >= 1000. Otherwise your image won't boot because no initial user is available (see /usr/lib/user-setup/functions.sh and /usr/lib/user-setup/user-setup-apply). While in chroot:

grep '<sup>[^:]*:[</sup>:]*:[1-9][0-9][0-9][0-9]:' /etc/passwd
grep '<sup>[^:]*:[</sup>:]*:[12][0-9][0-9][0-9][0-9]:' /etc/passwd

If you get any hits, try changing the uid:

usermod -u 500 $hit


Advanced Customizations

Live CD Kernel

If you want to customize further the boot process, you can change the livecd kernel, by copying the vmlinuz and initrd you want in place of the ones you find in extract-cd/casper (don't forget to apt-get the right kernel, the one that matches the livecd one, once chrooted into edit).

i.e.

sudo cp /boot/vmlinuz-2.6.15-26-k7 extract-cd/casper/vmlinuz
sudo cp /boot/initrd.img-2.6.15-26-k7 extract-cd/casper/initrd.gz

Boot init

You have to edit the files in edit/usr/share/initramfs-tools/scripts/casper-bottom/* For example you can change the hostname or the livecd user.

i.e.

sudo nano edit/usr/share/initramfs-tools/scripts/casper

and edit the username or hostname

sudo nano edit/usr/share/initramfs-tools/scripts/casper-bottom/10adduser

to edit even the livecd user's password.

P.S. in order to obtain an encrypted password, you have to use the mkpasswd program that's shipped with whois package!

Rebuilding initrd

After you've modified the kernel, init scripts or added new kernel modules, you need to rebuild the initrd.gz file and substitute it into the casper directory.

sudo chroot edit
mkinitramfs -o /initrd.gz 2.6.15-26-k7

(replace the kernel version with the one that the CD will boot with - this can be found in edit/lib/modules)

Exit from the chroot jail and move this file to extract-cd/casper:

exit
mv edit/initrd.gz extract-cd/casper/

Cleanup

Be sure to remove any temporary files which are no longer needed, as space on a CD is limited. A classic example is downloaded package files, which can be cleaned out using:

apt-get clean

Or delete temporary files

rm -rf /tmp/*

Or nameserver settings

rm /etc/resolv.conf

now umount (unmount) special filesystems and exit chroot

umount /proc
umount /sys
exit

Putting the CD together

Regenarate manifest

chmod +w extract-cd/casper/filesystem.manifest
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sudo sed -ie '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop

Compress filesystem

sudo rm extract-cd/casper/filesystem.squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs

Set an image name in extract-cd/README.diskdefines

sudo vim extract-cd/README.diskdefines

Remove old md5sum.txt and calculate new md5 sums

sudo -s
rm extract-cd/md5sum.txt
(cd extract-cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
exit

Create Iso

cd extract-cd
sudo 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-6.06.1-desktop-i386-custom.iso .

Testing the CD

Test using qemu emulator

qemu -cdrom ubuntu-6.06.1-desktop-i386-custom.iso -boot d

You can also test with vmplayer (which is free for Linux) which is a little faster than qemu, albeit not free and open source software.

Burning the image to CD

Simple! Just do:

cdrecord dev=/dev/cdrom ubuntu-6.06.1-desktop-i386-custom.iso

Comments

If you have any comments or questions, please feel free to add them here.

I have created an small Customization Example (named Firebird Live CD) by adding an firebird-super-server and flamerobin packages (this apply to ubuntu dapper drake) http://flamerobin.blogspot.com/2006/05/creating-flamerobinfirebird-live-cd.html I created an updated guide with Ubuntu Festy Fawn also with an iso download for the Firebird/Flamerobin live cd http://flamerobin.blogspot.com/2007/09/creating-flamerobinfirebird-livecd-with.html


I have created tool for automatic remastering of live CD images. See http://uck.sourceforge.net/ .

Features:

    • GUI for simple creation of localized CDs (including changing gfxboot and installing language packs)
    • Script for customization of ISO, SquashFS and initrd on live CD.

http://www.atworkonline.it/~bibe/ubuntu/custom-livecd.htm seems to have some nice info. no license that I can see so we would need to ask permission from the author to us its material.


If you want to make the CD boot faster, you might try sorting the files so that they are in the CD in the order that they are accessed: http://lichota.net/%7Ekrzysiek/projects/kubuntu/dapper-livecd-optimization/


Great How To. I am having one issue however. I would like to use custom xorg.conf and sources.list files. Any tips on doing this? Thanks.

  • Simply, copy the files to edit/etc/ in the same way (and at the same time) that you copy in the resolv.conf and hosts files.
  • I have found that copying xorg.conf doesn't work, as the boot-time scripts overwrite it. Besides, you can't guarantee that a particular xorg.conf will run on all hosts. I'm currently trying to get the binary NVIDIA drivers to work out of the box if an NVIDIA card is present. If I figure out how to fix the xorg.conf, I'll post it here. --JeremyVisser

I've managed to get Synaptic running from within the chroot environment, but it does hang when I try to apply packages. What you do is run "Xnest -ac :1" to get an Xnest server to run on display :1 without access control so anyone can connect to it. Then, in the chroot environment, run "export DISPLAY=:1" to get programs to use the display. Then, type "metacity &" to be able to move windows. Finally, run "synaptic".

It works fine until you try to apply packages, where it hangs for me. --JeremyVisser


Shouldn't the mkinitramfs command use the casper scripts, like "mkinitramfs -o initrd.gz 2.6.15-23-386 -d /usr/share/initramfs-tools"?


There are tricks on how you can get to feel the GNOME system in your chroot environment.

1. Copy your xorg.conf in the chrooted "etc/X11/" directory.

cp /etc/X11/xorg.conf edit/etc/X11/

2. Create generic devices on your chroot system using MAKEDEV

cd /dev/
MAKEDEV generic

3. Start X or restart gdm

/etc/init.d/gdm start

Supposed you want to make modifications on the Desktop, that will be used by all the new users, just change your $HOME to /etc/skel/ and start gdm or X.

export HOME=/etc/skel/

If you want to load all the other stuff GNOME needs (i.e, dbus, avahi, network-manager), just boot as (single-user mode), and start dbus in your chrooted environment.

/etc/init.d/dbus start

An example of the whole procedure. (under single-user mode)

sudo /etc/init.d/networking restart
sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/X11/xorg.conf edit/etc/X11/
sudo chroot edit
mount -o none /proc
mount -o none /sys
export HOME=/etc/skel/
cd /dev/
MAKEDEV generic
/etc/init.d/dbus start
/etc/init.d/gdm start


--- UbuntuHelp:joelbryan


Hello,

I am about to build a new Livecd and have a question: When I change the username, hostname and the user's password the user login automatically during booting the livesystem. But this is not desired. Is it correct, that I have to enter a password under a Desktop LiveCD when I delet the encrypted password in /usr/share/initramfs-tools/scripts/casper-bottom/10adduser ?

Thanks

Changing username and password will not change login behaviour, because this is done in /usr/share/initramfs-tools/scripts/casper-bottom/15autologin

--- UbuntuHelp:Alexander Hosfeld


Having trouble starting a MySQL server from within the chroot jail. Any suggestions?

- Dave


Hey,

I am trying to make a customized live cd of Kubuntu 6.06 that will be completly preconfigured, so that when the user clicks on the install icon on KDE the installer should do everything by itself, meaning that the installer should not ask any questions to the user.

To do this I am trying to write a preseed file to tell the installer the information that it needs.

The problem is that even with this preseed file I could only tell the installer what is the username that it should use, the rest of the information is simply ignored by the installer.

I must be doing something wrong and would appreciate any and all help given me.

Thanks, Komyg

PS: Should I post my preseed file here?


If the livecd is not going to be used for the purposes of installing what files can be removed? Can the "pool" files containing the .debs be removed too?

- Mike



If I want to put in my LiveCD applications that aren't in the sources.list (like ooffice 2.2 or perl audio converter), what cain I do?


- Isoldanne


To get desired /etc/X11/xorg.conf one can modify the /usr/bin/dexconf. This script generates xorg.conf automatically in liveCD session according to the booted machine.

For example:

# diff ~/bin/dexconf /usr/bin/dexconf 
268,269c268
< 	Option		"XkbLayout"	"us,il"
< 	Option          "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll" 
---
> 	Option		"XkbLayout"	"$XKB_LAYOUT"

-- yotam



I cant do chroot. When i run it a get this error

chroot: cannot run command `/bin/bash': No such file or directory

Please help me out