linux2.6.1/docs/README

网友投稿 495 2022-05-28

Linux kernel release 2.6.xx

Linux内核-2.6.xx版本

These are the release notes for Linux version 2.6.  Read them carefully,

as they tell you what this is all about, explain how to install the

kernel, and what to do if something goes wrong.

这些是Linux2.6版本的文档。认真阅读它们,因为它们能够告诉你这是什么,解释如何

安装内核,并且当出现错误的时候该怎么办。

WHAT IS LINUX?

Linux is a Unix clone written from scratch by Linus Torvalds with

assistance from a loosely-knit team of hackers across the Net.

It aims towards POSIX compliance.

It has all the features you would expect in a modern fully-fledged

Unix, including true multitasking, virtual memory, shared libraries,

demand loading, shared copy-on-write executables, proper memory

management and TCP/IP networking.

It is distributed under the GNU General Public License - see the

accompanying COPYING file for more details.

什么是Linux?

Linux是从Linus Torvalds的Unix衍生而来的,并且得到了通过网络而结交的松散的

linux2.6.1/docs/README

hackers的帮助,并遵从POSIX规则

它具备你所期望的在现代UNIX操作系统中的所有特点,包括真正的多任务,虚拟内存

共享库,按需加载,写时复制,优雅的内存管理和TCP/IP网络协议

Linux在GNU公共许可证的保护下发布-详情查看COPYING文件

ON WHAT HARDWARE DOES IT RUN?

Linux was first developed for 386/486-based PCs.  These days it also

runs on ARMs, DEC Alphas, SUN Sparcs, M68000 machines (like Atari and

Amiga), MIPS and PowerPC, and others.

运行于那些硬件平台?

Linux最初是开发运行于386/246体系结构的PC的。现在,它也能运行于ARMs,

DEC Alphas, SUN Sparcs, M68000的机器上 (像Atari金额Amiga),

MIPS,PowerPC和其他硬件平台上

DOCUMENTATION:

- There is a lot of documentation available both in electronic form on

the Internet and in books, both Linux-specific and pertaining to

general UNIX questions.  I'd recommend looking into the documentation

subdirectories on any Linux FTP site for the LDP (Linux Documentation

Project) books.  This README is not meant to be documentation on the

system: there are much better sources available.

- There are various README files in the Documentation/ subdirectory:

these typically contain kernel-specific installation notes for some

drivers for example. See ./Documentation/00-INDEX for a list of what

is contained in each file.  Please read the Changes file, as it

contains information about the problems, which may result by upgrading

your kernel.

- The Documentation/DocBook/ subdirectory contains several guides for

kernel developers and users.  These guides can be rendered in a

number of formats:  PostScript (.ps), PDF, and HTML, among others.

After installation, "make psdocs", "make pdfdocs", or "make htmldocs"

will render the documentation in the requested format.

文档:

- 对于Linux特定的或者是常见的Unix的问题在网上的电子版或者书中都有许多可用的

可用的文档。我推荐查看Linux的FTP站的documentation子目录下的LDP文档。这个

README文档不是整个系统的详细文档:还有更多更好的可用资源

- 在Documentation目录的子目录下有许多不同的README文档,它们通常包含了一些

内核相关的驱动的安装实例。请查看Documentation/00-INDEX文件。请阅读Changes

文件,因为它包含了升级你的内核可能带来的一些问题

- Documentation/DocBook的子目录包含了一些为内核开发者和用户提供的指导文档。

这些文档能被生成为多种格式:PostScripts(.ps),PDF,HTML等等。

安装之后,"make psdocs", "make pdfdocs", 或者"make htmldocs"会产生所需

格式的文档

INSTALLING the kernel:

- If you install the full sources, put the kernel tarball in a

directory where you have permissions (eg. your home directory) and

unpack it:

gzip -cd linux-2.6.XX.tar.gz | tar xvf -

Replace "XX" with the version number of the latest kernel.

Do NOT use the /usr/src/linux area! This area has a (usually

incomplete) set of kernel headers that are used by the library header

files.  They should match the library, and not get messed up by

whatever the kernel-du-jour happens to be.

- You can also upgrade between 2.6.xx releases by patching.  Patches are

distributed in the traditional gzip and the new bzip2 format.  To

install by patching, get all the newer patch files, enter the

top level directory of the kernel source (linux-2.6.xx) and execute:

