asm/linkage.h: No such file or directory

I’m trying to install the ftape drivers and tools. I’m stuck on this error in the drivers.

I got the source from http://ftape.cvs.sourceforge.net/viewvc/ftape/ and downloaded the GNU tarball. Had to remove linux/config.h from several places.

Now I’m getting this. Please help. I’ve spent many hours downloading kernel sources, running various make options, etc…


make
for i in ftape ; do make -C $i all ; done
make[1]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
for i in internal lowlevel parport zftape; \
do \
  make -C $i NODEP=true versions; \
done
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/lowlevel'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/lowlevel'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/parport'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/parport'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/zftape'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/zftape'
make -C internal modules
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
gcc -Wall -Wstrict-prototypes -O2  -fomit-frame-pointer -fno-strength-reduce -D__KERNEL__ -I. -I../../include -I/usr/src/linux/include -D__SMP__ -DCONFIG_X86 -mpreferred-stack-boundary=2 -march=i686 -DMODULE    -c -o fdc-internal.o fdc-internal.c
In file included from /usr/src/linux/include/linux/stat.h:59:0,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-internal.c:29:
/usr/src/linux/include/linux/types.h:229:8: error: redefinition of ‘struct list_head’
In file included from /usr/src/linux/include/linux/module.h:9:0,
                 from fdc-internal.c:29:
../../include/linux/list.h:16:8: note: originally defined here
In file included from /usr/src/linux/include/linux/kernel.h:15:0,
                 from /usr/src/linux/include/linux/cache.h:4,
                 from /usr/src/linux/include/linux/time.h:7,
                 from /usr/src/linux/include/linux/stat.h:60,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-internal.c:29:
/usr/src/linux/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
make[2]: *** [fdc-internal.o] Error 1
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
make[1]: *** [_modsubdir_internal] Error 2
make[1]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape'
make: *** [all] Error 2

I’m on openSUSE 12.2 (i586). It’s an AMD K7 cpu. KDE desktop.

What kernel are you running?

:>  uname -a

I am assuming you have kernel-desktop-3.4.63-2.44.1.i686.rpm from the 12.2 update repository.

With YaST > Software Manager > Filter > Patterns
install Linux Kernel Development
This should have ensured the installation of these packages (among others):

kernel-default-devel-3.4.63-2.44.1.i586.rpm
kernel-desktop-3.4.63-2.44.1.i686.rpm
kernel-desktop-devel-3.4.63-2.44.1.i686.rpm
And should provide:
/usr/src/linux/arch/x86/include/asm/linkage.h
which is a link to:
*/usr/src/linux-3.4.63-2.44.1/arch/x86/include/asm/linkage.h
*
As you have deleted some files, it would be prudent to ensure re-installation of any kernel-devel packages wihle you are in YaST.

Here’s the uname.

uname -a 
Linux linux-xpzs 3.4.6-2.10-default #1 SMP Thu Jul 26 09:36:26 UTC 2012 (641c197) i686 athlon i386 GNU/Linux


I had to reinstall everything. Couldn’t boot because I tried to build the kernel sources, and didn’t know what I was doing.

I did select to install all of the relevant kernel modules. And did the following.


cd /usr/src/linux
cp /boot/config-3.4.6-2.10-default .config 

The ftape install says to do a make dep there, but I did not. The last time I tried, it said that wasn’t necessary.

Within the ftape-driver directory I tried a make. This is a snip of the messages:


