The Vision


Network Boot LiveCD Creation

Posted in by Michael Lorant on the April 4th, 2006

This guide shows how to covert the Gentoo LiveCD into an image that can be booted via PXE. Credits must go to Sebastian Werner for his own guide on how to get Gentoo booting from the network. I took the information from his guide to make my own version.

Download

Download Gentoo LiveCD.

Preparation

On the server make sure SSH works with a password.

nano -w /etc/ssh/sshd_config

Change PasswordAuthentication to yes. Save and exit nano.

/etc/init.d/sshd restart

Extraction

Using a tool such as WinImage extract the kernel and initrd:

image.squashfs (Initrd)
isolinux/gentoo (Kernel)

Copy image.squashfs to the ssh server as gentoo-initrd-squash.
Copy gentoo to the shh server as gentoo-kernel.

Convert Filesystem

Boot an existing LiveCD (any LiveCD will work as long as it has the squash filesystem available). For this guide I am using the Gentoo LiveCD.

cd /usr/portage
scp (username)@(server name):gentoo-initrd-squash .
mkdir /mnt/squash
mount -o loop gentoo-initrd-squash /mnt/squash
dd if=/dev/zero of=gentoo-initrd bs=1024 count=120000
mke2fs gentoo-initrd
mkdir /mnt/initrd
mount -o loop gentoo-initrd /mnt/initrd
cd /mnt/initrd
cp -a /mnt/squash/* .
cd /usr/portage
umount /mnt/initrd
umount /mnt/squash
rm gentoo-initrd-squash
gzip gentoo-initrd
scp gentoo-initrd.gz mikel@azrael:

PXE Config File

label gentoo
menu label Gentoo LiveCD
kernel gentoo-kernel
append initrd=distributions/gentoo-initrd.gz ip=dhcp ramdisk=120000 root=/dev/ram0 dokeymap cdroot vga=791 splash=silent,theme:livecd-2006.0 CONSOLE=/dev/tty1 quiet

Leave a Reply

You must be logged in to post a comment.