I have a few question related to customizng Ubuntu 12.04 Live CD using the tutorial given at https://help.ubuntu.com/community/LiveCDCustomization .
For me it was possible to modify till the section where we install new softwares ( section 6.1.2) to the live cd. After that I directly jump to Advanced Customization (section 6.7) located at https://help.ubuntu.com/community/LiveCDCustomization#Advanced_Customizations . My questions are:-
1) When I run the following command to mount the live cd, it shows a warning that the iso is mounted as read only. Is it ok, or should it be writable?
2) There are three folders created in the folder livecdtmp. They are edit, extract-cd and mnt. My questions are, which folder should I edit so that the change happens to the "customized live cd", and which folder to edit to have the customized Ubuntu installation ?
3) What is the use of extract-cd, edit and mnt folders ?
4) The tutorial says, to have a custom background for GNOME, I have to edit /usr/share/gnome-background-properties/ubuntu-wallpapers.xml . Which file, or the file in which folder should I edit for the change to happen both in Live cd and the customized installation.
5) Then, coming to the Advanced Customiation --> Kernel Updation, once inside the chroot, I cannot issue the following commands :-
sudo cp edit/boot/vmlinuz-2.6.15-26-k7 extract-cd/casper/vmlinuz
sudo cp edit/boot/initrd.img-2.6.15-26-k7 extract-cd/casper/initrd.lz
It says, folder dosn't exist. Should this be done from inside the chroot environment ?
6) The tutorial says that, in order to edit the inird.lz file, I have to perform the following steps.
# cd extract-cd/casper
# mkdir lztempdir
# cd lztempdir
# lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames
Should this be done in chroot environment that we initially prepared ? Does editing this file alone make changes to both the customized live cd as well as to the installation made from that live cd ?
When I run the last command, I get the error, that there is a premature end of archive, or no file found ?
From the # symbol, it means that I should run it within the chroot environment. But the problem is that, whenever I run the command cd extract-cd/casper , it says, there is no such directory which is actually true, because, what is mounted is the 'edit' folder. So, what should be done ?
7) There are initrd.lz file in /casper folder in both 'extracr-cd' and 'mnt'. Should I copy the Kernel file to both these folders? Which one should I need to edit inorder to have updated kernel, new plymouth theme, etc ?
8) I wish to set gnome-classic to have in the live cd? What should be done in order to have the gnome-classic in both the live cd and in the installation made with that cd ?
9) How to remove lightdm login screen and to have the gdm like login screen that was initially present in Ubuntu till around 9.10 ?
Update:- When I ran the following command outside chroot, I get the following error.
roshan@roshan-Studio-1558:~/initrd$ lzma -dc -S .lz ../livecdtmp/extract-cd/casper/initrd.lz | cpio -imvd --no-absolute-filenames
lzma: ../livecdtmp/extract-cd/casper/initrd.lz: File format not recognized
cpio: premature end of archive
Edit is the one you want to chroot into, mnt is where you mount the read-only ISO, extract-cd is the extracted ISO. The ISO is fine as read-only, as I understand it, it is mounted at mnt. You DO NOT want to edit mnt, just the extracted CD. When you are done, you will make your own ISO. Anything you edit in the LiveCD, as I understand it, will be reflected in the installed system. Anything which has folders such as extract-cd, edit or mnt is not done inside chroot. As for the kernel - you need your own kernel here, and then you can
When done with the kernel:
And then follow the guide from Cleanup. Hope this works!
Those instructions on the wiki are extremely outdated and these days, quite complicated when there are tools such as Ubuntu Builder available. Since you are customizing Gnome, I highly recommend you follow the steps in this answer which explicitly discusses easily customizing the 12.04 LiveCD with Gnome-Classic.
As for your questions, here are the answers:
sudo apt-get update && sudo apt-get dist-upgrade
in the text chroot started from Ubuntu-Buildersudo apt-get install gdm
from UB chroot, and select it instead of lightdm in the dpkg popup1 - it is OK, iso's are supposed to be mounted read-only.
2,3 - you mainly change edit, as this is where you "chroot". Nevertheless, when you update the kernel, you have to "dump" the kernel and the initrd.img-... that you install inside the chroot at /edit/boot/... into the casper folder, inside the "extract-cd". So, to update kernel: Inside chroot, do an apt-get install linux-mage-XXX-whatever to get a new kernel version. This installs two things: a linux-image-XXX-whatever kernel image and a initrd-XXX-whatever inside your /boot directory (when outside the chroot, this directory will be edit/boot). If you blindly follow the wiki, first of all, and dump these two into extract-cd/casper, there are two problems with your initrd: one is it is compressed with gzip (extension .gz), and you need it as an initrd.lz (compressed with lzma), and second, the initrd that came when you installed the new kernel package may not have the squashfs module support to allow reading your live-cd. Both these problems are solved from inside the chroot (when the "edit" folder temporarily becomes your "root" environment, by generating a new initrd.lz using mkinitramfs for the new kernel version that you want to update to. This solves both problems, with one shot.
5 Should be done from outside the chroot environment, after you got the relevant files working inside the chroot (see my comment above)
6 It is done outside the chroot, but only if you really want to add new modules and maybe other stuff to your initrd. Otherwise stick to my comment above, to regenerate an initrd.lz with mkinitramfs.
7 As mnt is read-only, you do not do anything there. Everything is/was already copied off to either "edit" (the de-compressed squash-fs file) or to "extract-cd". You need to update extract-cd/casper such that vmlinuz and initrd.lz there are actually the new versions you want.