/usr/include/linux/version.h:2:2: error: #error "======================================================="
/usr/include/linux/version.h:3:2: error: #error "You should not include /usr/include/{linux,asm}/ header"
/usr/include/linux/version.h:4:2: error: #error "files directly for the compilation of kernel modules."
/usr/include/linux/version.h:5:2: error: #error ""
/usr/include/linux/version.h:6:2: error: #error "glibc now uses kernel header files from a well-defined"
/usr/include/linux/version.h:7:2: error: #error "working kernel version (as recommended by Linus Torvalds)"
/usr/include/linux/version.h:8:2: error: #error "These files are glibc internal and may not match the"
/usr/include/linux/version.h:9:2: error: #error "currently running kernel. They should only be"
/usr/include/linux/version.h:10:2: error: #error "included via other system header files - user space"
/usr/include/linux/version.h:11:2: error: #error "programs should not directly include <linux/*.h> or"
/usr/include/linux/version.h:12:2: error: #error "<asm/*.h> as well."
/usr/include/linux/version.h:13:2: error: #error ""
/usr/include/linux/version.h:14:2: error: #error "Since Linux 2.6, the kernel module build process has been"
/usr/include/linux/version.h:15:2: error: #error "updated such that users building modules should not typically"
/usr/include/linux/version.h:16:2: error: #error "need to specify additional include directories at all."
/usr/include/linux/version.h:17:2: error: #error ""
/usr/include/linux/version.h:18:2: error: #error "To build kernel modules, ensure you have the build environment "
/usr/include/linux/version.h:19:2: error: #error "available either via the kernel-devel and kernel-<flavor>-devel "
/usr/include/linux/version.h:20:2: error: #error "packages or a properly configured kernel source tree."
/usr/include/linux/version.h:21:2: error: #error ""
/usr/include/linux/version.h:22:2: error: #error "Then, modules can be built using:"
/usr/include/linux/version.h:23:2: error: #error "make -C <path> M=/home/abuild/rpmbuild/BUILD/linux-glibc-devel-3.4"
/usr/include/linux/version.h:24:2: error: #error ""
/usr/include/linux/version.h:25:2: error: #error "For the currently running kernel there will be a symbolic "
/usr/include/linux/version.h:26:2: error: #error "link pointing to the build environment located at "
/usr/include/linux/version.h:27:2: error: #error "/lib/modules/2.6.37.6-0.11-xen/build for use as <path>."
/usr/include/linux/version.h:28:2: error: #error ""
/usr/include/linux/version.h:29:2: error: #error "If you are seeing this message, your environment is "
/usr/include/linux/version.h:30:2: error: #error "not configured properly. "
/usr/include/linux/version.h:31:2: error: #error ""
/usr/include/linux/version.h:32:2: error: #error "Please adjust the Makefile accordingly."
/usr/include/linux/version.h:33:2: error: #error "======================================================="


I take that to mean I have to remove the #include <asm/… lines, which I commented out of all of the ftape modules. Then commented out all the #include <config.h> and #include <linux/config.h> lines. Since those files are not found anywhere withing the ftape directories.

Now I’m getting this.

make 
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
for i in ftape ; do make -C $i all ; done
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
make[1]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape'
&gt; ../include/linux/modftversions.h
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/autoconf.h: No such file or directory
for i in internal lowlevel parport zftape; \
do \
  make -C $i NODEP=true versions; \
done
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
make[2]: Nothing to be done for `versions'.
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/lowlevel'
make[2]: *** No rule to make target `/usr/src/linux/include/linux/autoconf.h', needed by `../../include/linux/modules/ftape_syms.ver'.  Stop.
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/lowlevel'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/parport'
make[2]: Nothing to be done for `versions'.
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/parport'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/zftape'
make[2]: Nothing to be done for `versions'.
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/zftape'
make -C internal modules
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
In file included from /usr/src/linux/include/linux/kernel.h:15:0,
                 from /usr/src/linux/include/linux/cache.h:4,
                 from /usr/src/linux/include/linux/time.h:7,
                 from /usr/src/linux/include/linux/stat.h:60,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-isapnp.c:29:
/usr/src/linux/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
In file included from fc-10.c:58:0:
/usr/include/linux/version.h:2:2: error: #error "======================================================="
/usr/include/linux/version.h:3:2: error: #error "You should not include /usr/include/{linux,asm}/ header"
/usr/include/linux/version.h:4:2: error: #error "files directly for the compilation of kernel modules."
/usr/include/linux/version.h:5:2: error: #error ""
/usr/include/linux/version.h:6:2: error: #error "glibc now uses kernel header files from a well-defined"
/usr/include/linux/version.h:7:2: error: #error "working kernel version (as recommended by Linus Torvalds)"
/usr/include/linux/version.h:8:2: error: #error "These files are glibc internal and may not match the"
/usr/include/linux/version.h:9:2: error: #error "currently running kernel. They should only be"
/usr/include/linux/version.h:10:2: error: #error "included via other system header files - user space"
/usr/include/linux/version.h:11:2: error: #error "programs should not directly include &lt;linux/*.h&gt; or"
/usr/include/linux/version.h:12:2: error: #error "&lt;asm/*.h&gt; as well."
/usr/include/linux/version.h:13:2: error: #error ""
/usr/include/linux/version.h:14:2: error: #error "Since Linux 2.6, the kernel module build process has been"
/usr/include/linux/version.h:15:2: error: #error "updated such that users building modules should not typically"
/usr/include/linux/version.h:16:2: error: #error "need to specify additional include directories at all."
/usr/include/linux/version.h:17:2: error: #error ""
/usr/include/linux/version.h:18:2: error: #error "To build kernel modules, ensure you have the build environment "
/usr/include/linux/version.h:19:2: error: #error "available either via the kernel-devel and kernel-&lt;flavor&gt;-devel "
/usr/include/linux/version.h:20:2: error: #error "packages or a properly configured kernel source tree."
/usr/include/linux/version.h:21:2: error: #error ""
/usr/include/linux/version.h:22:2: error: #error "Then, modules can be built using:"
/usr/include/linux/version.h:23:2: error: #error "make -C &lt;path&gt; M=/home/abuild/rpmbuild/BUILD/linux-glibc-devel-3.4"
/usr/include/linux/version.h:24:2: error: #error ""
/usr/include/linux/version.h:25:2: error: #error "For the currently running kernel there will be a symbolic "
/usr/include/linux/version.h:26:2: error: #error "link pointing to the build environment located at "
/usr/include/linux/version.h:27:2: error: #error "/lib/modules/2.6.37.6-0.11-xen/build for use as &lt;path&gt;."
/usr/include/linux/version.h:28:2: error: #error ""
/usr/include/linux/version.h:29:2: error: #error "If you are seeing this message, your environment is "
/usr/include/linux/version.h:30:2: error: #error "not configured properly. "
/usr/include/linux/version.h:31:2: error: #error ""
/usr/include/linux/version.h:32:2: error: #error "Please adjust the Makefile accordingly."
/usr/include/linux/version.h:33:2: error: #error "======================================================="
In file included from /usr/src/linux/include/linux/kernel.h:15:0,
                 from /usr/src/linux/include/linux/sched.h:55,
                 from ../../include/linux/ftape.h:35,
                 from fc-10.c:65:
