Difference between revisions of "How-to compile the Scull examples"

From Klaus' wiki
Jump to: navigation, search
(Created page with 'As root on your virtual server execute the following commands: <source lang="bash"> $ yum install gcc kernel-devel $ yum update # # If a new kernel came in restart the server # …')
 
Line 2: Line 2:
  
 
<source lang="bash">
 
<source lang="bash">
$ yum install gcc kernel-devel
+
$ yum install gcc kernel-devel ncurses-devel
 
$ yum update
 
$ yum update
 
#
 
#
Line 10: Line 10:
 
#
 
#
 
# Wait a few minutes and login once again
 
# Wait a few minutes and login once again
 +
#
 +
</source>
 +
 +
Now we need a local copy of the kernel sources. Follow the instructions on [http://wiki.centos.org/HowTos/I_need_the_Kernel_Source#head-a8dae925eec15786df9f6f8c918eff16bf67be0d Centos Wiki]
 +
 +
Next create the ordinary users for the system with
 +
<source lang="bash"> $ adduser <username></source>
 +
As root edit the /etc/group file and add a new group at the end. Copy the line above (one of the ordinary useres) and change the group number to bee at least one higher. Add the usernames after the last : having the file looking something like this:
 +
<source lang="bash">
 +
klausk:x:500:
 +
moduledev:x:501:klausk
 +
</source>
 +
 +
Next follow the instructions at [http://wiki.centos.org/HowTos/BuildingKernelModules#head-d2e4c05886f94c701e4ae74387d41d8c40c25d01 Centos wiki on building kernel modules] '''REMEMBER''' do this as an ordinary user as recommended.
 +
 +
<source lang="bash">
 
#
 
#
 
# Provided that the examples are placed in /home/eml1 issue these commands:
 
# Provided that the examples are placed in /home/eml1 issue these commands:

Revision as of 15:48, 26 September 2010

As root on your virtual server execute the following commands:

$ yum install gcc kernel-devel ncurses-devel
$ yum update
#
# If a new kernel came in restart the server
#
$ init 6
#
# Wait a few minutes and login once again
#

Now we need a local copy of the kernel sources. Follow the instructions on Centos Wiki

Next create the ordinary users for the system with

 $ adduser <username>

As root edit the /etc/group file and add a new group at the end. Copy the line above (one of the ordinary useres) and change the group number to bee at least one higher. Add the usernames after the last : having the file looking something like this:

klausk:x:500:
moduledev:x:501:klausk

Next follow the instructions at Centos wiki on building kernel modules REMEMBER do this as an ordinary user as recommended.

#
# Provided that the examples are placed in /home/eml1 issue these commands:
#
$ cd /home/eml1
$ tar zxvf examples.tar.gz
$ chown -R root:root examples
$ cd examples
#
# Create a link to the current kernel - remember to change this, when kernel changes
#
# The version number below may vary
#
$ ln -s /usr/src/kernels/2.6.18-194.11.4.el5-i686/ current-kernel
#
# Prepare the helper script as described below
#
# When entering the example directory execute this
#
$ . settings.sh
#
# To make the scull module perform:
#
$ cd scull
$ make

Helper script called settings.sh - to be run every time you enter this directory. It sets up the environment.

#
#!/bin/bash
#
# Preparation for the compilation of the scull example code
#
KERNELDIR=`pwd`/current-kernel
export KERNELDIR