LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-01-2007, 06:29 AM   #16
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48

Quote:
Originally Posted by bonder View Post
How do I find what packages I need to install? I've run
Code:
sudo apt-get install linux-headers-`uname -r`
from the command line, but this doesn't change anything.
That looks pretty reasonable (sorry I don't know Ubuntu's package naming conventions). What do you mean nothing changed? Did anything get installed?

Try command

dpkg -L linux-headers-`uname -r`

This should list all files in the package, and in particular the directory they are located in. Then you can set KERNEL_SOURCES to match.

NemoTheBlue: if you can get the .deb package on to your PC you can install it with:

sudo dpkg -i <package-file>

(assuming Ubuntu has dpkg similar to standard Debian).

Last edited by maroonbaboon; 10-01-2007 at 06:30 AM. Reason: fix line break
 
Old 10-02-2007, 07:28 AM   #17
NemoTheBlue
LQ Newbie
 
Registered: Sep 2007
Distribution: Ubuntu 7.04 Server
Posts: 8

Rep: Reputation: 0
Nice one, maroonbaboon. I've downloaded the headers package and emailed it to myself at home. Once I'm home from work, I'll give your advice a shot. Will the headers install themselves into the default directory in which make was searching? Or will I still need to amend the makefile?
 
Old 10-02-2007, 04:27 PM   #18
NemoTheBlue
LQ Newbie
 
Registered: Sep 2007
Distribution: Ubuntu 7.04 Server
Posts: 8

Rep: Reputation: 0
Ok, now I'm getting a little frustrated. I copied over the proper headers and installed them with no errors using dpkg, but /lib/modules/2.6.20-15-server/build/ is still empty! What am I doing wrong?

I installed linux-headers-2.6.20-15 and then linux-headers-2.6.20-15-server (the former were a dependency of the latter according to dpkg)

I'm still getting the exact same "*** No rule to make target 'modules'. Stop." Is it possible I've done something ridiculously stupid like putting the source files in the wrong directory?

I even changed the line in Makefile from "shell uname -r" to "2.6.20-15-server"

Any advice?
 
Old 10-02-2007, 06:15 PM   #19
bonder
LQ Newbie
 
Registered: Sep 2007
Distribution: Debian Lenny
Posts: 9

Rep: Reputation: 0
I uninstalled and reinstalled the headers, and that appears to have taken care of my problem after I edited the KERNEL_SOURCES back to the original state. Now it seems to be working almost properly, though, the last 3 lines of output when I run make are:
Code:
!!! WARNING: Module file much too big (>1MB)
!!! Check your kernel settings or use 'strip'
*** Module rt73.ko built successfully
I'm going to poke around to try to fix this before running make install. Thanks for your help in getting over the first hurdle.

Edit: I found the fix:
Code:
sudo strip -S rt73.ko
and I got the driver installed.

Last edited by bonder; 10-02-2007 at 06:30 PM.
 
Old 10-02-2007, 06:56 PM   #20
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Quote:
Originally Posted by NemoTheBlue View Post
Ok, now I'm getting a little frustrated. I copied over the proper headers and installed them with no errors using dpkg, but /lib/modules/2.6.20-15-server/build/ is still empty! What am I doing wrong?
Like I suggested to bonder, the command

dpkg -L linux-headers-`uname -r`

should tell you where the package has installed the header files (assuming they match the kernel you are running, as determined by the output of uname -r).

The KERNEL_SOURCES variable in the Makefile should point to the same place. You may even be able to revert back to the original Makefile if the headers are installed.

Quote:
I installed linux-headers-2.6.20-15 and then linux-headers-2.6.20-15-server (the former were a dependency of the latter according to dpkg).
I'm not familiar with this setup. The usual place to have the kernel headers is

/lib/modules/<whatever uname -r says>/build

but I have some recollection that Ubuntu might use something different.

Quote:
Is it possible I've done something ridiculously stupid like putting the source files in the wrong directory?
Not really, the packaging system, via dpkg, decides where they go.

Quote:
I even changed the line in Makefile from "shell uname -r" to "2.6.20-15-server"
Same thing, assuming command 'uname -r' returns that string. Anyway dpkg -L will hopefully tell you where the files are and you can put it in explicitly.

Last edited by maroonbaboon; 10-02-2007 at 06:58 PM. Reason: formatting error
 
Old 10-03-2007, 03:30 PM   #21
NemoTheBlue
LQ Newbie
 
Registered: Sep 2007
Distribution: Ubuntu 7.04 Server
Posts: 8

Rep: Reputation: 0
Thanks again MB! I'm afraid I'm still stuck, though. dpkg -L gave me a long list of directories, all but the last beginning /usr/src/linux-headers-2.6.20-15-server. The last one in the list was /lib/modules/2.6.20-15-server/build.

However, the /build directory is still empty. That really shouldn't be, should it? I didn't receive a single error message or see anything suspicious when I installed both header packages, which lead me to believe they installed without a hitch, but shouldn't they have populated the /build directory?
 
Old 10-03-2007, 06:12 PM   #22
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
That 'build' directory might be a symbolic link (i.e. a pointer to another directory). If you run

ls -l /lib/modules/2.6.20-15-server/build

it will show if it is a link (look out for the '->'). The directory you are looking for should contain (at least) as subdirectory called 'include/linux'. This directory is what KERNEL_SOURCES should be set to. It may be that 'build' is a just a link to this. That's the setup on my Debian system.

All this apparent complexity is in fact an attempt to get compatibility between different distros and kernel versions, but when something breaks it does make it more difficult to see what is wrong.
 
