fai and broadcom 5700 nic

Jacob Weismann Poulsen jwp at dmi.dk
Sun Aug 3 10:30:39 CEST 2003


Hi,

  The reason I didn't post it to the list was that it was simply
a proof-of-concept and in my point of view much to un-polished to post.
Anyway, now that you ask for it, I'll post it anyway. I have attached
a note that explains the overall idea and another file where I try
to remember and summarize what I had to modify in the files from the 
mkinitrd-cd package.

Best regards,
Jacob
* Jacques Foury <Jacques.Foury at math.u-bordeaux.fr> [2003-08-02 22:57]:
> John Zaitz wrote:
> 
> >>I haven't try to use their kernel-patch but I have successfully made an
> >>
> >>initrd solution where I load their module before mounting the nfsroot.
> >>If you still care I can mail you the details.
> >>   
> >>
> >
> >Yes I would be interested. 
> >
> >thanks
> > 
> >
> 
> We all would be !!!
> 
> Send this here !!!
> 
> -- 
> Jacques Foury
> Ingénieur d'études
> Mathématiques Appliquées de Bordeaux
> Université Bordeaux 1
> 351 cours de la Libération
> 33405 TALENCE Cedex
> 
> Tel : (33/0) 5 4000 69 56
> Fax : (33/0) 5 4000 26 26
> 
> 5 Vendemiaire 181
> 
> 
> 

-- 
<jwp at dmi.dk>
Fingerprint: 9315 DC43 D2E4 4F70 3AA8  F8F0 9DA0 B765 F5C8 7D26
-------------- next part --------------
# --------------------------------------------------------------------------- #
#
# $Id: README.initrd,v 1.2 2003/07/04 12:24:16 jwp Exp $
#
# --------------------------------------------------------------------------- #

This README describes the procedure for constructing an initrd
boot media for DMItux. It can be used as a fallback strategy for 
the cases where you can't compile support for a particular 
netdriver hard into the kernel, i.e. in the cases where the 
netdriver only comes as a module to the kernel.

The overall idea is:

1. Construct a kernel with non-modular support for isofs, procfs,
ram disk and initrd and with modular support for the netdriver.

2. Construct an initrd image where the linuxrc script will

	a. load the FUCKING module
	b. configure the netcard
	c. mount the nfsroot
	d. pivot to the nfsroot
	c. chroot to the nfsroot

3. Construct a boot image

4. Transfer the boot image into a floppy or a cdrom media

5. Boot from the media

# --------------------------------------------------------------------------- #

The host used to construct the image must have support for
loopback interface and must have mkinitrd-cd and busybox
installed. Moreover you might have to patch the following
files:

/usr/share/mkinitrd-cd/scsiprobe-min.dat
/usr/share/mkinitrd-cd/syslinux.cfg
/usr/share/mkinitrd-cd/linuxrc
/usr/sbin/mkinitrd-cd

# --------------------------------------------------------------------------- #

The proceduren for constructing a boot-floppy:

	a. unpack the kernel modules, e.g.

dpkg -x kernel-image-2.4.20-dmiinstall_1.0_i386.deb /tmp

	b. construct an initrd package, e.g.:

mkinitrd-cd /tmp/lib/modules/2.4.20-dmiinstall/ /root/initrd.img min

	c. construct bootimg with mkbootimg, e.g.

mkbootimg 1440 /tmp/boot/vmlinuz-2.4.20-dmiinstall /root/initrd.img /root/boot.img

	d. construct the bootfloppy, e.g.:

dd if=/root/boot.img of=/dev/fd0 bs=512

# --------------------------------------------------------------------------- #

The proceduren for constructing a boot-cdrom:

Follow a)-c) above and proceed:

	d. construct bootcd.iso  
	mkdir -p cdrom/boot
	cp -p boot.img cdrom/boot
	cd cdrom
	mkisofs -r -b boot/boot.img -c boot/boot.catalog -o bootcd.iso .

	e. burn the bastard (cdrecord --scanbus to find CDDEV, e.g. 1,0,0)
	cdrecord -v speed=4 dev=1,0,0 -data bootcd.iso


# --------------------------------------------------------------------------- #

Howto study the contents of the initd.img:

cp initrd.img tmp/initrd.img.gz
cd tmp
gunzip initrd.img.gz
mount -o loop initrd.img /mnt/
cd /mnt

# --------------------------------------------------------------------------- #

-------------- next part --------------
/usr/share/mkinitrd-cd/scsiprobe-min.dat
----------------------------------------
simply added bcm5700

I did a test on a eepro100 card before I tried
the broadcom, in this test I had to add: both mii and eepro100

/usr/share/mkinitrd-cd/syslinux.cfg
-----------------------------------
Added the lines below:

DEFAULT testthis
LABEL testthis
KERNEL linux
APPEND vga=0x303 initrd=initrd.bin ramdisk_size=2048 root=/dev/ram0 init=/linuxrc rw verbose

/usr/share/mkinitrd-cd/linuxrc
------------------------------
Some of the cd-stuff in the beginning was outcommented and
the following line were added the relevant places in the script

IP=xxx.xxx.xxx.xxx
GW=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
NFSSERVER=xxx.xxx.xxx.xxx

insmod -k /modules/bcm5700.o > /dev/null 2> /modules-loading2 ;
RETVAL=$?

if [ $RETVAL -ne 0 ]; then
	echo "Error: unable to load module $1, error was:"
	cat /modules-loading2
fi
if ifconfig eth0 $IP netmask $NETMASK 2>/dev/null;
then
       echo "ifconfig success"
else
       echo "failed to ifconfig"
fi

if mount -o ro -t nfs $NFSSERVER:/fai/nfsroots/v0_3 $MNTPOINT 2>/dev/null; then
	echo "mount -o ro -t nfs $NFSSERVER:/fai/nfsroots/v0_3 $MNTPOINT success"
else
	echo "failed to mount"
fi

echo "route add default gw $GW"
if route add default gw $GW 2>/dev/null; then 
	echo "route success"
else
    echo "failed to make a default route"
fi

exec /usr/sbin/chroot . /sbin/init <dev/console >dev/console 2>&1

/usr/sbin/mkinitrd-cd
---------------------
Added bcm5700 til the list of cdboot_required_modules:

cdboot_required_modules="cdrom scsi_mod sr_mod ide-mod ide-probe ide-probe-mod ide-cd bcm5700"

Added kernel/drivers/net to the list of moduledirs:

moduledirs="kernel/drivers/scsi kernel/drivers/ide kernel/drivers/cdrom kernel/drivers/block kernel/f s kernel/drivers/net"

## added a couple of binaries to busybox (ifconfig, ping, route, nfsmoute, sleep)
busybox_bin="cat chmod chgrp cut dirname dmesg expr find grep gunzip
kill ln ls mknod mount mv ps pwd rm rmdir tr umount ifconfig route ping nfsmount sleep"




More information about the linux-fai mailing list