Which packages are needed to compile a kernel module?

I have openSuse 12.1 lol! after being a loyal ubuntu follower since 2007 (11.10 onward failed to recognize my Lexmark printer!)

I want to compile a module from the source code - the “**samsung-backlight driver”

Which packages do I need installing?

I have followed the instructions on comment #3

http://forums.opensuse.org/english/get-technical-help-here/laptop/455979-opensuse-11-4-samsung-r580-gf-330m.html

Yet when I “sudo make”

I get the following error

make -C /lib/modules/3.1.10-1.16-default/build M= modules
make[1]: Entering directory /usr/src/linux-3.1.10-1.16-obj/i386/default' Using /usr/src/linux-3.1.10-1.16 as source for kernel GEN /usr/src/linux-3.1.10-1.16-obj/i386/default/Makefile CHK include/linux/version.h CHK include/generated/utsrelease.h make[4]: *** No rule to make target kernel/bounds.c’, needed by kernel/bounds.s'. Stop. make[3]: *** [prepare0] Error 2 make[2]: *** [sub-make] Error 2 make[1]: *** [all] Error 2 make[1]: Leaving directory /usr/src/linux-3.1.10-1.16-obj/i386/default’
make: *** [all] Error 2

Do I need the full source for the kernel installed?
Are there any packages that I am missing?

Regards

**

I guess you have installed the Basic developement pattern because you have make. I think that installiing the package* kernel-source* is a good idea.

What is also a good idea is not running the make as root. Only installing must be done as root.

Also please use CODE tags when posting computer text here: http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html And when yyou do that copy/paste including the prompt, the command, the output and the next prompt. Then there is no need to say

**Yet when I “sudo make”

I get the following error**

because it is all there.

hcvv wrote:
>
> I guess you have installed the Basic developement pattern because you
> have -make.- I think that installiing the package- kernel-source- is a
> good idea.
>
> What is also a good idea is not running the -make- as root. Only
> installing must be done as root.
>
> Also please use CODE tags when posting computer text here:
> http://tinyurl.com/2wwx7l9 And when yyou do that copy/paste including
> the prompt, the command, the output and the next prompt. Then there is
> no need to say
>> Yet when I “sudo make”
>>
>> I get the following error

> because it is all there.
>
>
You need to install the kernel devel pattern,


zypper in -t pattern devel_kernel

and as hcvv say, NEVER make nothing as root

No.

Type:

$ zypper info -t pattern devel_kernel

intead of zypper in ( = install) and you’ll notice which packages you are missing.

You need the kernel-devel package (not to be confused with the devel_kernel pattern) that matches the installed kernel - meaning if it is not alreading installed you MUST update your kernel first. See this post http://forums.opensuse.org/english/get-technical-help-here/how-faq-forums/unreviewed-how-faq/477573-nvidia-newbies-using-opensuse-12-2-a-2.html#post2481161. It’s about the same story.

@simonjames,
If you followed the instructions in this post http://forums.opensuse.org/english/get-technical-help-here/laptop/455979-opensuse-11-4-samsung-r580-gf-330m.html#post2337959 (which was meant for 11.4 btw), you already have the required packages. From which directory are you running the ‘make’ command?

Thanks for replies.:slight_smile:

Installed kernel-devel package

I get the same error messages as before.

will try the other suggestions.

On Wed, 29 Aug 2012 21:16:03 GMT, simonjames
<simonjames@no-mx.forums.opensuse.org> wrote:

>
>Thanks for replies.:slight_smile:
>
>Installed kernel-devel package
>
>I get the same error messages as before.
>
>will try the other suggestions.

When you use yast to install stuff, you can use what is called “patterns”.
Installing development software by patterns is really the best choice. It
brings in a lot of related stuff that is not actual dependencies. Really
worthwhile.

?-)