Difference between revisions of "How-to compile the Scull examples"
From Klaus' wiki
Line 2: | Line 2: | ||
<source lang="bash"> | <source lang="bash"> | ||
− | $ yum install gcc kernel-devel ncurses-devel | + | $ yum install gcc kernel-xen-devel ncurses-devel |
$ yum update | $ yum update | ||
# | # | ||
Line 21: | Line 21: | ||
klausk:x:500: | klausk:x:500: | ||
moduledev:x:501:klausk | moduledev:x:501:klausk | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</source> | </source> | ||
Line 54: | Line 39: | ||
$ cd /home/eml1 | $ cd /home/eml1 | ||
$ tar zxvf examples.tar.gz | $ tar zxvf examples.tar.gz | ||
− | $ | + | $ chgrp -R moduledev examples |
$ cd examples | $ cd examples | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
# | # | ||
# Prepare the helper script as described below | # Prepare the helper script as described below | ||
Line 72: | Line 51: | ||
# | # | ||
$ cd scull | $ cd scull | ||
− | $ make | + | $ make modules |
</source> | </source> | ||
Line 78: | Line 57: | ||
<source lang="bash"> | <source lang="bash"> | ||
− | |||
#!/bin/bash | #!/bin/bash | ||
# | # | ||
# Preparation for the compilation of the scull example code | # Preparation for the compilation of the scull example code | ||
# | # | ||
− | KERNELDIR= | + | KERNELDIR=/usr/src/kernels/2.6.18-194.11.4.el5-xen-i686/ |
export KERNELDIR | export KERNELDIR | ||
+ | </source> | ||
+ | |||
+ | |||
+ | Remember that only root can insmod a module in the kernel. | ||
+ | |||
+ | If you add a line like this into /etc/sudoers using visudo | ||
+ | <source lang="bash"> | ||
+ | klausk ALL=(ALL) NOPASSWD: ALL | ||
</source> | </source> |
Revision as of 11:25, 27 September 2010
As root on your virtual server execute the following commands:
$ yum install gcc kernel-xen-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
As normal user issue this:
$ cd /home/eml1/examples $ make -C ~/rmpbuild/BUILD/kernel-2.6.18/linux-2.6.18.i686 # # Takes a while to compile the kernel #
# # Provided that the examples are placed in /home/eml1 issue these commands: # $ cd /home/eml1 $ tar zxvf examples.tar.gz $ chgrp -R moduledev examples $ cd examples # # 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 modules
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=/usr/src/kernels/2.6.18-194.11.4.el5-xen-i686/ export KERNELDIR
Remember that only root can insmod a module in the kernel.
If you add a line like this into /etc/sudoers using visudo
klausk ALL=(ALL) NOPASSWD: ALL