8/7/12

How to complie Linux Kernel 2.6

Step # 1 Get Latest Linux kernel code

Visit http://kernel.org/ and download the latest source code. File name would be linux-x.y.z.tar.bz2, where x.y.z is actual version number. For example file inux-2.6.25.tar.bz2 represents 2.6.25 kernel version. Use wget command to download kernel source code:

#root cd /tmp
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2 Note: Replace x.y.z with actual version number.

Step # 2 Extract tar (.tar.bz3) file

Type the following command:

# tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
# cd /usr/src
Install Location

#cd /usr/src
Step # 3 Configure kernel

Before you configure kernel make sure you have development tools (gcc compilers and related tools) are installed on your system. If gcc compiler and tools are not installed then use rpm command under Redhat Linux to install development tools.

#rpm -ivh gcc
Now you can start kernel configuration by typing any one of the command:

make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.

make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop

make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop. For example make menuconfig command launches following screen:

#make menuconfig
You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help.

Step # 4 Compile kernel

Start compiling to create a compressed kernel image, enter:

#make
Start compiling to kernel modules:

#make modules
Install kernel modules (become a root user, use su command):

#make modules_install
Step # 5 Install kernel

So far we have compiled kernel and installed kernel modules. It is time to install kernel itself.

#make install
It will install three files into /boot directory as well as modification to your kernel grub configuration file: System.map-2.6.25 config-2.6.25 vmlinuz-2.6.25

Step # 7 Modify Grub configuration file - /boot/grub/grub.lst

Open file using vi:

#vi /boot/grub/menu.lst
title Redhat Linux,kernel 2.6.25
root (hd0,0)
kernel /boot/vmlinuz root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.25

update-grub

Step # 8 : Reboot computer and boot into your new kernel

Just issue reboot command:

#reboot

Linux Network Configuration

How to Configure Network on Linux

What are the RPM need to installed

kdenetwork-3.5.4-4.fc6
system-config-network-1.3.99-1.el5
system-config-network-tui-1.3.99-1.el5
kdenetwork-devel-3.5.4-4.fc6
Network Configuration File

#/etc/sysconfig/network-scripts/ifcfg-eth0
#/etc/sysconfig/network
Network Configuration Tool

system-config-network
system-config-network-gui
system-config-network-cmd
system-config-network-tui

What is service need to be started

service network restart/stop/start

Editing network Configuration File

maually assigning ip address
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=10.192.194.110
BOOTPROTO=static ("dhcp" when you want dhcp server ip address)
NETMASK=255.255.240.0
MII_NOT_SUPPORTED=yes
ONBOOT=yes
How add the Default Route Redhat Linux:

vi /etc/sysconfig/network
HOSTNAME=bgospc
GATEWAY=10.192.207.254
NETWORKING=yes

How add the Default Route in SuSe Linux:

#vi /etc/sysconfig/network/routes
default 10.192.207.254 - -
How to add DNS Server name and IP address

Add the entry to vi /etc/resolv.conf

#vi /etc/resolv.conf
search bg.emulex.com ad.emulex.com emulex.com wa.emulex.com sj.emulex.com ma.emulex.com co.emulex.com
nameserver 138.239.197.20
nameserver 138.239.197.101
nameserver 138.239.197.103

Linux Samba Server Configuration

How to Configure Samba Server on Linux

What RPM Need to be installed:

system-config-samba-1.2.39-1.el5
samba-common-3.0.23c-2
samba-3.0.23c-2
samba-client-3.0.23c-2
What is the Config File:

#/etc/samba/smb.conf
what is the service need to started

#service smb restart
Configure Samba Server:

Add the entry to vi /etc/samba/smb.conf

[samba-disk1]
comment = samba-disk1
path = /disk1
write list = root
valid users = root guest
create mask = 0664
directory mask = 0775
#save
Add the Samba user Paasword

#smbpasswd -a root
How mount samba clinet on Windows

start->run->//sambaserver ipaddress it will ask sambaserver username and password
How to mount samba client on Linux

mount.smbfs //sambaserver ipaddress/shared path /localpath

Ex:
mount.smbfs //10.192.192.189/samba-disk1 /disk1
or

mount //10.192.192.189/samba-disk1 /disk1 and it will ask samba server password
Note:The samba.winbind package need to installed for this future