Creating a UW CSCF Customized Ubuntu 9.04 Desktop Live CD Image.
Currently I'm building a customized
Ubuntu 9.04 (Jaunty Jackalope) 64-bit PC (AMD64) desktop CD
image on a
Ubuntu 8.10 (Intrepid Ibex) 64-bit PC (AMD64) desktop system.
The Process
During the section I used these replies:
- sudo aptitude install squashfs-tools genisoimage
- No addition replies for this step needed however my current setup
already had genisoimage installed.
- sudo modprobe squashfs
- No addition replies for this step needed
since squashfs was already installed.
This is where I deviate just a little, in that I like to get a fresh copy
of the ISO I'm going to customize.
- mkdir UWcustom && cd UWcustom
-
wget http://mirror.cs/ubuntu-releases/jaunty/ubuntu-9.04-desktop-amd64.iso
We want an emulator/virtual machine to test the new image and we can
use this image to test if our emulator is working.
Tried "qemu -cdrom ubuntu-9.04-desktop-amd64.iso" only to get
"This kernel requires an x86-64 CPU, but only detected an i686 CPU."
The host I'm running on is a 64 bit kernel:
"root@cutter:/.Previous_OS/UWcustom/UWcustom# uname -m"
x86_64
So I choose KVM:
- see
https://help.ubuntu.com/community/KVM/Installation
- sudo apt-get install kvm libvirt-bin ubuntu-vm-builder qemu bridge-utils
which might not be needed as the following is new starting with
the intrepid release.
- sudo apt-get install ubuntu-virt-server ubuntu-virt-mgmt
- sudo sudo modprobe dm-loop
- sudo kvm -cdrom ubuntu-9.04-desktop-amd64.iso
Which does allow you to see that the boot process is working,
although I couldn't get a working GUI screen.
OK, exit out of the virtual host and lets get back to making the
custom image.
Extracting the CD contents
- mkdir mnt && sudo mount -o loop ubuntu-9.04-desktop-amd64.iso mnt
- I had to enter the proper sudo passwd here.
- mkdir extract-cd && rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
Extracting the Desktop system
- mkdir squashfs && sudo mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
- mkdir edit && sudo cp -a squashfs/* edit/
- Wow this took a long time (ie minutes rather than seconds),
however be patient, it does complete.
Prepare and chroot
- sudo cp /etc/resolv.conf edit/etc/
- sudo cp /etc/hosts edit/etc/
- sudo cp /etc/adduser.conf edit/etc/
- We have some very old (20+ years) user accounts
with UID's and GID's around the 100 range so
I'm adding 2*10^10 to the FIRST and LAST UID,GID
configuration options in adduser.conf.
- We need to run a "fixids" shell script (put URL to it here).
- We then need to fix edit/etc/passwd and edit/etc/group.
- update /etc/apt/sources.list to use local repositories and some
that aren't included by default.
- sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
- sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
- sudo mount --bind /dev/ edit/dev
- sudo chroot edit
- mount -t proc none /proc
- mount -t sysfs none /sys
- export HOME=/root
- export LC_ALL=C
Customizations
- mkdir -p /home/UWcustom/doc && cd /home/UWcustom/doc
- dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr > PackageListInitial
- aptitude purge `grep games PackageListInitial | cut -d" " -f 2`
- aptitude install msttcorefonts
- aptitude install some other packages
-
Rebuilding initrd
- sudo chroot edit
- mkinitramfs -o /initrd.gz
where is a file from "ls /lib/modules"
- exit
- mv edit/initrd.gz extract-cd/casper/
Cleanup