Re: Compiling ftape modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-03-01 at 03:56 +0000, Stephen Childress wrote:
> Dear Fedora List,
>      I posted a couple of weeks ago regarding my attempts to get ftape
> working on Fedora Core 3, since it no longer comes as a pre-compiled kernel
> module.  The suggestion at that time was to follow the directions in the
> release notes for compiling modules.  I've finally gotten back to working on
> this project.  Actually I had stumbled on the release notes before I posted
> but wasn't sure how to apply them to the task at hand.  Here is the question
> I have.  Quoting from the release notes, 
> 
> quote(( "For example, to build the foo.ko module, create the following file
> (named Makefile) in the directory containing the foo.c file:
> 
> obj-m    := foo.o
> 
> KDIR    := /lib/modules/$(shell uname -r)/build
> PWD    := $(shell pwd)
> 
> default:
>     $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
>               
> Issue the make command to build the foo.ko module." )) #end quote
> 
> Now, there are three modules that I need, ftape.ko, zftape.ko, and
> zft-compressor.ko.  The source files for these are in three directories
> under the drivers tree: lowlevel, zftape, and compressor.  Each directory
> has several .c and .h files as well as a Makefile, but there is no file
> named ftape.c, zftape.c, or zft_compressor.c.  The object module is created
> by linking several files together.  So my question is, what do I substitute
> for "foo.o" in the above makefile?  My strategy is going to be 1) Copy all
> .c and .h files to a temp directory.  2)  Create Makefile as above.  3)
> make.  4) Copy *.ko modules to appropriate directory in /lib/modules.  

This is a strategy that should work. Attached is what I think is a
suitable Makefile for the temp directory. It's basically a combined
version of the Makefile in the release notes plus the Makefiles in the
three module directories.

You'll probably want to run "strip -g *.ko" after building the modules,
before installing them to somewhere under /lib/modules/`uname -
r`/kernel/drivers and running "depmod -a"

Good luck!

Paul.
-- 
Paul Howarth <paul@xxxxxxxxxxxx>
#
#       Copyright (C) 1996, 1997 Clau-Justus Heine.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Source: /homes/cvs/ftape-stacked/ftape/lowlevel/Makefile,v $
# $Revision: 1.4 $
# $Date: 1997/10/07 09:26:02 $
#
#      Makefile for the lowlevel part QIC-40/80/3010/3020 floppy-tape
#      driver for Linux.
#

# ZFT_OBSOLETE - enable the MTIOC_ZFTAPE_GETBLKSZ ioctl. You should
#                leave this enabled for compatibility with taper.

PWD := $(shell pwd)
KDIR := /lib/modules/$(shell uname -r)/build

CONFIG_FTAPE := m
CONFIG_ZFTAPE := m
CONFIG_ZFT_COMPRESSOR := m

obj-$(CONFIG_FTAPE) += ftape.o
obj-$(CONFIG_ZFTAPE) += zftape.o
obj-$(CONFIG_ZFT_COMPRESSOR) += zft-compressor.o

ftape-objs := ftape-init.o fdc-io.o fdc-isr.o \
	      ftape-bsm.o ftape-ctl.o ftape-read.o ftape-rw.o \
	      ftape-write.o ftape-io.o ftape-calibr.o ftape-ecc.o fc-10.o \
	      ftape-buffer.o ftape-format.o ftape_syms.o

zftape-objs := zftape-rw.o zftape-ctl.o zftape-read.o \
	       zftape-write.o zftape-vtbl.o zftape-eof.o \
	       zftape-init.o zftape-buffers.o zftape_syms.o

zft-compressor-objs := zftape-compress.o lzrw3.o

ifeq ($(CONFIG_FTAPE),y)
ftape-objs += ftape-setup.o
endif

ifndef CONFIG_FT_NO_TRACE_AT_ALL
ftape-objs += ftape-tracing.o
endif

ifeq ($(CONFIG_FT_PROC_FS),y)
ftape-objs += ftape-proc.o
endif

EXTRA_CFLAGS := -DZFT_OBSOLETE

CFLAGS_lzrw3.o	:= -O6 -funroll-all-loops

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux