Cannot compile tape kernel module

sebelk asked:

I’m trying to build IBM lin_tape module for a Ultrium LTO-5 tape device, but it’s failing

The OS is a Centos 5.4 x.86_64

When I run:

rpmbuild –rebuild lin_tape-1.76.0-1.src.rpm

It outputs as follows:

Installing lin_tape-1.76.0-1.src.rpm

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.42840

+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf lin_tape-1.76.0
+ /bin/gzip -dc /usr/src/redhat/SOURCES/lin_tape-1.76.0.tgz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd lin_tape-1.76.0
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.42840
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd lin_tape-1.76.0
+ LANG=C
+ export LANG
+ unset DISPLAY
++ echo x86_64-redhat-linux-gnu
++ cut -f 1 -d -
+ p=x86_64
+ '[' x86_64 == i386 ']'
+ '[' x86_64 == i586 ']'
+ '[' x86_64 == i686 ']'
+ '[' x86_64 == ppc64 ']'
+ '[' x86_64 == powerpc ']'
+ '[' x86_64 == powerpc64 ']'
+ '[' x86_64 == s390 ']'
+ '[' x86_64 == s390x ']'
+ '[' x86_64 == ia64 ']'
+ '[' x86_64 == x86_64 ']'
+ proc=AMD
+ cp -af lin_tape_359X_AMD.ReadMe lin_tape_359X.ReadMe
+ cp -af lin_tape_Ultrium_AMD.ReadMe lin_tape_Ultrium.ReadMe
+ make KERNEL=2.6.30.5-UP PROC=x86_64 driver
make -C /lib/modules/2.6.30.5-UP/build SUBDIRS=/usr/src/redhat/BUILD/lin_tape-1.76.0 PWD=/usr/src/redhat/BUILD/lin_tape-1.76.0 clean
make[1]: Entering directory `/usr/src/kernels/linux-2.6.30.5'
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.30.5'
mkdir bldtmp
make KERNEL=2.6.30.5-UP compileclean lin_tape.ko
make[1]: Entering directory `/usr/src/redhat/BUILD/lin_tape-1.76.0'
export PWD
make -C /lib/modules/2.6.30.5-UP/build SUBDIRS=/usr/src/redhat/BUILD/lin_tape-1.76.0 PWD=/usr/src/redhat/BUILD/lin_tape-1.76.0 modules
make[2]: Entering directory `/usr/src/kernels/linux-2.6.30.5'
  CC [M]  /usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_scsi_config.o
/usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_scsi_config.c: In function 'lin_tape_bind_device':
/usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_scsi_config.c:1833: warning: ignoring return value of 'device_bind_driver', declared with attribute warn_unused_result
  CC [M]  /usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_scsi_tape.o
  CC [M]  /usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_scsi_trace.o
  CC [M]  /usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_ioctl_tape.o
/usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_ioctl_tape.c: In function 'lin_tape_blk_rq':
/usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_ioctl_tape.c:5822: error: 'struct request' has no member named 'resid_len'
make[3]: *** [/usr/src/redhat/BUILD/lin_tape-1.76.0/lin_tape_ioctl_tape.o] Error 1
make[2]: *** [_module_/usr/src/redhat/BUILD/lin_tape-1.76.0] Error 2
make[2]: Leaving directory `/usr/src/kernels/linux-2.6.30.5'
make[1]: *** [lin_tape.ko] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/lin_tape-1.76.0'
make: *** [bldtmp/lin_tape-2.6.30.5-UP.ko] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.42840 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.42840 (%build)

End of Output

any idea?

Thanks in advance!

My answer:


You’ve replaced the standard EL5 kernel with a newer custom kernel, in which the programming interfaces (ABI/API) are different.

To quote from the install.README you should have received along with the source RPM:

IBM does not guarantee correct operation of the lin_tape driver on any other kernel or operating system.

Unfortunately you didn’t mention why this system has a custom kernel, so the advice will be limited. Some options available to you include:

  1. Evaluate why this server has a custom kernel and consider whether it can be replaced with the supported kernel.
  2. Install the tape drive and driver on another server which runs the supported kernel.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.