Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: lid on August 11, 2014, 04:46:34 PM

Title: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 11, 2014, 04:46:34 PM
Hi,

I pxebooted TC5.3 on a X86 platform using ramdisk. The problem is that it failed to configure the interface that was used in pxeboot.
The interface's IP address should have been configured by DHCP. Manual attempt using ifconfig after boot also failed.

I investigated a little bit. The interface NIC is:

      bnx2 0000:24:00.0: eth2: Broadcom NetXtreme II BCM5709 1000Base-SX (C0)

The dmesg shows that:

      bnx2: Can't load firmware file "bnx2/bnx2/bnx2-mips-09-6.2.1b.fw"

Can someone explain if this is because the TC package doesn't have the right driver for this NIC?

David




Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 11, 2014, 04:53:49 PM
You need to load firmware-broadcom_bnx2.tcz
You can create a second initrd with the firmware, or remaster the initrd.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 12, 2014, 12:03:11 PM
You need to load firmware-broadcom_bnx2.tcz
You can create a second initrd with the firmware, or remaster the initrd.

Will the kernel be able to load the correct driver on boot before DHCP if I use second initrd or remaster?

I am thinking that kernel should find and load the correct NIC driver in order for the DHCP to be successful during the boot. Just want to make sure this is the case.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 12, 2014, 01:01:32 PM
It is currently loading the driver. The driver fails because of the missing firmware.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 12, 2014, 04:46:53 PM
It is currently loading the driver. The driver fails because of the missing firmware.

I have downloaded the driver files from http://distro.ibiblio.org/tinycorelinux/5.x/x86/tcz/

Since this is my first time to do this, I 'd like to make sure the path I am following is correct:

1. If I build the second initrd to include the firmware, should I put the following two files in /opt/tce/optional:

firmware-broadcom_bnx2.tcz
firmware-broadcom_bnx2.tcz.list

and echo "firmware-broadcom_bnx2.tcz" >> /opt/tce/onboot.lst?

2. If I use remastering, should I put the above two files in /lib/modules?



Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 12, 2014, 05:04:38 PM
There are wiki articles on how to remaster.
There is also the ezremaster program.

If you install from coreplus, you have more options.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 12, 2014, 05:57:52 PM
There are wiki articles on how to remaster.
There is also the ezremaster program.

If you install from coreplus, you have more options.

Yes, I have gone through wiki but want to make sure the above files and directories are correct.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: curaga on August 13, 2014, 12:21:09 AM
Since this is my first time to do this, I 'd like to make sure the path I am following is correct:

1. If I build the second initrd to include the firmware, should I put the following two files in /opt/tce/optional:

firmware-broadcom_bnx2.tcz
firmware-broadcom_bnx2.tcz.list

and echo "firmware-broadcom_bnx2.tcz" >> /opt/tce/onboot.lst?

/opt/tce is the old location (from a couple major releases ago). The current one is /tmp/builtin. So /tmp/builtin/optional and /tmp/builtin/onboot.lst.

Quote
2. If I use remastering, should I put the above two files in /lib/modules?

You should extract them directly using unsquashfs in this case.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 13, 2014, 09:26:18 AM
Since this is my first time to do this, I 'd like to make sure the path I am following is correct:

1. If I build the second initrd to include the firmware, should I put the following two files in /opt/tce/optional:

firmware-broadcom_bnx2.tcz
firmware-broadcom_bnx2.tcz.list

and echo "firmware-broadcom_bnx2.tcz" >> /opt/tce/onboot.lst?

/opt/tce is the old location (from a couple major releases ago). The current one is /tmp/builtin. So /tmp/builtin/optional and /tmp/builtin/onboot.lst.

OK, maybe the wiki page on netbooting needs to be updated to reflect this.  Do you know if there is a page on how to package new driver firmware?
Quote
Quote
2. If I use remastering, should I put the above two files in /lib/modules?

You should extract them directly using unsquashfs in this case.

I am not sure I understand this step. Can you explain a little more?

Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 13, 2014, 09:52:39 AM
This is not a netbooting issue.
This is an issue of not having the firmware in the initrd, so the network is not available after booting.
Use ezremaster and have it extract the extension into the initrd.
Then take the generated iniitrd and put in on your PXE server.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 13, 2014, 01:43:52 PM
This is not a netbooting issue.
This is an issue of not having the firmware in the initrd, so the network is not available after booting.
Use ezremaster and have it extract the extension into the initrd.
Then take the generated iniitrd and put in on your PXE server.

