Re: Kernel derleme asamalari.

Gorkem Cetin (e077245@orca.cc.metu.edu.tr)
Tue, 13 Aug 1996 09:57:25 +0400 (MEDT)


On Tue, 13 Aug 1996, Veli HAZAR wrote:

>
> Selam,
> Kernel i derlemek icin gerekli asamalari nerden bulabilirim ?
> bunu iceren bir README dosyasi hangi directory altinda ?
>
> saygilar ,

Selam
Bu kernel derleme dokumanini daha once de listeye gecmistim -dagilmamis
olabilir - ayrintisi ile kernel derleme asamalarini anlatiyor..
(bunun turkcelestirmeli :-)
iyi calismalar,
gorkem

===============================================================================
KERNEL-COMPILE-GUIDE "Trust this and live with a new kernel."
===============================================================================
(This Guide is Linux Specific, and Unix General.(By Kent Robotti (7-13-96)>>>>>
===============================================================================
ncftp> open
to> ftp.funet.fi <-Complete kernel source, & patches.)
ncftp> cd /pub/Linux/kernel/src/v2.0
ncftp> ls LATEST*
<LATEST-IS-2.0.4>
ncftp> bin <-Set to binary mode...)
ncftp> get linux-2.0.4.tar.gz
ncftp> get modules-2.0.0.tar.gz
ncftp> quit
===============================================================================
?# mv linux-2.0.4.tar.gz /usr/src <-Move kernel to, /usr/src)
?# cd /usr/src
/usr/src# rm -rf linux <-Remove old kernel...)
# tar xzvf linux-2.0.4.tar.gz <-Unpack new kernel...)
# cd /usr/include

/usr/include# ln -sf /usr/src/linux/include/linux linux <-Create symbolic
# ln -sf /usr/src/linux/include/asm-i386 asm links, to new
# ln -sf /usr/src/linux/include/scsi scsi kernel.........)
# cd /usr/src/linux
===============================================================================
Before you compile the kernel I suggest you upgrade your module utilities,
otherwise some of the newly compiled modules might not load.

(http://www.pi.se/blox/modules) (/sbin/genksyms, insmod, kerneld, etc.)
(modules-2.0.0.tar.gz) (# make # make install)

(Don't replace your /etc/rc.d/(rc.S) file with (rc.hints) from modules-2.0.0,
just keep (rc.hints) as a reference.)

(Answer Yes to these three questions when you do # make config...............)
(1). Enable loadable module support = Y
(2). Set version information on all symbols for modules = Y
(3). Kernel daemon support = Y

(If you answer yes to question (2). as I suggest you do, you'll have to
answer (m)odule for ppp support, if you want ppp.)

/sbin/update & <-Add this line to /etc/rc.d/(rc.S) so that your
/sbin/kerneld modules will be loaded automatically when needed.)

alias net-pf-3 off <-Put these lines in /etc/(modules.conf)
alias net-pf-4 off ~# vi /etc/modules.conf <-Create file if it
alias net-pf-5 off doesn't exist.)

(Turn them off if you don't have these modules, pf-3 = AX.25, pf-4 = IPX,
pf-5 = Appletalk, otherwise you may get annoying messages at bootup time.)

(Never strip a module.-> ~# strip module <-Don't do this...)

(Use the -f switch if a module refuses to load...~# insmod -f /path/module.o)
===============================================================================
Try and read /usr/src/linux/Documentation/(Configure.help), (Changes),
(modules.txt), & /usr/src/linux/(README), these will explain the
various options you have when configuring the kernel, and any
updates to other programs that might be needed because of
the new kernel.)
===============================================================================
/usr/src/linux# make config <-To configure kernel...)
# make dep <-To create dependencies...)
# make clean
# make zlilo <-To compile kernel...)
# make modules <-To compile and install any modules.)
# make modules_install <-/lib/modules/2.0.4/???)
# depmod -a <-To create.> /2.0.4/modules.dep file.)

# make dep;make clean;make zlilo <-You can put these above
commands together, instead
of doing them separately...)

(If you do a # make zlilo and lilo is not installed, you'll just get a couple
of error messages at the end of make zlilo, but a compressed kernel will still
be placed in /vmlinuz.........................................................)

If you prefer to do a # make zImage instead of # make zlilo, you'll have to.>>>
/usr/src/linux# mv /vmlinuz vmlinuz.old <-Move old kernel.)
/usr/src/linux# mv arch/i386/boot/zImage /vmlinuz <-Put new kernel in /)
# lilo <-Run lilo, if you're using lilo to boot linux,
this presumes that /sbin/lilo is installed and
configured...................................)

# make zlilo would do all of the above for you.............................)
===============================================================================
There are two alternative's to (make config) # make menuconfig & # make
xconfig, these provide a impressive graphical interface when configuring
the kernel, I don't recommend useing these, if this is your first time
configuring a kernel.
(# make menuconfig, requires (libncurses.so.?) # make xconfig, reguires X
Windows & (wish) from tcl/tk)
===============================================================================
(Configuring (LILO) to boot Linux and other (O)perating (S)ystems...........)
===============================================================================
~# liloconfig
(1). Start LILO configuration with a new LILO header...
(Enter extra parameters ==> <-Press <Enter> for none.)
(Please pick a target location (1-3): 1 <-(M)aster (B)oot (R)ecord)
(Choose LILO delay: 4 = Present a prompt and wait until a choice is made...)
(2). Add a Linux partition...
/dev/hd?? <-Where is the /partition/??)
Enter name: Linux (~# fdisk -l <-To see partition table.)
(2). Add a Dos partition...
/dev/hd?? <-Where is the /partition/??)
Enter name: FreeBSD (Or.> OS/2, DOS, WIN95)
(5). Install LILO...
Added Linux *
Added FreeBSD *
~#

