在VMware上安装Gentoo 2004.1笔记( 三 )


--------------------------------------------------------------------------------
# cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
--------------------------------------------------------------------------------
Chroot 进入新的编译环境

一、chroot
--------------------------------------------------------------------------------
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
--------------------------------------------------------------------------------
Note : 如果 env-update 提示出错,看一下 /etc/make.conf 是不是有错,刚才,mirrorselect 会加入镜像站点地址,但是那一行上面会多出一行多余的提示信息,注释掉或删掉都可以 。

二、更新 Portage
--------------------------------------------------------------------------------
# emerge sync
{如果不能完成,就用下面的命令
# emerge-webrsync }
--------------------------------------------------------------------------------

三、USE设置
--------------------------------------------------------------------------------
# nano -w /etc/make.conf
--------------------------------------------------------------------------------
加入:
USE="-gtk -gnome qt kde alsa"

四、下载必须的源码
--------------------------------------------------------------------------------
# cd /usr/portage
# scripts/bootstrap.sh -f
--------------------------------------------------------------------------------
编译它
--------------------------------------------------------------------------------
# scripts/bootstrap.sh
--------------------------------------------------------------------------------
如果有改变过 预置的环境变量,那么需要用
--------------------------------------------------------------------------------
# source /etc/profile
--------------------------------------------------------------------------------
更新一下 。

续:
五、从stage2 到 stage3 (如果你是从stage3 开始的就应该可以不做了)
看看你将需要做的内容:
--------------------------------------------------------------------------------
# emerge --pretend system | less
--------------------------------------------------------------------------------
获取源码:
--------------------------------------------------------------------------------
# emerge --fetchonly system// 上周做到这里了 。
--------------------------------------------------------------------------------
编译系统:
--------------------------------------------------------------------------------
# emerge system
--------------------------------------------------------------------------------
顺利的做完了这些,我们就可以编译内核了 。

编译内核

一、设置时区
--------------------------------------------------------------------------------
# cd /etc
# rm localtime
# ln -sf /usr/share/zoneinfo/Asia/Shanghai localtime
# nano -w /etc/rc.conf
--------------------------------------------------------------------------------
修改使 CLOCK="PRC"

二、下载内核的源码包
使用 2.4.X 内核
--------------------------------------------------------------------------------
# emerge gentoo-sources
--------------------------------------------------------------------------------
使用 2.6.X 内核
--------------------------------------------------------------------------------
# emerge gentoo-dev-sources
--------------------------------------------------------------------------------

三、修改内核源码目录链接
--------------------------------------------------------------------------------
# ls -l /usr/src/linux
在这里你可以看到你下载的源码的目录
# rm /usr/src/linux && ln -s /usr/src/linux-2.6.7-gentoo-r8/usr/src/linux
--------------------------------------------------------------------------------

推荐阅读