This is a bit chicken-and-egg issue. My current machine need the firmware first to be able to connect to the network.
Maybe I misunderstand  how to use ezremaster, don't you need to network connection first to download the firmware?
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 13, 2014, 01:51:48 PM
Burn coreplus to a CD or dd it to a USB thumb drive.
Boot it. and see if you can get a network connection.
If you can, you should be able to remaster the ISO and use the firmware included on the CD.
You can awarys do this on another machine that has a different NIC and download the firmware and remaster.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 13, 2014, 02:35:18 PM

Since this is my first time to do this, I 'd like to make sure the path I am following is correct:

1. If I build the second initrd to include the firmware, should I put the following two files in /opt/tce/optional:

firmware-broadcom_bnx2.tcz
firmware-broadcom_bnx2.tcz.list

and echo "firmware-broadcom_bnx2.tcz" >> /opt/tce/onboot.lst?

/opt/tce is the old location (from a couple major releases ago). The current one is /tmp/builtin. So /tmp/builtin/optional and /tmp/builtin/onboot.lst.



I tried this option by building a second initrd file with the /builtin/optional directory and firmware files. It booted up but the new NIC driver firmware never loaded.  Are you sure this is the right way to put in the new driver?

On the machine, I see the /builtin directory. Should it be /tmp/builtin?




Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 13, 2014, 02:53:35 PM
No. Choose the extract to initrd option.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: curaga on August 14, 2014, 02:33:05 AM

I tried this option by building a second initrd file with the /builtin/optional directory and firmware files. It booted up but the new NIC driver firmware never loaded.  Are you sure this is the right way to put in the new driver?

On the machine, I see the /builtin directory. Should it be /tmp/builtin?

Yes, the resulting image should have /tmp/builtin not /builtin. But anyway, please try ezremaster first, it should be easier.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 14, 2014, 10:49:39 AM

I tried this option by building a second initrd file with the /builtin/optional directory and firmware files. It booted up but the new NIC driver firmware never loaded.  Are you sure this is the right way to put in the new driver?

On the machine, I see the /builtin directory. Should it be /tmp/builtin?

Yes, the resulting image should have /tmp/builtin not /builtin. But anyway, please try ezremaster first, it should be easier.


Hey, this time it worked! I rebuilt my second initrd with /tmp/builtin directory structure and magic happened after the boot. My 1G broadcom interface actually came up with the correct IP assigned by the DHCP. Thanks!

I would like to understand this a little deeper with some follow-up questions:

1. Which code did the search for the correct drivers in the /tmp/builtin directory? Is it in vmlinuz or core.gz?

2. Can you also explain how to use unsquashfs ( which you mentioned before) so I can try to pack the required firmware into the original initrd?

3. Now I am facing a new issue. I can't ssh into the new TC node. Is this because it doesn't have sshd running or because I didn't enable it?

David
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: Misalf on August 14, 2014, 11:25:47 AM
@ 1.)
"/usr/bin/tce-setup" loads extensions from "/tmp/builtin/".

@ 2.)
Code: [Select]
unsquashfs -d /tmp/extension-name /etc/sysconfig/tcedir/optional/extension-name.tcz
"/tmp/extension-name" will be created automatically.
Also see:
http://wiki.tinycorelinux.net/wiki:creating_extensions#all_extension_creators_please_note
http://wiki.tinycorelinux.net/wiki:remastering
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: curaga on August 14, 2014, 01:40:04 PM
TC does not ship with SSH, and in addition to installing a SSH server, you also need to set a password.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 15, 2014, 12:00:49 PM
TC does not ship with SSH, and in addition to installing a SSH server, you also need to set a password.

How about telnetd? Is it in Core-currrent.iso? I didn't find it.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 15, 2014, 12:23:09 PM
No. There are no user programs included in core.  Just those programs needed to boot and install additional programs.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 15, 2014, 01:56:06 PM
No. There are no user programs included in core.  Just those programs needed to boot and install additional programs.

Will Tinycore-5.3.iso have more user applications and development tools?
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: bmarkus on August 15, 2014, 02:40:29 PM
No. There are no user programs included in core.  Just those programs needed to boot and install additional programs.

Will Tinycore-5.3.iso have more user applications and development tools?

Please be more specific what are you missing.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: lid on August 15, 2014, 04:10:07 PM
No. There are no user programs included in core.  Just those programs needed to boot and install additional programs.

Will Tinycore-5.3.iso have more user applications and development tools?

Please be more specific what are you missing.

I need at least ssh or telnet, gcc for compiling.
Title: Re: NIC driver (bnx2) problem in pxebooting
Post by: gerald_clark on August 15, 2014, 04:40:20 PM
Setup a nfs tce directory as described in the wiki.
Then you can install compiletc and sshd from the repo.
Please read the book http://tinycorelinux.net/book.html