PDA

View Full Version : How to make a live CD/DVD from your harddisk installation


capink
February 5th, 2008, 09:39 PM
Transforming your Installation into a Live DVD/CD


This HOWTO is about making a live CD/DVD from the main system on your hard drive. This might be desired if you have customized your system and want to have it on CD.

Another approach that will be discussed here is building your live CD/DVD from scratch. This will be done by building a new system using debootstrap. This is usefull if you want to build a clean live CD, or if you want to build a minimal rescue cd. (Consult Appendix.2 for more details about building a CD from scratch).

The live CD is usually created with a filesystem called squashfs. Squashfs is read only compressed filesystem that allow us to squeeze our system into a single CD. Note that your system has to be about 2GB (this might need some trial an error) to produce a compressed image that fits on the CD.





Background on live CD/DVD

Note: This section is a clarification of how live CD works. You don't have to read it. You can skip it if you want.

A live CD/DVD is basically a normal linux installation just like an ordinary harddrive installation. However, simply copying the harddirve installation over to a CD/DVD is not enough to produce a working system. Why? because there are still minor differences between a live CD/DVD and on ordinary harddrive installation. So in addition to copying our harddirve installation to the CD/DVD we must address those differences as well.

So what are these differences?





The CD or DVD is read only media. Linux needs to have write access to certain parts of the system to be able to operate properly (like "/dev" "/proc" "/var" "/tmp"). There are a lot of approaches to address this problem. All of which utilize the system RAM. Some of these approaches enable write access only to essential directories and files, and hence, they do not allow the user to modify the system or install new packages while in the live CD. Other approaches, like unionfs (http://www.filesystems.org/project-unionfs.html) which is what is used in this guide, allows the user to write to any part of the system. This is done by merging part of the RAM with the read-only filesystem of the live CD/DVD and making the look like one filesystem that have read-write access. Unionfs has to be mounted at boot in a certain manner.



With the harddrive installation the location of the root filesystem is fixed. So it is passed to the kernel at boot time using the root=/dev/... parameter. With a live CD/DVD, the location of the root device is not fixed as the user might have multiple cdrom drives, these drives can be ide, scsi ... etc. So for the root filesystem to be mounted, there must be a way to identify the root device, and then we have to load the suitable kernel modules (to be able to access the cdrom controller as well as the CD filesystem). All this has to be done even before we have a root filesystem mounted.




To fit on a CD, the filesystem is usually compressed using squashfs (http://squashfs.sourceforge.net/). So we need to autodetect the filesystem type. We also need to have the proper modules for mounting it.





These considerations require special preparation at boot time, some of which must be performed even before mounting the actual filesystem. How can we do this?

Linux introduced a mechanism that allow for such preparations at boot time before the actual root filesystem is mounted. It is called the initial root filesystem or initramfs. This mechanism is used also in mounting normal harddirve installations, as it adds flexibilty to the boot process.


initramfs (http://www.linuxdevices.com/articles/AT4017834659.html) is virtual filesystem. It is a compressed cpio (cpio is an archive format similar to tar) archive that contains a minimal shell, kernel modules necessary for mounting the root filesystem and number of scripts that perform some tasks at boot time. The most important of these scripts is a script called init located at the root of the initramfs.

How does initramfs work?

The boot loader loads both the kernel and the initramfs into memory and starts the kernel. The kernel then unpacks the initramfs and mount it as initial root filesystem, and then looks for the init program within the initial filesystem, and once it finds it, it executes it and hand the boot process over to it. This init scirpt is responsible for finding the real root filesystem and mounting it. It is also responsible for any special preparations required at boot time.

So any special operations required for booting the system from live media can be coded into the initramfs boot scripts.

How is initramfs is created?

We do not have to create initramfs manually (although it can be done). There are tools for creating and updating initramfs like the command update-initramfs. Moreover, these tools can include custom scripts into the initramfs if they are placed in a certain preset locations (/usr/share/initramfs/scripts). So all we have to do is dump our custom scripts (which will do all the required preparation for booting the live CD/DVD) into these preset locations, and then create a custom initramfs by running update-initramfs.

We don't even have to write these scripts. Why? becuase there are packages that have scripts tailored for booting form live CDs. One of these packages is called casper (this is the package used in this howto). By installing casper into the system, it places the scripts in there proper locations (where they can be spotted by update-initrfamfs). The only thing we need to do after installing casper is running update-initramfs to create an initramfs suitable for live CD/DVD.







The live CD/DVD structure:

The directory tree of the live CD/DVD we are going to create is going to look like this:


(CD ROOT)
|-------+casper
| |-------filesystem.${FORMAT}
| |-------filesystem.manifest
| |-------filesystem.manifest-desktop
|
|-------+boot
| |--------+grub
| | |--------menu.lst
| | |--------stage2_eltorito
| |
| |-------vmlinuz
| |-------initrd.gz
| |-------memtest86+
|
|--------md5sum.txt




/casper/filesystem.${FORMAT}: This is the container of the linux filesystem we are going to copy from our harddisk. It is usually a compressed filesystem like squahsfs.

/casper/filesystem.manifest: This file is optional. You only need it if you decide to include the Ubuntu installer in the CD. The purpose of this file will be explained later.

/casper/filesystem.manifest-desktop: This file is optional. You only need it if you decide to include the Ubuntu installer in the CD. The purpose of this file will be explained later.

/boot/grub/menu.lst: File containing boot options for the live CD/DVD.

/boot/grub/stage2_eltorito: The boot loader of the CD. (stage2 of grub).

/boot/vmlinuz: The linux kernel. This is copied form the linux filesystem.

/boot/initrd.gz: the initramfs that contain the customizations necessary for the live CD/DVD.

/boot/memtest86+: Optional file used to test the RAM of the machine form the live CD/DVD.

/md5sum.txt: Optional file containing checksums for all the files in the CD.





What you need:

A working Debian or Ubuntu machine with internet access.
CD/DVD Writer.
Enough space in your harddirve. At least two times as much space as your installation size.






Outline of the steps:

A. Prepare Our work environment.

B. Copy the Source system to the target directory.
Note: People building a live CD/DVD from scratch using debootstrap: This step and replaced with the instructions listed here (http://ubuntuforums.org/showpost.php?p=4887531&postcount=65).

C. Chroot into the new system and make some modifications.

D. Prepare The CD directory tree.

E. Build the CD/DVD

Appendix 1. Adapting this guide to Debian.
Appendix 2. Building the live media form scratch using Debootstrap.




Conventions used in this HOWTO:

Text highlighted in Magenta is meant to be replaced by the user's custom value.
Commands performed within a chroot will be in Blue.
Optional arguments or steps will be highlighted in Gray.
Special notes and instructions for people building a live CD/DVD from scratch using debootstrap are highlighted in Green
I will use gedit as my default text editor. Replace gedit with your favorite text editor.










A. Preparing the environment

1. Set some variables

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper


The WORK Directory is where our temporary files and mount point will reside.
The CD is the location of the CD tree.
FORMAT is the filesystem type. We you are going to use a compressed squashfs
FS_DIR is the location of the actual filesystem image within the cd tree.

Replace only the values highlighted in Magenta.




2. Create the CD and the WORK directory structure:

sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs


3. Install some packages on your current system:


sudo apt-get update
sudo apt-get install mkisofs grub squashfs-tools qemu


qemu is optional. It is only needed for testing the cd before burning it. It can be substituted with any other virtualization software like virtualbox.



Note: For both gutsy and hardy you need to install extra package called linux-ubuntu-modules-$(uname -r)
sudo apt-get install linux-ubuntu-modules-$(uname -r)

This is not required for versions before gutsy, or version after hardy








B. Copy your installation into the new filesystem.

Note: People building a live CD/DVD from scratch using debootstrap: skip this step and replace it with the instructions listed here (http://ubuntuforums.org/showpost.php?p=4887531&postcount=65).

sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/*\
--exclude=/sys/* --exclude=/tmp/* --exclude=/home/*\
--exclude=/lost+found / ${WORK}/rootfs


Note: rsync is used instead of cp to take advantage of the --one-file-system and the --exclude options.




If you have a separate boot partition you will have to copy it using the following command:

sudo cp -av /boot/* ${WORK}/rootfs/boot



(Optional) Copy settings in your home dir:


If you want to preseve your user account settings which are stored in your home directory, you can copy them to ${WORK}/rootfs/etc/skel/.

But first we have to define what files we want to copy. For example I am using xcfe4 as my DE, and it stores all it settings in a directory called .config in my home directory, so I am going to add .config to the variable $CONFIG:

CONFIG='.config .bashrc'

Now, Copy the CONFIG files using the following command:

cd ~ && for i in $CONFIG
do
sudo cp -rpv --parents $i ${WORK}/rootfs/etc/skel
done






C. Chroot into the new system and modify it:

1. Chroot into the copied system after mounting proc and dev:

Note: People building a live CD/DVD from scratch using debootstrap: skip this step.

sudo mount -o bind /dev/ ${WORK}/rootfs/dev
sudo mount -t proc proc ${WORK}/rootfs/proc
sudo mount -t sysfs sysfs ${WORK}/rootfs/sys
sudo chroot ${WORK}/rootfs /bin/bash


N.B: All commands in Blue are done within a chroot.

Now you are within chroot environment, type the following command:

LANG=



Note: People building a live CD/DVD from scratch using debootstrap: Resume the steps of the guide here.


2. Install Packages Essential for live CD:


apt-get update
apt-get install casper xresprobe

casper contain the live scirpts.
discover1 & xresprobe are used for autodetectin hardware at startup.


3. (Optional) If you want your live cd to have an installer, install the Ubuntu installer:

apt-get install ubiquity


Note: People using kde replace replace the previous command with

apt-get install ubiquity ubiquity-frontend-kde

Credit for this goes note to Fragadelic (http://ubuntuforums.org/member.php?u=386921) author of remastersys (http://www.remastersys.klikit-linux.com/). Remastersys (http://www.remastersys.klikit-linux.com/).



(Optional Step)Install any packages you want to be in the CD. Some of the following packages are useful in emergency situations:

sudo apt-get install gparted ms-sys testdisk wipe partimage xfsprogs reiserfsprogs jfsutils ntfs-3g ntfsprogs dosfstools mtools

gparted: patitioning tool. It is automatically installed as a dependecy of ubiquity.
ms-sys: writing a Microsoft compatible boot record (MBR).
testdisk: Partition scanner and disk recovery tool.
wipe: Secure file deletion.
partimage: backup partitions into a compressed image file (like norton ghost).
xfsprogs reiserfsprogs jfsutils: Tools for handling different filesystems.
mtools: Tools for manipulating MSDOS files




Note: People building a live CD/DVD from scratch using debootstrap: Additional step right here. Look in appendix.2 for details.



4. Update the initramfs:

Note: People building a live CD/DVD from scratch using debootstrap: Commands in this step are to be modified. Look in appendix.2 for details.


First update modules.dep:

depmod -a $(uname -r)


update-initramfs -u -k $(uname -r)

As already metioned above, the initramfs is reponsible for much of the preparation required at the boot time of the CD/DVD. The updated initramfs now contain the live scirpts installed with casper.





5. Delete these files.

for i in "/etc/hosts /etc/hostname /etc/resolv.conf /etc/timezone /etc/fstab /etc/mtab /etc/shadow /etc/shadow- /etc/gshadow /etc/gshadow- /etc/gdm/gdm-cdd.conf /etc/gdm/gdm.conf-custom /etc/X11/xorg.conf /boot/grub/menu.lst /boot/grub/device.map"
do
rm $i
done 2>/dev/null

These files are not needed in the CD/DVD. some of them are could interfer with the CD/DVD boot process. (e.g. shadow and gdm.conf-custom can interfere with autologin).



6. Clean apt cache

apt-get clean



7. Clean some dirs and files:

rm -r /tmp/* /root/* 2>/dev/null

rm /boot/*.bak 2>/dev/null



8. Remove non system users

Note: People building a live CD/DVD from scratch using debootstrap: skip this step.

for i in `cat /etc/passwd | awk -F":" '{print $1}'`
do
uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`
[ "$uid" -gt "999" -a "$uid" -ne "65534" ] && userdel --force ${i} 2>/dev/null
done

Non-system users are users created by you that have user id more than 999.



9. Clean the chroot environment form unnecessary files:

Note: People building a live CD/DVD from scratch using debootstrap: skip this step.

find /var/run /var/log /var/mail /var/spool /var/lock /var/backups /var/tmp -type f -exec rm {} \;




10. If you are using GDM recreate it's config file:

Note: People building a live CD/DVD from scratch using debootstrap: skip this step.


[ -f "/etc/gdm/factory-gdm.conf" ] && cp -f /etc/gdm/factory-gdm.conf /etc/gdm/gdm.conf 2>/dev/null


Sometimes a customized /etc/gdm/gdm.conf can interfere with the live CD/DVD autologin.



11. Create some files in /var/log:

Note: People building a live CD/DVD from scratch using debootstrap: skip this step.

for i in dpkg.log lastlog mail.log syslog auth.log daemon.log faillog lpr.log mail.warn user.log boot debug mail.err messages wtmp bootstrap.log dmesg kern.log mail.info
do
touch /var/log/${i}
done

Most of these files are log files that have been cleaned in step 7. We created an empty files in their place to prevent the system from complaining at boot.




12. Exit chroot

exit





D. Prepare The CD directory tree:

1. Copy the kernel, the updated initrd and memtest prepared in the chroot:

Note: People building a live CD/DVD from scratch using debootstrap: Commands in this step are to be modified. Look in appendix.2 for details.

sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-$(uname -r) ${CD}/boot/vmlinuz
sudo cp -vp ${WORK}/rootfs/boot/initrd.img-$(uname -r) ${CD}/boot/initrd.gz
sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot



2. Generate manifest:

Note: This step is only needed if you installed the Ubuntu installer ubiquity. This step generates two files (filesystem.manifest & filesystem.manifest-desktop).

sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifest
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}
REMOVE='ubiquity casper user-setup discover1 xresprobe os-prober libdebian-installer4'
for i in $REMOVE
do
sudo sed -i "/${i}/d" ${CD}/${FS_DIR}/filesystem.manifest-desktop
done


These two files are used by the ubiquity installer when installing to harddisk. These two files are just lists of packages. Ubiquity compares these two files and removes packages unique to filesystem.manifest. This way when installing to harddisk, packages like casper which is only useful in a live CD/DVD are removed. These packages that will be removed at install are defined in the variable $REMOVE


3. Unmount bind mounted dirs:

sudo umount ${WORK}/rootfs/proc

sudo umount ${WORK}/rootfs/sys

sudo umount ${WORK}/rootfs/dev



4. Convert the directory tree into a squashfs:


sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}

Note: Make sure the resulting file size can fit into your live media.


Note: Compression might incur a slight performace penalty. If you are using DVD and your overall system size is less than 4GB you don't have to use compression, instead you can use squashfs without compression by adding the -noI -noD -noF switches to mksquashfs.



5. Make Grub the bootloader of the CD

Copy grub file:

sudo find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} ${CD}/boot/grub \;



Make the menu.lst

sudo gedit ${CD}/boot/grub/menu.lst


Copy the following text into it and save it.

# By default, boot the first entry.
default 0

# Boot automatically after 30 secs.
timeout 30

color cyan/blue white/blue


title Start Linux in Graphical Mode
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet splash
initrd /boot/initrd.gz

title Start Linux in Safe Graphical Mode
kernel /boot/vmlinuz BOOT=casper boot=casper xforcevesa rw quiet splash
initrd /boot/initrd.gz

title Start Linux in Text Mode
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet
initrd /boot/initrd.gz

title Start Presistent Live CD
kernel /boot/vmlinuz BOOT=casper boot=casper persistent rw quiet splash
initrd /boot/initrd.gz

title Start Linux Graphical Mode from RAM
kernel /boot/vmlinuz BOOT=casper boot=casper toram nopersistent rw quiet splash
initrd /boot/initrd.gz

title Memory Test
kernel /boot/memtest86+.bin

title Boot the First Hard Disk
root (hd0)
chainloader +1




6. Calculate MD5



cd $CD && find . -type f -print0 | xargs -0 sudo md5sum | sudo tee ${CD}/md5sum.txt








E. Build the CD/DVD

1. Make the ISO file

sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD



2. Test the CD

Test using qemu emulator
qemu -cdrom ~/live-cd.iso -boot d

Or use any other virtualization program you like.


Update: As noted by az (http://ubuntuforums.org/member.php?u=844) in this post (http://ubuntuforums.org/showpost.php?p=4643009&postcount=18), while testing the iso with qemu sometimes it drops you to an initramfs shell because of a problem with qemu. This behaviour has been confirmed by other users. In this case it is advisable to retest the iso with another virtualization software like virtualbox or to burn the iso to REWRITABLE cd and test directly on your pc.


3. (Optional) Clean our workspace

[ -d "$WORK" ] && rm -r $WORK $CD







Final Notes:



You can add a splash image (http://ruslug.rutgers.edu/~mcgrof/grub-images/) to the grub menu.


If you are using a custom kernel make sure it has support for the following:



Support of loopback device.
Support for the filesystem format you are using (e.g. squashfs ).
Support for unionfs.
Support for initramfs.





There are some extra options I put in the grub menu. The ones that I have not tried are highlighted in Red below:






Start linux form RAM. This option is only possible if your ram is larger than data on the live media. This option can be useful if you are building a minimal command line rescue disc as it would enhance performance to start it from RAM.


Start in presistent mode. To learn about it more look here (https://help.ubuntu.com/community/LiveCDPersistence).


Start Linux in Text Mode. This will not start X. The user will be autologged into a virtual terminal (the kind of terminal you get when you press Alt+Ctrl+F1). Note that this option will not work in all Ubuntu versions prior to Gutsy.









Appendix 1. Adapting this guide to Debian

This guide can be modified to apply to Debian systems as well. There are number of differeces between Ubuntu and Debian that we must take into account:



As of Debian lenny, casper is deprecated and replaced with live-initramfs. live-initramfs is a fork of casper and it has the same options, with one difference in the CD directory tree sturcute. This can be solved by setting the variable FS_DIR=live instead of FS_DIR=casper.

Sqaushfs modules and unionfs modules are in two separate packages.

Ubiquity installer is not present in the Debain repositories. Ubiquity is only needed if you intend to install Linux from the live CD/DVD to the harddisk. I have not tried using ubiquity on Debian so I am not sure if it will work. To install it on Debian you have to add Ubuntu main repository to your sources.list.


So in light of the points mentioned above we have to make the following modifications to adapt the guide to Debian:

In step A.1 replace FS_DIR=casper with

FS_DIR=live

Replace the command in Step A.3 with:

sudo apt-get install mkisofs grub squashfs-tools squashfs-modules-$(uname -r) qemu

Replace the command in Step C.2 with:

apt-get install live-initramfs unionfs-modules-$(uname -r) discover1 xresprobe

Skip step C.3 and D.2 if you do not intend to try ubiquity on Debian.

In Step D.5 Replace every occurence of BOOT=casper and boot=casper in menu.lst with BOOT=live and boot=live respectively




Appendix 2. Building the live media form scratch using debootstrap.

Instead of using your current installation to be the basis of you live CD, you can build a custom system from scratch into any directory in your system using debootstrap (http://ubuntuforums.org/showpost.php?p=4887531&postcount=65), and then use that as the basis of your CD. The modifications you have to make are:


skip step B alltogether. Instead, do the instructions listed here (http://ubuntuforums.org/showpost.php?p=4887531&postcount=65) to build your custom system from scratch using debootstarp

after finishing the instructions of the guide mentioned above, you resume the steps in this guide, going straight to step C.2 (skip step C.1).


Before step C.4 set the following variable:

export kversion=`cd /boot && ls vmlinuz-* | sed 's@vmlinuz-@@'`



Modify the two commands in step C.4 so they look lik this:

depmod -a ${kversion}

update-initramfs -u -k ${kversion}



Skip the following steps: C8, C9, C10, C11


Modify the commands in Step D.1 as follows:
find ${WORK}/rootfs/boot -iname 'vmlinuz*' -exec sudo cp -vp {} ${CD}/boot/vmlinuz \;
find ${WORK}/rootfs/boot -iname 'initrd.img*' -exec sudo cp -vp {} ${CD}/boot/initrd.gz \;
sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot





Edit (1): 20/02/08

Added Suggestions for packages useful in rescue CD.
Modified step D.5 as per RumorsOfWar (http://ubuntuforums.org/member.php?u=501131) suggestion.




Update (2): 14/03/08

Fragadelic (http://ubuntuforums.org/member.php?u=386921) kindly posted this guide (http://www.remastersys.klikit-linux.com/capink.html) on his website. Fragadelic (http://ubuntuforums.org/member.php?u=386921) is the author of remastersys (http://www.remastersys.klikit-linux.com/). Remastersys (http://www.remastersys.klikit-linux.com/) is a tool that can create a live CD/DVD in an automated manner as opposed to the step by step nature of this guide. Another advantage of remastersys is that it has a GUI for those who do not want to miss with the command line.


Edit (3): 12/04/08
Correcting a typo in step E.2 as pointed out by vbgeek (http://ubuntuforums.org/member.php?u=551076)


Edit (4): 21/04/08
Removed live-initramfs from the variable REMOVE (in step D.2) as pointed out by gjhicks (http://ubuntuforums.org/member.php?u=10906)


Edit (5): 05/05/08
Removed the appendix of how to make the cd using a unix filesystem like ext2. This is now obsolete as you can use squashfs without compression by adding the -noI -noD -noF switches to mksquashfs.

pagadama
February 8th, 2008, 04:29 AM
정말 유용한 정보이군요.
감사합니다.
Happy New Year!
(7. Feb is Korean Traditional New Year's day:))

RumorsOfWar
February 10th, 2008, 05:49 PM
Great post! Thanks. I was looking at switching back to Ubuntu and this seals it.

capink
February 10th, 2008, 10:08 PM
Great post! Thanks. I was looking at switching back to Ubuntu and this seals it.

Can you confirm that it actually worked for you. What format did you go with? squashfs or ext2?

RumorsOfWar
February 16th, 2008, 01:28 PM
I'm using Gutsy 64 alternate install.
I've added the apps I need, my system is up to 2.5 GB so I'll use ext2, DVD.
I'm on step C, but when I "sudo LANG= chroot ${WORK}/rootfs /bin/bash", I get "sudo: LANG=: command not found" error.
I'll keep trying, but if you know the problem, that would help :)
( to resume, do I need to reset the variables at the beginning of step A ?)

capink
February 16th, 2008, 04:06 PM
I'm using Gutsy 64 alternate install.
I've added the apps I need, my system is up to 2.5 GB so I'll use ext2, DVD.
I'm on step C, but when I "sudo LANG= chroot ${WORK}/rootfs /bin/bash", I get "sudo: LANG=: command not found" error.
I'll keep trying, but if you know the problem, that would help :)
( to resume, do I need to reset the variables at the beginning of step A ?)

replace the command with:

sudo chroot ${WORK}/rootfs /bin/bash

Once in chroot type this command before proceeding:

LANG=


You do not need to reset any of the variables as long as you are still working in the same terminal.

RumorsOfWar
February 16th, 2008, 11:53 PM
And now I'm replying from my own live CD :guitar:
I think I messed up my first effort by missing some ext2 changes, so I redid it in squashfs.
In step C, using 'LANG=' after chroot worked. :)
I had to change a line at D/5 so grub set up for an x86_64-pc rather than i86, and this live cd environment hangs if I enable 3D.
But this is very cool. I can restore or duplicate my Ubuntu setup faster, and without an internet.
Thanks Capink :)

If I may suggest, edit lines at C/1 and D/5 in the first post, and put a "*ext2" tag beside things that need appendix1.
This tutorial is worthy of being Sticky :)

capink
February 17th, 2008, 12:25 AM
And now I'm replying from my own live CD :guitar:
I think I messed up my first effort by missing some ext2 changes, so I redid it in squashfs.
In step C, using 'LANG=' after chroot worked. :)
I had to change a line at D/5 so grub set up for an x86_64-pc rather than i86, and this live cd environment hangs if I enable 3D.
But this is very cool. I can restore or duplicate my Ubuntu setup faster, and without an internet.
Thanks Capink :)


Glad it worked for you. Can you post the exact modification you did to menu.lst so that I can add it to my post (with credits ofcourse).

Also, what do you think messed up for you in ext2?

RumorsOfWar
February 17th, 2008, 03:18 AM
Can you post the exact modification you did to menu.lst
Sure, I wouldn't worry about crediting me though. My input was insignificant compared to yours.
sudo cp -pv /usr/lib/grub/x86_64-pc/* ${CD}/boot/grub
In place of;
sudo cp -pv /usr/lib/grub/i386-pc/* ${CD}/boot/grub
Also, what do you think messed up for you in ext2?
I went to step B before creating the virtual file system mentioned in appendix A.
I just wasn't patient enough to read ahead and understand as much as I needed to. My bad. But a hint marker like "*ext2*" would have stopped me.
*edit* Now I see you did have the line there. I may have had it right.
Oh well, I'm still reading through it and seeing how it works. :popcorn:

Tybion
February 23rd, 2008, 07:40 PM
Thanks, capink. This is brilliant. I am pasting it into a customized script specifically for me, but leaving all your comments in the script.

TheRoot
February 29th, 2008, 10:07 PM
Thanks capink for this Tutorial, really it was great, and worked wonderful for me :-D

Wish you good luck.
BTW: Mabrook the CAF 2008 for Eygpt

capink
March 1st, 2008, 12:52 AM
Thanks capink for this Tutorial, really it was great, and worked wonderful for me :-D

Wish you good luck.
BTW: Mabrook the CAF 2008 for Eygpt

Alla yebarek feek.

capink
March 1st, 2008, 12:55 AM
Thanks, capink. This is brilliant. I am pasting it into a customized script specifically for me, but leaving all your comments in the script.

The script is going to be handy whenever you want to repeat the process. I thought about making it in a script at first, but then I retreated and felt it is better to present it with a series of instructions so anyone can make a script of his own if he wishes. Good luck.

WebDesignHero
March 8th, 2008, 11:39 PM
Hello,

Thanks for the well written and well formatted guide. I just have one issue:
Everything seems to work well, but after selecting the normal GUI option in GRUB I am dumped to
BusyBox ash shell where the prompt display ( initramfs ). Could anyone tell me what I messed up? I feel like the correct outcome should boot me into my normal GUI from the original install or something else.... I am working with Ubunut 7.10 and also tried this a few weeks ago on Debian 4.0 and had the same end result. Any help or explanation of why I got dumped into this shell instead of the system I thought I had squashed and put on the CD would be most helpful.

capink
March 9th, 2008, 01:42 PM
After being dumped to the busybox shell, you should find a log file called live.log or casper.log. You can know the name of the log file by typing:

ls

After identifying the log filename, type the following command to view the content of the log:

cat /log/filename

The error message should give an idea about the problem you are facing.

joshrobinson
March 10th, 2008, 03:27 AM
i followed your guide to the letter, but when i start the live cd, it loads the gnome desktop, then 5 seconds later bumps me back to the GDM login screen, and says user ubuntu will start in 10 seconds, logs in again and kicks back out, not sure what happend

Fred_E _krugar
March 10th, 2008, 02:42 PM
Well mine worked in VirtualBox. But when I actually tried to boot to live CD it got stuck on FD0 I dont even own a floppy WTH do I do to get past that???

capink
March 10th, 2008, 06:46 PM
i followed your guide to the letter, but when i start the live cd, it loads the gnome desktop, then 5 seconds later bumps me back to the GDM login screen, and says user ubuntu will start in 10 seconds, logs in again and kicks back out, not sure what happend

I don't know what is causing this problem. Can you try logging from a text shell (press alt+f1 and then login and type the command startx -- :1)

capink
March 10th, 2008, 06:49 PM
Well mine worked in VirtualBox. But when I actually tried to boot to live CD it got stuck on FD0 I dont even own a floppy WTH do I do to get past that???

That is most probably indicative of hardware problem. If the official Ubuntu cd is working fine for you, One hack you can try is copying the initrd from the official Ubuntu cd to replace the one in your custom cd (this will only work if both cds have exactly the same kernel version).

markp1989
March 10th, 2008, 06:52 PM
very nice how to , i will be using this later

Fred_E _krugar
March 11th, 2008, 01:13 AM
On my homebrew cd the initrd is in the boot folder.
On the Ubuntu CD the initrd is in the casper folder could that bethe problem if it is how can I change the iso. ?

capink
March 11th, 2008, 10:10 AM
the ISO image is read only. You will have to recreate it as follows:

- Mount you homemade custom iso:

sudo mount -o loop -t iso9960 /path/to/the/iso /mnt

- Copy the contents of the iso to a new folder:

mkdir ~/iso

sudo cp -a /mnt/* ~/iso

- Copy the initrd of the official cd after mounting it

sudo cp -vf /path/to/official/cd/casper/initrd.gz ~/iso/boot/initrd.gz

- Recreate the iso image:

sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso ~/iso


Some Notes:
==========
- Make sure the official cd is working on your hardware.
- Only do the above under two conditions: The first is that both cds have exactly the same kernel version. The Second condition is that your custom cd is created with casper and not live-initramfs (since the official ubuntu cd is created with casper).
- This should work (provided that you are able to boot from the official ubuntu cd) but there is no guarantee it will. So please use Rewritable media to avoid wasting black cds while trying the different solutions to your problem.

Fred_E _krugar
March 12th, 2008, 02:33 AM
Thank you I will try this.

stumpalump
March 13th, 2008, 06:43 AM
So I have a question. Let's say my ubuntu install is almost 6.7Gb and I want to make a Dual Layer LIVE DVD complete with installer. How can I do this with the limitation in the iso 9660? Can I use UDF somehow?

capink
March 13th, 2008, 08:35 AM
No you cannot use udf as it is not supported for the time being (neither casper not live-initramfs supports it). But you do not need to use udf becuase after compressing your system into a squashfs it will be about 2.7 GB.

Fragadelic
March 13th, 2008, 10:14 AM
capink - very nice howto.

I am the creator of remastersys - http://www.remastersys.klikit-linux.com and have borrowed some of your ideas to improve how remastersys works.

You can also add a graphical grub boot to this by putting the splash image of your choice in boot of the cd tree and adding the following line above the boot entries:

splashimage=/boot/splash.xpm.gz

Or whatever name you used for the splash image.

Also, a quick question - I have always used "boot=casper" and never had an issue. Where is BOOT=casper needed?

I don't think you need the rw or nopersistent.

Fragadelic
March 13th, 2008, 11:38 AM
BTW, this is the best howto I've seen on this subject to date.

capink
March 13th, 2008, 01:41 PM
capink - very nice howto.

I am the creator of remastersys - http://www.remastersys.klikit-linux.com and have borrowed some of your ideas to improve how remastersys works.

Nice project.

I just started to learn python. I also intend to learn pyqt so maybe I will be able contribute to your project.

You can also add a graphical grub boot to this by putting the splash image of your choice in boot of the cd tree and adding the following line above the boot entries:

splashimage=/boot/splash.xpm.gz

Or whatever name you used for the splash image.

Yes this is a nice feature. I already have a link explaining this in the final notes section. Another option is to use grub-gfxboot (http://ubuntuforums.org/showthread.php?t=208855), this is supposed to produce more fancy graphics but I have not tried it yet.

Also, a quick question - I have always used "boot=casper" and never had an issue. Where is BOOT=casper needed?

I think I read somewhere that the BOOT=casper option is checked for by the main casper script before it takes control of the boot process. While the boot=casper option defines the directory where casper looks for the live image.

I have not tested this information, I just took it for granted. But since you are able to produce the same result using only boot=casper it seems it is redundant to use BOOT=casper.

I don't think you need the rw or nopersistent.

These are indeed redundant.

BTW, this is the best howto I've seen on this subject to date.

Thank you for the complement.

capink
March 13th, 2008, 01:46 PM
Fragadelic, I hope you can help solve people problems that I don't have an answer for if your time permit.

Fragadelic
March 13th, 2008, 01:52 PM
I saw your bit about the grub splash after I posted - lol.

Remastersys right now is using bash and zenity or kdialog for the gui frontend and now that I have things working pretty well, I will start to learn python myself and might convert it over.

I've been doing bash for so long and just find it easy to do and it works for what I need so I just went with it. Its also easier for folks just starting with linux scripting to take a look at and see how I did certain things.

I've looked at a lot of howtos on making ubuntu livecd's but this one is definitely the most complete and very well written one that I've found.

I've bookmarked this thread for future reference for myself.

Please feel free to take a look at remastersys and let me know if you have any suggestions. I still have some cleanup to do but it works pretty well so far on a number of system. It was originally created on Kubuntu and Mint but I now use Klikit-Linux(Kubuntu based) and am part of the team there.

/etc/shadow and /etc/gshadow can stay as long as the normal users are cleaned out of it. You can check /usr/bin/remastersys after you install it to see how I did it. I got my info for the checks directly from how casper looks to see before it creates the livecd user.

Your howto deserves a webpage and not just to be here in the forum where it might get lost.

Let me know if you would like me to put it up on my website and then you can just give the link to folks.

Fragadelic
March 13th, 2008, 02:07 PM
Fragadelic, I hope you can help solve people problems that I don't have an answer for if your time permit.


I'll check back in the thread as I can and try to help where I can.

casper is very picky about a lot of things - lol.

One thing you might want to add is that mkisofs has a limit of 4.7GB so if the system is too large, it will not create the iso file. Haven't found a way around that yet.

For those that find this prodecure a bit daunting, please feel free to try remastersys as it does this very thing from a simple gui without the need to copy the entire system to a temp area.

Fragadelic
March 13th, 2008, 02:09 PM
i followed your guide to the letter, but when i start the live cd, it loads the gnome desktop, then 5 seconds later bumps me back to the GDM login screen, and says user ubuntu will start in 10 seconds, logs in again and kicks back out, not sure what happend


Try going to a console term window and see if it is with gdm or not.

CTRL-ALT-F1

then take a look at the /var/log/gdm log files and see if there are any errors.

capink
March 13th, 2008, 05:25 PM
I saw your bit about the grub splash after I posted - lol.

Remastersys right now is using bash and zenity or kdialog for the gui frontend and now that I have things working pretty well, I will start to learn python myself and might convert it over.

I was thinking about learning kdialog or ssft to add gui to my bash scripts. But since my next project (a private one) will need a full blown gui I decided that I will try learning pyqt.

I've been doing bash for so long and just find it easy to do and it works for what I need so I just went with it. Its also easier for folks just starting with linux scripting to take a look at and see how I did certain things.

Yes bash scripts are beautiful. And since casper itself is written in bash, it makes sense to use it for remastersys.


Please feel free to take a look at remastersys and let me know if you have any suggestions. I still have some cleanup to do but it works pretty well so far on a number of system. It was originally created on Kubuntu and Mint but I now use Klikit-Linux(Kubuntu based) and am part of the team there.

I will defenitely look at remastersys and report back to you. By the way, this is the first time I know about Klikit-Linux. How is different from Kubuntu? I plan to switch into a good kde distro once 4.1 is released.

/etc/shadow and /etc/gshadow can stay as long as the normal users are cleaned out of it. You can check /usr/bin/remastersys after you install it to see how I did it. I got my info for the checks directly from how casper looks to see before it creates the livecd user.

I will check /usr/bin/remastersys. But do you think it would be much different to keep the files? I think the ubuntu installer recreate these files anyway (I don't know how but I think it uses the commands pwconv & grpconv).

Your howto deserves a webpage and not just to be here in the forum where it might get lost.

Let me know if you would like me to put it up on my website and then you can just give the link to folks.


Unfortunately I don't have a webpage. But it would be really nice if you hosted this guide on your website.


One thing you might want to add is that mkisofs has a limit of 4.7GB so if the system is too large, it will not create the iso file. Haven't found a way around that yet.

The main problem for me is that ISO9660 cannot support single files larger than 4 GB. So the squashfs cannot be more than 4 GB.

Using udf is not possible because it is not supported by casper nor live-initramfs. But is not the main problem (As casper scripts can possilbly be modified to handle udf), the real showstopper here is that grub does not support booting from udf.

The only option remaining is to not create a squashfs. But to place the system in folder called /casper/squashfs.dir. This is supposedly supported by casper (by looking at the casper main scirpt it looks like it is possible but I have not tried it yet). But the problem here is does iso9660 support essential features of unix filesystems like symlinks, permissions and ownership?. On my system I'm able to create an ISO > 4.7 Gb using the original mkisofs (instead of the symlink created by genisoimage).

stumpalump
March 13th, 2008, 06:15 PM
No you cannot use udf as it is not supported for the time being (neither casper not live-initramfs supports it). But you do not need to use udf becuase after compressing your system into a squashfs it will be about 2.7 GB.

Okay well I kinda wanted to use ext2 rather than squash. Didn't you say that would make the disc run faster? So I kinda wanted to use that for loading times.

So I thought of maybe trying this

sudo dd if=/dev/zero of=${CD}/${FS_DIR}/filesystem.${FORMAT} bs=1024 count=7000000


And then somehow making a bootable udf out of the output. I know Nero can make udf discs and bootable DVDs but I couldn't merge the two...

Anyone have any ideas?

capink
March 13th, 2008, 07:10 PM
Okay well I kinda wanted to use ext2 rather than squash. Didn't you say that would make the disc run faster? So I kinda wanted to use that for loading times.

So I thought of maybe trying this

sudo dd if=/dev/zero of=${CD}/${FS_DIR}/filesystem.${FORMAT} bs=1024 count=7000000


And then somehow making a bootable udf out of the output. I know Nero can make udf discs and bootable DVDs but I couldn't merge the two...

Anyone have any ideas?

Well, the recent updates to the guide suggested using uncompressed squashfs (by adding the -noI -noD -noF switches to mksquashfs) instead of ext2 and you would sitll get the same performance. You can still use ext2 if you want, but advantage to use an uncompressed squashfs is that you will not need to create a virtual filesystem.

The main problem preventing us from making a cd in UDF format is that grub does not support booting from a UDF image.

stumpalump
March 14th, 2008, 02:26 AM
Okay, so I've done it with an uncompressed squashfs. Now, for some reason, when I try to make the actual iso, it goes through and does it but I can't find the file???

EDIT: Nevermind it was in root folder.

Fragadelic
March 14th, 2008, 11:52 AM
capink - here is this howto on my webspace:

http://www.remastersys.klikit-linux.com/capink.html

There is a link to it from the bottom of my webpage as well.

http://www.remastersys.klikit-linux.com/

I left it in a more printer friendly format so folks can print it out if they want to.

stumpalump
March 16th, 2008, 04:04 PM
Okay, so when I made my DVD, I copied all the user settings over, but I didn't see anything that looked like my settings at all. I was kinda hoping that the DVD would boot and it would have my gtk/emerald theme, my menus, my awn etc...

Anyone know how I can do this?

capink
March 16th, 2008, 06:20 PM
To preserve your settings you need to:

1. Konw exactly what are the files that store these settings (This is sometime tricky depending on the program). Note that if you are storing the themes in your home directory they also have to be copied along with the config files. I keep all my themes and graphics in a system wide directories to make them available to all users.

2. These files are not copied to the home directory of your live CD. they are copied to the /etc/skel of the live cd (${WORK}/rootfs/etc/skel) as explained in the optional part of step. B



If you are not able to determine what are the files that carry these config files, One solution is to copy all the config files in your home directory by replacing the optional commad in step B with this command:

cd $HOME && find . -type f | grep '^\./\.' \
| grep -vi -e 'cache' -e 'thumbnail' -e 'log' -e 'trash' \
-e 'history' -e 'snapshot' -e 'tmp' -e 'temp' -e \
'serverauth' -e 'ICEauthority'\
| while read file; do sudo cp -v --parents --preserve=mode $file ${WORK}/rootfs/etc/skel; done

stumpalump
March 16th, 2008, 07:18 PM
I have all my themes saved on a different hard disk. So what you're saying is I would also have to copy the tar files over as well?

Do you happen to know where exactly the config file is that points to the tar files and all that?

capink
March 17th, 2008, 11:35 AM
I have all my themes saved on a different hard disk. So what you're saying is I would also have to copy the tar files over as well?

Do you happen to know where exactly the config file is that points to the tar files and all that?

As far as I know the themes are usually stored in /usr/share or in home directory, but I don't use gnome nor compiz so maybe they can enable the user to store the themes elsewhere as in our case (you said you have them on another harddisk).

In the live CD, the themes must reside in same directory structure as in your host system. For example, if your themes are in /media/sda4/theme you have to copy them as follows to you work dir

sudo cp -av --parents /media/sda4/themes ${WORK}/rootfs

If you are not sure what are the config files that store the settings for your theme, you can copy all the config files in your home directory as I explained in my previous post.

stumpalump
March 17th, 2008, 03:15 PM
Capink, thanks for your continued help in this thread.

Sorry if I was unclear before. What I meant was that I download all the .tar.gz's to another hard disk and then apply them in emerald/gtk. So what I'm trying to accomplish is to have the liveDVD I create use my theme by default as opposed to the human theme when it boots.

It is using my custom loading screen and my gdm though.

I'm kinda new to linux still. So when I import a theme from a .tar, you're saying it gets stored in /usr/share so that's what I need to copy, right?

Also, I guess it would help if I knew which .conf stored all the default user paths/settings for the buttons, metacity, and emerald themes.

Thanks in advance for your reply, Capink

Fragadelic
March 17th, 2008, 04:24 PM
Take a look at the global gconf settings as most of it is stored there.

capink
March 17th, 2008, 04:54 PM
Capink, thanks for your continued help in this thread.

Sorry if I was unclear before. What I meant was that I download all the .tar.gz's to another hard disk and then apply them in emerald/gtk. So what I'm trying to accomplish is to have the liveDVD I create use my theme by default as opposed to the human theme when it boots.

It is using my custom loading screen and my gdm though.

I'm kinda new to linux still. So when I import a theme from a .tar, you're saying it gets stored in /usr/share so that's what I need to copy, right?

Also, I guess it would help if I knew which .conf stored all the default user paths/settings for the buttons, metacity, and emerald themes.

Thanks in advance for your reply, Capink

Anything in /usr/share is already copied in step B. So if the theme is there you only need to copy the config file.

I am not sure, but I think when you applied the theme it has gone to the ~/.themes and ~/.emerald/theme directories. You can check this directory and check if your theme is there. If it is, you need to copy these directories along with some config files ( I not positive about the config files because I am using difffernt desktop evironment but try the ones in the command below ):


for i in .gconf .local .emerald .gnome2 .themes .compiz
do
sudo cp -r --preseve=mode ~/${i} ${WORK}/rootfs/etc/skel
done



These include .gconf folder as suggested by Fragadelic.

Or you can try the remastersys script by Fragadelic with the backup option. A link to it is present now in my opening post.

capink
March 17th, 2008, 04:56 PM
Take a look at the global gconf settings as most of it is stored there.

Hi Fragadelic. I just started looking into your scirpt. It is very nice. I will post my comments (and questions later) when I have more time to look at it more.

Fragadelic
March 17th, 2008, 10:24 PM
Hi Fragadelic. I just started looking into your scirpt. It is very nice. I will post my comments (and questions later) when I have more time to look at it more.
Thanks. I still have some work to do on it in terms of cleanup of /var for the dist mode but its coming along.

I did some checking and pwconv and grpconv do rebuild the shadow and gshadow files so the next version will just omit those.

Any suggestions are greatly appreciated.

Fragadelic
March 18th, 2008, 03:27 PM
I think I will add BOOT=casper to the grub entries in remastersys as well. This might be the reason some folks have been getting it stopping at the (initramfs). Not 100% sure but worth a try anyway.

Fragadelic
March 18th, 2008, 03:44 PM
I did some quick checking and cannot find any reference to BOOT=casper anywhere on the web. Everything I see refers to only boot=casper so I don't think that is it.

I think some of the folks that had issues were using Hardy 8.04 and I found a bug about that.

capink
March 18th, 2008, 04:03 PM
I think I realize where I got confused about this whole BOOT=casper and boot=casper. I am currently using Debian which uses live-initramfs as a fork for casper.

The live-initramfs (http://live.debian.net/other/manpages/live-initramfs.7.html) man said to use BOOT=live. I then converted the guide to work for both casper and live-initramfs. But casper have the boot=casper. So to make the guide support both, I added both BOOT and boot options.

capink
March 18th, 2008, 04:06 PM
I think I will add BOOT=casper to the grub entries in remastersys as well. This might be the reason some folks have been getting it stopping at the (initramfs). Not 100% sure but worth a try anyway.

The problem of people being dropped to an initramfs shell does not happen only with custom made cds. I was dropped to the same shell by the live Ubuntu Feisty Cd. It seems that this problem happens with certain types of hardware.

Fragadelic
March 18th, 2008, 06:54 PM
I think I realize where I got confused about this whole BOOT=casper and boot=casper. I am currently using Debian which uses live-initramfs as a fork for casper.

The live-initramfs (http://live.debian.net/other/manpages/live-initramfs.7.html) man said to use BOOT=live. I then converted the guide to work for both casper and live-initramfs. But casper have the boot=casper. So to make the guide support both, I added both BOOT and boot options.

That makes sense.

Fragadelic
March 18th, 2008, 06:56 PM
The problem of people being dropped to an initramfs shell does not happen only with custom made cds. I was dropped to the same shell by the live Ubuntu Feisty Cd. It seems that this problem happens with certain types of hardware.
you are correct. I found some references of it with regards to using acpi=off in the boot params to get by it. Looks like it has problems loading the filesystem.squashfs after it boots initramfs - maybe a module loading issue.

vbgeek
April 12th, 2008, 04:03 AM
Just finished applying the step in the tutorial and burning DVD now, anxious to see how it turns out. I found one problem I wanted to point out, E. 2. has a typo:

-----------------------------------------
2. Test the CD

Test using qemu emulator

Code:
qemu -cdrom ~\live-cd.iso -boot d
-----------------------------------------

That needs to be a forward slash.

My use of this is probably somethign that has not been tested, I am creating a DVD from a VMWare instance of Ubuntu 7.10 Gutys. I have customized that with apps I use in my job, including a VPN client for connecting to my companies network. My goal here is to make an emergency Live DVD. I am on call off-hours and get tired of lugging my laptop with me for the occassional times I need it. If I can boot this up in another PC and get VPN access, it will be cool. We will see what happens.

capink
April 12th, 2008, 07:53 PM
Thank you for pointing out the typo. I have corrected it.

gjhicks
April 21st, 2008, 02:04 AM
Hi,

Thanks very much for the clearly explained procedure.

I used it successfully to create a LiveCD of my much-abbreviated IceWM-Gutsy hard disk install.

Bu then have had a rather bizarre problem (or series of problems).

After the intial sucess, have not been able to 'make' another LiveCD, when running the ISO under Qemu, keep getting dropped to the 'initramfs' error.

Noticed a couple of things that might be having an effect:

1) after the remove non-system errors, my username is gone from /etc/passwd but the screen messages at the conclusion of making the squashfs file include a mention of my username.

2) a package called 'live-initramfs' is supposed to be removed from the filesystem.manifest, to prepare the '-desktop file, but such a package doesn't seem to exist on the system (I followed all the installation instructions).

Bearing in mind my very limited knowledge of this 'live cd building' stuff, the above may be unrelated to the failure but thought it was worth letting you know.

Thanks again for the work you have put in.

Used your

capink
April 21st, 2008, 11:37 AM
After the intial sucess, have not been able to 'make' another LiveCD, when running the ISO under Qemu, keep getting dropped to the 'initramfs' error.


As noticed by az (http://ubuntuforums.org/member.php?u=844) in this post (http://ubuntuforums.org/showpost.php?p=4643009&postcount=18), this sometimes happens with qemu. To be sure try burning the iso to a REwritable cd and test on your machine directly without an emulator.


after the remove non-system errors, my username is gone from /etc/passwd

That is intended and is normal. The live cd will create a user of its own called ubuntu upon boot.


but the screen messages at the conclusion of making the squashfs file include a mention of my username.


That is probably because some of the files in the system are owned by the main user. To rectify this problem run these commands just after the fisrt command in step B (after copying your filesystem):

sudo find ${WORK}/rootfs -user username -exec sudo chown --no-dereference root {} \;

sudo find ${WORK}/rootfs -group username -exec sudo chgrp --no-dereference root {} \;

Replace username with the username of your original system.


2) a package called 'live-initramfs' is supposed to be removed from the filesystem.manifest, to prepare the '-desktop file, but such a package doesn't seem to exist on the system (I followed all the installation instructions).


Indeed, I have corrected this mistake by removing live-initramfs from the variable REMOVE (in step D.2)

LuisPT
April 22nd, 2008, 07:05 PM
Thanks guys for this wonderfull tutorial.

Well, I've built about 5 or 6 livecd using this guide, BUT all the times I get the same problem:

When I'm booting the iso with QEMU the boot process stops at (initramfs) prompt !!!!

I've tried to add acpi=off in grub, but that didn't resolve the problem.

When I'm at initramfs prompt.

I've tried also to add all_generic_ide since in booting with Gutsy I have to this also, but no way it stops also when detecting some hardware.

Now I've tried with VirtualBox and it works well, so it was a problem with QEmu.

But now I have a another problem:
- I've installed a debootstrap system and made the live cd from it.
- I've installed xdm on debootstrap
- But when I arrive to XDM Login screen it prompts for a username and a password that I don't now (I've tried my login and pass that I use in my Ubuntu Gutsy but it doens't work)
- Can I disable the login in LiveCD? How?
- I've installed also ubiquity, so doest it ask me for a new user and password when It starts to make the installation to hard disk?

Sorry for so many questions, but I'm just so close to make my LiveCD/Installation Custom CD.

Thanks in advance for your help.

capink
April 22nd, 2008, 09:02 PM
Unfortunately casper only supports gdm and kdm. Try adding the following parameter to grub entry:

textonly

This should log you to a text terminal where you can start GUI by typing:

startx -- :1


Edit: You can modify grub parameters temporarily without remastersing the cd. look of instructions in this link (http://grumpymole.blogspot.com/2007/05/ubuntu-how-to-edit-grub-boot-parameters.html).

relugrigorescu
May 1st, 2008, 04:11 AM
I made a custom live cd of my gutsy 64 with remastersys and it's not workin'
I get this error message about gdm :
"Server Authorization directory (daemon/ServAuthDir) is set to /var/lib/gdm but this does not exist. Please correct GDM configuration and restart GDM"

What do i did wrong ?? What can i do ??

yakshbuntu
May 2nd, 2008, 02:14 PM
Fantastic post. Thanks a lot. I created LiveDVD of my hardy installation and I can get back hardy to the state in liveDVD using ubiquity installer.

RumorsOfWar
May 3rd, 2008, 05:29 PM
I just tried to use my install disk on another machine ( it has the same processor and similar vid card), and it hung at 94% while configuring hardware.
I'm wondering if my install disk is missing some hardware components because I started out with the Alt-install in the first place.
Any ideas?

capink
May 3rd, 2008, 07:32 PM
Most hardware drivers in linux are either part of the kernel (kernel modules), or come with xorg (video and output input devices). So I don't think the alt install would make any difference. I don't know what is the cause of your problems, maybe a certain piece like a motherbord controller is not supported. Sometimes it is helpful to try the latest version of the kernel when you have trouble with hardware.

jw5801
May 3rd, 2008, 10:53 PM
I just tried to use my install disk on another machine ( it has the same processor and similar vid card), and it hung at 94% while configuring hardware.
I'm wondering if my install disk is missing some hardware components because I started out with the Alt-install in the first place.
Any ideas?

Are you certain there isn't an error in the disk from when you burned it? That sounds much much more likely.

gjhicks
May 5th, 2008, 02:39 AM
Hello Capink,

Thanks for the suggestions about the stray non-root owned files.

Am most pleased to report that I successfully made a live cd of my IceWm-Gutsy hard disk install. The ISO file was 224mb - so now I will try and reduce it to fit onto a small CD.

Great guide! Thanks a lot!

Geoff

capink
May 5th, 2008, 11:52 AM
These are instructions for people who want a live CD containing a clean system (or a minimal rescue disc), you can build a new custom Ubuntu from scratch using debootstarp, and then apply the steps of the guide to make a live cd out of it. These are the steps that will replace step B in the original guide (http://ubuntuforums.org/showpost.php?p=4277073&postcount=1) for people who wish to build a custom system from scratch, instead of using their harddrive installation as a basis.


Note: Before doing the steps below, you must perform step A in the original guide (http://ubuntuforums.org/showpost.php?p=4277073&postcount=1).

B. Build a custom system from scratch using debootstrap

1. Install debootstrap

sudo apt-get install debootstrap

2. Run debootstrap to install the basic packages:

sudo debootstrap gutsy ${WORK}/rootfs

Replace gutsy with any other version you want (e.g. fesity, hardy, .....)

This step will take time as the deb files are downloaded.


Now you have a system the contain the basic packages. At this stage this system can only work as chroot system. But in the next steps we will modify it to be full system.



3. Prepare the new system before chrooting into it:

Modify the new system sources list:

sudo gedit ${WORK}/rootfs/etc/apt/sources.list

And place the following text into it:


deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse

deb http://packages.medibuntu.org/ gutsy free non-free

Note: Replace gutsy with your favorite version name. e.g. feisty




Copy the following files to have internet access within the chroot environment:

for i in /etc/resolv.conf /etc/hosts /etc/hostname; do sudo cp -pv $i ${WORK}/rootfs/etc/; done



4. Chroot into the new system:

sudo mount -t proc proc ${WORK}/rootfs/proc

sudo mount -t sysfs sysfs ${WORK}/rootfs/sys

sudo mount --bind /dev ${WORK}/rootfs/dev

sudo chroot ${WORK}/rootfs /bin/bash


Note: All commands in blue are run within chroot.

LANG=


5. Once in chroot, modify the new system:

apt-get update --allow-unauthenticated

This will give you GPG warning because of third party repositories (Codecs repositories). Ignore it and proceed.



6. Install the multimedia repository keyrings ( to prevent apt from complaining about missing GPG ):

apt-get -qq install wget && wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | apt-key add -





7. Install some important packages not included in the base install performed by debootstrap, most notably is the kernel:

apt-get install linux-generic linux-headers-generic ubuntu-minimal ubuntu-standard


Now, we have a complete command line system







8. To have a GUI system, install:

apt-get install xorg gdm openbox fbpanel thunar firefox mplayer w32codecs scite gqview xarchiver rxvt gtk2-engines xcursor-themes ttf-bitstream-vera ttf-dejavu ttf-freefont

xorg in necessary for a GUI.
Replace openbox with your favorite window manager.
Replace gdm with your favorite login manager. (Or you can do without login manager and user startx if you want)
The rest is optional. You can ignore them or replace them with your favorite programs. if you are a gnome fan you can install gnome-core. kde fans can install kde. xfce fans can install xfce4 ......

Note: If you want to build a system identical to official ubuntu replace all the packages above with just one metapackage called ubuntu-desktop (kubuntu-desktop for kubuntu, xubuntu-desktop for xubuntu)



By now you have built a complete GUI system.

You are still in chroot. Do not exit the chroot and resume the steps of the original guide (http://ubuntuforums.org/showpost.php?p=4277073&postcount=1) jumping directly to step C.2 in the original guide (http://ubuntuforums.org/showpost.php?p=4277073&postcount=1).

Angus77
May 6th, 2008, 09:43 AM
Knoppix somehow "just works" on both 32- and 64-bit systems. Is there some way to make an Ubuntu disc that does the same?

capink
May 9th, 2008, 09:23 AM
Knoppix somehow "just works" on both 32- and 64-bit systems. Is there some way to make an Ubuntu disc that does the same?

I have never used Knoppix before. But just by looking at their site it seems that they make a live CD that contains mixture of 32-bit and 64-bit applications. To be more specific almost all the packages are 32-bit except the kernel and the development tools like gcc, which are 64 bit.

My Understanding is that while a 32-bit applications can work on both 32-bit 64-bit processors, 64-bit applications can only work on 64-bit processors. So, I think the version of Knoppix you are talking about will only work on 64-bit processors, since it contains a 64-bit processor, which will not work on 32-bit processors.

From I gathered from their site, Knoppix 64-bit edition is using 32-bit applications for various technical considerations, one of which is to be able to fit the distro into one cd.

Angus77
May 11th, 2008, 05:14 AM
Well, except that I downloaded and burned a copy of both the Japanese and English editions of Knoppix 5.1, and it ran on my home desktop (a 64-bit AMD Athlonx2), my office computer (a 32-bit 500MHz AMD something-or-other---really slowly) and a laptop at a class I'm going to (a 32-bit 1.8GHz something-or-other). I still use it at the class.

I'd like to customize an Ubuntu live disk and be able to use it at home, work and school, which I can't do right now.

Puppy Linux (http://www.puppylinux.com/) also works on both 32- and 64-bit systems.

Oldsoldier2003
May 12th, 2008, 08:01 PM
very nice and comprhensive tutorial, I'm replying from my live cd so that tells you it definitely works :) the one thing I am having problems with at the moment is for some reason the cd mounts sda2 as the / partition. If it makes any sense thats the partition where my minimal Ubuntu install for building the live cd resides. unmounting sda2 with umount -l doesnt solve the problem.

I have tried removing all references to the device in /etc/fstab prior to creating the squashfs filesystem but that doesn't fix the issue either.Oddly enough Gparted (when run from the live cd) reports this partition as full when it is only maybe 10% full. Any thoughts on how to workaround this?

capink
May 12th, 2008, 09:19 PM
In step C.5 we delete the fstab file. So, the live CD is supposed to not have fstab file. Are you sure you went through this step?

To make sure, please mount the squashfs (after mounting the iso) and see if there is a /etc/fstab there or not. If it present, you will have to redo the steps of the guide making sure that you get rid of this file. Squashfs is a read-only filesystem so you cannot delete the file once it is in the squashfs.

Oldsoldier2003
May 12th, 2008, 11:36 PM
In step C.5 we delete the fstab file. So, the live CD is supposed to not have fstab file. Are you sure you went through this step?

To make sure, please mount the squashfs (after mounting the iso) and see if there is a /etc/fstab there or not. If it present, you will have to redo the steps of the guide making sure that you get rid of this file. Squashfs is a read-only filesystem so you cannot delete the file once it is in the squashfs.

I ran through the steps again and realized the problem was that the script in step c-5 was the problem. Rather than try to figure out why its choking i'll manually delete the files and give it another run through.

rraj.be
May 21st, 2008, 04:29 AM
Hello geeks.......

i have came up to the last step of making ISO..

i have not yet burnt a single disk in ubuntu.......

whether we have to insert blank disk before this step

E. Build the CD/DVD

1. Make the ISO file

sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD



i entered this code without inserting any disk and i got thefollowing result

raj@raj-dworkstation:~/cd$ sudo mkisofs -b boot/grub/stage2_eltorito \
> -no-emul-boot -boot-load-size 4 -boot-info-table \
> -V "Custom Live CD" -cache-inodes -r -J -l \
> -o ~/live-cd.iso $CD
Unknown file type (unallocated) /home/raj/cd/.. - ignoring and continuing.
Size of boot image is 4 sectors -> No emulation
0.94% done, estimate finish Wed May 21 13:38:49 2008
1.88% done, estimate finish Wed May 21 13:38:49 2008
2.81% done, estimate finish Wed May 21 13:39:24 2008
3.75% done, estimate finish Wed May 21 13:39:42 2008
4.69% done, estimate finish Wed May 21 13:39:31 2008
5.63% done, estimate finish Wed May 21 13:39:42 2008
6.57% done, estimate finish Wed May 21 13:39:34 2008
7.51% done, estimate finish Wed May 21 13:40:08 2008
8.44% done, estimate finish Wed May 21 13:40:00 2008
9.38% done, estimate finish Wed May 21 13:40:03 2008
10.32% done, estimate finish Wed May 21 13:39:56 2008
11.26% done, estimate finish Wed May 21 13:40:00 2008
12.20% done, estimate finish Wed May 21 13:39:54 2008
13.14% done, estimate finish Wed May 21 13:39:57 2008
14.07% done, estimate finish Wed May 21 13:40:07 2008
15.01% done, estimate finish Wed May 21 13:40:08 2008
15.95% done, estimate finish Wed May 21 13:40:04 2008
16.89% done, estimate finish Wed May 21 13:40:05 2008
17.83% done, estimate finish Wed May 21 13:40:07 2008
18.77% done, estimate finish Wed May 21 13:40:03 2008
19.70% done, estimate finish Wed May 21 13:40:05 2008
20.64% done, estimate finish Wed May 21 13:40:06 2008
21.58% done, estimate finish Wed May 21 13:40:03 2008
22.52% done, estimate finish Wed May 21 13:40:04 2008
23.46% done, estimate finish Wed May 21 13:40:09 2008
24.40% done, estimate finish Wed May 21 13:40:06 2008
25.33% done, estimate finish Wed May 21 13:40:07 2008
26.27% done, estimate finish Wed May 21 13:40:05 2008
27.21% done, estimate finish Wed May 21 13:40:06 2008
28.15% done, estimate finish Wed May 21 13:40:07 2008
29.09% done, estimate finish Wed May 21 13:40:08 2008
30.03% done, estimate finish Wed May 21 13:40:05 2008
30.96% done, estimate finish Wed May 21 13:40:06 2008
31.90% done, estimate finish Wed May 21 13:40:07 2008
32.84% done, estimate finish Wed May 21 13:40:08 2008
33.78% done, estimate finish Wed May 21 13:40:05 2008
34.72% done, estimate finish Wed May 21 13:40:06 2008
35.66% done, estimate finish Wed May 21 13:40:07 2008
36.59% done, estimate finish Wed May 21 13:40:05 2008
37.53% done, estimate finish Wed May 21 13:40:06 2008
38.47% done, estimate finish Wed May 21 13:40:06 2008
39.41% done, estimate finish Wed May 21 13:40:05 2008
40.35% done, estimate finish Wed May 21 13:40:05 2008
41.29% done, estimate finish Wed May 21 13:40:06 2008
42.22% done, estimate finish Wed May 21 13:40:07 2008
43.16% done, estimate finish Wed May 21 13:40:05 2008
44.10% done, estimate finish Wed May 21 13:40:06 2008
45.04% done, estimate finish Wed May 21 13:40:06 2008
45.98% done, estimate finish Wed May 21 13:40:05 2008
46.92% done, estimate finish Wed May 21 13:40:05 2008
47.85% done, estimate finish Wed May 21 13:40:06 2008
48.79% done, estimate finish Wed May 21 13:40:04 2008
49.73% done, estimate finish Wed May 21 13:40:05 2008
50.67% done, estimate finish Wed May 21 13:40:03 2008
51.61% done, estimate finish Wed May 21 13:40:04 2008
52.55% done, estimate finish Wed May 21 13:40:05 2008
53.48% done, estimate finish Wed May 21 13:40:03 2008
54.42% done, estimate finish Wed May 21 13:40:04 2008
55.36% done, estimate finish Wed May 21 13:40:04 2008
56.30% done, estimate finish Wed May 21 13:40:05 2008
57.24% done, estimate finish Wed May 21 13:40:05 2008
58.18% done, estimate finish Wed May 21 13:40:04 2008
59.11% done, estimate finish Wed May 21 13:40:03 2008
60.05% done, estimate finish Wed May 21 13:40:03 2008
60.99% done, estimate finish Wed May 21 13:40:02 2008
61.93% done, estimate finish Wed May 21 13:40:03 2008
62.87% done, estimate finish Wed May 21 13:40:03 2008
63.81% done, estimate finish Wed May 21 13:40:04 2008
64.74% done, estimate finish Wed May 21 13:40:04 2008
65.68% done, estimate finish Wed May 21 13:40:03 2008
66.62% done, estimate finish Wed May 21 13:40:04 2008
67.56% done, estimate finish Wed May 21 13:40:03 2008
68.50% done, estimate finish Wed May 21 13:40:03 2008
69.44% done, estimate finish Wed May 21 13:40:03 2008
70.37% done, estimate finish Wed May 21 13:40:02 2008
71.31% done, estimate finish Wed May 21 13:40:01 2008
72.25% done, estimate finish Wed May 21 13:40:02 2008
73.19% done, estimate finish Wed May 21 13:40:02 2008
74.13% done, estimate finish Wed May 21 13:40:01 2008
75.07% done, estimate finish Wed May 21 13:40:02 2008
76.00% done, estimate finish Wed May 21 13:40:01 2008
76.94% done, estimate finish Wed May 21 13:40:03 2008
77.88% done, estimate finish Wed May 21 13:40:03 2008
78.82% done, estimate finish Wed May 21 13:40:02 2008
79.76% done, estimate finish Wed May 21 13:40:02 2008
80.70% done, estimate finish Wed May 21 13:40:02 2008
81.63% done, estimate finish Wed May 21 13:40:02 2008
82.57% done, estimate finish Wed May 21 13:40:01 2008
83.51% done, estimate finish Wed May 21 13:40:00 2008
84.45% done, estimate finish Wed May 21 13:40:01 2008
85.39% done, estimate finish Wed May 21 13:40:01 2008
86.33% done, estimate finish Wed May 21 13:40:01 2008
87.26% done, estimate finish Wed May 21 13:40:01 2008
88.20% done, estimate finish Wed May 21 13:40:01 2008
89.14% done, estimate finish Wed May 21 13:40:00 2008
90.08% done, estimate finish Wed May 21 13:40:01 2008
91.02% done, estimate finish Wed May 21 13:40:01 2008
91.96% done, estimate finish Wed May 21 13:40:01 2008
92.89% done, estimate finish Wed May 21 13:40:01 2008
93.83% done, estimate finish Wed May 21 13:40:01 2008
94.77% done, estimate finish Wed May 21 13:40:00 2008
95.71% done, estimate finish Wed May 21 13:40:01 2008
96.65% done, estimate finish Wed May 21 13:40:01 2008
97.59% done, estimate finish Wed May 21 13:40:01 2008
98.52% done, estimate finish Wed May 21 13:40:01 2008
99.46% done, estimate finish Wed May 21 13:40:01 2008
Total translation table size: 2048
Total rockridge attributes bytes: 1593
Total directory bytes: 5226
Path table size(bytes): 34
Max brk space used 0
532875 extents written (1040 MB)
raj@raj-dworkstation:~/cd$


I dont know what to do now......

please any one could help me.

rraj.be
May 21st, 2008, 05:37 AM
I boot from my live cd that i have made.
its just getting into the shell and not showing the llogin screen

please help me

rraj.be
May 21st, 2008, 08:21 AM
Which player can i uae to play the 3Gp videos in ubuntu..

Whih codec must i use.

could any one give me the exact command plz

capink
May 22nd, 2008, 01:32 PM
Which player can i uae to play the 3Gp videos in ubuntu..

The combination of mplayer and w32codecs can play 3gp. Before installing w32codecs you have to edit /etc/apt/sources.list and add to it the following:

deb http://packages.medibuntu.org/ hardy free non-free

Note: Replace hardy with your vesion codename.

Add the GPG key of the above repository:

wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | apt-key add -

sudo apt-get update && sudo apt-get install mplayer w32codecs

frozer
May 25th, 2008, 11:46 AM
Hi Capink!

You made a great work! I try to make custom CD for educational purposes (I'm a teacher) with a few of services in text mode - DNS, iptables, dhcpd etc and used your guide to create it.

But after loading, init wont mount /cdrom, so system stops on (initrafs) prompt.
/casper.log:
Begin: Running /scripts/casper-premount
Done.
Done.
Unable to find a medium containing a live file system

But I can see device /dev/scd0 with live root fs, and can mount it manually to /casper, then mount squashfs live fs to root...

Any ideas?

Thanks.

MikeRussell
May 28th, 2008, 11:52 PM
After I mount the newly created file system and enter a chroot environment (step C.1.), I am unable to apt-get anything. Any reason this would happen?
Mike

capink
May 29th, 2008, 08:32 AM
After I mount the newly created file system and enter a chroot environment (step C.1.), I am unable to apt-get anything. Any reason this would happen?
Mike

Make sure the file /etc/resolv.conf is copies to your chroot filesystem:

sudo cp -v /etc/resolv.conf ${WORK}/rootfs

The previous command must be run outside chroot.

bayrem
June 8th, 2008, 11:39 AM
hi,

Thaks for u'rer great tuto :d

I got one prob but before that I would like to share some prob that i got and succed to find an issue :

1. for people how use a virtuel machine, guys u must replace $(uname -r) but the real kernel release like 2.6.14-22-generic and not use the VM kernel who looks like this 2.6.14-22-virtual. that do not create a bootable kernel for real machines :d

My prob is this :

I have a login screen and I cannot login in the system

So how can I diagnostic the prob :
make a working auto-login OR making a working use that can login.

No matter for me

Thank u all

Regards

bayrem
June 8th, 2008, 11:55 AM
The prob is not only a login prob, I got many prob like mouse .. and I think it is a module loading prob, more informations bellow.

I saw some critical error messages (about depmod et modprob):

modeprob /lib/modules/2.6.22-14-generic/module.dep : no such file or directory


and then many error messages with :

user not known to underlying authentification module

Help please

Regards

capink
June 8th, 2008, 06:53 PM
modeprob /lib/modules/2.6.22-14-generic/module.dep : no such file or directory


This is probably because you did not perform the first command in step C.4 (which builds the file module.dep). Try redoing the two commands in step C.4 replacing $(uname -r) with your kernel version, so the commands should look:

depmod -a 2.6.22-14-generic

update-initramfs -u -k 2.6.22-14-generic

These two steps are done within chroot.

If this does not solve your problem, I don't think I have any other solution. But if you receive error messages post them, maybe someone would be able to help.

bayrem
June 9th, 2008, 07:15 AM
I think that you're missing to mount /sys in C.1 I think :

HOME$ sudo mount -t sys -o bind /sys livecd/sys

Then, I made a new environnement and recompile all

no prb anymore with :
modeprob /lib/modules/2.6.22-14-generic/module.dep : no such file or directory

but still can't login autologin. It display me the login screen.

I made this changes for live user:

HOME$ sudo nano /PATH/TO/HOME/LIVECD/etc/casper.conf

export USERNAME="MYUSERNAME"

export USERFULLNAME="MYUSERNAME"

export HOST="MYUSERNAME"

export BUILD_SYSTEM="MYUSERNAME"

and here for the password :

mkpasswd -s motdepasse

E/RzddfzlTY0A

HOME$ sudo nano /PATH/TO/HOME/LIVECD/usr/share/initramfs-tools/scripts/casper-bottom/10adduser

set passwd/root-password-crypted E/RzddfzlTY0A

set passwd/user-password-crypted E/RzddfzlTY0

Nothing to do cannot login with MYUSER and THE PASS I MADE.

P.S: Didn't made the step C.8 to delete non system users (note: MYUSER used for live session does not exist in my system users, I specially created with liveCD), does it bother auto login?

ANY help please

Regards

capink
June 9th, 2008, 09:17 AM
P.S: Didn't made the step C.8 to delete non system users (note: MYUSER used for live session does not exist in my system users, I specially created with liveCD), does it bother auto login?

ANY help please

Regards

The thing that bothers the autologin is havein a user with an id more than 999. So if MYUSER id is less than 999, there should be no problem. Anyway, you can try doing the steps as they are (without adding MYUSER) and see if that makes any difference.

bayrem
June 9th, 2008, 10:59 AM
I test without adding user + i change the ID of my users to 888 and 889
No way it this same thing

Does some servers bother the liveCD

I have mysql and apache2 + openssh installed on that cd.

I heard that could have some probs if /etc/passwd and /etc/groups are different or there is some missing users in one or the other :(

I gave both files :

/etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
dhcp:x:100:101::/nonexistent:/bin/false
syslog:x:101:102::/home/syslog:/bin/false
klog:x:102:103::/home/klog:/bin/false
bayrem:x:888:888:,,,:/home/bayrem:/bin/bash
coucou:x:889:889:,,,:/home/coucou:/bin/bash
sshd:x:103:65534::/var/run/sshd:/usr/sbin/nologin
messagebus:x:104:111::/var/run/dbus:/bin/false
haldaemon:x:105:112:Hardware abstraction layer,,,:/home/haldaemon:/bin/false
gdm:x:106:114:Gnome Display Manager:/var/lib/gdm:/bin/false
mysql:x:107:115:MySQL Server,,,:/var/lib/mysql:/bin/false

etc/groups
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:bayrem
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:bayrem
fax:x:21:
voice:x:22:
cdrom:x:24:bayrem,haldaemon
floppy:x:25:bayrem,haldaemon
tape:x:26:
sudo:x:27:
audio:x:29:bayrem
dip:x:30:bayrem
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:bayrem
sasl:x:45:
plugdev:x:46:bayrem,haldaemon
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
dhcp:x:101:
syslog:x:102:
klog:x:103:
scanner:x:104:bayrem
nvram:x:105:
fuse:x:106:
crontab:x:107:
ssh:x:108:
lpadmin:x:109:bayrem
admin:x:110:bayrem
bayrem:x:888:
coucou:x:889:
messagebus:x:111:
haldaemon:x:112:
powerdev:x:113:haldaemon
gdm:x:114:
mysql:x:115:

I'm desesperate :confused:

I need u're lights

Regards

knadoor
June 10th, 2008, 11:25 AM
thanks,

however is there any way to adapt this method on a Red Hat based system, that is, a system not based on debian?

More specifically for Fedora.

Thanks.

capink
June 11th, 2008, 01:10 AM
thanks,

however is there any way to adapt this method on a Red Hat based system, that is, a system not based on debian?

More specifically for Fedora.

Thanks.

Unfortunately no. Because casper scripts depends a lot on debconf, so even if you converted the casper debian package into rpm package, I am afraid it is not going to work.

But while gathering information for this guide, I think I saw some solutions for Fedora. So try searching google, you may find something. Also check this site (http://www.livedistro.org/).

Keith Hedger
June 14th, 2008, 08:09 AM
Exellent howto booted to live cd first time, one question though the live cd booted to 800x600 how can i get it to use the nvidia driver that my main system uses ( or even just a higher resolution )

capink
June 14th, 2008, 08:00 PM
Exellent howto booted to live cd first time, one question though the live cd booted to 800x600 how can i get it to use the nvidia driver that my main system uses ( or even just a higher resolution )

To keep your X settings don't delete the xorg.conf in step C.4. That works for me in Debian. But I am not sure about hardy because I have not tried it, and I heard it has a new way of setting resolution. You can find an answer to that in threads about resolution in hardy in forums.

spicewoodleo
June 17th, 2008, 07:33 PM
I am having the same problem as RumorsOfWar. When I try to install from an image I generated from the above procedure, I get a stall at 94%. Here is what I am seeing: I looked at /var/log/syslog, and it is indicating a failure resolving the UUID in spite of the fact that I do indeed have this UUID on /dev/sda5 (see log below, and output from ls_vol). Upon further digging in the ubiquity scripts, particularly in /usr/share/ubiquity/install.py, I found that the "findfs" was failing because it was being run as 'chroot /target'. When I looked at '/target/dev', it only had two entries in it: 'null' and 'tty',. I was expecting (and so was findfs) the full compliment of /dev/xxx entries including /dev/sda... stuff. "findfs UUID=xxxxxx" works fine if not run as 'chroot target'. Here is my question, what step in this process left me without entries in the /target/dev during the ubiquity install? and what can I do to get them to be there? Or is this some problem with Ubiquity?

Thanks very much, Leo

Here are the logs:
...
python: log-output -t ubiquity chroot /target dpkg-divert --package ubiquity --rename --quiet --add /usr/sbin/update-initramfs
ubiquity: Running depmod.
ubiquity: Not updating initrd symbolic links since we are being updated/reinstalled
ubiquity: (2.6.22-14.46 was configured last, according to dpkg)
ubiquity: Not updating image symbolic links since we are being updated/reinstalled
ubiquity: (2.6.22-14.46 was configured last, according to dpkg)
ubiquity: Running postinst hook script /sbin/update-grub.
ubiquity: Searching for GRUB installation directory ...
ubiquity: found: /boot/grub
ubiquity: findfs
ubiquity: :
ubiquity: Unable to resolve 'UUID=4ee62f6e-c3b7-4052-9a4a-c93954d81ee6'
ubiquity: ^M
ubiquity: Cannot determine root device. Assuming /dev/hda1
ubiquity: This error is probably caused by an invalid /etc/fstab
ubiquity: Searching for default file ...
ubiquity: found: /boot/grub/default
ubiquity: Testing for an existing GRUB menu.lst file ...
ubiquity:
ubiquity:
ubiquity: Could not find /boot/grub/menu.lst file.
ubiquity: Would you like /boot/grub/menu.lst generated for you?
ubiquity: (y/N)
<<< stalls here >>>

root@ubuntu:# vol_id /dev/sda5
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=4ee62f6e-c3b7-4052-9a4a-c93954d81ee6
ID_FS_UUID_ENC=4ee62f6e-c3b7-4052-9a4a-c93954d81ee6
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=

spicewoodleo
June 19th, 2008, 06:54 PM
Figured this out. (This in Ubuntu 7.10 anyway).
I did 3 things:
1> I mounted sys on livecd/sys, as above where the /proc and /dev directories are mounted. (don't think it made much difference though)

2> I mounted /dev/.static/dev while running mksquashfs, so that some minimal /dev entries end up there, and...

3> (Probably what fixed it)
I renamed /boot/initrd.img-`uname -r` to /boot/initrd.img-`uname -r`.bak in the chrooted section (in blue) as some code down in /var/lib/dpkg/info/linux-image-`uname -r`.postinst was looking to see if the initrd.image-`uname -r` file was there or not. If so, ubiquity was assuming I was taking an upgrade path and not an install path, and it was ending up in the weeds.

I did this by adding a line just after the "rm -f /boot/*.bak" line in the chroot (blue) section:

rm /boot/*.bak 2>/dev/null # (existing)
mv /boot/initrd.img-`uname -r` /boot/initrd.img-`uname -r`.bak

This did the trick for me. Thanks.

Leo :guitar:

umairmehmood
June 23rd, 2008, 07:25 AM
Hello!
This is really an excellent guide.
I am facing a few problems though:

System: Debian

I installed a fresh copy of Debian and followed the guide.
All went fine. No errors or warnings.
When i try to emulate the image, using QEMU, i cant get into the graphical interface.

This is the output which i can see:

Uncompressing Linux...Ok, booting the kernel..
....
...
Loading, please wait...

BusyBox v1.1.3 (Debian) Built in shell (ash)
Enter help for a list of built in commands

/bin/sh: cant access tty; job turned off
(initramfs)

This is the command based interface i see..
I would like to see the graphical interface.
Am i doing anything wrong here?

Oldsoldier2003
June 23rd, 2008, 12:19 PM
Hello!
This is really an excellent guide.
I am facing a few problems though:

System: Debian

I installed a fresh copy of Debian and followed the guide.
All went fine. No errors or warnings.
When i try to emulate the image, using QEMU, i cant get into the graphical interface.

This is the output which i can see:



This is the command based interface i see..
I would like to see the graphical interface.
Am i doing anything wrong here?
I've had issues running an ISO in QEMU as well. I have managed to get the same ISO to run in virtualbox, or when burned to a CD. Even though there may be a workaround, I blame QEMU...

umairmehmood
June 24th, 2008, 09:25 AM
You were right.
That was a problem with the QEMU.

I have the image, but all other applications which i wanted to be in the live CD are not available.
How can i make the Live CD to have my custom apps.

I was hoping, the Livé CD would have the same structure as my working Linux copy. (I was hoping for the same Desktop environment too).

What am i missing?

Oldsoldier2003
June 24th, 2008, 03:22 PM
You were right.
That was a problem with the QEMU.

I have the image, but all other applications which i wanted to be in the live CD are not available.
How can i make the Live CD to have my custom apps.

I was hoping, the Livé CD would have the same structure as my working Linux copy. (I was hoping for the same Desktop environment too).

What am i missing?

If you follow the instructions for making a live cd from your existing installation it will have the same structure. If you are wanting to keep your current home directory and settings dont remove it. if you are wanting to create a livecd user with the same desktop and settings, then put the configurations in /etc/skel

umairmehmood
June 24th, 2008, 03:43 PM
okey....i need to try this...before i can ask you something more :)

One Question.

Does it matter if you are making an ext2 installation?

The only difference as far as i know is,
In a standard installation, the files are compressed and hence the installation size is minimal.
In Ext2 installation, the size expands to meet the current size of your existing environment, BUT being Fast.

So, does the ext2 installation create any difference ?

blazercist
June 24th, 2008, 04:09 PM
nice howto

umairmehmood
June 24th, 2008, 05:05 PM
?

jokermatt999
June 26th, 2008, 04:59 PM
Nice tutorial. How difficult is this to adapt to a different system? To be more specific, how difficult/different would it be for Damn Small Linux or Puppy Linux?

umairmehmood
June 28th, 2008, 12:21 PM
if you are wanting to create a livecd user with the same desktop and settings, then put the configurations in /etc/skel

I can see how to transfer the files, but how should i have the same desktop background copied too ?

Oldsoldier2003
June 28th, 2008, 12:45 PM
I can see how to transfer the files, but how should i have the same desktop background copied too ?

If you save the wallpaper image in your home directory and set the desktop to use that file, save that file into the same place in /etc/skel/ . your copied configs will reference the file so it has to be in /etc/skel to be copied to the new account , or the desktop background will be blank/colored , instead of having a background wallpaper.

talikarng
June 29th, 2008, 03:47 AM
Apologies in advance if this has already been suggested; but could someone please advise me if this is in any way problematic.

Instead of letting debootstrap download the deb files to create the chroot environment I stopped it when it started downloading. As sudo I then copied all of the deb files from /var/cache/apt/archives into the the target's /var/cac...... and when I re-ran debootstrap it just unpackaged them.

Obviously this left a lot of useless files in the target's /var/cache/apt/archives; so I erased them all.

karika200
July 9th, 2008, 05:47 PM
Hi!

I followed your instructions, but my live system doesn't wotk :\ It starts the boot process, but crashes at the initramfs... Here's the screenshot: http://kepfeltoltes.hu/080709/scrsht1_www.kepfeltoltes.hu_.jpg
I write into the menu.lst the next 3 menu items:

title Debian GNU/Linux, kernel 2.6.18-6-486 (by karika200)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw
initrd /boot/initrd.gz

title Memtest86+
kernel /boot/memtest68+.bin

title Start the installed OS
root (hd0)

Why can't it mount the rootfs?:\ It writes "No such device", but there is some loop device in /dev...

thx, karika200

prototype_angel
July 10th, 2008, 12:45 AM
Hi,

Thanks for the great guide. We want to make a livecd for our university linux user group and distribute them in our tutorials, seminars, etc.

I made quite a few changes to a fresh install like setting the sources.list, adding some introduction documents, some new packages etc.

Q1. I'm hoping that it will work with all the machines ubuntu normally works with.

Q2. Do I need to worry about the user that I'm creating it as? Meaning if someone installs a fresh copy will they be locked into the same username and password that I used?

Q3. Moreover, I'd love it if I could remaster ubuntu and still make it work with wubi. can someone point me to such a guide?

Thanks

jedi453
July 10th, 2008, 05:00 PM
Hi, Thanks for the great guide capink!

I was curious though would it be possible to use lzma compression for mksquashfs. I think it would be a great way to fit a little extra on a cd. I am not sure exactly how to rebuild the kernel with support for reading from an archive compressed with lzma. I would guess you would have to use the package "lzma-source", but beyond that I'm not sure what to do. I think it would be great to get working on many systems that are just barely too big for a CD. The closest I've come so far is finding the pre-built kernel from "http://www.squashfs-lzma.org/", however I've found hardware support to be insufficient for my system. Is there a way to get the hardware support of Ubuntu while getting the better compression ratios as well?

If that doesn't work, is there any other way to get a better compression ratio?

Thanks

jedi453
July 10th, 2008, 05:31 PM
karika200, Try burning the disk you made to a cd or dvd then boot from that. I've had the same problem trying to use an emulator to run the liveCD. If you've tried that or it doesn't work, try using this instead for your grub menu.lst:


title Debian GNU/Linux, kernel 2.6.18-6-486 (by karika200)
kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet
initrd /boot/initrd.gz

title Memory Test
kernel /boot/memtest86+.bin

title Start the installed OS
root (hd0)
chainloader +1



prototype_angel, as long as you delete the files Capink suggests and use the step to create the empty gdm file, it should work. I made them from a password protected account before and have not seen any problems. If your worried about keeping files in your home account, copy them to "/etc/skel" before following this process. Only copy files you want readily accessable on the CD to /etc/skel/ , they will automatically be copied to /home/ubuntu when the cd boots. Be careful about this, because putting too much in /etc/skel will use a lot of ram.

jedi453
July 10th, 2008, 05:59 PM
Angus77, looks like you posted a while ago, but I think the problem you were having is that you have a 64-bit install on your desktop. The live cd's you make from it will only work on 64-bit machines. If you install a 32-bit version of Ubuntu alongside the 64-bit version (back up your stuff first) Then the 32-bit version should be able to make live-cds that can run on both 32-bit and 64-bit processors.

karika200
July 10th, 2008, 06:47 PM
Ahh, I was dumb.. I thought the linux-image*.deb package contains the squashfs and the unionfs modules... Now, I have installed these packages, and it works fine.:)

thx ;]

capink
July 11th, 2008, 08:18 AM
Nice tutorial. How difficult is this to adapt to a different system? To be more specific, how difficult/different would it be for Damn Small Linux or Puppy Linux?

If these distros are based on Debian, all you have to do is to follow the instructions for making a live Cd in Debian. But you will end up with a live CD without installer. Also you have to make sure that repositories of the debian based distro contain the package live-initramfs.

capink
July 11th, 2008, 08:22 AM
Hi,

Q1. I'm hoping that it will work with all the machines ubuntu normally works with.

It should.

Q2. Do I need to worry about the user that I'm creating it as? Meaning if someone installs a fresh copy will they be locked into the same username and password that I used?

No, the installer will ask him for a new username and password.

Q3. Moreover, I'd love it if I could remaster ubuntu and still make it work with wubi. can someone point me to such a guide?


Unfortunately, I don't have any experiece with wubi.

herger
July 11th, 2008, 08:36 AM
Hi.
Really beautiful thread and how-to!
I used to use remastersys, but the iso was incredibly slow when I used it as a live cd...
I will try Your method, thanks

Herger

capink
July 11th, 2008, 12:02 PM
Hi, Thanks for the great guide capink!

I was curious though would it be possible to use lzma compression for mksquashfs. I think it would be a great way to fit a little extra on a cd. I am not sure exactly how to rebuild the kernel with support for reading from an archive compressed with lzma. I would guess you would have to use the package "lzma-source", but beyond that I'm not sure what to do. I think it would be great to get working on many systems that are just barely too big for a CD. The closest I've come so far is finding the pre-built kernel from "http://www.squashfs-lzma.org/", however I've found hardware support to be insufficient for my system. Is there a way to get the hardware support of Ubuntu while getting the better compression ratios as well?

If that doesn't work, is there any other way to get a better compression ratio?

Thanks


I have not looked at lzma yet. But in debian lenny which I am currently using, there is lzma-modules-$(uname -r). So you might want to install the debian kernel in Ubuntu and see how it works. But I cannot guarntee it will work.

Note that you have to install the following packages from Debian repositories together:

sudo apt-get install linux-image-$(uname -r) squashfs-modules-$(uname -r) unionfs-modules-$(uname -r) lzma-modules-$(uname -r)

where $(uname -r) is the kernel version.


Or if you do not mind it, you can switch to Debian.

bkrsml
July 19th, 2008, 01:00 AM
I will be reposting this message as a reply to the top level post. I am only doing this because I accidently replied to the wrong thread.

I agree with the others that this is a very well written how-to.

I tried a subset of the instructions for a different but related goal. The results were not quite what I was looking for but I still think these instructions are close.

I know I was taking a lot of liberties with my subset of the instructions but I am hoping someone can help me with this or at least point me in the right direction.

Below are the details of my goal, the steps I used to try to reach it, and the results. Thanks in advance for any help.

GOAL:
I have an SDHC card (High Capacity SD card) on a USB reader. The card has a physical write protect switch which is an important reason I am using it. I want to be able to run Ubuntu from the card like it was a regular drive and to run it when the card is write locked. This thread caught my attention because I would like the write locked sessions to use the same image as the read-write mode. I do not mind having to perform some simple steps from the read-write boot every time I want to update the write-protected image.

ACTIONS:
I installed from the 8.04.1 desktop CD and that worked fine. I installed a package, a printer, and did other configuration. Then to support the write locked boot I did the following:

1. Updated Packages

2. I issued the last command of C.1
LANG=

3. Changed the initial users uid to 500 to get it under 1000
sudo usermod -u 500 <username>

4. Installed casper discover1 xresprobe
I would like the write-locked boot to use the GDM configuration from the install because my driver and resolution are not detected correctly by the 8.04.1 LiveCD on the system I am using to build and test this card. However I would also like the card to be portable across a wide number of machines and be able to detect settings (for both read/write and write-locked boots).

5. I then did step C.4
sudo depmod -a $(uname -r)
sudo update-initramfs -u -k $(uname -r)

6. I did not do step C.5. I ran this step on a previous attempt and it created problems. I think this is because I am running from the same system I am modifying (no chroot). I did not do steps C.6 and C.7 because space is not too much of an issue at this point.

7. I did not do step C.8 because I was hoping the user id change mentioned in my step 3) above would take care of the issue.

8. I did not do step C.9 again because space was not an issue.

9. I did not do step C.10 because I was hoping to use the GDM configuration from my read-write install.

10. I did not do step C.11 again because space was not an issue.

11. I modified /boot/grub/menu.lst
I added an entry by coping the default that was already there. I added boot=casper and nopersistent
title Read Only Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=<ID> BOOT=casper boot=casper nopersistent rw quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

RESULTS:
If I choose the installed read-write default option from the grub menu everything seems to perform just as before.

If I choose the new "Read Only" option I seem to get pretty much an uncustom LiveCD image. I was automatically logged in to the Live Session User, my driver and resolution were incorrectly detected, the user I created on install is not available, a printer I had registered was not available, and a package I had loaded was not found (however casper, discover1, and xresprobe were installed according to Synaptic).

adamogardner
July 19th, 2008, 12:37 PM
cli - tech difficulties. making bootable dvd

ok so I am following the steps. I was converting the directory tree into a squashfs and it just ceased:

adamogardner@CRONUS:~$ sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}
sudo: unable to resolve host CRONUS
Parallel mksquashfs: Using 2 processors
Creating little endian 3.1 filesystem on //filesystem., block size 131072.
[============================ ] 73842/149545 49%

so I opened a new tab and tried it again but to no avail:

adamogardner@CRONUS:~$ sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}
sudo: unable to resolve host CRONUS
Can't find a SQUASHFS superblock on //filesystem.
Failed to read existing filesystem - will not overwrite - ABORTING!
To force Mksquashfs to write to this block device or file use -noappend
adamogardner@CRONUS:~$

Is my disk too small? how can I tell? What can I do?

bab1
July 19th, 2008, 01:25 PM
adamogardner@CRONUS:~$ sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}
sudo: unable to resolve host CRONUS

This appears to be a DNS problem with your setup. Not the LiveCD setup. Check to see if your hostname is resolved correctly.

Oldsoldier2003
July 19th, 2008, 04:27 PM
This appears to be a DNS problem with your setup. Not the LiveCD setup. Check to see if your hostname is resolved correctly.
Yes its a problem with sudo resolving the host. It happens a lot with upgraded installations since gutsy.
To the OP:
Make sure the hostname in /etc/hosts matches the name in /etc/hostname , also be aware that if your hostname file or hosts file list your computer as hostname.somedomain sudo will fail. To fix it launch a text editor and remove the suffix (.somedomain). (Don't forget that you need to edit these files as superuser:
sudo nano /etc/hosts

bkrsml
July 20th, 2008, 04:32 PM
This is was originally posted as a reply to a sub-thread. I am now trying to post it as a reply to the top level post. Sorry for the duplicate.

I agree with the others that this is a very well written how-to.

I tried a subset of the instructions for a different but related goal. The results were not quite what I was looking for but I still think these instructions are close.

I know I was taking a lot of liberties with my subset of the instructions but I am hoping someone can help me with this or at least point me in the right direction.

Below are the details of my goal, the steps I used to try to reach it, and the results. Thanks in advance for any help.

GOAL:
I have an SDHC card (High Capacity SD card) on a USB reader. The card has a physical write protect switch which is an important reason I am using it. I want to be able to run Ubuntu from the card like it was a regular drive and to run it when the card is write locked. This thread caught my attention because I would like the write locked sessions to use the same image as the read-write mode. I do not mind having to perform some simple steps from the read-write boot every time I want to update the write-protected image.

ACTIONS:
I installed from the 8.04.1 desktop CD and that worked fine. I installed a package, a printer, and did other configuration. Then to support the write locked boot I did the following:

1. Updated Packages

2. I issued the last command of C.1
LANG=

3. Changed the initial users uid to 500 to get it under 1000
sudo usermod -u 500 <username>

4. Installed casper discover1 xresprobe
I would like the write-locked boot to use the GDM configuration from the install because my driver and resolution are not detected correctly by the 8.04.1 LiveCD on the system I am using to build and test this card. However I would also like the card to be portable across a wide number of machines and be able to detect settings (for both read/write and write-locked boots).

5. I then did step C.4
sudo depmod -a $(uname -r)
sudo update-initramfs -u -k $(uname -r)

6. I did not do step C.5. I ran this step on a previous attempt and it created problems. I think this is because I am running from the same system I am modifying (no chroot). I did not do steps C.6 and C.7 because space is not too much of an issue at this point.

7. I did not do step C.8 because I was hoping the user id change mentioned in my step 3) above would take care of the issue.

8. I did not do step C.9 again because space was not an issue.

9. I did not do step C.10 because I was hoping to use the GDM configuration from my read-write install.

10. I did not do step C.11 again because space was not an issue.

11. I modified /boot/grub/menu.lst
I added an entry by coping the default that was already there. I added boot=casper and nopersistent
title Read Only Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=<ID> BOOT=casper boot=casper nopersistent rw quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

RESULTS:
If I choose the installed read-write default option from the grub menu everything seems to perform just as before.

If I choose the new "Read Only" option I seem to get pretty much an uncustom LiveCD image. I was automatically logged in to the Live Session User, my driver and resolution were incorrectly detected, the user I created on install is not available, a printer I had registered was not available, and a package I had loaded was not found (however casper, discover1, and xresprobe were installed according to Synaptic).

capink
July 20th, 2008, 07:02 PM
GOAL:
I have an SDHC card (High Capacity SD card) on a USB reader. The card has a physical write protect switch which is an important reason I am using it. I want to be able to run Ubuntu from the card like it was a regular drive and to run it when the card is write locked. This thread caught my attention because I would like the write locked sessions to use the same image as the read-write mode. I do not mind having to perform some simple steps from the read-write boot every time I want to update the write-protected image.



If I understood what you want to do properly, this link (http://ubuntuforums.org/showthread.php?t=707230) might help you achieve what you want. The method outlined there uses live-initramfs instead of casper. Keep in mind that people had a mixed results using this method depending on their hardware as well as the size of the image they are creating.

bkrsml
July 21st, 2008, 05:24 PM
Thanks capink. I looked at the link and it appears that it might get me what I want. I am also going take a closer look at initramfs, live-initramfs, and casper. I think I need to understand them at a lower level.

Rurushu
July 23rd, 2008, 06:10 AM
Thanks for the tutorial... It is really helpful

I have few questions, if that possible...

1. When I reboot my LiveCD, everything goes well.. grub starts, I choose an option, ubuntu loading, and then BusyBox shell starts instead of loading the system...

I tried cat casper.log

(initramfs) cat casper.log
/init: /init: 1: cannot open /dev/fd0: No such device or address
stdin: error 0
/init: /init: 1: cannot open /dev/fd0: No such device or address
stdin: error 0
/init: /init: 1: cannot open /dev/fd0: No such device or address
stdin: error 0
/init: /init: 1: cannot open /dev/fd0: No such device or address
stdin: error 0
Unable to find a medium containing a live file system

[EDIT]: ISSUE 1 SOLVED...

2. If I created a new filesystem, manifest, manifest-desktop and md5sum.text files... then replaced the files in ubuntu live cd with the new files... well that be enough? If no, why?!

Thanks alot

karika200
July 24th, 2008, 09:43 AM
In debian lenny repositories I can't found the unionfs modul for the precompiled(2.6.25) kernel, but there is a package aufs. I installed aufs, but at boot, it requires unionfs. What should I do?:\

karika200
July 24th, 2008, 12:45 PM
In debian lenny repositories I can't found the unionfs modul for the precompiled(2.6.25) kernel, but there is a package aufs. I installed aufs, but at boot, it requires unionfs. What should I do?:\

union=aufs boot parameter rlz.. ^^ But now, I have kernel panic with the message "specify the file system"...

LuisPT
August 5th, 2008, 01:09 PM
I'm making a livecd using a debootstrap (hardy 8.04.1) installation.

In STEP D1 (since I'm building from debootstrap) I've replaced the three commands of the original guide with the ones from appendix.2.

OK, everyting cool.

BUT, since I also installed ubiquity in deboostrap, I think I need to run the commands in Step D2 in order to Generate the manifest:

So I do:
sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifest

and:
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}


BUT when I do the following command:
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}

IT RETURNS AN ERROR.

Any Idea????

LuisPT
August 5th, 2008, 05:47 PM
I'm making a livecd using a debootstrap (hardy 8.04.1) installation.

In STEP D1 (since I'm building from debootstrap) I've replaced the three commands of the original guide with the ones from appendix.2.

OK, everyting cool.

BUT, since I also installed ubiquity in deboostrap, I think I need to run the commands in Step D2 in order to Generate the manifest:

So I do:
sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}/filesystem.manifest

and:
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}


BUT when I do the following command:
sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}

IT RETURNS AN ERROR.

Any Idea????

Sorry to bump again, but I forgot to give details about the error that happens to me when I do command sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop} in step D2.

cp: destination file argument is missing after`/home/cd/casper/filesystem.manifest{,-desktop}'
Try 'cp --help' for more informations
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
sed: não é possivel ler /home/cd/casper/filesystem.manifest-desktop: Ficheiro ou directoria inexistente
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
sed: it's not possible to read /home/cd/casper/filesystem.manifest-desktop: File or directory doesn't exist
umount: /home/work/rootfs/dev: device is busy
umount: /home/work/rootfs/dev: device is busy
Parallel mksquashfs: Using 2 processors
Creating little endian 3.1 filesystem on /home/cd/casper/filesystem.squashfs, block size 131072.
[================================================== ================================================== ============== ] 25072/27696 90%


(I've translate the error to english, so sorry for some mistake).

Any Idea of what's happening???? :confused:

capink
August 5th, 2008, 07:59 PM
Sorry to bump again, but I forgot to give details about the error that happens to me when I do command sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop} in step D2.



(I've translate the error to english, so sorry for some mistake).

Any Idea of what's happening???? :confused:

The first problem is probably due to your shell being set as /bin/sh instead of /bin/bash. Since /bin/sh does not understand brace extension it does not interpret the command properly. To solve this problem try replacing the command with this:

sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest ${CD}/${FS_DIR}/filesystem.manifest-desktop


As for the second problem, I think it can be solved by replacing the following command in step D.3:

sudo umount ${WORK}/rootfs/dev

with this commmand:

sudo mount --move ${WORK}/rootfs/dev /dev

chris4585
August 7th, 2008, 06:09 AM
hello capink, I finally got back to what I was working on say... 5? months ago. Well after scratching my head, reading your guide, a few times, I finally made my livecd based off ubuntu 8.04.1 (its not done yet) but I have a working copy. You're guide is awesome! It was easier then I thought after words, I still have a few things to fix though, just small things I can figure out with time.

EDIT: I have a few questions though, while installing from the livecd ubiquity gave me a error, (I didn't record the msg) but it installed just fine, have you encountered that problem? I'll reinstall it in virtualbox again to report it.

the files that are placed in /etc/skel/ are they copied to every new user that is created?

capink
August 8th, 2008, 03:54 PM
EDIT: I have a few questions though, while installing from the livecd ubiquity gave me a error, (I didn't record the msg) but it installed just fine, have you encountered that problem? I'll reinstall it in virtualbox again to report it.

the files that are placed in /etc/skel/ are they copied to every new user that is created?

I think the error you are talking about is related to ubiquity looking for language packages to install from a local repository on the cd. Since we have not created this repository on the cd it gives the error. Maybe this can be solved by preseeding ubiquity. I might try it in the future as I am busy at the moment. The important thing is that it does not affect the installation process.

As for your second question, yes. The files are copied from /etc/skel to newly created user home directory.

Hope it will go smooth for you and you will enjoy your cutom made distro.

capink
August 8th, 2008, 03:54 PM
EDIT: I have a few questions though, while installing from the livecd ubiquity gave me a error, (I didn't record the msg) but it installed just fine, have you encountered that problem? I'll reinstall it in virtualbox again to report it.

the files that are placed in /etc/skel/ are they copied to every new user that is created?

I think the error you are talking about is related to ubiquity looking for language packages to install from a local repository on the cd. Since we have not created this repository on the cd it gives the error. Maybe this can be solved by preseeding ubiquity. I might try it in the future as I am busy at the moment. The important thing is that it does not affect the installation process.

As for your second question, yes. The files are copied from /etc/skel to newly created user home directory.

I Hope it will go smooth for you and you will enjoy your cutom made distro.

chris4585
August 8th, 2008, 08:50 PM
I think the error you are talking about is related to ubiquity looking for language packages to install from a local repository on the cd. Since we have not created this repository on the cd it gives the error. Maybe this can be solved by preseeding ubiquity. I might try it in the future as I am busy at the moment. The important thing is that it does not affect the installation process.

As for your second question, yes. The files are copied from /etc/skel to newly created user home directory.

I Hope it will go smooth for you and you will enjoy your cutom made distro.

Thank you for replying and answering my questions. Ok the system seems to install just fine, besides that error, and when i'm using the system from hard disk nothing appears to be wrong.

Thanks again for the amazing guide and help

http://i35.tinypic.com/2v3g3fo.jpg

umairmehmood
August 14th, 2008, 05:58 PM
I am facing a weird problem.
I tried this guide for the first time and everything worked fine.
It generated a live ISO, which was working perfectly.

Now, using the same environment, with a couple of amendmends, i ran the procedure again for the Live ISO, but now my installation gets held up on the step:

"4. Convert the directory tree into a squashfs:"

The installer runs smoothly but gets held up at 96%.
No matter how long i wait, it does not resume.
I have to Ctrl+C to resume operations.

What do you think can the problem be ?


root@opennms-liveCD:~# sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}
Parallel mksquashfs: Using 1 processor
Creating little endian 3.1 filesystem on /home/opennms/Desktop/sample/cd/casper/filesystem.squashfs, block size 131072.
[================================================== ========================================= ] 108436/112061 96%

capink
August 14th, 2008, 07:40 PM
I don't know what is the cause of your problem. Maybe it is because the command is trying to append to the old squashfs instead of creating a new one. If this is the reason, then it can be solved by either deleting the old squashfs or replacing the command with the following:

sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend

chris4585
August 15th, 2008, 12:17 AM
I agree with capink, I always delete my old squashfs before making a new one, just seems logical to me

umairmehmood
August 15th, 2008, 05:31 PM
I did delete the contents of WORK and CD before running the scripts for new Image.

I now tried the command as advised:

sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend

but still the same problem.
The squashfs stucks at 96%.

umairmehmood
August 16th, 2008, 03:35 PM
I tried everything from scratch now.
Installed a fresh copy of Ubuntu 8.0.4 desktop.

Installed all necessary modules and then ran the scripts as mentioned in the guide.

The installer halts at the end.

root@open-liveCD:~# sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT} -noappend
Parallel mksquashfs: Using 1 processor
Creating little endian 3.1 filesystem on /home/open/cd/casper/filesystem.squashfs, block size 131072.
[================================================== ============================== ] 99466/103602 96%



With WORK:/tmp/work
CD: /home/open/cd
I am running ubuntu as a virtual Image using VMWARE.

I don't understand.
The same settings were working fine before.

Some help would sure be appreciated!

chris4585
August 16th, 2008, 05:01 PM
why not if you dont find the solution, make a partition, about 4GB at most, and install ubuntu on there and start over? thats the only solution i can think of

EDIT: if you do that try copying your /work/rootfs/ to the new installation and try making a new squashfs and if the same thing happens then its either something to do with your rootfs or something i have no clue about..

sorry just trying to help

user11
August 16th, 2008, 08:40 PM
Or you could just use remastersys. I googled it, downloaded it, and now I can make custom live boot CDs with it. The only catch is that it doesn't save some important setting like auto login / automatic login, which I fixed by just editing /etc/gdm/gdm.conf before backing up (I also edited the UTC option in /etc/default/rcS).

Now if I can just keep remastersys from deleting the /etc/timezone file I'm set. By the why, would anyone know how to fix that? :?

umairmehmood
August 17th, 2008, 10:06 AM
chris4585:
I appreciate your help :)
I tired again but the same problem.
Really strange.

User11:

I tried Remastersys.
Remaster is in fact the same script automated!
I created the Live Image without any problem :D

I installed a few services like Tomact etc.
Now when i start Ubuntu form live image, it loads up tomcat too.
But i can't access it through the web interface.

I mean, http://localhost:8081 does not respond. !!

Could you think of any known problem ?

Skip Da Shu
August 17th, 2008, 04:30 PM
Can you confirm that it actually worked for you.

I'm really after a duplicate install from one of my dedicated 'number crunchers'... down to the same single user and password would be fine. The only thing I really want different from machine to machine is the static IP address and hostname.

I've read thru this entire thread and it certainly seems as close as I've found so far and seems so well written that even "I" might be able to do it.

I have not looked into Remastersys yet, should I?

Sure wish I'd found this 5 machines ago.

Noob questions:

1) Is there any reason that you can think of that this would not work for on a Xubuntu 64b v8.04 (Hardy) system?

2) Since the Xubuntu machines don't have a CD burner on them can I create the .iso and save it on some samba shared storage and do the actual burn over on my WinXP box, then test it in a CD-ROM on the Xubuntu machine?

3) Lastly, and of less importance... Are there any simple changes to make my repeatable install even more complete?
a) user=me & pw=mine
b) gkrellm theme (by copying in home?)
c) desktop launchers (by copying in home?}
d) sources.list (assume will have to overlay after the install)
e) apt proxy settings (only need to have the file /etc/apt/apt.conf.d/01proxy included)
f) X11vnc setup (gdm.conf-custom, /etc/gdm/Init/Default, remote PW is someplace in Home also)
g) xorg.conf (they all use same display when it's attached and all use vesa driver, assume I'll have to copy over after install)

Thanx in advance, Skip

Skip Da Shu
August 17th, 2008, 05:06 PM
10 - there are certain apps and libraries that ubuntu doesn't have on their livecd's and for whatever reason they cause the livecd to fail if they are installed - no workaround

delete me

umairmehmood
August 17th, 2008, 05:41 PM
Is there any restriction to the live Cd as what apps can be run and others which cant.

For example, Is it only supposed to run system related apps and ignore user specified ones ?

I am observing this strange behavior with Tomcat.
Its included in the live distro. It is running perfectly, but i can't access my webapps.

capink
August 17th, 2008, 06:33 PM
I have not looked into Remastersys yet, should I?


Remastersys can do what this guide is doing in an automated way (i.e make a distribution from your hard disk installation). So it can save you the hussle if you are not comfortable with the command line. Also the remastersys author is very friendly and is open for questions. You can find a link to remastersys site at the end of the opening post of this thread.

The only thing that can be done using this method and not with remastersys, is creating a clean distro using the debootstrap method outlined in the guide.



1) Is there any reason that you can think of that this would not work for on a Xubuntu 64b v8.04 (Hardy) system?

I have not tested it, but it should work. The only caveat here is that you will have to perform the instructions from a system with 64 bit kernel, otherwise you will not be able to chroot.


2) Since the Xubuntu machines don't have a CD burner on them can I create the .iso and save it on some samba shared storage and do the actual burn over on my WinXP box, then test it in a CD-ROM on the Xubuntu machine?

Yes you can. But I do not have any experince in samba.
You can also test the iso in a virtual machine like virtualbox or vmware before burning it.


a) user=me & pw=mine

I am not sure what you mean?


b) gkrellm theme (by copying in home?)

Yes. But instead of copying to home you will copy to /etc/skel. Refer to the the end of step B to see how to do it


c) desktop launchers (by copying in home?}

Same as abobe. It is possible by creating a directory:

sudo mkdir ${WORK}/rootfs/etc/skel/Desktop


and copying the launchers to this directory.




d) sources.list (assume will have to overlay after the install)


Yes. You simply copy the sources.list file to:

${WORK}/rootfs/etc/apt


e) apt proxy settings (only need to have the file /etc/apt/apt.conf.d/01proxy included)

Same as above.


f) X11vnc setup (gdm.conf-custom, /etc/gdm/Init/Default, remote PW is someplace in Home also)

I do not advise missing with gdm config files because it can prevent the cd from logging in.


g) xorg.conf (they all use same display when it's attached and all use vesa driver, assume I'll have to copy over after install)

Yes.

nimam
August 19th, 2008, 02:38 PM
* How can the name of live-session-user be changed from 'ubuntu' to our own?
* How can we use Ubuntu's own splashimage in grub for booting from cd?

capink
August 21st, 2008, 07:09 AM
* How can the name of live-session-user be changed from 'ubuntu' to our own?

There are two ways to do this:
1. You can add the following parameter to your grub boot entry:

username=whatever_username_you_want

2. You can edit the file ${WORK}/rootfs/etc/casper.conf change the following entry:

export HOST="ubuntu"

into:

export HOST="whatever_username_you_want"



Note: If you do both methods, the first method will override the second one. That is, the username in your boot entry will override the username in /etc/casper.conf


* How can we use Ubuntu's own splashimage in grub for booting from cd?

To be able to use Ubuntu's splash Image you need to have the same exact kernel version in your system. IThis is not usually the case because the kernel in the splash image is usually older than your system kernel (if you are updating your system you will most likely have a newer version).

Supposing that you have the same kernel version as that of Ubuntu splash image, you have to do the following two steps:

1. Create the following directory:

sudo mkdir /casper

and place the splash image into it

2. Add the following entry to your grub menu:


title RAM Session
root (hd0,2)
kernel /boot/vmlinuz-$(uname -r) BOOT=casper ro quiet splash
initrd /boot/initrd.img-$(uname -r)


The text highlighted in blue should match the corresponding parts of your main system entry.



One the other hand, if your kernel is newer. You will have to extract the following two files from the splash image:

/boot/vmlinuz-....
/boot/initrd.img-.....

and place those two files in your /boot directory


Then you will add this entry to your grub file:


title RAM Session
root (hd0,2)
kernel /boot/vmlinuz-$(uname -r) BOOT=casper ro quiet splash
initrd /boot/initrd.img-$(uname -r)


The text highlighted in blue should match the corresponding parts of your main system entry.

The text highlighted in red should match version of the two files you extracted from the splash image.

DemonBob
August 22nd, 2008, 10:01 AM
For Intrepid

In step A.3

sudo apt-get install mkisofs grub squashfs-tools linux-ubuntu-modules-$(uname -r) qemu

should be

sudo apt-get install mkisofs grub squashfs-tools linux-headers-$(uname -r) qemu

linux-ubuntu-modules was merged with linux-headers i believe.

Posting from a custom Intrepid Live cd as we speak :D


Questions:
1. Does the toram work in this guide?
2. You got any easy to follow guides on making a custom boot splash/grub splash?

capink
August 22nd, 2008, 12:17 PM
For Intrepid

In step A.3

sudo apt-get install mkisofs grub squashfs-tools linux-ubuntu-modules-$(uname -r) qemu

should be

sudo apt-get install mkisofs grub squashfs-tools linux-headers-$(uname -r) qemu

linux-ubuntu-modules was merged with linux-headers i believe.

Thanks for posting this information. I will add it to the guide



1. Does the toram work in this guide?


It is working for me in Debian lenny with live-initramfs. If I remember correctly, it did work with casper and gutsy (not so sure) when I first wrote this guide. I do not have hardy or intrepid so I am not sure.


2. You got any easy to follow guides on making a custom boot splash/grub splash?

There is a link in the final notes section. The link is not working currently but it is still stored in google cache (http://216.239.59.104/search?hl=en&q=cache%3Aruslug.rutgers.edu%2F~mcgrof%2Fgrub-images&btnG=Google+Search&meta=).

armageddon08
August 26th, 2008, 03:04 PM
ok.......I used remastersys to transfer my hdd install to dvd. Now, I can boot off the dvd and install the system very well. After installation when I can't boot into Ubuntu. It says..

Grub Loading
Stage1.5
Error15

What does this mean?

In my original system I had a custom grub splash image installed. Is that causing any problem?

DemonBob
August 27th, 2008, 12:10 AM
For those of you making your own distro.

You can edit /etc/lsb_release to edit distro information, version number and stuff.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu intrepid (development branch)"

chris4585
August 27th, 2008, 06:32 PM
hey I've been continuously building onto my rootfs and recreating iso's etc..
but There's been a update with these packages:

linux-headers-2.6.24-19 linux-headers-2.6.24-19-generic
linux-image-2.6.24-19-generic linux-libc-dev

I'm not sure what I'd have to do to update my CD dir.. I don't want to screw up my cd dir

Also I've tried to change my user@host but editing the /etc/casper.conf didnt work

here's the contents of the file:

# This file should go in /etc/casper.conf
# Supported variables are:
# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM

export USERNAME="open"
export USERFULLNAME="Live session user"
export HOST="box"
export BUILD_SYSTEM="Ubuntu"

EDIT: wouldnt I just delete my CD dir and recreate it completely? If so I think that'd be easier

capink
August 28th, 2008, 12:02 AM
I'm not sure what I'd have to do to update my CD dir.. I don't want to screw up my cd dir


You just chroot into your CD dir and apply the updates. Before doing so you will have to set the enviroment:

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper


sudo mount -o bind /dev/ ${WORK}/rootfs/dev


sudo mount -t proc proc ${WORK}/rootfs/proc



sudo chroot ${WORK}/rootfs /bin/bash


Commands in Blue are done within a chroot.


LANG=


apt-get update


apt-get upgrade

exit

sudo umount ${WORK}/rootfs/proc

sudo umount ${WORK}/rootfs/sys

sudo umount ${WORK}/rootfs/dev




Also I've tried to change my user@host but editing the /etc/casper.conf didnt work

here's the contents of the file:

I have never tried doing it but according to the man pages this should do it. make sure that you are changing the casper.conf file in the CD tree, not the one in your root partition.

Also there is another way to change the username in my previous post. You can check it.



EDIT: wouldnt I just delete my CD dir and recreate it completely? If so I think that'd be easier


Yes that would do it. But you don't have to because you can upgrade your cd tree as illustrated above.

chris4585
August 28th, 2008, 06:36 AM
You just chroot into your CD dir and apply the updates. Before doing so you will have to set the enviroment:

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper


sudo mount -o bind /dev/ ${WORK}/rootfs/dev


sudo mount -t proc proc ${WORK}/rootfs/proc



sudo chroot ${WORK}/rootfs /bin/bash


Commands in Blue are done within a chroot.


LANG=


apt-get update


apt-get upgrade

exit

sudo umount ${WORK}/rootfs/proc

sudo umount ${WORK}/rootfs/sys

sudo umount ${WORK}/rootfs/dev





I have never tried doing it but according to the man pages this should do it. make sure that you are changing the casper.conf file in the CD tree, not the one in your root partition.

Also there is another way to change the username in my previous post. You can check it.





Yes that would do it. But you don't have to because you can upgrade your cd tree as illustrated above.

I think we got terms mixed up

Ok, what I meant by CD dir is /home/chris/CD/ not /home/chris/work/rootfs/

What I meant was do I need to change which kernel to boot from the /home/chris/CD/ as we create in the step D. Prepare The CD directory tree and E. Build the CD/DVD or does it even matter at all, because I had to install the same kernel on my host system and my grub did not change so is it just a update on the same kernel?

sorry for all the confusion

and if that isnt true then..

my simplist guess is just move my /home/chris/CD/ to somewhere else (just in case I need it) and recreate my CD tree, not my rootfs

I've tried editing /home/chris/work/rootfs/etc/casper.conf and made a ISO after words but the host and user did not update on the iso

I have never tried doing it but according to the man pages this should do it. make sure that you are changing the casper.conf file in the CD tree, not the one in your root partition.

So.. you mean /home/chris/work/rootfs/ ?

because in the CD tree /home/chris/CD/

here is what I have:

.
|-- boot
| |-- grub
| | |-- menu.lst
| | `-- stage2_eltorito
| |-- initrd.gz
| |-- memtest86+.bin
| `-- vmlinuz
|-- casper
| |-- filesystem.manifest
| |-- filesystem.manifest-desktop
| `-- filesystem.squashfs
`-- md5sum.txt

and I dont see casper.conf

Thanks for the help

capink
August 28th, 2008, 10:47 AM
I think we got terms mixed up

Ok, what I meant by CD dir is /home/chris/CD/ not /home/chris/work/rootfs/

What I meant was do I need to change which kernel to boot from the /home/chris/CD/ as we create in the step D. Prepare The CD directory tree and E. Build the CD/DVD or does it even matter at all, because I had to install the same kernel on my host system and my grub did not change so is it just a update on the same kernel?


Actually you are right. If the updates have a new kernerl version you will have to repeat step D after the doing all the steps in my previous post. That is because the kernel in /home/chris/CD/boot must be the same version as the one in the squashfs. You will not have to edit grub menu.list because it does not refernce the kernel version (in step D the kernel is renamed to vmlinuz). And finally, you will also have to repeat step E.


sorry for all the confusion

and if that isnt true then..

my simplist guess is just move my /home/chris/CD/ to somewhere else (just in case I need it) and recreate my CD tree, not my rootfs

You will have to recreate both because as I pointed out earlier, the kernel on /home/chris/CD/boot must match the kernel in the squashfs.


I've tried editing /home/chris/work/rootfs/etc/casper.conf and made a ISO after words but the host and user did not update on the iso



So.. you mean /home/chris/work/rootfs/ ?


Yes I mean /home/chris/work/rootfs/. Sorry for the confusion, it was my mistake.

chris4585
August 28th, 2008, 04:19 PM
You will have to recreate both because as I pointed out earlier, the kernel on /home/chris/CD/boot must match the kernel in the squashfs.


I'd like to clarify again, that as long as the squashfs matches the CD tree I shouldn't have to recreate my rootfs. What I've been doing is when I want to make a new ISO just delete my old squashfs file in the CD tree and recreate the squashfs

Its worked quite well, its ok everyone makes mistakes

Thanks for your help! :D

maybeway36
September 1st, 2008, 01:44 PM
Sometimes when I build the CD and run it in QEMU or VirtualBox, I end up at the initramfs/busybox prompt.
The /casper.log (in QEMU) reads:
Begin: Running /scripts/casper-premount ...
Done.
Done.
mount: Mounting /dev/loop0 on //filesystem.squashfs failed: Invalid argument
Can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs

niccholaspage
October 25th, 2008, 10:32 PM
I am having trouble following this guide in Intrepid Ibex...

capink
October 26th, 2008, 03:24 AM
I am having trouble following this guide in Intrepid Ibex...

I have not tested it on Intrepid. I don't plan to test it on Intrepid untill it is officially released. But you can refer to post number 143 on this thread on the modifications required to get this working under Intrepid.

niccholaspage
October 26th, 2008, 09:50 AM
Thank you.

chris4585
November 8th, 2008, 09:17 PM
ok I figured it out on my own to discover that.. (funny enough) the package discover1 isn't in intrepid..

so does this mean I use the package discover instead?

capink
November 9th, 2008, 02:13 PM
Yes it should work fine with discover. Also note that you do not need to install the package linux-ubuntu-modules-$(uname -r) anymore as it is now part of the main kernel package in intrepid.

chris4585
November 9th, 2008, 02:24 PM
Yes it should work fine with discover. Also note that you do not need to install the package linux-ubuntu-modules-$(uname -r) anymore as it is now part of the main kernel package in intrepid.

Thanks for the reply, I wasn't sure about discover, I already did know about the linux-ubuntu-modules-$(uname -r) though.

So linux-ubuntu-modules-$(uname -r) is only needed for the host system (gutsy or hardy), for creating any kind of LiveCD?

and

So linux-headers-(uname -r) is only needed for the host system (intrepid) for creating any kind of LiveCD?

The reason why I was asking is because I'm making some scripts that I've made to make life easier and needed to know.

If you're interested... they're a little crude but they do get the job done!

http://boxbuntu.com/downloads/Scripts/plusone-livecd-scripts/

penC
November 10th, 2008, 02:32 AM
Excellent guide! Thank you for this!

pen

capink
November 10th, 2008, 04:26 PM
So linux-ubuntu-modules-$(uname -r) is only needed for the host system (gutsy or hardy), for creating any kind of LiveCD?

They are required for both the host and the target (only in gutsy and hardy). They are required in the host to be able to create a squahsfs image. And they are required in the target to be able to mount the squashfs and the unionfs.

So linux-headers-(uname -r) is only needed for the host system (intrepid) for creating any kind of LiveCD?


linux-headers-(uname -r) is not really required. You can put it if you want it as part of your system though.


If you're interested... they're a little crude but they do get the job done!

http://boxbuntu.com/downloads/Scripts/plusone-livecd-scripts/

Intersting idea. I thought about making a script for the whole procedure, but I decided against it because I thought chrooting and installing packages would be better done interactively to react to any problems that might arise. Also there is a script that does a similar thing to this guide called remastersys. You can check the link for the script in the first post in this thread.

niccholaspage
November 10th, 2008, 05:36 PM
I got an errors at the end of following your guide.

chris4585
November 10th, 2008, 05:49 PM
They are required for both the host and the target (only in gutsy and hardy). They are required in the host to be able to create a squahsfs image. And they are required in the target to be able to mount the squashfs and the unionfs.




linux-headers-(uname -r) is not really required. You can put it if you want it as part of your system though.



Intersting idea. I thought about making a script for the whole procedure, but I decided against it because I thought chrooting and installing packages would be better done interactively to react to any problems that might arise. Also there is a script that does a similar thing to this guide called remastersys. You can check the link for the script in the first post in this thread.

Thanks for the clarification

With the scripts I tried to emphasize how easy it is to edit the system once after the first iso is made.

capink
November 11th, 2008, 11:44 AM
I got an errors at the end of following your guide.

Can you post the error messages and clarify which steps triggerd them.

niccholaspage
November 12th, 2008, 09:20 AM
I will after school.

Spitphire
November 15th, 2008, 06:58 AM
Minor problem.. I must admit i'm in a bit unfamiliar territory with chroot & debootstrap.

Anyway - I created a working live CD using the debootstrap method. I added another user, while still in chroot. When I boot the cd i would like it to ask me for a login prompt and not log in directly as 'ubuntu'

Anyone know how to fix this? This is a text-only boot, there is no GUI..

The reason I would like to do this is because I would like certain files to be available upon login.. for example my ssh keys which i put in the home directory of the new user i created.

What I'm trying to accomplish is a bootable disc that that I can insert into my media center pc and execute dd over a ssh connection to the server, to clone the drive for backup purposes. But I only allow ssh sessions with key.. So i need the keys available on the live cd..

Long story short - i just need to know how to make it go to a login prompt on boot up and not auto login as 'ubuntu'.

Thanks,
-spit

chris4585
November 15th, 2008, 12:27 PM
Minor problem.. I must admit i'm in a bit unfamiliar territory with chroot & debootstrap.

Anyway - I created a working live CD using the debootstrap method. I added another user, while still in chroot. When I boot the cd i would like it to ask me for a login prompt and not log in directly as 'ubuntu'

Anyone know how to fix this? This is a text-only boot, there is no GUI..

The reason I would like to do this is because I would like certain files to be available upon login.. for example my ssh keys which i put in the home directory of the new user i created.

What I'm trying to accomplish is a bootable disc that that I can insert into my media center pc and execute dd over a ssh connection to the server, to clone the drive for backup purposes. But I only allow ssh sessions with key.. So i need the keys available on the live cd..

Long story short - i just need to know how to make it go to a login prompt on boot up and not auto login as 'ubuntu'.

Thanks,
-spit

It would be easier to do the following (in my opinion)

first you'd have to change the user name to your user name on the livecd

set the variables you set before

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper

sudo mount -t proc proc ${WORK}/rootfs/proc
sudo mount -t sysfs sysfs ${WORK}/rootfs/sys
sudo mount --bind /dev ${WORK}/rootfs/dev
sudo chroot ${WORK}/rootfs /bin/bash

nano /etc/casper.conf

change the USERNAME= to fit the username you want to ssh with in nano

then within chroot run these commands

export kversion=`cd /boot && ls vmlinuz-* | sed 's@vmlinuz-@@'`
depmod -a ${kversion}
update-initramfs -u -k ${kversion}

then exit out of chroot

set your variables you set before

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper

sudo rm ${CD}/boot/initrd.gz
find ${WORK}/rootfs/boot -iname 'initrd.img*' -exec sudo cp -vp {} ${CD}/boot/initrd.gz \;

this should work


then copy your ssh key into ${WORK}/rootfs/etc/skel

then remove the old user you created

I think using userdel

then of course make a new iso

what you should get with this, is a autologin with your username, from what I read this should be what you want

capink
November 15th, 2008, 01:17 PM
Long story short - i just need to know how to make it go to a login prompt on boot up and not auto login as 'ubuntu'.

Thanks,
-spit

For this to be done you will have to use live-initramfs instead of casper. After this it is just a matter of adding to following option to your grub boot entry.

noautologin


Note: Another solution is to stick to casper and use ALT + F(2) to switch to another getty and log in as whatever user you wish.

Beware though that if you opt to use live-initramfs, you will not be able to install ubiquity (The Ubuntu installer) as it depends on casper. Also, you need to do some modifications to the guide. They are as follows:

1. In step A.1 replace:

export FS_DIR=casper

with:

export FS_DIR=live


2. Replace the command in Step C.2 with:

apt-get install live-initramfs unionfs-modules-$(uname -r) discover1 xresprobe

Note that in order to install live-initramfs you have to enable the universe repository in your chroot ennviroment. Here are guides to enable universe ,CLI (https://help.ubuntu.com/community/Repositories/CommandLine#head-e1a24b1b2037f68b5a95f54388582b58ea4c9bd0)).

3. Skip step C.3 and D.2 as you will not be using ubiquity.

4. In Step D.5 Replace every occurence of BOOT=casper and boot=casper in menu.lst with BOOT=live and boot=live respectively.

5. To disable automatic login in a text only system, add the following line to your main boot entry in menu.lst (In step D.5):

noautologin

Spitphire
November 16th, 2008, 09:00 AM
This file should go in /etc/casper.conf
# Supported variables are:
# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM

export USERNAME="am"
export USERFULLNAME="am"
export HOST="lp"
export BUILD_SYSTEM="Ubuntu"


I decided to put the files I need in /etc/skel . Great idea btw, don't know why I didn't think about doing that. Thank you!

I changed /etc/casper.conf (as seen above)

When I boot the live CD though it still logs me in as ubuntu@ubuntu.

Am I missing something?

capink
November 16th, 2008, 12:31 PM
This file should go in /etc/casper.conf
# Supported variables are:
# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM

export USERNAME="am"
export USERFULLNAME="am"
export HOST="lp"
export BUILD_SYSTEM="Ubuntu"


I decided to put the files I need in /etc/skel . Great idea btw, don't know why I didn't think about doing that. Thank you!

I changed /etc/casper.conf (as seen above)

When I boot the live CD though it still logs me in as ubuntu@ubuntu.

Am I missing something?

If I remember correctly, chris4585 had a the same problem. Changing the username in casper.conf does not have the intended effect. Maybe it is a bug in casper. Maybe if you try to create the user with an id less than 999 the settings in casper.conf will be honoured.

Spitphire
November 16th, 2008, 01:38 PM
If I remember correctly, chris4585 had a the same problem. Changing the username in casper.conf does not have the intended effect. Maybe it is a bug in casper. Maybe if you try to create the user with an id less than 999 the settings in casper.conf will be honoured.


Ok, I didn't add the user 'am', i put the files i wanted access to in /etc/skel . for casper.conf to work correctly does the user need to be added to the system? or does is it suppose to add the user specified in casper.conf to the system upon boot up?

If casper creates the user, to achieve the desired results of a id less than 999 do you think changing /etc/adduser.conf to reflect so that the first user added would have an id less than 999?

I could change the following in /etc/adduser.conf:


FIRST_SYSTEM_GID=100
LAST_SYSTEM_GID=997

FIRST_GID=998
LAST_GID=29999


I haven't tried it yet, I'm just not exactly sure how casper creates the user ubuntu..

chris4585
November 16th, 2008, 02:40 PM
This file should go in /etc/casper.conf
# Supported variables are:
# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM

export USERNAME="am"
export USERFULLNAME="am"
export HOST="lp"
export BUILD_SYSTEM="Ubuntu"


I decided to put the files I need in /etc/skel . Great idea btw, don't know why I didn't think about doing that. Thank you!

I changed /etc/casper.conf (as seen above)

When I boot the live CD though it still logs me in as ubuntu@ubuntu.

Am I missing something?

I explained how to change the user on the livecd before, its not as simple as just changing the file /etc/casper.conf and making a new iso, you have to update-initramfs then delete the old initrd in ${CD}/boot/ then copy the new initrd it from ${WORK}/rootfs/boot/ to ${CD}/boot/

I've attached a script that helps set the variables for you in a automatic way

just change/edit the two variables at the top of the file Set Names to the same variables as before then run the script and you'll be set (hopefully)

at one part of the scriipt it may seem as if its frozen its not, I need to fix this

chris4585
November 16th, 2008, 03:29 PM
Ok, I didn't add the user 'am', i put the files i wanted access to in /etc/skel . for casper.conf to work correctly does the user need to be added to the system? or does is it suppose to add the user specified in casper.conf to the system upon boot up?

If casper creates the user, to achieve the desired results of a id less than 999 do you think changing /etc/adduser.conf to reflect so that the first user added would have an id less than 999?

I could change the following in /etc/adduser.conf:


FIRST_SYSTEM_GID=100
LAST_SYSTEM_GID=997

FIRST_GID=998
LAST_GID=29999


I haven't tried it yet, I'm just not exactly sure how casper creates the user ubuntu..

casper creates the user during booting up as I understand, I'd say you'd have to update the initrd for this too (just a guess) I'd go for it and see what happens.

Update on the user@host thing, yes I did have issues with it, usually you get by default either ubuntu@ubuntu or casper@live, I know how to change ubuntu@ubuntu but not the latter...

Spitphire
November 16th, 2008, 05:30 PM
I explained how to change the user on the livecd before, its not as simple as just changing the file /etc/casper.conf and making a new iso, you have to update-initramfs then delete the old initrd in ${CD}/boot/ then copy the new initrd it from ${WORK}/rootfs/boot/ to ${CD}/boot/


That did the trick, update-initramfs appeared to be the problem. Guess I overlooked that initially. Thanks again for your help!

Everything works great now.

I put the cd in, it creates a network connection to local lan and asks me if i would like to backup or restore hard drive. Upon selection it creates ssh connection to server and starts cloning or restoring..

Very handy tutorial, helped a lot!

-spit

chris4585
November 16th, 2008, 06:09 PM
glad it worked right, just the other day I figured out how to fix the same issue

Kopachris
December 18th, 2008, 09:29 PM
Hey, is there a way to get more compression? Say, a 1:5 ratio instead of a 1:3 ratio? My uncompressed system is 3.4GB, and the compressed system is 1.2GB. I really want to get it down to less than 700MB, but removing enough software to make room would defeat the purpose of making the distro. And I really don't want to limit it DVD-only releases, either. I tried squashing the squashfs (it sounded like a good thing to do at the time, if it would read the squash within the squash), but it gave a segfault. Can I compress it any more or take out some unnecessary stuff, or am I SOL?

ckomurlu
December 23rd, 2008, 06:52 AM
Sometimes when I build the CD and run it in QEMU or VirtualBox, I end up at the initramfs/busybox prompt.
The /casper.log (in QEMU) reads:
Begin: Running /scripts/casper-premount ...
Done.
Done.
mount: Mounting /dev/loop0 on //filesystem.squashfs failed: Invalid argument
Can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs

Hi,
Thank you capnik for this great guide.
I generated the iso file, apperently with no problem. When I boot it in vbox, in the middle of the splash screen, it falls into a initrmfs shell. I checked casper.log and saw the same error message that maybeway36 reported above.
What can be the cause?

There is an issue which can be related to this problem: During the preparetion of the iso, the only unexpexted event was that, I received an error in this step:

sudo umount ${WORK}/rootfs/sys

it gives: umount: <some path>/work/rootfs/sys: not mounted

Another clue is that, the current kernel is not 2.6.24.19-generic. I use a patched version -patched with rtai-. Well, I copy-pasted the menu.lst content, as given in the guide.

Thanks in advance.

Millzy
January 12th, 2009, 06:09 AM
I'm hoping people are still using this How To and someone may have a solution for me.

I'm running Ubuntu 8.10 Server and have successfully completed almost all of the steps but i'm stuck on:


sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD

Error Msg:

I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: Uh oh, I cant find the boot image 'boot/grub/stage2_eltorito' !


I have looked in the /boot/grub directory but the only file close is just called stage2 and it isn't a boot image.

Any help would be most appreciated, would be a pity to have got this far and just scrap it all.

Kopachris
January 12th, 2009, 09:40 AM
I'm hoping people are still using this How To and someone may have a solution for me.

I'm running Ubuntu 8.10 Server and have successfully completed almost all of the steps but i'm stuck on:


sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD

Error Msg:

I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: Uh oh, I cant find the boot image 'boot/grub/stage2_eltorito' !


I have looked in the /boot/grub directory but the only file close is just called stage2 and it isn't a boot image.

Any help would be most appreciated, would be a pity to have got this far and just scrap it all.

Yep, it looks like you messed up while making the boot image. I think you're going to have to do it over again.

Millzy
January 14th, 2009, 02:16 AM
Thanks for replying, I will run through it again sometime. I found another article on "Making a Local Repository" which will suite me fine for now, i realize that i will have to install packages manually but it will do.

Might look into customizing a "Ubuntu Live CD" as well, i have seen a few walk through's but none that really stand out like this one.

prowebber
January 14th, 2009, 02:54 AM
Cool. Really have try this one out.

jedi453
January 24th, 2009, 05:14 PM
I'm hoping people are still using this How To and someone may have a solution for me.

I'm running Ubuntu 8.10 Server and have successfully completed almost all of the steps but i'm stuck on:


sudo mkisofs -b boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD

Error Msg:

I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: Uh oh, I cant find the boot image 'boot/grub/stage2_eltorito' !


I have looked in the /boot/grub directory but the only file close is just called stage2 and it isn't a boot image.

Any help would be most appreciated, would be a pity to have got this far and just scrap it all.

@Millzy:

Are you sure you ran this command from step D.5?

sudo find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} ${CD}/boot/grub \;

If you follow the steps below I think you should be all set as long as you didn't delete the $CD and $WORK directories or any of their contents. Please tell me if this works, or doesn't work. If it doesn't work I might be able to help if you reply. Good Luck

Run this to redefine your variables (if you changed ~/work and/or ~/cd to something else the first time you did this, change them back to those now):

export WORK=~/work
export CD=~/cd
export FORMAT=squashfs
export FS_DIR=casper

Then, run this to make sure all the proper tools (including grub) are installed:
sudo apt-get install mkisofs grub squashfs-tools squashfs-modules-$(uname -r)

Then make sure that ${CD}/boot/grub/menu.lst exists with:
ls ${CD}/boot/grub/menu.lst
If this returns "ls: cannot access ... " then ignore what I put below and start at step D.5. Otherwise continue with what I've wrote below.

Then, run this (I'm pretty sure you forgot this step) to copy your stage2_eltorito to ${CD}/boot/grub

sudo find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} ${CD}/boot/grub \;

Then start again at step E.1

ranch hand
February 10th, 2009, 08:13 PM
OK, So I am simple. How in flinderation do you burn this to a CD/DVD?

miguelp
February 26th, 2009, 12:46 AM
hello, this tut seems great, but i have a newbie question:

Lets say i create the live DVD correctly, if for some reason i messed up my installation of ubuntu, like delete the partiton (wasn't the first time) may i be able to reinstall the system from that costum live DVD, without loosing installed programs, kernel versions, drivers etc...?

will it work as a "system restore dvd" like does that came with windows?

I am a newbie with linux in general but i want to learn more, and hope soon completely abandon windows (as soon as adobe releases the Flash IDE to linux), i already use linux for development except for design (using Photoshop) and flash.

If i manage to create a DVD that lets me reinstall my custom linux system that would be just GREAT.

Thanks.

grndslm
February 26th, 2009, 02:53 AM
OK, So I am simple. How in flinderation do you burn this to a CD/DVD?If you run the remastersys script, you simply type one of these, depending on which mode of remastersys you chose:

sudo cdrecord /home/remastersys/remastersys/customdist.iso
-OR
sudo cdrecord /home/remastersys/remastersys/custombackup.iso

Lets say i create the live DVD correctly, if for some reason i messed up my installation of ubuntu, like delete the partiton (wasn't the first time) may i be able to reinstall the system from that costum live DVD, without loosing installed programs, kernel versions, drivers etc...?Exactly. Check out my sig for a SUPER easy guide to creating your own distro with remastersys.

will it work as a "system restore dvd" like does that came with windows?Essentially... but this is way better because you can customize EVERYTHING that goes on the CD.

I am a newbie with linux in general but i want to learn more, and hope soon completely abandon windows (as soon as adobe releases the Flash IDE to linux), i already use linux for development except for design (using Photoshop) and flash.I'm pretty sure you could add a virtual machine (like VMware Player, VMware Server, or VirtualBox) on top of your Ubuntu machine... then you can install XP in a virtual disk and whatever Flash apps you want inside that. I'm pretty sure you can add Photoshop to wine, but it might be better to install to a virtual disk instead???

If i manage to create a DVD that lets me reinstall my custom linux system that would be just GREAT.You betcha! ;) ;) ;)

miguelp
February 26th, 2009, 04:19 AM
Thanks a lot for the quick answer and for the tutorial.

liked, your sugestion about adding a virtual machine on top of ubuntu, better then install it in the hard drive and have to install grub again, i've tryed that once and did not end up so well... Maybe later i'll try again for now i'll stick with your sugestion, once again many thanks.

Marc666
March 6th, 2009, 04:32 AM
Hi everyBody, i need help.
This tuto is very cool and efficient but when i add some apps to the live Cd, at the boot time i receive a iO error "No Space left on Device".

Please help me.

Regards
Marc

kelscmi
March 12th, 2009, 03:26 AM
I have a questions regarding the live CD/DVD after it is created. I've been able to create the DVD, but one of the options during boot is install. This option also appears once fully loaded (system > administration > install). My question is what gets installed, the basic OS or everything on the live DVD? Or put another way, can the install from a created DVD be used similarly as a cloned DVD using a different program (clonezilla or partimage)?

danielrs
March 15th, 2009, 11:12 AM
I've followed this tutorial and I was able to finish it, but when I try to boot from the CD, it opens GDM and asks for the user and password, since I deleted all users, I can't login. Where have I made it wrong? Is it possible to login without re-creating the ISO?

Sorry if this have already been asked.

kelscmi
March 15th, 2009, 12:53 PM
I created a live DVD using the backup option and burned it. I then installed the OS into Virtualbox; during the install it asked for a user name, password, and computer name just as it would during an original install. I used a different name and password but when I tried to log in the system said the user name and password were incorrect. I actually had to use the user name and password that I used from the OS I had remastersys from.
I hope that answers the question you were asking, I'm pretty new at this also so don't take it as expert.
If you created the image using the distribute option then I don't know, I have not tried that yet. I can tell you the backup option includes your settings and data (evolution mail account and documents).

danielrs
March 15th, 2009, 03:40 PM
I didn't use remastersys, I made this manually...

grndslm
March 16th, 2009, 07:01 PM
I've followed this tutorial and I was able to finish it, but when I try to boot from the CD, it opens GDM and asks for the user and password, since I deleted all users, I can't login. Where have I made it wrong?You prolly changed the GDM theme and didn't edit the /etc/gdm/gdm.conf and gdm.conf-custom files accordingly. Check my sig if you did edit the theme.

dot2kode
March 17th, 2009, 07:03 PM
Nice tutorial! I like using remastersys...very very simple and works very good...

grndslm
March 20th, 2009, 05:11 AM
Nice tutorial! I like using remastersys...very very simple and works very good...
Thanks!

slickvguy
April 10th, 2009, 06:25 PM
Have used remastersys w/o any problems. Have a few different/customized livecd's too.

But I've been trying something a bit different and I can't get it to work properly. I wanted to make a custom "live" USB stick (w/o persistency).

I followed the guide on the first post of this thread as usual. Everything went smoothly ...but I can't get it to skip the login screen like the livecd's do. I always get the login screen - and I can't login because there are no users/passwords setup. The instructions in the guide causes the removal of all non-system users (< 1000) from /etc/passwd. I thought that the casper script creates a ubuntu user w/ a blank password w/ id 999? It does this when I use the ubuntu livecd.

I've been comparing the Ubuntu livecd filesystem and initrd, as well as the files that remastersys generates - but I cannot see what I'm missing.

I tried changing the /etc/gdm.conf autologin keys to "true" and "ubuntu'. That didn't work either.

Help?

slickvguy
April 11th, 2009, 04:38 PM
You prolly changed the GDM theme and didn't edit the /etc/gdm/gdm.conf and gdm.conf-custom files accordingly. Check my sig if you did edit the theme.

In my case, the gdm.conf has not been changed. I do not have a gdm.conf-custom file in my filesystem, but I do notice that in the script remastersys creates that file with a single " " (a few spaces) line.

I've been comparing the remastersys generated files (which work as expected w/ autologin) versus my own (which prompts at the login screen for a non-existent user). The gdm.conf's are identical.

What I don't understand (yet) is that when you mount the remastersys iso and look at /etc/gdm/gdm.conf, the AutomaticLoginEnable is false and AutomaticLogin is "". But AFTER you boot the livecd or iso, and check the gdm.conf, the entries have been changed to "true" and the username. So obviously a script/code in the startup process is changing those entries in that file. The timed login entries are changed as well.

Anyone? I know it's probably a very minor thing that is preventing mine from starting up properly, but I can't seem to find it! lol.

Update: OK. I grepped "gdm" in the decompressed initrd's. Found this...

# chroot needed to handle symlinks correctly
if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]; then
GDMCONF=/etc/gdm/gdm-cdd.conf
else
GDMCONF=/etc/gdm/gdm.conf
fi

# chroot needed to handle symlinks correctly
if chroot /root [ -f ${GDMCONF} ]; then
# Configure GDM autologin
chroot /root sed -i \
-e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
-e "s/^AutomaticLogin=.*\$/AutomaticLogin=$USERNAME/" \
-e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
-e "s/^TimedLogin=.*\$/TimedLogin=$USERNAME/" \
-e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
${GDMCONF}
fi



This must be where it's changing gdm.conf.

I'm sketchy on the chroot implications.
The -f part is testing to see if the file exists. Which of course it does.
Not sure why the chroot /root is there??? Is it looking in /root/etc/gdm instead of /etc/gdm???
I guess that either it isn't finding the file OR it isn't able to write the changes to it.

slickvguy
April 11th, 2009, 07:44 PM
Well, apparently I'm talking to myself here {crickets}, but I figured it out so perhaps this will help someone else avoid hours of frustration for such a minor problem.

For some reason - and I'm still not sure why - the permissions on 2 of the scripts in /casper/scripts/casper-bottom were 644 (i.e. no execute!) instead of 755. Of course, those two scripts would be: 10adduser and 15autologin! All of the scripts in my /usr/share/initramfs-tools/scripts/casper-bottom have theri permissions set properly. But for some reason - perhaps when I rsync'd everything over to the work directory? - the permissions on those 2 files changed (but not on the other scripts in that directory). Weird. I'd love to know what caused the permisions to change because I sure as heck didn't change them manually.

Anyways. Problem solved. Next... ;)

Skip Da Shu
April 11th, 2009, 10:58 PM
Well, apparently I'm talking to myself here {crickets}, but I figured it out so perhaps this will help someone else avoid hours of frustration for such a minor problem. ... edited....
Anyways. Problem solved. Next... ;)Well I appreciate you posting the fix... this is on my soon-to-do list.

slickvguy
April 12th, 2009, 08:44 PM
Found the culprit...


[ "$1" = "dist" ] && [ ! -d $WORKDIR/dummysys/home ] && mkdir $WORKDIR/dummysys/home
[ "$1" = "dist" ] && chmod 755 /usr/share/initramfs-tools/scripts/casper-bottom/*adduser /usr/share/initramfs-tools/scripts/casper-bottom/*autologin
[ "$1" = "backup" ] && [ -d $WORKDIR/dummysys/home ] && rm -rf $WORKDIR/dummysys/home
[ "$1" = "backup" ] && chmod 644 /usr/share/initramfs-tools/scripts/casper-bottom/*adduser /usr/share/initramfs-tools/scripts/casper-bottom/*autologin


The first time I used remastersys to make a "backup" livecd, it CHANGED the permissions on those 2 scripts (10adduser and 15autologin) removing execution permission. Then when I went to make a liveusb a few days ago using capink's instructions, I copied over my entire filesystem (w/ a few excludes) to a temporary work directory. Thus when I chrooted to the work directory and created the new initrd, it used the non-executable versions w/o my realizing it. The sneaky part is that I used remastersys again after that to make a DISTRO (not backup) cdlive (for comparitive purposes) - so the script changed the permissions BACK to executable! lmao. Which is why when I took a look at them, they looked fine, and I had no idea that remastersys had actually change their permissions from executable, to non-executable, and back again to executable. Got it? ;)

As much as I appreciate the remastersys script, I wish coders would not write scripts that modify an installation's files w/o at the very least informing people of the changes. It's bad practice. This isn't the only place in the script that it does this either (changing installation files). There's no reason for that script to change ANY file on your system. It uses temporary work directories and files for many changes - why not do that for ALL changes (unless it cannot be done for some reason)? In this particular case, you can copy the casper files to a separate/temporary directory and use those files to create a custom initrd with mkinitramfs.

Proteusiq
April 19th, 2009, 04:48 AM
Hej there!
I followed everything in your tutorial,I did not follow from Scratch one but the normal.
It looks like it working well but I do not know since I am stuck with a Login name and Password ....
I tried the one I use in my PC but it wont work...

Any idea what is the name and password?? Please let me know! Thank you

capink
April 20th, 2009, 07:46 AM
It should not ask you for a username or password. Are you sure you followed it to the letter, especially steps C.5, C.8 and C.10

maybeway36
April 22nd, 2009, 06:53 PM
This erro is appearing in casper.log on my new Jaunty custom CD:
Begin: Running /scripts/casper-premount ...
Done.
Done.
/init: line 1: cannot open /dev/sda: no such file
mount: Mounting /dev/loop0 on //filesystem.squashfs failed: Invalid argument
Can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs
This seems to happen when I build an Intrepid CD too? Anyone know why?

chris4585
April 23rd, 2009, 05:13 AM
This tutorial was great, but needs to be updated IMO, a script I made use to work 100% flawless using these guidelines, now it hardly functions the same as it did.

maybeway36
April 23rd, 2009, 05:07 PM
Update: I built my Jaunty CD on Intrepid, and it worked fine. Go figure. :)

uflieven
April 26th, 2009, 01:04 PM
For those who don't know the login and the password, try the following:
username: ubuntu
password: (nothing) -> just press enter

Hope this helps...

I have a problem with jaunty. When booting from my live-cd, it got stuck almost halfway through the progress-bar. When I switch to a console, it seems to got stuck at configuring network interfaces.

After pressing Ctrl+Alt+Del, it continues and after it has booted up, I can use the internet without any problem. But the fact that it hangs halfway through the progress-bar and that i have to mess around to get my custom cd booted, annoys me.

I'am using wicd as network manager instead of gnome-network-manager. Any ideas?

Update: Seems there's absolutely no problem with the instructions on this site, nor with my hardware. It has all to do with a missing package (but sadly enough i can't figure out which one...)

shafin
May 8th, 2009, 11:09 AM
Thanks a lot for the guide, worked wonderfully on my Jaunty installation

ciborro
June 22nd, 2009, 09:29 AM
Hi,

Big thanks for this great tutorial.
Almost works perfect but...;)

I have one little problem, I would like to change one file ( something like this , I don't remember clearly because I write from work /etc/event/tty1 ) whatever ;) I would like to change line with getty to run /directory/myscript.sh on first console. But something changed this file after mksquashfs command. How to change this file permanently.

Regards.
Przemek.

Pax-Man
June 23rd, 2009, 08:45 AM
Great post! It helped me with my new notebook :)

Trapper
July 11th, 2009, 03:38 PM
For me this was an excellent HowTo. I just followed the instructions and ended up with a LiveCD from my current Jaunty X86_64 install. Did another install from the livecd and it works just fine. Thanks for your work.

Trapper
July 12th, 2009, 08:08 AM
What files would I have to edit to change the default desktop a bit? For example, on my jaunty livecd install I want a launcher for nautilus directly on the desktop and a couple of other launchers on the upper panel available to a new user at first login.

There are also a couple of options in nautilus that I would like to have enabled in the default nautilus configuration.

chris4585
July 13th, 2009, 04:18 PM
In the /etc/skell folder, everything you want the live user to be in the home folder put in /etc/skell. For example if you want a launcher on your desktop put it /etc/skell/Desktop/ (of course after creating the Desktop folder).

Hope that helps

Trapper
July 13th, 2009, 04:23 PM
Well, I will answer my own question for me. This is how I created a new default desktop, panels, etc. in gnome for new users:

I created an ordinary test user and set up the desktop background, panels, theme, nautilus, volume, etc. to my liking. Then I did this while logged in as the test user: (the long way for clarity)

WARNING!!! This is what I did and had success. It doesn't mean that you will. Do it at your own risk.

In a terminal:
gconftool-2 --dump /apps/panel > /home/trapper/temp/new-panel-settings.xml
gconftool-2 --dump /apps/nautilus > /home/trapper/temp/new-nautilus-settings.xml
gconftool-2 --dump /apps/gnome > /home/trapper/temp/new-gnome-settings.xml
gconftool-2 --dump /apps/gnome-screensaver > /home/trapper/temp/new-gnome-screensaver-settings.xml
gconftool-2 --dump /apps/gnome-volume-control > /home/trapper/temp/new-gnome-volume-control-settings.xml
gconftool-2 --dump /desktop > /home/trapper/temp/new-desktop-settings.xml

sudo chown root:root /home/trapper/temp/new-panel.xml
sudo chown root:root /home/trapper/temp/new-nautilus-settings.xml
sudo chown root:root /home/trapper/temp/new-gnome-settings.xml
sudo chown root:root /home/trapper/temp/new-gnome-screensaver-settings.xml
sudo chown root:root /home/trapper/temp/new-gnome-volume-control-settings.xml
sudo chown root:root /home/trapper/temp/new-desktop-settings.xml


sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-panel.xml
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-nautilus-settings.xml
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-gnome-settings.xml
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-gnome-screensaver-settings.xml
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-gnome-volume-control-settings.xml
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --load /home/trapper/temp/new-desktop-settings.xml

After I did all this I proceeded with the "How to make a live CD/DVD from your harddisk installation" howto. When I do an install from my new custom LiveCD and login for the first time all the preferences I had as the test user and saved via the gconftool-2 are now the default settings.

Trapper
July 13th, 2009, 04:27 PM
In the /etc/skell folder, everything you want the live user to be in the home folder put in /etc/skell. For example if you want a launcher on your desktop put it /etc/skell/Desktop/ (of course after creating the Desktop folder).

Hope that helps

Thanks. It seems we were both posting solutions about the same time. :-)

chris4585
July 13th, 2009, 05:16 PM
copying all of your config files is what i do, but if you want to actually install from the livecd and have every user have all the same config files you should put those files in /etc/skell. Everytime a new user is created, /etc/skell is copied to the new user's home folder.

Trapper
July 14th, 2009, 07:07 AM
copying all of your config files is what i do, but if you want to actually install from the livecd and have every user have all the same config files you should put those files in /etc/skell. Everytime a new user is created, /etc/skell is copied to the new user's home folder.

Okay. I will give this method a try seeing that it seems a much easier process and has been mentioned a couple of times here. When you say to put all the config files into /etc/skel exactly what config files are you referring to? What I am wanting each new user to have is specifically customized panels, desktop background, application menu, and theme.

chris4585
July 14th, 2009, 05:50 PM
everything you had in your livecd user's directory counting the hidden files.

Trapper
July 14th, 2009, 07:20 PM
everything you had in your livecd user's directory counting the hidden files.

Okay. I will try this and see how it compares to the way I did it. Thanks chris4585.

chris4585
July 14th, 2009, 11:07 PM
No problem dude.

Trapper
July 17th, 2009, 09:36 PM
I just tried to use my install disk on another machine ( it has the same processor and similar vid card), and it hung at 94% while configuring hardware.
I'm wondering if my install disk is missing some hardware components because I started out with the Alt-install in the first place.
Any ideas?

Well, I am experiencing the same problem when I install my custom u904-64 livecd. It gets to 94% (hardware) and hangs for almost 10 minutes and then completes the install. I didn't see any problems for a while. Then I tried to print something. No cups. It was there, it's shows it's running, but nothing can connect. I totally removed everything related to cup and all my hp drivers, etc. and reinstalled. Still no cups access. The printer does get recognized by the hp install utility but it refuses to install it because of the cups problem.

Uniquely, this is on the same box I created my livecd on and the printer works well there. Also when I boot up in the livecd the printer is also there. It just is not there and I can't get it there when I do an install to the hard drive. I worked for hours trying to get things straightened out but to no avail.

Utimately I resorted to recreating my custom livecd again, burned it to disk and tried again. Same results. I tried the complete process six more times. Same result except that one time it installed without hanging at 94% and I had printer support. Did another install on another partition using the same livecd and it hung at 94% and no printer again.

I've never had difficulty like this on this machine. I have 8.04 32 bit, 9.04 32 and 64 bit, karmic 32 and 64 bit on the box and have not experienced this problem.

Oh well, I have a very nice custom cd setup but this problem negates all my work.

I find it real odd that I have the printer as the livecd user but not when I install to the hard drive. That's definetly not a hardware problem. All my other installs on this box back that up too.

Trapper
July 18th, 2009, 08:44 AM
Well, I am experiencing the same problem when I install my custom u904-64 livecd. It gets to 94% (hardware) and hangs for almost 10 minutes and then completes the install. I didn't see any problems for a while. Then I tried to print something.

I've yet to resolve this problem using this HowTo but I did easily resolve the problem using remastersys. The LiveCD I burned from the iso it created did a normal, successful install on the very first attempt. There was no minor hangup at 86% (languages) and no extended hangup at 94% (hardware). At 94% it did take a bit of time but there was obvious hard drive activity all during it rather than nothing happening. Most importantly, when I installed from the custom LiveCD, everything is as I desired and everything works, including cups and my printer.

I did the HowTo routine no less than 10 times. I've been working with computers since back in the day when the computer consisted of two 5 1/4' soft floppies. I'm no pro but I've installed complicated production postfix based mail server systems from scratch. I've gone through numerous other HowTo routines much more complicated than this one was. I am left with the assumption that there is something that's not addressed or addressed incorrectly in this HowTo. Obviously, something happens in remastersys that does not take place in this. I consider human error on my part but after so many attempts and taking extra effort to ensure I was taking all steps exactly according to instruction I am left with the feeling there's an instruction error somewhere. I do know one thing for certain. For clarity, non-bootstrap and bootstrap methods need to be in two distinctly different HowTo's rather than combined.

capink, I am not trying to bash. I am just trying to express my experience over the past few days and what my personal conclusions are. I've noted through the many pages of posts in this thread that many people seem to have had complete success. I have also noted though that others have been confronted with the same problem I have. There seems to be some circumstance that your routine does not address. Unfortunately, I have not been able to figure out what that circumstance is. Obviously, it is not a circumstance that everyone has. It does seem to be something that is handled in remastersys though.

Trapper

capink
July 18th, 2009, 12:50 PM
capink, I am not trying to bash. I am just trying to express my experience over the past few days and what my personal conclusions are. I've noted through the many pages of posts in this thread that many people seem to have had complete success. I have also noted though that others have been confronted with the same problem I have. There seems to be some circumstance that your routine does not address. Unfortunately, I have not been able to figure out what that circumstance is. Obviously, it is not a circumstance that everyone has. It does seem to be something that is handled in remastersys though.

Trapper

Don't worry, I know you are not bashing. This guide is not prefect. Some people have reported problems that I was not able to reproduce, and consequently not able to solve. Unfortunately I have been busy lately with not much time to improve the guide.

Trapper
July 18th, 2009, 09:48 PM
Unfortunately I have been busy lately with not much time to improve the guide.

capink - I sure know what you are talking about concerning time. I've been there and have done that. A full plate.

I am going to keep plugging away at this and see what I can discover. I'll surely let you know if I find anything pertinent.

There is one thing that keeps running across my mind when I run through the routine. It involves the mounting and unmounting of /rootfs/proc, sys, and dev. I note there's only code for mounting dev and proc. Then it jumps right into chroot. There's no sys mount. Here's the code in that section:

sudo mount -o bind /dev/ ${WORK}/rootfs/dev
sudo mount -t proc proc ${WORK}/rootfs/proc

sudo chroot ${WORK}/rootfs /bin/bashWhen unmounting the code is:


sudo umount ${WORK}/rootfs/proc
sudo umount ${WORK}/rootfs/sys
sudo umount ${WORK}/rootfs/dev
When doing umount for /rootfs/sys I always encounter a not mounted message.

I really don't know if this is meaningful but it makes me wonder why there's a umount line for /rootfs/sys but no sort of mount line. I'd try to mount sys but I have no idea what the correct syntex would be.

That's about the only glaring discripency I have seen so far and I don't even know if it is actually a discripency. I just thought it was worth mentioning.

Trapper

capink
July 19th, 2009, 02:07 PM
That's about the only glaring discripency I have seen so far and I don't even know if it is actually a discripency. I just thought it was worth mentioning.

Trapper

You are right. I added the missing command to guide. Thank you.

Trapper
July 22nd, 2009, 10:04 PM
You are right. I added the missing command to guide. Thank you.

I did a fresh install of U904-32. Cups was accessible and printer was available. I ran your routine with the correction. I burned the resulting iso to disk, booted it up and installed to a new partition from the gui. Everything was exactly as it should be in the new install except that cups was not accessible and consequently there was no printer support.

I then installed remastersys and created an iso using it, burned it to disk and installed to a new partition. It was exactly as it should be, cups was accessible and my printer was there.

I do note that I can burn the iso created with remastersys to a usb flash drive using the USB Startup Disk Creator in System/Administration. It refuses to burn the iso created with your routine though. The message is: "This is not a desktop install CD and thus cannot be used by this application."

Trapper

uflieven
August 13th, 2009, 05:03 AM
I noticed, when working with Remastersys, there are created three folders in the root of the live-cd: casper, isolinux and preseed. In this guide, there's only a casper and a boot folder.

As I'm trying to put the live-cd splashes (splash.pcx and splash.png) on the cd, I guess it would be possible with remastersys, (because the isolinux folder which should contain the splashes exists on the resulting iso, so I guess adding the splashes there after running remastersys distcdfs could do the trick) but not with this guide. (as there's no isolinux folder created)

Am I right, and if so, why doesn't this guide create an isolinux folder while remastersys does? Is there a logical explanation for this?

Thanks for your answer(s).

dimple148
August 29th, 2009, 02:17 AM
Hi,

Are these steps applicable to Ubuntu 9.04 installation?

Dimple.

Αντώνης
September 20th, 2009, 02:05 PM
Hi,

Are these steps applicable to Ubuntu 9.04 installation?

Dimple.

Yes.

My question:

sudo mkisofs -b /boot/grub/stage2_eltorito \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "Custom Live CD" -cache-inodes -r -J -l \
-o ~/live-cd.iso $CD

I get this ->

mkisofs -b /boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -V "Custom Live CD" -cache-inodes -r -J -l -o ~/live-cd.iso $CD
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage: Missing pathspec.
Usage: genisoimage [options] -o file directory ...

Use genisoimage -help
to get a list of valid options.

Report problems to debburn-devel@lists.alioth.debian.org.

Tbh, there is an iso file but when I run it with qemu, it cannot boot.
What does this command do? (mkisofs -b /boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -V "Custom Live CD" -cache-inodes -r -J -l -o ~/live-cd.iso $CD)

Milleman
September 29th, 2009, 07:12 AM
I've just found out that it is possible to make Casper to not autologin. In the file "/etc/casper.conf", just delete the login names:

export USERNAME=""
export USERFULLNAME=""

Then in chroot mode, create the user you like. Set the password and also create the home directory. After boot, it will ask for username and password.

Done!

Best regards,
/Mill

Milleman
October 1st, 2009, 01:39 PM
If I chose the "Persistent" option from the grub boot menu, the booting will be delayed and the following errors will be displayed about 6 times before the booting continues:

"I/O error, dev fd0, sector 0"


Is there a way to get rid of this?

Best regards,
Milleman


Solved!
The FD was absent but selected in BIOS. Just deselected the FD in BIOS and then the problem was gone!

kevinguillorytraining
October 9th, 2009, 01:50 PM
Thanks for a nice tutorial.

bsanyi
October 25th, 2009, 05:12 AM
Hi,
does anyone have pactice on building live system with X from Karmic? These steps are grat on Jaunty, but building a Karmic system fails for me. The problem is somewhere around xorg, hal and udev. These pachages does not like to be installed in a chroot-ed environment... Can you help me how to install them, please?

szerencsefia
October 31st, 2009, 04:55 PM
To: capink

This is a very useful write-up, thank you for sharing your knowledge with us.

In may case it would be interesting to know what are the steps need to be
changed to make a livecd booting up on the way as written here:
http://www.debuntu.org/how-to-install-ubuntu-linux-on-usb-bar-p2
but having the configuration from my running system.

Do you think you can provide me with that information? :D

from: Szerencsefia