PDA

View Full Version : Knoppix 6.2 Boot from PXE



krishnaprasadk
06-02-2010, 11:16 AM
Hello list,

I’ve a query regarding PXE booting Knoppix 6.2 DVD. As per the forums and documentation, I could create initrd and vmlinuz by running terminal server. I can even boot from that vmlinuz and initrd image ( miniroot.gz ).

But I do see that PXE boot fails to the debug shell with a message saying “Probing Network devices handled by bnx2.ko”. it’s loading bnx2.ko because my on-boards LOMs are Broadcom 5709 based.

By going through the init script inside miniroot.gz, I could see that it’s trying to load bnx2.ko module from modules/net directory inside miniroot.gz and it fails. I edited the below part of script and recreated the miniroot.gz to know what exactly happens while loading bnx2.ko..

# Load nfs modules
NFSMODULES="$(cd /modules/net; echo af_packet.*o sunrpc.*o lockd.*o nfs_acl.*o nfs.*o)"
for i in $NFSMODULES; do
insmod /modules/net/"$i"
done

FOUND_NETWORK=""
message "Loading network device module(s)"
for i in $(cd /modules/net; echo *.*o); do
case "$NFSMODULES" in
*$i*) continue ;;
*)
case "$i" in
00*) ;;
*) message -n "${CRE} ${BLUE}Probing network device(s) handled by ${MAGENTA}$i${BLUE}.${NORMAL}"
FOUND_NETWORK="$i" ;;
esac
insmod /modules/net/"$i" >/dev/null 2>&1 ;; # Edited by KP, removed redirecting to /dev/null
esac
done

Now I can see that while loading bnx2.ko, it’s not able to load bnx2 firmware file. Here is the exact error message.

Bnx2: can’t load firmware file “bnx2/bnx2-mips-06-4.6.16.fw”
Bnx2: probe of 0000:05:00.0 failed with error -2
Bnx2: can’t load firmware file “bnx2/bnx2-mips-06-4.6.16.fw”
Bnx2: probe of 0000:05:00.0 failed with error -2

But e1000 driver is getting loaded successfully on another system which has Intel NIC and PXE boot is fine by mounting my NFS share where Knoppix is residing.