gzip -cd ../patch-2.6.xx.gz | patch -p1

or

bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

(repeat xx for all versions bigger than the version of your current

source tree, _in_order_) and you should be ok.  You may want to remove

the backup files (xxx~ or xxx.orig), and make sure that there are no

failed patches (xxx# or xxx.rej). If there are, either you or me has

made a mistake.

Alternatively, the script patch-kernel can be used to automate this

process.  It determines the current kernel version and applies any

patches found.

linux/scripts/patch-kernel linux

The first argument in the command above is the location of the

kernel source.  Patches are applied from the current directory, but

an alternative directory can be specified as the second argument.

- Make sure you have no stale .o files and dependencies lying around:

cd linux

make mrproper

You should now have the sources correctly installed.

安装内核:

- 如果你从完整的内核源码包安装,请将内核源码压缩包放在具有权限的目录下

(例如你的主用户目录下)并且解压它:

gzip -cd linux-2.6.XX.tar.gz | tar xvf -

将“XX”替换为最新版本内核的版本号

千万不要使用/usr/src/linux的空间!这个区域有(通常不完整的)Linux内核

头文件的集合。它们需要与库对应,无论如何也不要把你当前的内核弄乱。

- 你也可以通过在2.6.××版本之间通过补丁来升级。补丁包一般通过gzip或者bzip2

来打包发布,获取最新的源码,进入源码树顶层路径并执行:

gzip -cd ../patch-2.6.xx.gz | patch -p1

或者

bzip2 -dc ../patch-2.6.xx.bz2 | patch -p1

(重复解压执行所有比现有版本号要大的xx的压缩包)

你可能想要移除那些备份的文件(xxx~或者xxx.orig),并且确保没有失败的

补丁(xxx#或者xxx.rej)。如果有,说明要么是你要么是我出错误了

另外,patch-kernel脚本可以用来自动的执行以上过程。它会按照现在的内核版本

应用它找到的所有内核补丁

linux/scripts/patch-kernel linux

上述命令的第一个参数是内核源码的位置。会被在当前的目录查找补丁,但是你可以

使用第二个参数来指定查找的目录

- 确保没有旧的.o文件或者依赖:

cd linux

make mrproper

你现在应该已经正确的安装了内核源代码

SOFTWARE REQUIREMENTS

Compiling and running the 2.6.xx kernels requires up-to-date

versions of various software packages.  Consult

./Documentation/Changes for the minimum version numbers required

and how to get updates for these packages.  Beware that using

excessively old versions of these packages can cause indirect

errors that are very difficult to track down, so don't assume that

you can just update packages when obvious problems arise during

build or operation.

软件依赖

编译和运行2.6.xx内核需要最新的不同软件包。查看./Documentation/Changes

来获取所需软件包的最小版本号和怎样更新这些软件包。要知道过多的使用老的

软件包会引起一些很难捕获到的错误,因此不要抱着侥幸心理不去升级那些软件包

BUILD directory for the kernel:

When compiling the kernel all output files will per default be

stored together with the kernel source code.

Using the option "make O=output/dir" allow you to specify an alternate

place for the output files (including .config).

Example:

kernel source code: /usr/src/linux-2.6.N

build directory: /home/name/build/kernel

To configure and build the kernel use:

cd /usr/src/linux-2.6.N

make O=/home/name/build/kernel menuconfig

make O=/home/name/build/kernel

sudo make O=/home/name/build/kernel modules_install install

Please note: If the 'O=output/dir' option is used then it must be

used for all invocations of make.

构建内核路径:

当编译内核时所有的输出文件会默认的存放在内核源代码的路径

使用"make O=output/dir"选项可以允许你指定一个目录存放这些文件

(包括 .config)

例如:

内核源码: /usr/src/linux-2.6.N

构建路径: /home/name/build/kernel

使用下列命令来配置和构建内核:

cd /usr/src/linux-2.6.N

make O=/home/name/build/kernel menuconfig

make O=/home/name/build/kernel

sudo make O=/home/name/build/kernel modules_install install

请注意:如果你使用了'O=output/dir'选项,那么所有相关的make命令

都要加上这个参数做指定路径

CONFIGURING the kernel:

Do not skip this step even if you are only upgrading one minor

version.  New configuration options are added in each release, and

odd problems will turn up if the configuration files are not set up

as expected.  If you want to carry your existing configuration to a

new version with minimal work, use "make oldconfig", which will

only ask you for the answers to new questions.

- Alternate configuration commands are:

"make menuconfig"  Text based color menus, radiolists & dialogs.

"make xconfig"     X windows (Qt) based configuration tool.

"make gconfig"     X windows (Gtk) based configuration tool.

"make oldconfig"   Default all questions based on the contents of

your existing ./.config file.

NOTES on "make config":

- having unnecessary drivers will make the kernel bigger, and can

under some circumstances lead to problems: probing for a

nonexistent controller card may confuse your other controllers

- compiling the kernel with "Processor type" set higher than 386

will result in a kernel that does NOT work on a 386.  The

kernel will detect this on bootup, and give up.

- A kernel with math-emulation compiled in will still use the

coprocessor if one is present: the math emulation will just

never get used in that case.  The kernel will be slightly larger,

but will work on different machines regardless of whether they

have a math coprocessor or not.

- the "kernel hacking" configuration details usually result in a

bigger or slower kernel (or both), and can even make the kernel

less stable by configuring some routines to actively try to

break bad code to find kernel problems (kmalloc()).  Thus you

should probably answer 'n' to the questions for

"development", "experimental", or "debugging" features.

- Check the top Makefile for further site-dependent configuration

(default SVGA mode etc).

配置内核:

不要跳过这步,哪怕你只升级了一个镜像版本。每一个新的版本都会添加新的配置

选项,如果没有按照所期望的那样去配置,那么将会出现一些很古怪的问题。如果

你想要做极少的工作来将你现在的配置移植到新版本的内核中。使用"make oldconfig"

那样的话只会问你少量的一些问题

- 可选的配置命令有:

"make menuconfig"  基于彩色菜单,单选列表和对话框的文本

"make xconfig"     基于X windows (Qt)的配置工具

"make gconfig"     基于X windows (Gtk)的配置工具

"make oldconfig"   基于所存在的./.config文件的默认配置

注意"make config":

- 安装不必要的驱动会使内核过大,并且在某些情况下会导致一些问题:

安装不存在控制卡的驱动会扰乱其他的控制卡

- 在编译内核时使用高于386的"Processor type"选项会使得内核不能在

386机器上运行。内核会在机器启动时检测这个问题,然后放弃启动。

- 编译有数学仿真器的内核依旧会使用协处理器,如果存在协处理器的话:

在那种情况下,数学仿真器从来不会被使用。内核会稍大一些,但是它们

会在不同的机器上运行,无论机器上是否存在协处理器

- "kernel hacking"配置细节会导致一个更大或者更慢的内核(或者兼而有之)

甚至会因为配置了一些为找到内核问题而积极破坏一些坏代码的例程而导致

内核不稳定(kmalloc()),因此你应该适当地回答'n'来回应"development",

"experimental"或者"debugging"

? - 检查最顶部Makefile为更相关依赖的配置(默认SVGA模式等)

COMPILING the kernel:

- Make sure you have gcc 2.95.3 available.

gcc 2.91.66 (egcs-1.1.2), and gcc 2.7.2.3 are known to miscompile

some parts of the kernel, and are *no longer supported*.

Also remember to upgrade your binutils package (for as/ld/nm and company)

if necessary. For more information, refer to ./Documentation/Changes.

Please note that you can still run a.out user programs with this kernel.

- Do a "make bzImage" to create a compressed kernel image.  If you want

to make a boot disk (without root filesystem or LILO), insert a floppy

in your A: drive, and do a "make bzdisk".  It is also possible to do

"make install" if you have lilo installed to suit the kernel makefiles,

but you may want to check your particular lilo setup first.

To do the actual install you have to be root, but none of the normal

build should require that. Don't take the name of root in vain.

- In the unlikely event that your system cannot boot bzImage kernels you

can still compile your kernel as zImage. However, since zImage support

will be removed at some point in the future in favor of bzImage we

encourage people having problems with booting bzImage kernels to report

these, with detailed hardware configuration information, to the

linux-kernel mailing list and to H. Peter Anvin .

- If you configured any of the parts of the kernel as `modules', you

will have to do "make modules" followed by "make modules_install".

- Keep a backup kernel handy in case something goes wrong.  This is

especially true for the development releases, since each new release

contains new code which has not been debugged.  Make sure you keep a

backup of the modules corresponding to that kernel, as well.  If you

are installing a new kernel with the same version number as your

working kernel, make a backup of your modules directory before you

do a "make modules_install".

- In order to boot your new kernel, you'll need to copy the kernel

image (found in .../linux/arch/i386/boot/bzImage after compilation)

to the place where your regular bootable kernel is found.

For some, this is on a floppy disk, in which case you can copy the

kernel bzImage file to /dev/fd0 to make a bootable floppy.

If you boot Linux from the hard drive, chances are you use LILO which

uses the kernel image as specified in the file /etc/lilo.conf.  The

kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or

/boot/bzImage.  To use the new kernel, save a copy of the old image

and copy the new image over the old one.  Then, you MUST RERUN LILO

to update the loading map!! If you don't, you won't be able to boot

the new kernel image.

Reinstalling LILO is usually a matter of running /sbin/lilo.

You may wish to edit /etc/lilo.conf to specify an entry for your

old kernel image (say, /vmlinux.old) in case the new one does not

work.  See the LILO docs for more information.

After reinstalling LILO, you should be all set.  Shutdown the system,

reboot, and enjoy!

If you ever need to change the default root device, video mode,

ramdisk size, etc.  in the kernel image, use the 'rdev' program (or

alternatively the LILO boot options when appropriate).  No need to

recompile the kernel to change these parameters.

- Reboot with the new kernel and enjoy.

编译内核:

- 确保你有可用的gcc 2.95.3

gcc 2.91.66 (egcs-1.1.2)和gcc 2.7.2.3已知会错误编译一部分内核,并且它们

为"非长期支持版本"

如果必要的话,记得升级你的binutils软件包。

获取更多信息请参考 ./Documentation/Changes

请注意,使用这个内核你仍然可以运行a.out用户程序

- 使用"nake bzImage"来创建一个压缩内核镜像。如果你想制作一个启动盘(没有

根文件系统或者LILO Linux加载程序),插入一张软盘然后使用"make bzdisk"命令

也可以使用"make install"如果你安装有适于内核makefiles的LILO,但是你可能要

先检查LILO的安装

做实际的内核安装你必须拥有root权限,但是正常的构建都不需要那样。不要随意

使用root

- 你的系统不能启动bzImage内核而能够依旧可以把内核编译为zImage是不可能的。

不论怎样,既然在未来的某个时刻,zImage将不再被支持,而支持bzImage,我们

鼓励大家来报告一些启动bzImage内核的问题,要包括详细的硬件配置信息来报告给

linux-kernel邮件列表并提交给.Peter Anvin  

- 如果你以模块化的形式编译内核,你需要按照"make modules_install"来使用

"make modules"命令

- 备份你的内核以防它出错。尤其对于开发者版本的内核,因为每一个新版本都包含

没有被调试的代码。也要确保你有对应你的内核版本的模块备份。如果你安装和你

当前工作一样版本的内核,在你使用"make modules_install"之前备份你的模块

目录

- 为了启动你的新内核,你需要拷贝你的内核镜像(编译后在 .../linux/arch/i386

/boot/bzImage 找到)至你一般启动的内核

以上是在软盘中启动,你可以拷贝内核bzImage文件至 /dev/fd0 来制作一个启动软盘

如果你在硬盘启动Linux,拷贝内核至相关路径(参见 /etc/lilo.conf)

内核镜像文件通常在 /vmlinuz, /boot/vmlinuz, /bzImage 或者 /boot/bzImage

为了使用新内核,拷贝一份老的镜像,然后用新镜像覆盖老镜像。然后你必须重新

运行LILO来更新装载表。如果不这样做,新内核将不会被启动

通常运行 /sbin/lilo 来重新设置LILO,你可能希望通过编辑 /etc/lilo.conf

来为你的老内核(vmlinux.old)指定一个入口以防新内核不工作。你可以查看

LILO文档来获取更多信息

重新设置LILO之后,一切准备就绪。关机,重启,OK!

如果你想要更改默认的跟设备,显示模式,内存大小等等,在内核镜像中使用"rdev"

(或者利用LILO启动选项)。没必要重新编译内核

- 用新内核重启,然后尽情的玩耍吧!

Linux 镜像服务

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Redis硬核篇:从高频问题横扫核心知识原理
下一篇:【月更第10篇】2022年,一个初级运维常用的命令清单,实战落地场景+解决方案,实操9场景
相关文章