Revisiting an old losetup bug (bug 609)
Cross, Matthew
mcross at irobot.com
Fri Feb 2 09:24:21 PST 2007
I have run into this old bug. I'm using an old version of busybox
(1.1.3) on an i.MX21 embedded system (it's ARM based). I understand
what's going on and how it could be fixed but I'm not sure if it's a
busybox bug or a problem with the toolchain. Looking at the code, the
problem is still in the latest source. Let me explain:
In my case, I'm using a "BSP" provided by Freescale for this chip. They
provide a pre-built toolchain (binutils, gcc, glibc). When the
toolchain was built, kernel headers from a 2.6.11 kernel were used by
glibc. The kernel that is running on the board is a heavily patched
2.4.20 kernel. Therefore, when libbb/loop.c is compiled it sees a 2.6
kernel, and so uses LOOP_GET_STATUS64 for BB_LOOP_GET_STATUS - note that
this is ioctl 0x4c05 (if you look in the strace output in the log of bug
609 you see this ioctl there, so it looks like the original submitter
had a similar problem). However, the loop driver in 2.4 kernels does
not support the 64 bit variants of these ioctl's, only the 32 bit
LOOP_GET_STATUS (which is 0x4c03). When I hack loop.c to use the 2.4
version of the code, it works on my system properly, so clearly the 2.4
kernel supports the loop device fine.
Busybox could be modified to work in this scenario by trying the 32 bit
version of the ioctl if the 64 bit version fails, but I don't know if
that goes against the low-bloat philosophy of busybox. Does the busybox
dev team feel that this is a problem with the build system, or should a
busybox built with headers from a 2.6 kernel work with a 2.4 kernel?
The vendor I am working from has argued that userland applications
should not depend on kernel headers and that this toolchain has been
working for several years with this processor and kernel.
-Matt
--
Matt Cross
Senior Lead Software Engineer
iRobot Corporation
63 South Avenue, Burlington, MA 01803
781-418-3373 (ph)
781-345-0201 (fax)
mcross at irobot.com
www.irobot.com <http://www.irobot.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/busybox/attachments/20070202/6186fc96/attachment.htm
More information about the busybox
mailing list