Have any one experienced on why bnx2 is failing for Knoppix 6.2 when it’s booted from PXE? Note that this is booting up fine from CDROM. Am I missing something here? :(

Thanks in advance !


Thanks,
Krishnaprasad

klaus2008
06-02-2010, 06:06 PM
Perhaps it is sufficient to add the file /lib/firmware/bnx2/bnx2-mips-06-4.6.16.fw to your miniroot.gz. Since you added the driver for the network card you know how to create a new miniroot.gz.

krishnaprasadk
06-03-2010, 05:49 AM
I had added the firmware files to the initrd. but it doesn't help. i've the files available under lib/firmware/bnx2 and under KNOPPIX and UNIONFS as well.

From the error message it looks like it's not able to load the firmware files?? :confused::confused:

Thanks much for your help !

- Krishnaprasad

krishna.murphy
06-03-2010, 03:23 PM
I had added the firmware files to the initrd. but it doesn't help. i've the files available under lib/firmware/bnx2 and under KNOPPIX and UNIONFS as well.

From the error message it looks like it's not able to load the firmware files?? :confused::confused:

Thanks much for your help !

- Krishnaprasad

I think you may need a different firmware file; -mips- part of the name suggests to me that this isn't a Knoppix-compatible driver.

Hope that helps!
Krishna :mrgreen:

kl522
06-04-2010, 02:51 AM
Have any one experienced on why bnx2 is failing for Knoppix 6.2 when it’s booted from PXE? Note that this is booting up fine from CDROM. Am I missing something here? :(


You might want to check if you boot up from CDROM, the loading of bnx2 is done after '/sbin/init' or before '/sbin/init'.
I think you might want to read this :-

http://lwn.net/Articles/242046/

It seems 'early' firmware loading will require additional tweaking.

Cheers.

krishnaprasadk
06-04-2010, 05:23 AM
I think you may need a different firmware file; -mips- part of the name suggests to me that this isn't a Knoppix-compatible driver.

Hope that helps!
Krishna :mrgreen:

Hi Krishna,

I don't think so because when i boot Knoppix from a CDROM, then the same module gets loaded successfully. and i do see that only this firmware file is available in the entire CD w.r.t bnx2. So that means this firmware file must be loaded while bnx2 bootup. But unfortunately we could not check if the firmware is really loaded to the kernel or not. lsmod doesnt give this info and neither dmesg.

Also the error message says can't load the firmware file bnx2/bnx2-mips-06-4.6.16.fw”

Probably this means while module load ( bnx2.ko ), it's not able to see the firmware file available in initrd or it's not able to load this to kernel because of some other reasons.

Another doubt that i have is, in the case of CDROM bootup, init may be loading this firmware file after mounting the KNOPPIX image to a temporary location. i.e. it may not be getting loaded from initrd.

if that's the case, this can't be implemented in my case because my KNOPPIX image sits in an NFS share and i need network access to mount that NFS share to a temp location... :(

Thank you all for supporting me in this issue. Any ideas will be highly appreciated.

Thanks,
Krishnaprasad

krishnaprasadk
06-04-2010, 05:34 AM
You might want to check if you boot up from CDROM, the loading of bnx2 is done after '/sbin/init' or before '/sbin/init'.
I think you might want to read this :-

http://lwn.net/Articles/242046/

It seems 'early' firmware loading will require additional tweaking.

Cheers.

Hello,

as you know the modules ( network ) are getting loaded from initrd and the firmware load happens when bnx2.ko is getting loaded. The module gets loaded to the kernel but the network devices will be failed as the firmware is not loaded.

From the init code, it's seen that it tries to load bnx2.ko but there the failure happens.

# Load nfs modules
NFSMODULES="$(cd /modules/net; echo af_packet.*o sunrpc.*o lockd.*o nfs_acl.*o nfs.*o)"
for i in $NFSMODULES; do
insmod /modules/net/"$i"
done

FOUND_NETWORK=""
message "Loading network device module(s)"
for i in $(cd /modules/net; echo *.*o); do
case "$NFSMODULES" in
*$i*) continue ;;
*)
case "$i" in
00*) ;;
*) message -n "${CRE} ${BLUE}Probing network device(s) handled by ${MAGENTA}$i${BLUE}.${NORMAL}"
FOUND_NETWORK="$i" ;;
esac
insmod /modules/net/"$i" >/dev/null 2>&1 ;;
esac
done

# Enable kernel messages again
echo "6" > /proc/sys/kernel/printk
ifconfig lo 127.0.0.1 up

[ -n "FOUND_NETWORK" ] || debugshell

But if i have an Intel card and if e1000.ko is the driver, this gets initalized properly. The issue is only with bnx2.ko and the firmware files.

