pre-2.0.31-6 hangs at boot, patches to icmp.h and ftape with glibc

Trevor Johnson (trevor@jpj.net)
Fri, 15 Aug 1997 06:19:32 -0400 (EDT)


With pre-2.0.31-6 I'm still receiving the "Unable to open an initial
console" message from init/main.c which I experienced with pre-2.0.31-5
and reported yesterday.

While trying to compile ipfwadm, I noticed an incompatibility with GNU
libc 2.0: libc's netinet/icmp.h contains an #include <linux/icmp.h>, and
the errno variable can get redefined. This is fixed in Linux 2.1 with an
#ifdef __KERNEL__.

While compiling the ftape module, I received these errors:

gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strength-reduce -pipe -m486 -DCPU=486 -DMODULE
-DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h
-DVERIFY_HEADERS -DNR_BUFFERS=3 -DCLK_48MHZ=1 -DNO_TRACE -DFDC_82078SL -c
-o ecc.o ecc.c
In file included from /usr/include/_G_config.h:9,
from /usr/include/libio.h:31,
from /usr/include/stdio.h:29,
from ecc.c:36:
/usr/include/gnu/types.h:75: warning: `__NFDBITS' redefined
/usr/src/linux/include/linux/posix_types.h:30: warning: this is the
location of
the previous definition
/usr/include/gnu/types.h:77: warning: `__FDMASK' redefined
/usr/src/linux/include/linux/posix_types.h:42: warning: this is the
location of
the previous definition

I found that drivers/char/ftape/ecc.c used libc headers. I made some
minor changes so it does not do this. With the changes, it compiles with
no warnings. I could not test it with pre-2.0.31-6 because of the
"initial console" problem. However, I made the same change against 2.0.30
and was able to use the module with only the usual number of problems (the
tape drive here is an Iomega Ditto 800i :\). I would recommend that a more
recent version of the ftape driver be distributed with the kernel. I've
had better results with
http://sunsite.unc.edu/pub/Linux/kernel/tapes/ftape-3.03a.tar.gz .

diff -ur linux-2.0.30-dist/drivers/char/ftape/ecc.c
linux/drivers/char/ftape/ecc.c
--- linux-2.0.30-dist/drivers/char/ftape/ecc.c Thu Mar 14 01:51:21 1996
+++ linux/drivers/char/ftape/ecc.c Fri Aug 15 02:13:22 1997
@@ -33,8 +33,7 @@
*/

#include <linux/ftape.h>
-#include <stdio.h>
-#include <sys/errno.h>
+#include <asm/errno.h>

#include "tracing.h"
#include "ecc.h"
--- linux-2.0.30-dist/include/linux/icmp.h Sun Oct 6 07:41:49 1996
+++ linux/include/linux/icmp.h Fri Aug 15 02:40:27 1997
@@ -75,11 +75,12 @@
} un;
};

+#ifdef __KERNEL__

struct icmp_err {
int errno;
unsigned fatal:1;
};
-
+#endif

#endif /* _LINUX_ICMP_H */

___
Trevor Johnson