Gentoo初探

鉴于之前在Ubuntu上面的种种问题,决定尝试下Gentoo,正好最近学习linux内核,这个可以作为一次实践。


关于Ubuntu的问题见:http://blog.csdn.net/zhgn2/article/details/7466597个


1. 准备安装


因为之前有专门的一个启动分区(安装Grub4Dos)用来管理我机器上的若干个Linux和Windows系统,这步比较简单。

首先下载minimal ISO: amd64

把下载来的ISO放到一个Fat分区,因为之前就有一个专门的Fat分区存放各种LInux的ISO这步也简单。为什么需要fat分区下面再说。

在Grub4Dos的menu.lst文件中添加“安装gentoo”

timeout 9000

title Windows 7
root (hd0,0)
chainloader +1
boot

title WinPE
boot

title Gentoo 64bit
root (hd0,7)
chainloader +1
boot

title Install ubuntu
find --set-root /ubuntu-9.10-amd64.iso
map /ubuntu-9.10-amd64.iso (hd32)
map --hook
kernel (hd32)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-9.10-amd64.iso
initrd (hd32)/casper/initrd.lz
boot

title Install ubuntu 11.10
find --set-root /ubuntu-11.10-amd64.iso
map /ubuntu-11.10-amd64.iso (hd32)
map --hook
kernel (hd32)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-11.10-amd64.iso
initrd (hd32)/casper/initrd.lz
boot

title Install ubuntu 12.04
find --set-root /precise-desktop-amd64.iso
map /precise-desktop-amd64.iso (hd32)
map --hook
kernel (hd32)/casper/vmlinuz boot=casper iso-scan/filename=/precise-desktop-amd64.iso
initrd (hd32)/casper/initrd.lz
boot

title Install ubuntu 12.04 mem
find --set-root /precise-desktop-amd64.iso
map /precise-desktop-amd64.iso (hd32)
map --hook
chainloader (hd32) +1
rootnoverify (hd32)
map --harddrives=1
boot

title Install Gentoo
find --set-root /Gentoo-amd64-minimal-20120223.iso
map /Gentoo-amd64-minimal-20120223.iso (hd32)
map --hook
chainloader (hd32) +1
rootnoverify (hd32)
map --harddrives=1
boot

title Reboot
reboot

title Shutdown
halt

以上的目的其实主要是实现不使用光驱,只用ISO完成gentoo安装。但由于gentoo对硬盘安装的支持不够好,所以还需要把iso的内容解压到任意分区的根目录下才行。


下载stage3:amd64

注意不要放到解压iso的那个分区,因为启动gentoo livecd后那个分区会自动挂载,但是我看不到那个挂载的目录,应该是chroot引起的。


2. 重启, 进入Gentoo liveCD


3. 用net-setup配置好网络


4. 然后alt+F2启动另一个tty,用links打开gentoo的主页,然后按照文档一步一步进行安装。

如果你在虚拟机上安装的话,就不需要这样了。

PS:发现命令行下的浏览器异常的快,但是不能显示图片。用来装系统还是够用的。不能显示中文。


5. 如果你不想破坏MBR中设置好的启动方式的话,注意最后的grub安装时不要安装在整个磁盘上,而是安装到类似(hd0,7)这样的分区上面。

安装好后,上面的“Gentoo 64bit”就可以用来启动到gentoo系统了。


6.我的Gentoo安装好后,命令行的默认分辨率为1024*768,看着很不爽。继续查看handbook,发现提到把“video=uvesafb:1280x1024-32,mtrr:3,ywrap”加入到Command Line。查了资料才知道原来这里提到的Command Line是指kernel的,就是

title Gentoo Linux 3.2.12
root (hd0,7)
kernel /boot/kernel-3.2.12-gentoo root=/dev/sda8 video=uvesafb:1280x1024-32,mtrr:3,ywrap
initrd /boot/initramfs-genkernel-x86_64-3.2.12-gentoo

7. 编译FrameBuffer

参考文档:http://en.gentoo-wiki.com/wiki/Framebuffer


8. 由于在安装Gentoo的过程中不小心把默认Locale配置成了中文,所以安装了zhcon。当然还是可以改回英文的。

这里提供了一些其他的选择:http://forums.gentoo.org/viewtopic-t-740531-start-0.html

忘记了emerge的时候出现的什么问题了,不过都不难,直接links开搜索引擎就都搞定了。这里提一下,由于google在天朝偶尔存在打不开的情况,百度有都是中文结果。所以在控制台下可以使用www.yandex.com。一个德国的搜索引擎。


9. 为了帮助你可以更好的工作学习在gentoo环境下

可以看看这篇文章: http://www.terminally-incoherent.com/blog/2007/05/21/a-day-without-x/

ZGV,一个可以使用FrameBuffer的图片浏览器


10. 安装显卡驱动,我的是ATI

gentoo提供了详尽的文档来配置xorg和nvid、ati和intell的显卡。http://www.gentoo.org/doc/en/?catid=desktop


11. 安装xorg和kde,我选择了kde环境而不是gnome

转完的效果显示,gentoo+kde比KUbuntu快了N多。


12. 可能是显卡驱动安装的有问题,所以进入KDE后打不开桌面效果,我的双屏也不能正常工作,当然镜像不包含在内。


13. ibus似乎不能很好的工作,这篇文章使用云输入法写的。ftcitx可以正常工作。


14. 由于对emerge的方式还不太熟悉,安装了个图形前端kuroo。portage库里面没有,上官网下载源码自己编译。好用

http://sourceforge.net/apps/mediawiki/kuroo/index.php?title=Main_Page


总结

目前来看Gentoo并没有对我的使用造成很严重的问题,而且这些问题应该都是可以解决的。所以不出意外的话,很长的时间内我都将继续使用它用来工作和学习。不知道KDE4.9是不是可以带来什么惊喜,Qt5也一样。

通过Gentoo的安装,第一次尝试了内核编译,发现也不是很复杂,只是很多内核的选项还不知道是干什么用的。

至此Gentoo的学习暂时告一段落,太耗时间了,基本上3天时间。可能我笨,呵呵。剩下的留待使用中遇到了问题再解决好了,毕竟操作系统也是一个工具而已,是用来帮助人使用电脑的,太过于沉迷于工具本身,我感觉有点浪费时间,更好的利用工具来加快学习和工作的进度才是最主要的。


END

你可能感兴趣的:(Gentoo初探)