Old 10-04-2007, 02:41 PM   #23
NemoTheBlue
LQ Newbie
 
Registered: Sep 2007
Distribution: Ubuntu 7.04 Server
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by maroonbaboon View Post
That 'build' directory might be a symbolic link (i.e. a pointer to another directory). If you run

ls -l /lib/modules/2.6.20-15-server/build

it will show if it is a link (look out for the '->'). The directory you are looking for should contain (at least) as subdirectory called 'include/linux'.
Ok, I ran that command and the only output was "total 0" so /build really is empty. I can tell you that there is an instance of the /include/linux directory within both of the headers (linux-headers-2.6.20-15 and linux-headers-2.6.20-15-server) directories in /usr/src.

I should specify now that I'm trying to install a different driver than Bonder, and my Makefile is quite different.

The first five lines read (as I have already amended):

KVER := 2.6.20-15-server
KDIR := /lib/modules/$(KVER)/build
KMISC := /lib/modules/$(KVER)/kernel/drivers/net
KEXT := $(shell echo $(KVER) | sed -ne 's/^2\.[567]\..*/k/p')o
KFLAG := 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x

I figure they're the most pertinent to the thread. If I've understood you so far, the KDIR is instructing make where to search for the /include/linux directory, so should I change that line to read /usr/src/linux-headers-2.6.20-15-server/ ? The KMISC line appears to be correct as I've checked that directory exists and is indeed full of drivers (I assume .ko files are drivers)

I genuinely appreciate all your help so far; do you think you can see this through with me?
 
Old 10-04-2007, 07:00 PM   #24
maroonbaboon
Senior Member
 
Registered: Aug 2003
Location: Sydney
Distribution: debian
Posts: 1,495

Rep: Reputation: 48
Nice to see you are so determined! Yes, it looks like you should change KDIR as you suggest (forget the '/' at the end tho'). This is all assuming that the output of 'uname -r' really is 2.6.20-15-server. You can check the others by opening a terminal and entering (just cut and paste onto the command line)

KVER=2.6.20-15-server
echo 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x

This should show you what KFLAG actually expands to. Same with the others.

Anyway, it looks OK to me. Post the error message if it fails again.
 
Old 07-09-2008, 05:27 AM   #25
madkevo
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
Hi,
sorry to resurrect such an old thread, but was using this to try to install a Realtek R8168 driver under RedHat EL4 U5 and was getting the same error message.
I tried lots of things with the Makefile etc, but in the end it turned out that the path to the source files for the driver contained a space (I had copied the directory structure from a Windows machine) - once I renamed the directory, losing the space, the drivers compiled straight away.
Hopefully this'll help someone else at some stage.
All the best,
Kevin.
 
Old 07-09-2008, 06:39 AM   #26
pellicle
Member
 
Registered: Jul 2008
Location: Finland
Distribution: RHEL4
Posts: 137

Rep: Reputation: 15
HiYa

Quote:
Originally Posted by madkevo View Post
Hi,
sorry to resurrect such an old thread,
well I'm glad you did, as I hadn't noticed it was old till you said that at the end. I'm having exactly the same sorts of troubles with my system and a NIC.

I'm spending days (not hours) on this, and its making me wonder when I ever had this sort of problem with Apple -> DOS -> Win 3.1 -> Win anything.

sigh..

still ... its all worth it (I'm told).
 
Old 03-19-2009, 09:14 AM   #27
hinesbx
LQ Newbie
 
Registered: Mar 2009
Location: Huntsville, AL
Distribution: SuSE Linux (currently upto 10)
Posts: 2

Rep: Reputation: 0
Unhappy make[1]: *** No rule to make target `modules'.

I am experiencing this for the first time. I have done a couple of (would kernel re-links be accurate?) these before just following doc, this is the first problem.

Is the reason for the error messages due to the fact that the LINUX
versions are different?

I see all of the suggestions in the previous posts. I will have to figure out how to display headers and some of the other stuff before I can tackle fixing it.


make -C /usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp
SUBDIRS=/usr/vpn/vpnclient modules
make[1]: Entering directory
`/usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory
`/usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp'
make: *** [default] Error 2
Failed to make module "cisco_ipsec.ko".



I'm a Transplanted z/VM-z/OS system programmer so this is all new.
 
Old 01-14-2018, 06:58 PM   #28
pictsidhe
LQ Newbie
 
Registered: Jan 2018
Posts: 4

Rep: Reputation: Disabled
Solution, for some

I too was blundering around in the dark. I'd tried a mkdir for ../build, which hadn't worked, then I found I need to install the headers. That didn't fix it either. After discovering that ..build is a symlink, I did the following

rmdir the empty ../build directory I created
apt purged the headers
apt installed the headers

apt install --reinstall may work too
 
1 members found this post helpful.
  


Reply


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
make: *** No rule to make target `mrproper'. Stop. dauphinfay Linux - General 7 11-24-2014 07:35 AM
Belkin Wirless G RTL8185L make[1]: *** No rule to make target `Makefile'. Stop. SilverRock Linux - Wireless Networking 2 02-11-2007 07:25 AM
linux-wlan-ng: No rule to make target `modules'. Stop. johnc2k Linux - Software 1 01-26-2007 05:19 PM
make: *** No rule to make target 'gconfig'. Stop. cswake Slackware 4 10-10-2004 12:13 PM
*** No rule to make target `modules'. Stop. kmack2001 Linux - Newbie 9 02-16-2004 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:01 PM.

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