Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-17-2011, 06:14 PM   #1
LQ Newbie
Registered: Jan 2011
Location: Texas
Posts: 2

Rep: Reputation: 0
Problem installing driver for FTDI converter cable on my linux system

Hi everybody,
I'm new to linux, so sorry if this turns out to be a no-brainer.

I'm trying to install an FTDI usb to serial converter driver on a linux machine (kernel: Linux, on a Phytec LPC3250 board) and it's not working for me. The driver itself comes with some c code and a makefile (got the driver from here:, the 1.5.0 version for linux). When I try running make, I get the following error:

1 [root@nxp /ftdi_sio]# make
2 /ftdi_sio/Rules.make:24: /lib/modules/ No such file or directory
3 make: Warning: File `/ftdi_sio/Rules.make' has modification time 1.1e+09 s in the future
4 make: *** No rule to make target `/lib/modules/'. Stop.

where 1...4 are line numbers that I added for clarity.

When I try to access the /lib/modules/ directory, I find that it is a symbolic link to the /usr/src/linux directory, and when I cd to /usr, there is no src directory! I think this might be a problem with the way I configured my kernel or something, but I'm not sure.

I think I need to have a .config file or something, but I have no idea how to get it. I used the linux target image builder (ltib) to build my kernel, and I tried messing around with the options there to find something about the .config file, but no luck. I also tried looking around online and the ftdi website for any info about this type of problem, but no one else seems to have trouble installing the driver, just me...

Can anyone help? If you need more info, I'd be happy to provide it.

Thanks in advance.
Old 01-18-2011, 11:58 AM   #2
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252

Some sourcecode packages are rather simple to install (just "./configure && make && make install"). However, if all you have is a "Makefile" and a few *.c files, you'll need to review the Makefile.

I pulled down the 1.5.0 version for x86_64 and saw that it's pretty dry....

luser@boxen(Linux)ftdi_sio$ ls -lb
total 148
-rw-r--r-- 1 luser lgrp  78536 Dec  1  2008 ftdi_sio.c
-rw-r--r-- 1 luser lgrp  38004 Dec  1  2008 ftdi_sio.h
-r-xr-xr-x 1 luser lgrp    551 Jan 10  2006 Makefile
-r-xr-xr-x 1 luser lgrp   2497 Jan 10  2006 Rules.make
The Makefile doesn't offer much help....

# This Makefile has been simplified as much as possible, by putting all
# generic material, independent of this specific directory, into
# ../Rules.make. Read that file for details
# The usb serial headers
INCLUDEUSBSER := $(shell echo "/usr/src/linux-`uname -r`/drivers/usb/serial/")
TOPDIR  := $(shell pwd)
include $(TOPDIR)/Rules.make
OBJS = ftdi.o
all: $(OBJS)
ftdi.o: ftdi_sio.o
        $(LD) -r $^ -o $@
        install -d $(INSTALLDIR)
        install -c $(OBJS) $(INSTALLDIR)
        rm -f *.o *~ core
But the real gold is in the Rules.make file...
# -*-makefile-*-
# This file is part of the sample code for the book "Linux Device Drivers",
# second edition. It is meant to be generic and is designed to be recycled
# by other drivers. The comments should be clear enough.
# It partly comes from Linux Makefile, and needs GNU make. <>
# TOPDIR is declared by the Makefile including this file.
ifndef TOPDIR
        TOPDIR = .
# KERNELDIR can be speficied on the command line or environment
        KERNELDIR := $(shell echo "/lib/modules/`uname -r`/build")
# The headers are taken from the kernel
        INCLUDEDIR = $(KERNELDIR)/include
# We need the configuration file, for CONFIG_SMP and possibly other stuff
# (especiall for RISC platforms, where CFLAGS depends on the exact
# processor being used).
ifeq ($(KERNELDIR)/.config,$(wildcard $(KERNELDIR))/.config)
        include $(KERNELDIR)/.config
        MESSAGE := $(shell echo "WARNING: no .config file in $(KERNELDIR)")
# ARCH can be speficed on the comdline or env. too, and defaults to this arch
# Unfortunately, we can't easily extract if from kernel configuration
# (well, we could look athe asm- symlink... don't know if worth the effort)
ifndef ARCH
  ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
                -e s/arm.*/arm/ -e s/sa110/arm/)
# This is useful if cross-compiling. Taken from kernel Makefile (CC changed)
CC      =$(CROSS_COMPILE)gcc
CPP     =$(CC) -E
# The platform-specific Makefiles include portability nightmares.
# Some platforms, though, don't have one, so check for existence first
ifeq ($(ARCHMAKEFILE),$(wildcard $(ARCHMAKEFILE)))
  include $(ARCHMAKEFILE)
# CFLAGS: all assignments to CFLAGS are inclremental, so you can specify
# the initial flags on the command line or environment, if needed.
        CFLAGS += -D__SMP__ -DSMP
# Prepend modversions.h if we're running with versioning.
        CFLAGS += -DMODVERSIONS -include $(KERNELDIR)/include/linux/modversions.h
#Install dir
VERSIONFILE = $(INCLUDEDIR)/linux/version.h
VERSION     = $(shell awk -F\" '/REL/ {print $$2}' $(VERSIONFILE))
INSTALLDIR = /lib/modules/$(VERSION)/misc
The .config file they're talking about is generated when you run "make menuconfig" (while in your kernel source directory)....or if you can get the .config file used to compile your current kernel (which might be included in the kernel-development packages for your Linux Distribution).

Easiest thing I can suggest is to look for /proc/config.gz (a copy of the .config stored in the running kernel). Just ungzip that puppy into your kernel source directory.

However, a word of warning....BACKUP YOUR KERNEL SOURCE FIRST!!!! I've seen poorly written drivers freak-out a system before, then you forget they're in your source-code directory when you go to recompile a kernel....

...What Linux Distribution are you running?

Last edited by xeleema; 01-18-2011 at 12:04 PM.
1 members found this post helpful.
Old 01-18-2011, 09:47 PM   #3
LQ Newbie
Registered: Jan 2011
Location: Texas
Posts: 2

Original Poster
Rep: Reputation: 0
Hey xeleema,
Thanks for your help. I was able to gunzip the config file and use it, and it solved my immediate problem. Hopefully I won't have too much more trouble with it.

FYI though, I'm using a general linux kernel (if that makes sense). It's just plain linux, on an embedded system.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
FTDI driver for MIPS netbook vertexm Linux - Laptop and Netbook 0 08-16-2010 09:53 PM
USB serial driver(ftdi): there is error in receive data plumnut Linux - Newbie 0 03-23-2009 07:30 AM
help for installing driver pl2303, USB to serial converter Misbah Naveed Linux - Newbie 2 07-13-2008 02:36 PM
ftdi serial to usb converter rightsidedown Linux - Hardware 1 04-29-2008 05:36 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration