1

I'm trying to build a Linux Device Driver for a Devkit 8000. I'm getting the following errormessage:

Error Message

When I try to follow it's directions I get asked a bunch of yes/no questions I don't really understand. In the end, I get to choose between 25 different processors(?):

Processor selection

Here's my makefile:

ifeq ($(KERNELRELEASE),)

KERNELDIR = ~/sources/linux-3.2.6
PWD := $(shell pwd)
modules:
$(MAKE) ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- -C $(KERNELDIR) M=$(PWD) modules

.PHONY: modules clean

else
# called from kernel build system: just declare what our modules are
obj-m := LED_timer.o
endif

I don't think my code itself is relevant yet, plus I know that my sourcecode is riddled with bugs, you don't want to see that, haha.

2 Answers2

0

You haven't said where you got the source you are using, but evidently there's an invalid .config in it. This is used to set various options, such as the processor type. There are literally hundreds of these options with intricate dependencies upon one another (e.g., what processor you choose will affect what other choices you have).

The vanilla source has no .config in it; you need to either provide or create one. make oldconfig is used when the .config is from a previous version, and must be updated. Sometimes this process cannot be completely automated and you end up basically running make config, which uses a CLI interface; this might also be what happens if you try make oldconfig with no config.

You should look at the more graphical make menuconfig to get a better perspective on what this is all about.

However, starting from nothing and trying to get a config that will work for you is going to be impossible unless you know what you are doing. Ideally, you would start with the one used to create your running kernel. This is especially true if you are just building a module; while you don't need to build the actual kernel, in order to compile the module it must be known how the kernel it is to be used for was compiled.

Hopefully, you can find that at /proc/config.gz on the target system. This is not an on disk file, the system must be running in order to retrieve it. It's gzipped so

gunzip config.gz
mv config .config

Should do it. Copy that into your source tree and run make menuconfig to add instructions for the module you want to build.

If that doesn't exist, you're going to have to track down the config that was used. Note also that you need to use the exact same kernel version if you are building a module.

Here's a general overview of the compilation process, which might also be helpful, read #2 and 3 first.

goldilocks
  • 87,661
  • 30
  • 204
  • 262
  • Thanks for the long answer but this just seems like a really really long solution for something that should just work. I'll set it to soluted, since I do not have the time to read all this (I won't be using Linux next year, this is just an exercise)

    I'll ask my teacher tomorrow, even though the hand-in is due tomorrow. Again, thank you for the long answer.

    – Mathias Siig Nørregaard Nov 17 '14 at 19:20
0

First we have to clear the old config, like make mrproper.

After that freshly run make menuconfig. If you selected unwanted items definitely, .config won't be created.

Greenonline
  • 1,851
  • 7
  • 17
  • 23