Hello List, hello Alain,
I am playing around with the "udpcast image generator" and I need to store the next-server address in the filesystem for later processing. I am using kernel-udpcast_2.6.30-rc5_all.deb and udpcast-mkimage_20081213_all.deb.
This is what my dhcp.script looks like: === snip === #!/bin/sh
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" case "$1" in deconfig) /sbin/ifconfig $interface 0.0.0.0 ;; renew|bound) /sbin/ifconfig $interface $ip $BROADCAST $NETMASK /sbin/echo $siaddr > /etc/server.ip ;; esac === snap ===
This works as expected when generating cd-images. If I generate a initrd and boot via PXE, the file /etc/server.ip never gets created. I tried to create the file in many places (/tmp, /sbin, etc.) but it doesn't work.
Is there something important that I am missing? I thought that there is no difference between a cd-image and a plain initrd (besides syslinux/pxelinux and the kernel being separate).
Additionally FYI, when using the latest kernel and mkimage I get some weird behaviour. I use VirtualBox 2.2 for testing purposes and both cd-image and initrd crash the VM when trying to write to the filesystem from within dhcp.script.
Any help/suggestion is much appreciated.
Thanks in advance.
Regards Jens
Jens Breuer wrote:
Hello List, hello Alain,
I am playing around with the "udpcast image generator" and I need to store the next-server address in the filesystem for later processing. I am using kernel-udpcast_2.6.30-rc5_all.deb and udpcast-mkimage_20081213_all.deb.
This is what my dhcp.script looks like: === snip === #!/bin/sh
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$subnet" ] && NETMASK="netmask $subnet" case "$1" in deconfig) /sbin/ifconfig $interface 0.0.0.0 ;; renew|bound) /sbin/ifconfig $interface $ip $BROADCAST $NETMASK /sbin/echo $siaddr > /etc/server.ip ;; esac === snap ===
This works as expected when generating cd-images. If I generate a initrd and boot via PXE, the file /etc/server.ip never gets created. I tried to create the file in many places (/tmp, /sbin, etc.) but it doesn't work.
Is there something important that I am missing? I thought that there is no difference between a cd-image and a plain initrd (besides syslinux/pxelinux and the kernel being separate).
Exactly. PXE and CD initrd's are the same. Only the floppy initrd is different (in order to fit into a smaller size).
In which directory do you put the script on CD?
Additionally FYI, when using the latest kernel and mkimage I get some weird behaviour. I use VirtualBox 2.2 for testing purposes and both cd-image and initrd crash the VM when trying to write to the filesystem from within dhcp.script.
Personally, I use kvm, and it works like a charm!
Any help/suggestion is much appreciated.
Thanks in advance.
Regards Jens
Regards,
Alain
In which directory do you put the script on CD?
I just edited the existing script under /usr/lib/udpcast/tmpl/bin
Personally, I use kvm, and it works like a charm!
I got my hands onto some real hardware lately and to me it appears as if I was on the completely wrong track. It seems as if it has nothing to do with writing to the filesystem but with the network driver.
If I take a plain initrd created with cast-o-matic without preconfiguration everything works as expected.
However, if I use cast-o-matic to preconfigure the initrd and set the network driver to AUTO VirtualBox keeps crashing as described above. On the real hardware the system hangs for a few minutes then udpcdialog tells me: === snip === ifconfig: ioctl 0x8914 failed: No such file or directory === snap === At the same time in syslog (last line): === snip === <3>e100: eth0: e100_request_firmware: Failed to load firmware "e100/d102e_ucode.bin": -2 === snap === What puzzles me here, is that in syslog it says eth0 but in udpcdialog (not preconfigured) I can see that eth1 is the active interface.
The error message in udpcdialog presents me an OK-button. If I click it, I am prompted to enter an IP in the next screen. If I chose "Back" there, I can chose whether to use dhcp or enter an IP manually. If I chose dhcp everything is back to normal and I can continue to go through the menu system.
The same goes for initrds created with makeImage. As long as I do not do any preconfig everything works fine. If I preconfigure udpcdialog and change nothing else I get the scenario described above. Even if I explicitly preconfigure the driver to be used (e100) I face the error. By now I am using the latest udpcast (20090920).
The system has two ethernet cards where one is connected to LAN and the other not.
To be honest I am completely clueless where the solution of this problem resides. Additionally I do not know what further information might be needed to track the problem down. If you need any further information please do not hessitate to ask. I will provide information immediately.
Thank you.
Jens
Hello all,
sorry for double posting.
I just tested with a different hardware which has only one NIC and it worked flawlessly.
I suppose that the problem is somewhat related to the presence of two NICs.
However, I don't have a clue how to work around that problem as disabling one NIC is not an option.
Regards Jens
Hello List, hello Alain,
we finally tracked down the problem.
If dhcp is set to yes in the udpc.config and udpcdialog detects that the "ip" environment variable (set by pxelinux) is set, it will use the extracted IP together with the hardcoded interface name "eth0". Since eth0 hasn't got link in my testsetup ifconfig will fail and udpcdialog presents the error message described in my previous posts.
A workaround is to introduce an new config option where one can set the interface to use. The patch is added as an attachment (patch #04) of this email. Maybe you and others find it useful and maybe you could include it in the next version of udpcast (udpcdialog). The config option is called "defNic" and you use it by specifying a string like "eth1" to override the hardcoded "eth0" (e.g.: defNic=eth1).
Additionally while walking through the code, I think I spotted some potential errors.
Patch #01 fixes a potential buffer size problem. Might have been a typo. I saw a warning from gcc when building busybox.
Patch #02 fixes a compiler issue with gcc 4.3.3 which demands a third parameter to the open syscall. The build process of busybox stopped with an error.
Patch #03 makes sure that the correct option gets preselected in the use-dhcp-dialog-box.
I hope that you get the time to review the patches and that you find them useful for inclusion in udpcdialog.
All of this has been done with the additional help of Tobias Selzer.
Kind regards, Jens
Jens Breuer wrote:
Hello List, hello Alain,
we finally tracked down the problem.
If dhcp is set to yes in the udpc.config and udpcdialog detects that the "ip" environment variable (set by pxelinux) is set, it will use the extracted IP together with the hardcoded interface name "eth0". Since eth0 hasn't got link in my testsetup ifconfig will fail and udpcdialog presents the error message described in my previous posts.
A workaround is to introduce an new config option where one can set the interface to use.
The easiest workaround would have been not to use the IPAPPEND option... But this is now fortunately moot after your and my fixes (see below).
The patch is added as an attachment (patch #04) of this email. Maybe you and others find it useful and maybe you could include it in the next version of udpcast (udpcdialog). The config option is called "defNic" and you use it by specifying a string like "eth1" to override the hardcoded "eth0" (e.g.: defNic=eth1).
The patches are now applied to version 20091031, after some cleanup (removed needless appending of spaces at end of some lines) and along with some refactoring in interface choosing code (support of BOOTIF, interface choosing also for other methods than dhcp).
Additionally while walking through the code, I think I spotted some potential errors.
Patch #01 fixes a potential buffer size problem. Might have been a typo. I saw a warning from gcc when building busybox.
Agreed & applied
Patch #02 fixes a compiler issue with gcc 4.3.3 which demands a third parameter to the open syscall. The build process of busybox stopped with an error.
Agreed & applied
Patch #03 makes sure that the correct option gets preselected in the use-dhcp-dialog-box.
No it doesn't. It choses exactly the contrary of what was configured. And what's worse, this is the _only_ thing that it does...
I hope that you get the time to review the patches and that you find them useful for inclusion in udpcdialog.
1, 2 and 4 were indeed useful, and are now applied. Thanks for these.
All of this has been done with the additional help of Tobias Selzer.
Kind regards, Jens
As a result of refactoring, now IPAPPEND 2 or IPAPPEND 3 should be used, rather than IPAPPEND 1.
Thanks,
Alain