|
| ||||||||||||
| ||||||||||||
|
2006 г.
Справочник по Debian[ назад ] [ Содержание ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ] [ A ] [ вперед ]Osamu Aoki, перевод Ильи В. Головко, qref.sourceforge.net Глава 7 - The Linux kernel under DebianDebian has its own method of recompiling the kernel and related modules. See also Debian и ядро, раздел 2.7. 7.1 Kernel recompile
The use of Since it is a moving target, kernel compilation is a difficult subject that may confuse even the most admired developer:
Be careful and always rely on the
initrd is not needed for a kernel compiled only for one machine.
I use it since I want my kernel to be almost the same as the one provided by
the kernel-image packages. If you use initrd, make sure to read
7.1.1 Debian standard method
Watch out for bug reports on
Compiling a custom kernel from source under a Debian system requires special
care. Use the new --append_to_version with
# apt-get install debhelper modutils kernel-package libncurses5-dev
# apt-get install kernel-source-2.4.18 # use latest version
# apt-get install fakeroot
# vi /etc/kernel-pkg.conf # input my name and email
$ cd /usr/src # build directory
$ tar --bzip2 -xvf kernel-source-2.4.18.tar.bz2
$ cd kernel-source-2.4.18 # if this is your kernel source
$ cp /boot/config-2.4.18-386 .config # get current config as default
$ make menuconfig # customize as one wishes
$ make-kpkg clean # must run (per: man make-kpkg)
$ fakeroot make-kpkg --append_to_version -486 --initrd \
--revision=rev.01 kernel_image \
modules_image # modules_image is for pcmcia-cs* etc.
$ cd ..
# dpkg -i kernel-image*.deb pcmcia-cs*.deb # install
make-kpkg kernel_image actually does make oldconfig and make dep. Do not use --initrd if initrd is not used. If one wants to use modules from pcmcia-cs or no pcmcia, one should select "General setup —>" to "PCMCIA/CardBus support —>" in make menuconfig and set the configuration to "< > PCMCIA/CardBus support" (i.e., uncheck the box).
On an SMP machine, set CONCURRENCY_LEVEL according to
7.1.2 Classic methodGet pristine sources from:
or use equivalent sources in Debian and do the following:
# cd /usr/src
# tar xfvz linux-whatever.tar.gz
# rm -rf linux
# ln -s linux-whatever linux
# tar xfvz pcmcia-cs-whatever.tar.gz
# ln -s pcmcia-cs-whatever pcmcia
# cd linux
# make menuconfig
... configure stuff ...
# make dep
# make bzImage
... edits for lilo / grub ...
... move /usr/src/linux/arch/i386/boot/bzImage to boot ...
... /sbin/lilo or whatever you do for grub
# make modules; make modules_install
# cd ../pcmcia
# make config
# make all
# make install
... add needed module names to /etc/modules
# shutdown -r now
... boot to new kernel ...
7.1.3 Kernel headers
Most "normal" programs don't need kernel headers and in fact may
break if you use them directly; instead they should be compiled against the
headers with which
So do not put symlinks to the directories in
If you need particular kernel headers for some kernel-specific
application programs, alter the makefile(s) so that their include path points
to 7.2 The modularized 2.4 kernel
The new Debian 2.4 kernels provided by
Although I have many examples for
See 7.2.1 PCMCIA
# ISA PnP driver
isa-pnp
# New Low level PCMCIA driver
# yenta_socket # does not seem to be needed in my case
The rest is taken care of by PCMCIA scripts (from the
Voice of the genius Miquel van Smoorenburg
"I simply removed the entire pcmcia stuff from the laptop here at work,
including the cardmgr etc and just installed a 2.4 kernel with cardbus support,
and the new As long as you only have 32-bit cards you don't need the pcmcia package; 2.4 has card services built in. And the standard tulip driver should work fine with your dlink card. —Mike."
See 7.2.2 SCSI
[NOT TESTED]
# SCSI core
scsi_mod
# SCSI generic driver
sg
# SCSI disk
sd_mod
# All other needed HW modules
...
7.2.3 Network function
# net/ipv-4
ip_gre
ipip
# net/ipv-4/netfilter
# iptable (in order)
ip_tables
ip_conntrack
ip_conntrack_ftp
iptable_nat
iptable_filter
iptable_mangle
#
ip_nat_ftp
ip_queue
#
ipt_LOG
ipt_MARK
ipt_MASQUERADE
ipt_MIRROR
ipt_REDIRECT
ipt_REJECT
ipt_TCPMSS
ipt_TOS
ipt_limit
ipt_mac
ipt_mark
ipt_multiport
ipt_owner
ipt_state
ipt_tcpmss
ipt_tos
ipt_unclean
#
#ipchains
#ipfwadm
The preceding may not be optimized. 7.2.4 EXT3 filesystem ( > 2.4.17)Enabling a journaling filesystem with the EXT3 FS involves the following steps using a Debian precompiled kernel-image ( > 2.4.17) package:
# cd /etc; mv fstab fstab.old
# sed 's/ext2/ext3,ext2/g' <fstab.old >fstab
# vi /etc/fstab
... set root filesystem type to "auto" instead of "ext3,ext2"
# cd /etc/mkinitrd
# echo jbd >>modules
# echo ext3 >>modules
# echo ext2 >>modules
# cd /
# apt-get update; apt-get install kernel-image-2.4.17-686-smp
... install latest kernel and set up boot (lilo is run here)
# tune2fs -j -i 0 /dev/hda1
# tune2fs -j -i 0 /dev/hda2
... For all EXT2 FS's converted to EXT3
# shutdown -r now
Now EXT3 journaling is enabled. Using ext3,ext2 as the
If you have previously installed a 2.4 kernel and do not wish to reinstall,
perform the above steps up to the
# mkinitrd -o /boot/initrd.img-2.4.17-686-smp /lib/modules/2.4.17-686-smp
# lilo
# tune2fs -j -i 0 /dev/hda1
# tune2fs -j -i 0 /dev/hda2
... for all EXT2 FS's converted to EXT3
# shutdown -r now
Now EXT3 journaling is enabled.
If
... at initrd prompt to gain shell (5 sec.), type RETURN
# insmod jbd
# insmod ext3 # modprobe ext3 may take care of everything
# insmod ext2
# ^D
... continue booting
At the system boot screen ( Some systems are reported to experience severe kernel lockup if EXT3 is enabled but I had no problem (as of 2.4.17). 7.2.5 Realtek RTL-8139 support in 2.4
For whatever reason, the RTL-8139 support module is no longer called rtl8139,
it's now called 8139too. Just edit your 7.2.6 Parallel port support
For
# modprobe lp
# echo lp >> /etc/modules
See 7.3 Tuning the kernel through the proc filesystemThe behavior of the Linux kernel can be changed on the fly using the proc filesystem.
For basic information on changing kernel parameters through the
See some examples of kernel parameter manipulations in
See 7.3.1 Too many open filesThe Linux kernel may complain "Too many open files". This is due to the small default value (8096) for file-max. To fix this problem, run the following command as root:
# echo "65536" > /proc/sys/fs/file-max # for 2.2 and 2.4 kernel
# echo "131072" > /proc/sys/fs/inode-max # for 2.2 kernel only
or put the following into
file-max=65536 # for 2.2 and 2.4 kernel
inode-max=131072 # for 2.2 kernel only
7.3.2 Disk flush intervalsYou can change disk flush intervals through the proc filesystem. The following will shorten its interval from the default five seconds to one second.
# echo "40 0 0 0 100 30000 60 0 0" > /proc/sys/vm/bdflush
This may negatively impact file I/O performance a little bit. But this secures file contents except for the last one second which is shorter than the default five seconds. This is true even for journaling filesystems. 7.3.3 Sluggish old low memory machinesFor some old low memory systems, it may still be useful to enable over-commit of memory through the proc filesystem:
# echo 1 > /proc/sys/vm/overcommit_memory
[ назад ] [ Содержание ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ] [ A ] [ вперед ] |
|
CITForum © 1997–2025