Kernel
Network Boot + NFS Root FileSystem
Kernel
Network Boot + CompactFlash Root FileSystem
Kernel CompactFlash Boot + CompactFlash Root FileSystem
Advantech PCM-3350 Model Information |
Network Booting a Linux STB with PXE |
This quick setup explains how to configure your Linux host machine to support PXE. Take a look at the link described above for a general setup.
Here is my setup:
server=192.168.0.2, PCM3350=192.168.0.12
My /tftpboot layout:
~/html/cross-stuff/htdocs$ tree /tftpboot/
/tftpboot/
|-- EDB9315A
| |-- initrd.gz
| |-- rootfs-jffs2.img
| `-- zImage
|-- LITE5200
| |--
flashfs-jffs2-be.img
| |-- initrd.gz
| |--
rootfs-jffs2-be.img
| |-- rootfs-jffs2.img
| `-- vmlinux.img
|-- PCM3350
| |-- bzImage
| |-- initrd.gz
| `-- rootfs-jffs2.img
|-- pxelinux.0
`-- pxelinux.cfg
`-- C0A8000C
C0A8000C
is 192.168.0.12 in hexadecimal
This method describes how to boot both Linux and the root file-system from the Network:
· The script build-linux-2.6.18.sh should have build the kernel image as /tftpboot/PCM3350/bzImage
· Customize the root filesystem build script as this
· Then run it, that will generate the file /tftpboot/PCM3350/initrd.gz
·
Modify the file /tftpboot/pxelinux.cfg/C0A8000C
· Power the PCM3350 and be sure that the BIOS is configured to enable PXE boot.
This method describes how to boot Linux from the Network and have the root filesystem mounted through NFS:
· The script build-linux-2.6.18.sh should have build the kernel image as /tftpboot/PCM3350/bzImage
· Customize the root filesystem build script as this
· Then run it, that will generate the file /tftpboot/PCM3350/initrd.gz
·
Modify the file /tftpboot/pxelinux.cfg/C0A8000C
· Power the PCM3350 and be sure that the BIOS is configured to enable PXE boot.
Notes:
o The script /etc/init.d/rcS does not call anymore udhcpd, that would prevent to mount the root partition from NFS (infamous error 101, Network unreachable)
o Use the options ro or rw in the file C0A8000C depending on the case if you want to have your root filesystem mounted as R/O or R/W.
This method describes how to boot Linux from the Network and have the root filesystem mounted from the CompactFlash.
The first step consists in creating the partitions on the CF.
·
On the host, create a tar file of the whole root
filesystem:
cd ~/sf/cross-stuff/xcross/PCM3350/rootfs
sudo tar -z -c -f ../rootfs.tgz .
cp ../rootfs.tgz .
· Boot now the PCM-3350 using a Ramdisk Root filesystem
·
Mount the NFS exported directory:
mount
-t nfs -o nolock
192.168.0.2:/home/osingla/sf/cross-stuff/xcross/PCM3350/rootfs /host
·
Create the EXT2 partition on the HD:
fsck.ext2
/dev/sda1
·
Mount this partition:
mount -t ex2t
/dev/hda1 /hd
·
Unarchive now the root
filesystem on the HD:
cd /hd
tar -z -f /host/roottfs.tgz -x
·
Un-mount the hard-drive partition:
umount /hd
·
Modify
the file /tftpboot/pxelinux.cfg/C0A8000C
·
Then reboot the PCM-3350.
This method describes how to boot Linux from the HD and have the root filesystem mounted from the HD.
· On the host, download lilo 22.7.3.bin.tar.gz from this location
· And copy it into this directory: cross-stuff/xcross/PCM3350/rootfs (this directory is exported via NFS)
·
On the host, create a tar file of the whole root
filesystem:
cd ~/sf/cross-stuff/xcross/PCM3350/rootfs
sudo tar -z -c -f ../rootfs.tgz .
cp ../rootfs.tgz .
· Boot now the PCM-3350 using a Ramdisk Root filesystem
·
Mount the NFS exported directory:
mount -t nfs -o nolock
192.168.0.2:/home/osingla/sf/cross-stuff/xcross/PCM3350/rootfs /host
·
On the PCM-3350, verify that HD has the right
partition:
fdisk /dev/hda, command ‘p’
·
Create the EXT2 partition on the HD:
fsck.ext2
/dev/sda1
·
Mount this partition:
mount -t ex2t
/dev/hda1 /hd
·
Unarchive now the root
filesystem on the HD:
cd /hd
tar -z -f /host/roottfs.tgz -x
·
Unarchive now the lilo program:
cd /hd
mkdir lilo
cd lilo
tar -z -f ../lilo-22.7.3.bin.tar.gz -x
·
On the host copy the kernel image and the .map
file in the NFS exported directory:
cp
~/sf/cross-stuff/xcross/PCM3350/build/linux-2.6.18/arch/i386/boot/bzImage
~/sf/cross-stuff/xcross/PCM3350/rootfs
cp ~/sf/cross-stuff/xcross/PCM3350/build/linux-2.6.18/System.map ~/sf/cross-stuff/xcross/PCM3350/rootfs
·
On the PCM-3350, create a boot directory and
copy both the kernel and the .map file:
mkdir /hd/boot
cp /host/bzImage /hd/boot
cp /host/System.map /hd/boot/.map
· Edit the file /hd/lilo.conf:
boot = /dev/hda
prompt
compact
root = /dev/hda1
map = /hd/boot/.map
install = /hd/boot/boot.b
read-only
backup = /hd/boot/.boot.bck
image=/hd/boot/bzImage
append="root=/dev/hda1
rw"
·
Install now the boot loader:
/hd/lilo/sbin/lilo -C /hd/lilo/lilo.conf
· Reboot now the PCM-3350. Do not forget to change the BIOS and disable network booting first so the BIOS will try to boot from the HD first.
Very same thing as above, but change /dev/hda to be /dvd/hdc.