(LILO can boot other operating systems e.g. Dos, FreeBSD, OS/2, Win95. After
you add a linux partition you can add a dos partition, you don't have to
choose a dos partition to boot, it can be any one of the above operating
systems. Just tell lilo where it is (/dev/hd??), and then give it a name.>
(5). Install LILO...)

(From Dos.> C:\ fdisk /mbr <-Three ways to remove lilo from the (MBR)
(From Dos Floppy.> A:\ fdisk /mbr Don't remove lilo unless you're having a
(From Linux.> ~# lilo -u problem with lilo, or you just want to.)
===============================================================================
If the kernel compiled you'll have /vmlinuz and /vmlinuz.old, If you're using
lilo to boot linux everything is fine as is, but if you're using, or want to
use loadlin or a floppy to boot linux, do this.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
===============================================================================
(If you're using loadlin to boot linux from dos, do this.>>>>>>>>>>>>>>>>>>>>>>>
/dev/hda? msdos /dos defaults O 2 <-This line should be in /etc/fstab)
/# mkdir /dos <-Make /dos = C:\ Directory.)
/# mount -t msdos /dev/hda? /dos <-Mount the (/dos/partition?)
/# cp vmlinuz /dos/dos <-Copy /vmlinuz (to> C:\dos\(vmlinuz)
/# tar xzvf loadlin.tgz <-Unpack to get.> /root/(lodlin15.zip)
/# cd root
~# unzip lodlin15.zip
~# cd LOADLIN
~LOADLIN# mv LOADLIN.EXE /dos/dos <-Move LOADLIN.EXE > C:\dos\(LOADLIN.EXE)
C:\ edit dos\linux.bat <-Create linux.(bat) file...)
loadlin vmlinuz root=/dev/hda? ro <-Put this line in linux.bat & save file.)
C:\ linux <-Boot the (/linux/partition?) from dos.)

(On slackware 3.0.0 loadlin.tgz is in /cdrom/slakware/a3/(loadlin.tgz)

~# mount -r -t iso9660 /dev/cdrom /cdrom <-Mount cdrom, if not mounted.)
~# pkgtool
(Other.) Install packages from some other directory.
(Select Source Directory.> /cdrom/slakware/a3
(Press \|/ down-arrow key for.> (Yes) (No) (Quit)

(ftp.cc.gatech.edu) (/pub/Linux/system/Linux-boot) (lodlin16?.tgz)
===============================================================================
(If you're booting from a floppy, do this.>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

/# fdformat /dev/fd0H1440 <-Format a floppy...)
/# cp vmlinuz /dev/fd0H1440 <-Copy kernel to floppy...)

(Boot the new kernel, then /# rm vmlinuz.old) <-Remove old kernel.)
===============================================================================
(You don't need all of the kernel source after it's compiled, you just need
/usr/src/linux/include: you'll need the (include) files to compile anything.)
===============================================================================
~# mv /usr/src/linux/include /usr/src <-Steps to removing the
~# rm -rf /usr/src/linux kernel source, minus
~# mkdir /usr/src/linux the (include) files...)
~# mv /usr/src/include /usr/src/linux

(To remove just the (.o)bject files and extra compiled kernels, that were
created when you compiled the kernel source, do this.>>>>>>>>>>>>>>>>>>>>>>>>>>

?# cd /usr/src/linux
/usr/src/linux# make clean

(I would keep the kernel source and just do a # make clean, unless I was short
on space, don't forget # rm linux-2.0.4.tar.gz...)
===============================================================================
Patching & Recompiling the Kernel Source.....................................)
===============================================================================
~# uname -a <-To see kernel version.-> (Linux darkstar 2.0.4 #1........WOW!!!)
===============================================================================
Rather then downloading the complete kernel source again to update the kernel,
you can patch the present kernel source to update it.>>>>>>>>>>>>>>>>>>>>>>>>>>
Put the patch or patches in /usr/src/linux/scripts/ patch-2.0.5.gz, patch-
2.0.6.gz, patch-2.0.7.gz, etc.............................................)
/usr/src/linux/scripts# chmod u+x patch-kernel <-Make script executable.)
# patch-kernel <-Run script.............)
===============================================================================
If you want to recompile the kernel source after patching or for any reason,
do a /usr/src/linux# make mrproper first. (Then.> make config, dep, clean,
zlilo, etc. (Only do a # make mrproper if you're going to recompile the kernel.
===============================================================================
(There's a shell script called (getpatch), that will determine your current
kernel version and download through ftp all the patches needed to bring
your kernel up to date.)
(It will put the patches in /usr/src/linux/scripts, then you just have to.>
/usr/src/linux/scripts# patch-kernel

(ftp.sunsite.unc.edu)
(pub/Linux/system/Misc)
(getpatch.v2.1) <-Read (getpatch.v2.1)
===============================================================================
>>>...Further Reading...<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
===============================================================================
(ftp.cc.gatech.edu)
(/pub/Linux/docs/HOWTO)
(Kernel-HOWTO) (text/plain)

[Copyright 7-13-96 By Kent Robotti]
===============================================================================