/usr/src/linux/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
In file included from /usr/src/linux/include/linux/kernel.h:15:0,
                 from /usr/src/linux/include/linux/cache.h:4,
                 from /usr/src/linux/include/linux/time.h:7,
                 from /usr/src/linux/include/linux/stat.h:60,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-internal.c:29:
/usr/src/linux/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
make[2]: Entering directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
gcc -Wall -Wstrict-prototypes -O2  -fomit-frame-pointer -fno-strength-reduce -D__KERNEL__ -I. -I../../include -I/usr/src/linux/include -D__SMP__ -DCONFIG_X86 -mpreferred-stack-boundary=2 -march=i586 -DMODULE -DMODVERSIONS -include ../../include/linux/modftversions.h    -c -o fdc-internal.o fdc-internal.c
grep: /usr/src/linux/include/linux/version.h: No such file or directory
grep: /usr/src/linux/include/linux/version.h: No such file or directory
In file included from /usr/src/linux/include/linux/stat.h:59:0,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-internal.c:29:
/usr/src/linux/include/linux/types.h:229:8: error: redefinition of ‘struct list_head’
In file included from /usr/src/linux/include/linux/module.h:9:0,
                 from fdc-internal.c:29:
../../include/linux/list.h:16:8: note: originally defined here
In file included from /usr/src/linux/include/linux/kernel.h:15:0,
                 from /usr/src/linux/include/linux/cache.h:4,
                 from /usr/src/linux/include/linux/time.h:7,
                 from /usr/src/linux/include/linux/stat.h:60,
                 from /usr/src/linux/include/linux/module.h:10,
                 from fdc-internal.c:29:
