Chapter 7 Debian LINUX Kernel
~~~~~~~~~~~~~
DEBIAN uses its own way to compile the kernel and related modules. See 〖2.7 Debian and System Kernel.
7.1 kernel compilation
============
The GCC, Binutils, and Modu on the debian unsteable release can be used to compile the latest Linux kernel. Official information in this regard, see the second half of the /usr/share/doc/kerenl-package/readme.gz file.
Nuclear compilation is a very difficult issue, because the goal is constantly changing, even the most respected developers will have different insights:
Manoj Srivastava wrote:
--initrd requires Debian special Cramfs patches.
Herbert XU wrote:
No, it doesn't need to use file systems other than Cramfs, just set MKImage in /etc/mkinitrd/mkinitrd.conf.
Carefully act in accordance with Manoj and Kent written /usr/share/doc/kernel-package/readme.gz, if you want to compile the latest version of the kernel, please confirm the latest UnStable version of the Kernel-Package package.
For stand-alone kernel compilation, INITRD is not necessary. I use it to hope that my newly compiled kernel is exactly the same as the corresponding kernel mirror. If you use initrd, please read Mkinitrd (8) and Mkinitrd.conf (5). You can also refer to http://bugs.debian.org/149236.
7.1.1 Debian standard way
--------------------
Caring for the error report on kernel-package, gcc, binutils and modutils. If necessary, the most version should be used.
Customizing the kernel in the Debian system is especially careful. Use Make-KPKG -Append_to_Version option to create multiple kernel mirroring relatively secure.
# APT-GET Install Debhelper MODUTILS KERNEL-Package Libncurses5-Dev
# APT-GET Install kernel-source-2.4.18 # Using the latest version
# APT-GET Install Fakeroot
# vi /etc/kernel-pkg.conf # Enter my name and email
$ CD / USR / SRC # Create a directory
$ tar --bzip2 -xvf kernel-source-2.4.18.tar.bz2
$ cd kernel-source-2.4.18 # If this is your kernel source code
$ cp /boot/config-2.4.18-386 .config # Set the current configuration as the default configuration
$ Make MenuConfig # Customized by your preferences
$ make-kpkg clean # must do this (per: man make-kPKG)
$ fakeroot make-kPkg --append_to_version -486 --initrd /
--Revision = Rev.01 kernel_image /
Modules_Image # modules_image can be PCMCIA-CS *, etc.
$ CD ..
#DPKG -I kernel-image * .deb pcmcia-cs * .deb # installation
Make-KPKG Kernel_Image actually executed make Oldconfig and make Dep. Do not use the --initrd option if you don't use INITRD.
If you want to load the PCMCIA-CS module or no pcmcia, you should select "General Setup ->" in Make MenuConfig, configure the <> PCMCIA / Cardbus Support option (for example, cancellation Options). For the SMP machine, set conscious_level with reference to kernel-pkg.conf (5).
7.1.2 Classic
----------------
Get clean source code from the following address:
· Linux: http://www.kernel.org/
· PCMCIA-CS: http://pcmcia-cs.sourceforge.net/
Or use the equivalent source code attached to DEBIAN:
# CD / USR / SRC
# tar xfvz linux-whatver.tar.gz
# rm -rf linux
# ln - linux-whatver Linux
# tar xfvz pcmcia-cs-whatver.tar.gz
# ln -s pcmcia-cs-whatver PCMCIA
# cd Linux
# Make MenuConfig
... Configure the kernel option ...
# Make Dep
# Make Bzimage
... Edit LILO / GRUB ...
... Mobile / USR / SRC / Linux / Arch / I386 / Boot / Bzimage to Boot ...
... / sbin / lilo or whatver you do for grub
# Make Modules; Make Modules_Install
# cd ../pcmcia
# make config
# Make All
# make install
... Add needed module name to / etc / modules
# Shutdown -r Now
... start to the new kernel ...
7.1.3 Nuclear ID
----------------
Most "ordinary" programs do not require internal nuclear files, in fact, if they are directly referenced to them. These procedures should reference those headers used to compile glibcs, which are located in the / usr / include / linux and / usr / include / ASM directory of the Debian system.
Therefore, do not create links to / usr / include / linux and / usr / include / usr / include / linux directory in the / usr / src / linux directory, and some outdated documents have suggested creating them.
If some kernel applications require a specific kernel header file, modify Makefile (s) so that it contains paths that point to "Specific Nuclear Person Directory / Include / Linux" and "Specific Nuclearhead Directory / Include / asm" .
7.2 Modular 2.4 kernel
===================
KERNTL-MAGE-2.4.NN provides a new version of Debian 2.4 kernel, which is extremely high. You must activate the related modules to get the desired kernel function.
Although many samples are provided in the next part, it is said that all device alias can be solved in / etc / models / with a file to provide all device alias. Question, current kernels have enough alias for you to use.
See Documentation / *. TXT in the Linux kernel source directory.
7.2.1 PCMCIA
----------------
To use PCMCIA, you need to include the following content in / etc / modules:
# ISA PNP Driver
ISA-PNP
# Low level pcmcia driver # YENTA_SOCKET # I don't seem to need on my machine
The rest of the work is responsible for the PCMCIA script (from the PCMCIA-CS package), DepMod and Kmod. I need ISA-PNP because my laptop is used by old ISA-PCMCIA. Newer laptops use Cardbus / PCMCIA, no longer need it.
Generous Miquel Van Smoorenburg (miquels@cistron.nl said:
"I will delete all the things about PCMCIA's things including Cardmgr, and only supports the 2.4 version of the kernel and the new HotPlug package in Woody in CardBus.
As long as you are using a 32-bit card, you don't need a PCMCIA package; 2.4 Built-in CardServices. Standard Tulip drivers can also work normally on the DLINK card.
--Mike. "
7.2.2 SCSI
------------
[Nothing test] Want to work, please include the following in / etc / modules:
# SCSI CORE
SCSI_MOD
# SCSI generic driver
SG
# SCSI Disk
SD_MOD
# All Other Needed HW Modules
...
Some of the above modules can be operated with DEPMOD.
7.2.3 Network function
----------------
/ etc / modules need to include the following content to expand the 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 above content is not optimized. Some of the above modules can be operated with DEPMOD.
7.2.4 EXT3 file system (> 2.4.17)
----------------------------
The following operations can be activated by the pre-compiled kernel mirroring package (> 2.4.17) to activate the EXT3 log vectors.
# cd / etc; mv fstab fstab.old
# SED 'S / EXT2 / EXT3, EXT2 / G'
# VI / ETC / FSTAB
... Set the root file system type to "auto" instead "" 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 the latest kernel and configure boot (Lilo runs from here)
# tne2fs -j -i 0 / dev / hda1
# tne2fs -j -i 0 / dev / hda2
... Transform all EXT2 FS to EXT3
# Shutdown -r Now Now you can use the EXT3 log web. Using EX3 in FSTAB "Type", EXT2 is for insurance, if the kernel does not support non-root partitions using EXT3 can also be returned to EXT2.
If you have installed a 2.4 version of the kernel and don't want to reload it again, you can perform the steps before the Apt-get command in the above steps. then:
# mkinitrd -o /boot/initrd.img-2.4.17-686-smp /lib/modules/2.4.17-686-smp
# lilo
# tne2fs -j -i 0 / dev / hda1
# tne2fs -j -i 0 / dev / hda2
... Transform all EXT2 FS to EXT3
# Shutdown -r Now
Now the EXT3 log field has been effective.
If you don't set / etc / mkinitrd / modules, you are best to load some modules when the system starts:
... When the initrd prompt gets shell (5 seconds), enter return
# InSMOD JBD
# insmod ext3 # modprobe ext3 will be responsible for everything
# insmod ext2
# ^ D
... Continue to start
In the system boot screen (DMESG), "Cramfs: Wrong Magic" will appear, don't worry that this is not harmful. This problem has been solved in Sarge (2002/10). See http://bugs.debian.org/135537 and http://www.symonds.net/-dex.html, or / usr / share / doc / howto / en-txt / mini /Extra/ext3-mini-howto.gz gets details.
Activating the EXT3 feature will cause a serious core-core lock in some systems, but I have not encountered this problem (my kernel is 2.4.17).
7.2.5 Support for Realtek RTL-8139
------------------------------
I don't know why, the RTL-8139 support module is no longer called RTL8139, and now it is called 8139too. Upgrade from the 2.2 ring to version 2.4, remember to make a corresponding modification in / etc / modules.
7.2.6 Parallel Port Support
------------------
For kernel-image-2.4. *, Parallel port support has been modular, to activate executable:
# modprobe lp
# echo lp >> / etc / modules
See Documentation / PARPORT.TXT in the Linux kernel source directory.
7.2.7 Open too many files
--------------------
The Linux kernel sometimes reports "Too Many Open Files", which is that the File-Max default value is too small. To solve this problem, you can perform the following commands as root (or add them to the init script under /etc/rcs.d/*.)
# echo "65536"> / proc / sys / fs / file-max # Suitable for 2.2 and 2.4 cores
# echo "131072"> / proc / sys / fs / inode-max # only for version 2.2 core
Other kernel parameters Operation examples See /etc/init.d/networking and 〖3.7.5 Unable to access the blame of this site.
================================================== Debian Reference
CVS, 2003-01-31-07: 53: 52
Osamu aoki osamu@debian.org
Editor: David SEWELL DSEWELL@virginia.edu
Lyoo iamlyoo@163.com
2003/02/19