• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Install linux-headers  (Read 1031 times)
byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« on: August 16, 2010, 03:34:12 PM »

Trying to compile a usb module.  It appears that I need to install linux headers for my version of linux.  uname - reports:

Linux SheevaUno 2.6.35.2 #1 PREEMPT Fri Aug 13 22:01:35 MDT 2010 armv5tel GNU/Linux

...but... sudo apt-get install linux-headers-$(uname -r)

...gives me...  E: Couldn't find package linux-headers-2.6.35.2

sudo apt-cache search linux-headers*

...reports a bunch of 2.6.28-13 thru 2.6.28.19 available packages.

Don't know anything about compiling - just trying to follow the instructions that came with the usb module package I'm trying to compile. 

For kernel updates, I've been following the instructions here: http://plugcomputer.org/plugforum/index.php?topic=1047.msg6409#msg6409   ...and I've also copied over the modules.

I see the header files at http://sheeva.with-linux.com/sheeva/

...but don't know how to install them.  I'm sure it's obvious that I'm totally lost!

Logged

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #1 on: August 17, 2010, 04:33:31 PM »

I see the header files at http://sheeva.with-linux.com/sheeva/

...but don't know how to install them.  I'm sure it's obvious that I'm totally lost!
  • Download sheeva-2.6.35.2-KernelHeaders.tar.gz and sheeva-2.6.35.2-KernelHeaders.tar.gz .md5
  • Check that the md5sum of the former matches the contents of the latter
  • Copy sheeva-2.6.35.2-KernelHeaders.tar.gz to the plug if it isn't already there.
  • On the Plug - cd /
  • tar xvzf ..../sheeva-2.6.35.2-KernelHeaders.tar.gz
Logged

byteman
Newbie
*

Karma: 1
Posts: 26


View Profile
« Reply #2 on: August 19, 2010, 08:07:21 AM »

OK birdman, thanks.

I installed the headers per your instructions - when I compile, I get this:
Code:
geoff@SheevaUno:~/cm19a$ make
Building X10-CM19A for 2.5/2.6 kernel...
   (make sure you have write access to your kernel source tree)
make -C /lib/modules/`uname -r`/build SUBDIRS=/home/geoff/cm19a modules
make: *** /lib/modules/2.6.35.2/build: No such file or directory.  Stop.
make: *** [all] Error 2
And here is my Makefile:
Code:
geoff@SheevaUno:~/cm19a$ cat Makefile
# Copyright (C) 2005 Michael LeMay
# All rights reserved

VERSION = 0.01
ADD_CPPFLAGS = -DMVERSION="\"$(VERSION)\""

.PHONY: all

ifneq ($(KERNELRELEASE),)   # Invoked by kbuild, symbols defined
EXTRA_CFLAGS = $(ADD_CPPFLAGS)
obj-m += x10-cm19a.o
x10-cm19a-objs := drivers/usb/comm/x10-cm19a.o

else   # Direct make invocation

KERNEL_VERSION = `uname -r`
KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
PWD  := $(shell pwd)
MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/comm/

# Kernel v.2.4.x not supported
ifeq ($(shell uname -r | cut -d. -f1,2), 2.4)

all:
        @echo "Sorry, kernel v.2.4.x not supported."
        @exit 1

else

all:
        @echo 'Building X10-CM19A for 2.5/2.6 kernel...'
        @echo '   (make sure you have write access to your kernel source tree)'
        $(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) modules

endif

install:
        mkdir -p $(MODULE_INSTALLDIR)
        install -c -m 0644 x10-cm19a.ko $(MODULE_INSTALLDIR)
        /sbin/depmod -ae

uninstall:
        rm -f $(MODULE_INSTALLDIR)/x10-cm19a.ko
        /sbin/depmod -aq

endif

##############################################################################
# OTHER TARGETS
##############################################################################
clean:
        rm -r -f drivers/usb/comm/*.o drivers/usb/comm/.x10-cm19a.o.cmd  *.o *.ko *.mod.* core *.i .x10* .tmp* Module.symvers

##############################################################################

Not sure what to try next - I see that the "build" and "source" symlinks point to an erroneous location, but have tried experimenting with several locations to no avail???
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 429


View Profile WWW
« Reply #3 on: August 19, 2010, 04:22:44 PM »

I see that the "build" and "source" symlinks point to an erroneous location, but have tried experimenting with several locations to no avail???
They are only erroneous for you - they made sense to the person who built the kernel in the first place.
As for "experimenting with several locations", you'll need to set them (both) to point to where your kernel source is i.e. where the main Makefile for the kernel build is.  So it looks like you'll need to install the stock kernel source too (from http://ftp://ftp.kernel.org/pub/linux/kernel/v2.6/).



Logged

Pages: [1]
Print
Jump to: