up

from lfs

”Linux From Scratch: Version 3.3”というものが有るようです 。 理解し たという理由では 無いのですが 以下のようなものが有ります。 勝手な抜粋ですので オリジナルな もので 確認されたいと思 います。

http://archive.linuxfromscratch.org/lfs-museum/3.3/LFS-BOOK-3.3-HTML/chapter05/kernel.html
The kernel configuration file is created by running the following command:
make mrproper &&
make include/linux/version.h &&
make symlinks &&
mkdir $LFS/usr/include/asm &&
cp include/asm/* $LFS/usr/include/asm &&
cp -R include/linux $LFS/usr/include &&
touch $LFS/usr/include/linux/autoconf.h

make mrproper other

make mrproper: This will ensure that the kernel tree is absolutely clean. We do this because the kernel team recommend that this is done prior to each kernel compilation, and that we shouldn't rely on the source tree being automatically clean after untarring.

make include/linux/version.h and make symlinks: This creates the include/linux/version.h, as well as the include/asm symlink.

mkdir $LFS/usr/include/asm and cp include/asm/* $LFS/usr/include/asm: This copies the platform-specific assembler kernel header files to $LFS/usr/include/asm

cp -R include/linux $LFS/usr/include: This command copies the cross-platform kernel header files to $LFS/usr/include

touch $LFS/usr/include/linux/autoconf.h: Some kernel header files include this autconf.h file, but outside the Linux source tree, that file has no meaning so we just create an empty one so we don't get compile errors whenever it happens to be a dependency of another kernel header file.

Why we copy the kernel headers and don't symlink them

In the past, it was common practice for people to symlink the /usr/include/linux and asm directories to /usr/src/linux/include/linux and asm respectively. This is a bad idea as this extract from a post by Linus Torvalds to the Linux Kernel Mailing List points out:

I would suggest that people who compile new kernels should: - not have a single symbolic link in sight (except the one that the kernel build itself sets up, namely the "linux/include/asm" symlink that is only used for the internal kernel compile itself)

And yes, this is what I do. My /usr/src/linux still has the old 2.2.13 header files, even though I haven't run a 2.2.13 kernel in a _loong_ time. But those headers were what glibc was compiled against, so those headers are what matches the library object files.

And this is actually what has been the suggested environment for at least the last five years. I don't know why the symlink business keeps on living on, like a bad zombie. Pretty much every distribution still has that broken symlink, and people still remember that the linux sources should go into "/usr/src/linux" even though that hasn't been true in a _loong_ time.

もう少し 理解できないので 実際に 試してみましょう。

にゃんたろう 拝!

2007年11月21日 (水) 22:13:11 JST 作成


up

Copyright © 2004.-2007. nyantarou All Rights Reserved.