My goal is to build a live ubuntu CD that has a patched kernel and my own applications pre-installed on it. I feel I am very close, but I can't get the kernel to work right.

I am using Ubuntu 7.10 desktop version.
At first, I was trying to use kernel 2.6.23.17 + my own hacks with a .config based off of Fedora 8, and then with a .config from the ubuntu 2.6.22 kernel. I then tried back-porting my patches into the official 2.6.22.9 ubunto kernel-tree and using the default debian .config. I changed the .config slightly (disabled debugging symbols, support 16 cpus, 2/2G memory mapping, 1000
ticks per sec and enabled some modules relating to my own patch-set.)

In all cases, the live CD (booted under qemu) appears to start OK, but without any obvious
errors it goes to the initramfs prompt instead of booting into linux proper.

I am attaching the steps I am using to try to do all of this. Once I run through these steps once, I have been going into the chroot again to install new test kernels, and then run all of the live-cd related commands after '#Clean up chroot" I tried the steps w/out updating the kernel and it booted fine, so it seems to be specifically related to the kernel.

Any ideas what I could be doing wrong or suggestions for ways to further debug this?

Thanks,
Ben

--
Ben Greear <[EMAIL PROTECTED]> Candela Technologies Inc http://www.candelatech.com



Mostly just follow notes on this page:

http://www.debuntu.org/how-to-customize-your-ubuntu-live-cd-p2

Also remove openoffice, totem, rhythmbox, sound-juicer, old linux kernel
(after update)


# Should be able to copy & paste this on an Ubuntu machine to
# get desired results.

sudo apt-get install squashfs-tools
mkdir /tmp/livecd
sudo mount -o loop ~/Desktop/ubuntu-7.10-desktop-i386.iso /tmp/livecd
mkdir ~/livecd
mkdir ~/livecd/cd
rsync --exclude=/casper/filesystem.squashfs -a /tmp/livecd/ ~/livecd/cd
mkdir ~/livecd/squashfs
mkdir ~/livecd/custom
sudo modprobe squashfs
sudo mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs 
~/livecd/squashfs/
sudo cp -a ~/livecd/squashfs/* ~/livecd/custom
sudo cp /etc/resolv.conf /etc/hosts ~/livecd/custom/etc/

# Enter the chroot
sudo chroot ~/livecd/custom
mount -t proc none /proc/
mount -t sysfs none /sys/
export HOME=/root 

# Purge things we don't need.
echo Y|apt-get remove --purge gnome-games*
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
language-pack | egrep -v '\-en'` 
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
openoffice`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
totem`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
rhythmbox`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
sound-juicer`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
gimp`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
evolution`
echo Y|apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep 
mono`

echo Y|apt-get install portmap nfs-common nfs-kernel-server
mkdir /mnt/d2
mount 192.168.100.3:/mnt/d2 /mnt/d2

echo deb file:/mnt/d2/pub/candela_cdrom.5.0.7/debs candela multiverse >> 
/etc/apt/sources.list
echo deb http://archive.ubuntu.com/ubuntu gutsy universe multiverse >> 
/etc/apt/sources.list
apt-get update

echo Y|apt-get dist-upgrade

echo Y|apt-get install wireshark traceroute dhcp bridge-utils ssh

# Install LANforge
adduser lanforge
echo y|apt-get install lanforge-gui
apt-get install lanforge-server
# apt-get install lanforge-xorp
apt-get install lanforge-server
apt-get install linux-image-2.6.23.17
update-initramfs -u -k 2.6.23.17

# Set root password
sudo passwd root

# Remove old kernel

# Clean up chroot
apt-get clean
rm -fr /tmp/*
umount /mnt/d2
umount nfsd
umount /proc
umount /sys
umount /proc
umount /sys
umount tmpfs
rm -f /etc/hosts /etc/resolv.conf

# Exit from chroot
exit

# Get ready to make the ISO
chmod +w ~/livecd/cd/casper/filesystem.manifest
sudo chroot ~/livecd/custom dpkg-query -W \
--showformat='${Package} ${Version}\n' > ~/livecd/cd/casper/filesystem.manifest
sudo cp ~/livecd/cd/casper/filesystem.manifest 
~/livecd/cd/casper/filesystem.manifest-desktop

# Copy new kernel into isolinux dir for the live cd
sudo cp /home/lanforge/livecd/custom/initrd.img 
/home/lanforge/livecd/cd/casper/initrd.gz
sudo cp /home/lanforge/livecd/custom/vmlinuz 
/home/lanforge/livecd/cd/casper/vmlinuz

# Make the squashfs file system
sudo rm ~/livecd/cd/casper/filesystem.squashfs
sudo mksquashfs ~/livecd/custom ~/livecd/cd/casper/filesystem.squashfs

# Edit ~/livecd/cd/README.diskdefines
sudo vi ~/livecd/cd/README.diskdefines

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

cd ~/livecd/cd
sudo mkisofs -r -V "Ubuntu-Live-LANforge" -b isolinux/isolinux.bin -c 
isolinux/boot.cat \
-cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table \
-o ~/Desktop/Ubuntu-Live-7.10-LANforge.iso .

cp /home/lanforge/Desktop/Ubuntu-Live-7.10-LANforge.iso 
/mnt/d2/pub/candela_cdrom.5.0.7/




# Building kernel .debs
# See:  http://www.falkotimme.com/howtos/debian_kernel2.6_compile/

apt-get install kernel-package ncurses-dev fakeroot wget bzip2
cd /usr/src
KVER=2.6.23.17
LFVER=5.0.7
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-$KVER.tar.bz2
tar -xvjf linux-$KVER.tar.bz2
cd linux-$KVER
# copy .config from proper place to .config
# copy candela patch locally
patch -p1 < candela_2.6.23.patch
export CONCURRENCY_LEVEL=2
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=ct \
 --revision=lanforge.$LFVER kernel_image kernel_headers
cp ../linux-image-2.6.23.17_lanforge.5.0.7_i386.deb 
/mnt/d2/pub/candela_cdrom.5.0.7/debs/dists/candela/multiverse/binary-i386/
#update-initramfs -u -k 2.6.23.17

cd /mnt/d2/pub/candela_cdrom.5.0.7/debs
dpkg-scanpackages . /dev/null | gzip -9c > 
dists/candela/multiverse/binary-i386/Packages.gz
-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to