Tuesday, March 21, 2006

Compile a Kernel

How to compile the Linux kernel

When I joined C-DAC(Formerly NCST) Bangalore, as a
technical associate(TA) , beside learning about the project,
which I'm part of, the task assigned to me was to write a
loadable kernel module(LKM). As a part of that task, I
wanted to upgrade the kernel on my machine to the latest
one. I started to look around for the material and books for
help. In all these efforts Google(http://www.google.com)
played an important role; also our library always proves to
be one of the best for that matter. After some early work I
could find out following steps to compile the linux kernel

1 Download the Linux kernel from http://www.kernel.org

2 Untar the tarball using either "tar -xzf" for ".tgz"
file or "tar -xjf" command for ".tar.bz2" file.

3 Go the kernel directory

4 make [config/menuconfig/defconfig/xconfig] This will
invoke either an editor to let you configure kernel
parameters or may ask questions in an interactive mode
in case of "make config". At the end of configuration
you'll have ".config" file written in the same direc-
tory. It's not reccomended you to edit this file.

5 make bzImage: This will start the actual compilation
process and at the end of this step you'll have
"vmlinuz" file ready, which is your kernel image.

6 make modules: This will compile the loadable kernel
modules source files to generate the kernel object(.ko)
files in case of Linux kernel-2.6.x and object(.o)
files for the kernels prior to kernel-2.6.x

7 make modules_install: This command needs the root priv-
ileges, so you gotta do the root login before executing
this command. As this command will create the directory
"linux-" under "/lib/modules" and copy
all the object files and dirvers generated so far in
this directory.

8 make install: This command will make the necessary
changes in the boot loader configuration file so that,
when you reboot the system you'll see the option to
boot into this freshly compiled Linux kernel.

Note:

. Always keep a running kernel image untouched, so in
case if new kernel image is unable to boot, you can
always boot with the old kernel and do the nessary
changes.

. Also do not forget to read the kernel documentation.

Courtsey: Prasad J Pandit

Thursday, March 16, 2006

SuSe 9.1 blues

Uhhhh... it is now becoming really frustating for me to work on SuSe. I am trying since a couple of days to figure out the problem in automount and still not able to get in to it.
I don't understand why this is a problem as it is working for fc3,rhel3,rhel4 and when it comes to SuSe it just stops responding.

Scenario is:

* NIS server is running on rhel4 and giving yp mappings.

* SuSe machine works for NIS authentication but doesn't switch to home directory as home directory is not automounted.

* I can see all the mapping from the SuSe machine with $ypcat -kt auto.home

* NIS and NFS server is working fine for all the other system except SuSe.

* I think the problem might be with the difference in flavors of Linux being used Server on rhel4 and client is on SuSe.

Well i am still struggling with it and will find the solution OR workaround.