Unfortunately all of my systems have Onboard Broadcom NICs. :( :(

Thanks,
Krishnaprasad

kl522
06-04-2010, 09:35 AM
Hello,

But if i have an Intel card and if e1000.ko is the driver, this gets initalized properly. The issue is only with bnx2.ko and the firmware files.

Unfortunately all of my systems have Onboard Broadcom NICs. :( :(


I have asked you to read the document, you have probably not read it thoroughly yet. :)
Nevermind, that's the long version of the answer. The short version of the answer is as follows :-

You need to have a shell script called /sbin/hotplug, with execution permission, the content
is something like this :-
#!/bin/sh
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/bnx2/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading

That's will likely do the trick.
Cheers.

krishnaprasadk
06-07-2010, 03:20 AM
I have asked you to read the document, you have probably not read it thoroughly yet. :)
Nevermind, that's the long version of the answer. The short version of the answer is as follows :-

You need to have a shell script called /sbin/hotplug, with execution permission, the content
is something like this :-
#!/bin/sh
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/bnx2/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading

That's will likely do the trick.


Cheers.


my bad !!.. i read the doc but it didn't clicked for me. I will try this out today. I've just one basic question..what's the DEVPATH needs to be used in my case? will it be the hard drive device name? please advise

Thanks,
Krishnaprasad

krishnaprasadk
06-07-2010, 08:07 AM
I have asked you to read the document, you have probably not read it thoroughly yet. :)
Nevermind, that's the long version of the answer. The short version of the answer is as follows :-

You need to have a shell script called /sbin/hotplug, with execution permission, the content
is something like this :-
#!/bin/sh
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/bnx2/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading

That's will likely do the trick.
Cheers.

Hi, Please ignore my previous post.

i do see that DEVPATH is the Path under /sys at which this device's sysfs directory can be found. i saw the documentation inside Documentation/firmware_class as well. From there i understood the way kernel is calling the firmware and how it needs to be passed from the user end. per your advise, I've created a script /sbin/hotplug as below:-

#!/bin/sh
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/bnx2/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading


Now the firmware is read while loading the module and it fails with an error message as below

firmware 0000:05:00.0: firmware_loading_store: vmap() failed
bnx2: Can't load firmware file "bnx2/bnx2-mips-06-4.6.16.fw"
bnx2: probe of 0000:05:00.0 failed with error -2

I am checking bnx2 driver code on why this failure is seen.

Thanks,
Krishnaprasad

krishnaprasadk
06-07-2010, 09:57 AM
Hi, Looks like this is a known issue.
https://patchwork.kernel.org/patch/49056/

Does any one if this patch is part of any of the upcoming Knoppix releases? :(

Thanks,
Krishnaprasad

krishnaprasadk
06-08-2010, 12:29 PM
Hi, Please ignore my previous post.

i do see that DEVPATH is the Path under /sys at which this device's sysfs directory can be found. i saw the documentation inside Documentation/firmware_class as well. From there i understood the way kernel is calling the firmware and how it needs to be passed from the user end. per your advise, I've created a script /sbin/hotplug as below:-

#!/bin/sh
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/bnx2/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading


Now the firmware is read while loading the module and it fails with an error message as below

firmware 0000:05:00.0: firmware_loading_store: vmap() failed
bnx2: Can't load firmware file "bnx2/bnx2-mips-06-4.6.16.fw"
bnx2: probe of 0000:05:00.0 failed with error -2

I am checking bnx2 driver code on why this failure is seen.

Thanks,
Krishnaprasad


It looks like the issue that i am seeing ( i.e. while loading the bnx2 firmware, vmap() call is failed ) is a known issue. i do see the link as below and it exactly matches the error code that i am seeing.

patchwork.kernel.org/patch/49056/

vmap is called to load the firmware data stored in /lib/firmware/bnx2/$FIRMWARE to the kernel.

Looks like Knoppix is not yet included the fix mentioned in the above link in the kernel that they use. So i compiled ( Changed firmware_class.c in drivers/base ) and created a new bzImage using Live CD but still i face the same error. The error is as below

firmware 0000:05:00.0: firmware_loading_store: vmap() failed
bnx2: Can't load firmware file "bnx2/bnx2-mips-06-4.6.16.fw"
bnx2: probe of 0000:05:00.0 failed with error -2


Any one have faced an error like this? :( i am blocked my Knoppix Booting via PXE because of this issue ..:( any help will be highly appreciated !

Thank you all for your time !
- Krishnaprasad

kl522
06-08-2010, 03:24 PM
Now the firmware is read while loading the module and it fails with an error message as below

firmware 0000:05:00.0: firmware_loading_store: vmap() failed
bnx2: Can't load firmware file "bnx2/bnx2-mips-06-4.6.16.fw"
bnx2: probe of 0000:05:00.0 failed with error -2

I am checking bnx2 driver code on why this failure is seen.

Thanks,
Krishnaprasad

Try this improved script ( still not the best ) :-



#!/bin/sh
[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading
Please, this is not ***NOT*** a kernel bug or something, this is
an ***EXPECTED*** behaviour.

Cheers.

kl522
06-09-2010, 04:58 AM
Let me add one more note to this. Between you and a working system, it's just this shell script, how complicated it can be ?

Please don't look any further and it is not any more complicated than this.

krishnaprasadk
06-09-2010, 06:21 AM
Try this improved script ( still not the best ) :-



#!/bin/sh
[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading
Please, this is not ***NOT*** a kernel bug or something, this is
an ***EXPECTED*** behaviour.

Cheers.

Hello,
Sorry if i took a wrong route. I tried the above change that you advised in /sbin/hotplug script, but still bnx2 fails to load the firmware file. I am still seeing the error message:-

firmware_loading_store: vmap() failed

As far as scripting is concerned, no difficulties are there.

since i saw a kernel forum thread which shows the exact error message, i thought of following that. Also in the 6.2 DVD, kernel source is available. There also inside drivers/base, firmware_class.c doesnt have the mutex fix that the forum is suggested to use. so I believed that i am facing the same issue.

Now that the loading of bnx2 firmware still fails with this updated script, could you please advise on how to move forward?

I really appreciate the help that you are providing in this issue !

- Krishnaprasad

krishnaprasadk
06-09-2010, 01:02 PM
Try this improved script ( still not the best ) :-



#!/bin/sh
[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading
Please, this is not ***NOT*** a kernel bug or something, this is
an ***EXPECTED*** behaviour.

Cheers.


okay..my mistake.. instead of sending the bnx2 firmware data ( /path/$FIRMWARE ) to /sys/$DEVPATH/data, i was re-directing it to /sys/class/firmware/data.

Now i corrected that and bootup of Knoppix 6.2 from PXE is successful using NFS share... there is not even requited to check if $FIRMWARE exists or not.

Thanks for all your patience in helping me out on this.

Thank you !
Krishnaprasad

kl522
06-09-2010, 01:47 PM
Did you notice that the script initially was

cat /lib/firmware/bnx/$FIRMWARE > /sys/class/firmware/data

and the new script was :-

cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data


Did you try to debug the script by changing it to :-

#!/bin/sh
[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
echo "Loading firmware /lib/firmware/$FIRMWARE" >> /tmp/log
cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading

Did you check if there are indeed firmware files in your initrd.gz, which filenames are matching what are needed by the script (as appeared in /tmp/log ) ?

krishnaprasadk
06-11-2010, 01:38 PM
Did you notice that the script initially was

cat /lib/firmware/bnx/$FIRMWARE > /sys/class/firmware/data

and the new script was :-

cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data


Did you try to debug the script by changing it to :-

#!/bin/sh
[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
echo "Loading firmware /lib/firmware/$FIRMWARE" >> /tmp/log
cat /lib/firmware/$FIRMWARE > /sys/class/firmware/data
echo 0 > /sys/$DEVPATH/loading

Did you check if there are indeed firmware files in your initrd.gz, which filenames are matching what are needed by the script (as appeared in /tmp/log ) ?




HI, not sure if you have seen the post that i posted before your reply. re-posting the required part.

instead of sending the bnx2 firmware data ( /path/$FIRMWARE ) to /sys/$DEVPATH/data, i was re-directing it to /sys/class/firmware/data.

Here is the final script

#!/bin/sh
#[ -z "$FIRMWARE" ] && exit
echo 1 > /sys/$DEVPATH/loading
cat /lib/firmware/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading

I must thank you for your patience in guiding me for getting into a resolution. I really appreciate and sorry for the change in path that i took by seeing the kernel patch :D .. My bad analysis :p

Thanks much !
- Krishnaprasad

kl522
06-12-2010, 09:08 AM
Haven't I told you between you and a working system is just this shell script ?

:)

krishnaprasadk
06-14-2010, 07:07 AM
Haven't I told you between you and a working system is just this shell script ?

:)

Yes.. :( My bad !! .. when i saw the error of vmap failure, i saw a matching Linux kernel posting as well talking about the same issue .. so changed my mind and went after that .. But good Experience :mrgreen:

Thanks !