BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Entertainment & Enjoyment > Linux World

Linux World Discuss here the different Derivatives of Linux...


Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 23-09-2008, 08:05 AM
Waqas Ahmed's Avatar

 
Join Date: Sep 2008
Location: New-Multan
Age: 37
Posts: 297
Contact Number: 0321-7359605, 0313-7359605
Program / Discipline: MSTS
Class Roll Number: 07-22
Waqas Ahmed will become famous soon enough
Lightbulb Quick Steps − Kernel Compile

Quick Steps − Kernel Compile
This section is written by Al Dev (alavoor[AT]yahoo.com)
The latest version of this section is at http://www.milkywaygalaxy.freeservers.com and click on "Quick Steps
to recompile linux kernel". Mirror sites are at − angelfire, geocities, virtualave, Fortunecity, Freewebsites,
Tripod, 101xs, 50megs,
These sites have lots of linux goodies and tips.
(The latest version of this document is at http://www.milkywaygalaxy.freeservers.com. You may want
to check there for changes).
Kernel re−compile is required in order to make the kernel very lean and which will result in FASTER
operating system . It is also required to support any new devices.
2.1 Precautionary Preparations
Before you build kernel, it is a good idea to do a backup of the system. If you had not backed up your system
recently then do it now. See BRS Backup−Recovery−Software go here and click on BRS.
Or if you feel that you can take risk of losing data, then skip this section and go to next section.
2.2 Building Kernel
Note: Below 'bash#' denotes the bash prompt, you should type the commands that appear after the 'bash#'
prompt. Below are commands tested on Redhat Linux, but it should work for other distributions with very
minor changes.
Note: You can have many kernel images on your system. By following the steps below you do not
overwrite or damage your existing kernel. These steps are very safe and your current kernel will be
intact and will not be touched.
1.
Login in as 'root' throughout all these steps. Mount Redhat linux cdrom and install the linux kernel

source rpm
bash$ su − root
bash# cd /mnt/cdrom/RedHat/RPMS
bash# rpm −i kernel−headers*.rpm
bash# rpm −i kernel−source*.rpm
bash# rpm −i dev86*.rpm
bash# rpm −i bin86*.rpm
(The bin86*.rpm and 'as86' is required only for OLDER Linux systems like redhat 5.x. Get Intel
assembler 'as86' command from dev86*.rpm on cdrom or from bin86−mandrake , bin86−kondara ).
Start X−windows with 'startx'. If you are not able to start X−window then see next step
below.
¨
bash# man startx
bash# startx
bash# cd /usr/src/linux
bash# make xconfig
3.
If you are not able to start X−window above then try − 4.
bash# export TERM=xterm
bash# make menuconfig
If you find scrambled display, then use different terminal emulators like vt100,
vt102, vt220 or ansi. The display will be scrambled and will have garbage
characters in cases where you use telnet to login to remote linux. In such
cases you should use the terminal emulators like vt100, vt220.
For example:
bash# export TERM=vt220
bash# export TERM=ansi
At a lower level, use:
bash# export TERM=vt100
bash# make menuconfig
If the menuconfig command fails then try −
bash# make config
The "make xconfig" or "make menuconfig" brings up a user friendly GUI interface. And "make
config" brings up command−line console mode interface. You can load the configuration file from
/usr/src/linux/.config (dot config file. Note the dot before config).
Within 'make xconfig' you must do these to avoid problems −
Select proper CPU type − Pentium 3, AMD K6, Cyrix, Pentium 4, Intel 386, DEC Alpha,
PowerPC otherwise kernel will not boot!!
¨
Select SMP support − whether single CPU or multiple CPUs ¨
Filesystems − Select Windows95 Vfat, MSDOS, NTFS as part of kernel and not as loadable
modules. (My personal preference but you are free to pick your own option).
¨
Enable the Loadable kernel modules support! With this option you can load/unload the
device drivers dynamically on running linux system on the fly. See these man pages
¨
bash# rpm −i /mnt/cdrom/Redhat/RPMS/modutils*.rpm

