Ahhh...I see. Thank you for the reply.
I have gotten a custom compiled kernel (with my bcm5700 net drivers) to work using the makeImage utility. I can successfully create floppy and cdrom utilites that work with my hardware. I can also boot using PXE with my custom kernel.
However, I would like to include hdparm in initrd. I'm using the following syntax when running makeImage "./makeImage -k /usr/src/linux-2.4.22/arch/i386/boot/bzImage -c /tftpboot/udpcast/images/udpcd.img -i /tftpboot/udpcast/initrd --bzip -m bcm5700 --merge /bin/hdparm=/sbin/hdparm". I boot up my PXE client and go to the console and type /sbin/hdparm, but I get "no such file or directory. I can see the file if I do an ls, but I can't execute it. Any ideas?
Stefan Jaeckel jaeckel@wiwi.uni-halle.de 12/04/03 01:51 AM >>>
hi,
the network driver has nothing to do with UNDI, after pxe (kernel and initrd loading) you have got a normal linux booting process with a ramdisk. Be shure, that you have copied the driver module from /lib/modules/<your kernel>/kernel/drivers/net/<your nic>.o onto your initrd. If you can boot the "master" system for the pxe-image from hd or cdrom, type "lsmod", to find out which network driver is loaded. It would be one of "/lib/modules/<your kernel>/kernel/drivers/net/<your nic>.o". You can also look into /var/log/messages or boot.msg on your pxe-system, to find an error message about the missing module. Or compile the network driver directly into a new kernel ("lspci -v" on the master system is also helpful).
ciao
Eric Becker schrieb:
I'm able to load the pxe images for udpcast successfully on my network clients using tftp and dhcp. However, I'm running into a problem loading a network driver. Is there any undi driver built into the pxe image or do I need to compile my own kernel with support for one? _______________________________________________ Udpcast mailing list Udpcast@udpcast.linux.lu http://udpcast.linux.lu/mailman/listinfo/udpcast
begin Friday 05 December 2003 02:02, Eric Becker quote:
Ahhh...I see. Thank you for the reply.
I have gotten a custom compiled kernel (with my bcm5700 net drivers) to work using the makeImage utility. I can successfully create floppy and cdrom utilites that work with my hardware. I can also boot using PXE with my custom kernel.
However, I would like to include hdparm in initrd. I'm using the following syntax when running makeImage "./makeImage -k /usr/src/linux-2.4.22/arch/i386/boot/bzImage -c /tftpboot/udpcast/images/udpcd.img -i /tftpboot/udpcast/initrd --bzip -m bcm5700 --merge /bin/hdparm=/sbin/hdparm". I boot up my PXE client and go to the console and type /sbin/hdparm, but I get "no such file or directory. I can see the file if I do an ls, but I can't execute it. Any ideas?
By default, initrd uses the "busybox" system, for space efficiency; in order to make everything small enough to fit on a boot floppy.
Busybox uses the following setup to save space: 1. There are no shared libraries, because these are huge nowadays (because they contain lots of function which are not actually needed on an embedded system) 2. Instead, everything (ifconfig, dhcpcd, ...) is linked together in a same single executable, which behaves differently depending on how it is called.
"Normal" programs that are just copied off a full Linux systems do need the shared libraries however. So you need to copy these as well to the initrd. It will make the initrd *much* larger, but in your case, this should not be cause of concern, as you are booting from PXE rather than floppy, thus there are no space constraints.
Here is how to find out which libraries you need.
1. On your main system, set up directories /chroot-test, /chroot-test/bin, /chroot-test/lib, /chroot-test/usr/lib, 2. Copy your app (hdparm) to this directory: cp /sbin/hdparm /chroot-test/bin/
3. Copy also /lib/ld-linux.so.2 : cp /lib/ld-linux.so.2 /chroot-test/lib This ld-linux.so.2 is the first shared library you need. It is also that part that allows you to get clearer error messages for the *other* libraries that may be missing
4. Now try running it using chroot:
chroot /chroot-test /bin/hdparm
You should now get an error message such as the following: /bin/hdparm: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
Keep adding those files (in this case /lib/libc.so.6) until you no longer get these
cp /lib/libc.so.6 /chroot-test/lib
now you have all shared libraries in /chroot-test/lib
On the machine I just tested (Red Hat Fedora), ld-linux.so.2 and libc.so.6 were enough to make it run; however depending on your distribution (or if you want to use a different app than hdparm), you may need more libraries.
Once you have these, just include everything under /chroot-test onto your initrd:
./makeImage -k /usr/src/linux-2.4.22/arch/i386/boot/bzImage -c \ /tftpboot/udpcast/images/udpcd.img -i /tftpboot/udpcast/initrd --bzip \ -m bcm5700 --merge /bin/hdparm=/chroot-test/bin/hdparm /lib=/chroot-test/lib
Again, such a technique will work for PXE and for CD-Rom boot. However, for floppy, the resulting image will be hopelessly oversized...
Regards,
Alain
begin Friday 05 December 2003 09:54, Alain Knaff quote: [File not found issue]
Here is how to find out which libraries you need.
Oops, there is an easyer way to find out which shared libraries are needed: the ldd command :
ldd /sbin/hdparm
libc.so.6 => /lib/tls/libc.so.6 (0x009d6000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00d9c000)
These libraries may be symlinks, but you need to include the actual file on the initrd:
ls -ld /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 11 Nov 27 15:35 /lib/ld-linux.so.2 -> ld-2.3.2.so
ls -ld /lib/tls/libc.so.6
lrwxrwxrwx 1 root root 13 Nov 27 15:35 /lib/tls/libc.so.6 -> libc-2.3.2.so
Once you have these, just include the needed libraries onto your initrd:
./makeImage -k /usr/src/linux-2.4.22/arch/i386/boot/bzImage -c \ /tftpboot/udpcast/images/udpcd.img -i /tftpboot/udpcast/initrd --bzip \ -m bcm5700 --merge /bin/hdparm=/chroot-test/bin/hdparm \ /lib/ld-linux.so.2=/lib/ld-2.3.2.so \ /lib/libc.so.6=/lib/tls/libc-2.3.2.so
Alain
On Fri, 2003-12-05 at 08:54, Alain Knaff wrote:
Again, such a technique will work for PXE and for CD-Rom boot. However, for floppy, the resulting image will be hopelessly oversized...
We wrote a simple script called "wizzybox" which downloads binaries from a web server to the client's RAM disk on demand as part of our "Pre-Installation Environment".
That way we have a floppy image (or PXE, ISO, etc) which has access to vi, hdparm, lynx, curl, iptables, more kernel modules, etc, etc but still fits on a single floppy.
See http://pie.ucs.ed.ac.uk/ for more details.
Cheers,
Kenny.