3
votes

So I am trying to write a simple hello module no need to say a newbie :)

however while following steps to create a make file - what I saw was I didnot have build folder at uname -r/build so I created one - not sure that itself should be problem as in instead of creating build folder if I am suppose to download some package ?

Also looking online there is solution which says I need to do below steps

prepare-kernel-sources cd /usr/src/linux - now turns out I dont i have linux folder too cp -rf include/generated/* include/linux/

make: Entering directory `/lib/modules/2.6.32-5-amd64/build'
make: *** No rule to make target `modules'.  Stop.
make: Leaving directory `/lib/modules/2.6.32-5-amd64/build'

I have tried to install following packages - only the highlighted ones goes through rest gives error

**apt-get install linux-headers-$(uname -r)**  goes through
apt-get install Linux-headers-generic
apt-get install build-essentials
apt-cache search linux-headers-$(uname -r)
apt-get install kernel-source-$(uname -r)
**apt-get source linux-image-$(uname -r)**   goes through

Can someone please help ?

1
Do you have the kernel development packages installed on your system?Etan Reisner
@EtanReisner - I have updated the question with things I have tried to install post the error based on research online - but majority of things are giving me error - ln btw flavor is debian on which I am tryingthedreamer
And did you try compiling again after installing those two packages? (I doubt apt-get source is helpful here though as that probably just grabbed the sources used to build the Debian package itself.)Etan Reisner
@EtanReisner - I have updated the answer - turns out it was because of missing system link . I have posted the answer if someone else trips on same issuethedreamer

1 Answers

5
votes

Finally I found the answer - Missing part was establishing system link.

Below steps solved the issue.

apt-get install linux-headers 
ln -s /usr/src/linux-headers-2.6.32-5-amd64/ /lib/modules/2.6.32-5-amd64/build