Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am working on fedora core 8 installed as a guest OS on a vmware server
i am trying to generate a sample kernel object file called a .ko file from a .c file to print "hello world".
i have written a Makefile to compile the .c file and generate a .ko file.
both the files are as follows:
now when i type the "make" command i get the following error:
make -C /lib/modules/2.6.23.1-42.fc8/build SUBDIRS=root/hash123/test modules
make: *** /lib/modules/2.6.23.1-42.fc8/build: no such file or directory. Stop.
make: *** [default] Error 2
can anybody tell me what is the problem and how to solve the problem?
You can either use the graphical interface or the command line. Using the graphical interface is as simple as selcting "Add/Remove Software" from the "System -> Administration" menu. Using the command line is as simple as running the following command from a terminal:
Code:
yum install kernel-devel-2.6.23.1-42
Don't bother about the installation path: it is hardcoded in the package itself and all the files will be installed in the standard locations. Obviuosly - as you expect - the kernel source will be installed under /usr/src.
i have successfully installed the required rpm and
now when type make at the commandline it gives the following error:
[root@dlhgn47dhcp157 test]# make
make -C /usr/src/kernels/2.6.23.1-42.fc8-i686/ SUBDIRS=/root/hash123/test modules
/usr/src/kernels/2.6.23.1-42.fc8-i686/scripts/gcc-version.sh: line 16: gcc: command not found
/usr/src/kernels/2.6.23.1-42.fc8-i686/scripts/gcc-version.sh: line 17: gcc: command not found
make[1]: gcc: Command not found
make[1]: Entering directory `/usr/src/kernels/2.6.23.1-42.fc8-i686'
CC [M] /root/hash123/test/hello.o
/bin/sh: gcc: command not found
make[2]: *** [/root/hash123/test/hello.o] Error 127
make[1]: *** [_module_/root/hash123/test] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.23.1-42.fc8-i686'
make: *** [default] Error 2
You could try making the symbolic links manually with 'ln -s /usr/src/kernels/2.6.23.1-42.fc8-i686/ /lib/modules/2.6.23.1-42.fc8/build; ln -s /usr/src/kernels/2.6.23.1-42.fc8-i686/ /lib/modules/2.6.23.1-42.fc8/source' (but they *should* be there) or change your KDIR to read "KDIR := /usr/src/kernels/2.6.23.1-42.fc8-i686".
Why would you want to do that? (rhetorical question - sorry)
1.) you can install the .rpm directly - but is does have dependencies _you_ need to solve then
2.) you build your own compiler...mmh ...no - you need a compiler for this
You could use yum to install it temporarily - build your own - and deinstall the one installed by yum
is there any other way to install the gcc compiler without using yum ?
Use the graphical interface (as suggested above). From the Gnome Menu -> System -> Administration -> Add/Remove Software. yum from command line is the quicker method, anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.