bash# man lsmod
bash# man insmod
bash# man rmmod
bash# man depmod
bash# man modprobe
Save and Exit "make xconfig". All the options which you selected is now saved into configuration
file at /usr/src/linux/.config (dot config file). And now, do −
6.
bash# make dep
bash# make clean
Read the following file (to gain some knowledge about kernel building. Tip: Use the color editor
gvim for better readability.
7.
bash# gvim −R /usr/src/linux/arch/i386/config.in
bash# man less
bash# less /usr/src/linux/arch/i386/config.in
Type 'h' for help and to navigate press i, j, k, l, h or arrow, page up/down keys.
Now, give the make command − 8.
bash# cd /usr/src/linux
bash# man nohup
bash# nohup make bzImage &
bash# man tail
bash# tail −f nohup.out (.... to monitor the progress)
This will put the kernel in /usr/src/linux/arch/i386/boot/bzImage
After bzImage is successful, copy the kernel image to /boot directory. You must copy the new kernel
image to /boot directory, otherwise the new kernel MAY NOT boot. And then read the manual page
on lilo (see also http://www.linuxdoc.org/HOWTO/LILO−c...722;HOWTO.html) and see the
sample lilo.conf file. Always give a date extension to the filename, because it tells you when you
built the kernel, as shown below:
9.
bash# cp /usr/src/linux/arch/i386/boot/bzImage /boot/bzImage.myker.26mar2001
bash# man lilo
bash# man lilo.conf
And edit /etc/lilo.conf file and put these lines −
image=/boot/bzImage.myker.26mar2001
label=myker
root=/dev/hda1
read−only
You can check device name for 'root=' with the command −
bash# df /
Now give 10.
bash# lilo

bash# lilo −q
You must re−run lilo even if the entry 'myker' exists, everytime you create a new bzImage.
Reboot the machine and at lilo press tab key and type 'myker' If it boots then you did a good job!
Otherwise at lilo select your old kernel, boot and re−try all over again. Your old kernel is still
INTACT and SAFE at say /boot/vmlinuz−2.0.34−0.6
11.
If your new kernel 'myker' boots and works properly, you can create the boot disk. Insert a blank
floppy into floppy drive and −
12.
bash# cd /usr/src/linux
bash# make bzdisk
See also mkbootdisk −
bash# rpm −i mkbootdisk*.rpm
bash# man mkbootdisk
LOADABLE MODULES: This step is required ONLY if you had enabled Loadable module
support in step 3 above. Loadable module are located in /lib/modules. You MUST do this step if you
enabled or disabled any modules, otherwise you will get 'unresolved symbols' errors during or after
kernel boot. Check for insmod command which is extensively used for loading the modules.
13.
bash# cd /usr/src/linux
bash# make modules
bash# make modules_install
This will copy the modules to /lib/modules directory. For example to load the module
/lib/modules/2.4.2−2/kernel/drivers/block/loop.o, you would do :
bash# man insmod
bash# modprobe loop
bash# insmod loop
bash# lsmod
You can set PATH the insmod searches in /etc/modules.conf
__________________

Waqas Ahmed

---------------------------------------------------
My education, expertise and experience as follows:
MS (CS), M.Sc.(TS), CCNA, CCNP, RHCE (prepared),
HTML, XHTML, DHTML, CSS, Javascripts, PHP, MYSQL, WORDPRESS, JOOMLA, DRUPEL, PHPBB ETC..
Adobe Photoshop, FLASH.
VMWARE Server. Windows 2003 Server, Apache Server, Squid Server, etc.
You can also get training from any of above or gain services.
Mobile : 0313-7359605
Email : waqqas1@yahoo.com
Company : www.vision2define.com
http://bzupages.com/f2/aoa-760/
Reply With Quote
Reply

Tags
, compile, kernel, quick, steps


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Study in 4 steps Salman Mushtaq Funniest Pictures 1 19-12-2011 01:48 AM
Wean Yourself Off Processed Foods in 7 Steps .BZU. Health and Nutrition 0 22-06-2010 05:20 PM
Six steps to protect your computer usman_latif_ch Computer & Programming 0 11-02-2010 10:14 PM
Your Website in simple steps(4 beginners) mrabyan Tutorial 4 11-08-2009 09:30 AM
Linux & Windows without virtualization - andLinux based on ubuntu using coLinux Kernel BSIT07-01 Daily News And halat-e-hazra 0 12-04-2009 02:44 AM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 02:25 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.