/usr/src/linux/include/linux/linkage.h:5:25: fatal error: asm/linkage.h: No such file or directory
compilation terminated.
make[2]: *** [fdc-internal.o] Error 1
make[2]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape/internal'
make[1]: *** [_modsubdir_internal] Error 2
make[1]: Leaving directory `/tmp/ftape/ftape/ftape-driver/ftape'
make: *** [all] Error 2


The /usr/src/linux/include/linux/linkage.h file has #include <asm/linkage.h> and the include file does not exist.

Is this a bug in openSUSE kernel sources?

How do I work around this?

So you have not applied the updates – generally part od the installation process.

I did select to install all of the relevant kernel modules.

You only need the Kernel Development Pattern – YaST will take care of everything else.

And did the following.

cd /usr/src/linux
cp /boot/config-3.4.6-2.10-default .config

Why??

The ftape install says to do a make dep there, but I did not. The last time I tried, it said that wasn’t necessary.

Within the ftape-driver directory I tried a make.

Is this a bug in openSUSE kernel sources?

No bug.
You have downloaded a tarball from 1996. If you read its documentation you will see that it was designed for linux kernel versions 1,x and 2.0.x. The INSTALL instructions say that you have to configure MCONFIG, but I doubt that a modern “make” would be compatible – I suspect that you would need to provide a new make environment.

If you are just trying to recover data from an old QIC tape, have you considered trying to install an older Linux distribution that includes ftape modules – probable SuSE <= 9.2.

I’m running openSUSE 12.2. I can’t upgrade because of an install defect in newer versions. I’ve opened a bug on that but it’s still open.

I believe kernel 2.4 would work, and maybe 2.5. The instructions have “…This package isn’t needed any longer when using ftape-4.03 (or later) with linux-2.4.0 (or later).”

Yes, I want to download some old tapes.

I googled suse 9.2 and could not find any links for download that worked. Where can I find an install with kernel 2.4 (or maybe 2.5)?

I meant update as in YaST > Software > Online Update
This is to get the bug fixes.

I believe kernel 2.4 would work, and maybe 2.5. The instructions have “…This package isn’t needed any longer when using ftape-4.03 (or later) with linux-2.4.0 (or later).”

Kernels (I think before 2.0.20) came with ftape. The kernel module and the ftape tools were included as a standard part of SuSE Linux. I used it occasionally up to about SuSE-6.4 (mostly we had SCSI tapes and hard disc drives).

I googled suse 9.2 and could not find any links for download that worked. Where can I find an install with kernel 2.4 (or maybe 2.5)?

9.2 was the first SuSE that had downloadable iso images, so it must be available somewhere (sunsite?). I think that it will not be so old as to not work on a modern machine. But then you have a floppy disc interface. I have a bunch of old CDs, but it might take a while to dig them out. I am busy just now, but if I can find suitable images I will upload them for you.

On 2014-04-17 16:46, eng-int wrote:

> I googled suse 9.2 and could not find any links for download that
> worked. Where can I find an install with kernel 2.4 (or maybe 2.5)?
> 9.2 was the first SuSE that had downloadable iso images, so it must be
> available somewhere (sunsite?).

qwdg?

ftp5.gwdg.de/pub/opensuse/discontinued/distribution/

goes back to 10.2, but

ftp5.gwdg.de/pub/linux/suse/discontinued/i386/

goes back to 7.3


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2014-04-17 17:03, Carlos E. R. wrote:
> On 2014-04-17 16:46, eng-int wrote:
>
>> I googled suse 9.2 and could not find any links for download that
>> worked. Where can I find an install with kernel 2.4 (or maybe 2.5)?
>> 9.2 was the first SuSE that had downloadable iso images, so it must be
>> available somewhere (sunsite?).
>
> qwdg?
>
>
> ftp5.gwdg.de/pub/opensuse/discontinued/distribution/
>
> goes back to 10.2, but
>
> ftp5.gwdg.de/pub/linux/suse/discontinued/i386/
>
> goes back to 7.3

Interestingly, they don’t have 9.2. or it is somewhere else. Also, the
‘update’ directories do not contain all versions.

Mind: 9.3 has DVD and CD isos, but 9.1 and previous versions do not.
Instead, they have floppy images, and one boot.iso which I believe was a
network install CD.

Up to some point in time, the install media had to be bought. About a
month after release, the files appeared on their ftp server, so that you
could do a network based install without buying the media.

For what you want, it appears that 9.1 should do. I can not say if 9.3
would.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

I got the 9.3 CDs and installed. But it still doesn’t work. It has kernel 2.6.11 and still says make dep is not necessary.

It did have the /dev/ftape defined though. So ftape is there somewhere. But no ftape utilities?

Ftape install says to disable kernel ftape before doing make on ftape download. I did that with menuconfig and ran make on the kernel. Compiled to the end. I did not make install yet.

But trying to make the downloaded ftape gets many errors.

I’ve downloaded the kernel-2.4.0.tar.gz. Maybe if I make that it will work?

Can you not just make the ftape-tools? The kernel module seems to be already installed.

I have not found the 9.2 DVD/CDs yet, which I think will be the best for your purpose. I am too busy trying to recovering a damaged database to investigate much at the moment. I did find the 9.2 box and manuals, but no media. I found the 8.1 media though. SuSE Linux 8.1 is close in architecture to your ftape tarball. For a limited time you can dounload the DVD image from:
http://do2.eng-int.net/pub/SuSE.old/

I got the 8.1 DVD and installed it. It did have kernel 2.4.19. But it still doesn’t work.

Got errors in a kernel module:

/usr/src/linux/include/linux/sched.h

Something about not being able to handle variables defined as int variable:1;

Then I downloaded linux-2.4.0 and linked /usr/src/linux to it. It blew up with timer.c:35: conflicting types for ‘xtime’.

Nothing works.

I do not Understand This. What doesn’t work?
The reference to /usr/src indicates that you are trying to compile something. Both SuSE-8.1 and SUSE-9.3 (32bit only) include ftape drivers by default. Try

ls -lh /dev/*tape*

find /lib/modules/ -path "*tape*

"

I do not have a floppy tape drive, but I loaded SuSE-8.1 in a VBox vm, and mt seemed to connect to the socket ok. I have a SCSI tape drive on another (SCO UNIX and Yggdrasil Linux) box. The mt command on 8.1 was able to read and rewind a tape in the remote machine.

Have you looked at the “Ftape-HOWTO” from the Linux Documentation Project? Also “man mt” – that does not seem to have changed in 20 years.

.

Then I downloaded linux-2.4.0 and linked /usr/src/linux to it. It blew up with timer.c:35: conflicting types for ‘xtime’.
Nothing works.
I do not want to attempt understanding the rationale for that move!