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 & C in the original guide 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.
B. Build a custom system from scratch using debootstrap
1. Install debootstrap
Code:
sudo apt-get install debootstrap
2. Run debootstrap to install the basic packages:
Code:
sudo debootstrap natty ${WORK}/rootfs
Replace natty with any other version you want (e.g. maverick, lucid, .....)
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:
Code:
sudo gedit ${WORK}/rootfs/etc/apt/sources.list
And place the following text into it:
Note: Replace natty with your version name. e.g. maverick
Copy the following files to have internet access within the chroot environment:
Code:
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:
Code:
sudo mount --bind /dev ${WORK}/rootfs/dev
Code:
sudo mount -t proc proc ${WORK}/rootfs/proc
Code:
sudo mount -t sysfs sysfs ${WORK}/rootfs/sys
Code:
sudo chroot ${WORK}/rootfs /bin/bash
Note: All commands in blue are run within chroot.
5. Once in chroot, modify the new system:
Code:
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 ):
Code:
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:
Code:
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:
Code:
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.
9. Install Packages Essential for live CD:
Code:
apt-get install casper lupin-casper
casper contain the live scripts.
3. (Optional) If you want your live cd to have an installer, install the Ubuntu installer:
Code:
apt-get install ubiquity ubiquity-frontend-gtk
[QUOTE]
Note: People using kde replace replace the previous command with
Code:
apt-get install ubiquity ubiquity-frontend-kde
(Optional Step)Install any packages you want to be in the CD. Some of the following packages are useful in emergency situations:
Code:
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.
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
10. Update the initramfs:
Set the kernel version of the chroot env:
Code:
export kversion=`cd /boot && ls -1 vmlinuz-* | tail -1 | sed 's@vmlinuz-@@'`
First update modules.dep:
Code:
depmod -a $kversion
Update the initrd
Code:
update-initramfs -u -k $kversion
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.
11. Clean apt cache
12. Clean some dirs and files:
Code:
rm /etc/resolv.conf
13. Exit chroot
Now resume the steps of the original guide jumping directly to step D.1 in the original guide.
Bookmarks