|
gentoo新手 的坎坷安装过程-,=
我写的太过凌乱。。。。。那啥不要在意=,=
我在Intel板载 raid0分区上安装Gentoo过程:
配置是:
CPU Core i7 2600K OC 4.5Ghz
MB GA-Z68X-UD3P-B3
MEM DDR3 1333Mhz OC 1600Mhz 12Gb
Graphics Card Nvidia Geforce GTX 460
HDD 7200RPM 1TB X2 RAID0
集成的Realtek 8168/8111E 网卡在Linux Kernel 自带的r8169模块中不知怎么回事,老是掉线和延迟超大,ethtool还不能控制。
没办法我只好进Bios屏蔽板载的8111E网卡,从另一台机器上拆下一块8139网卡插上去了。。。。等以后编译官方版驱动把=。=
使用Gentoo Live mini安装CD http://mirrors.163.com/gentoo/re ... inimal-20110922.iso
启动临时安装环境
boot: gentooo dodmraid doraid
已经提前在Windows下分区完毕了,50GB root分区,和100GB /Home 分区,我只把/home独立出来了,因为那啥不太喜欢多分区,省的日后万一有啥空间不足。。。。
# ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 Sep 25 10:31 control
brw------- 1 root root 253, 0 Sep 25 10:31 isw_bfcfcafdga_Ra
brw------- 1 root root 253, 1 Sep 25 10:31 isw_bfcfcafdga_Ra1
brw------- 1 root root 253, 2 Sep 25 10:31 isw_bfcfcafdga_Ra2
brw------- 1 root root 253, 3 Sep 25 10:31 isw_bfcfcafdga_Ra3
brw------- 1 root root 253, 4 Sep 25 10:31 isw_bfcfcafdga_Ra4
#mkfs.ext4 /dev/mapper/isw_bfcfcafdga_Ra3
#mkfs.ext4 /dev/mapper/isw_bfcfcafdga_Ra4
#mount /dev/mapper/isw_bfcfcafdga_Ra3 /mnt/gentoo
#mkdir /mnt/gentoo/home
#mount /dev/mapper/isw_bfcfcafdga_Ra4 /mnt/gentoo/home
# cd /mnt/gentoo
#wget http://mirrors.163.com/gentoo/re ... 64-20110922.tar.bz2
#tar xvjpf stage3-*.tar.bz2
#wget http://mirrors.163.com/gentoo/snapshots/portage-latest.tar.bz2
# tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
# nano -w /mnt/gentoo/etc/make.conf
#cat /mnt/gentoo/etc/make.conf
ACCEPT_KEYWORDS="~amd64"
CFLAGS="-O2 -pipe -march=native -mtune=native -mavx -finline-limit=1000 "
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="mmx gd* ipv6 kdrive nptl udev xorg openmp gtk -kde apng boost aqua a52 aac acpi cairo canna ssse3 cvs dbus dri gd glut lame mad mng mp4 mplayer multilib smp svg theora usb wifi x264 xvid alsa nvidia sasl ssl sse sse2 X sse3 sse4 avx qt4 dvd alsa cdr bash-completion bzip2 cjk curl cvs cxx iconv jpeg jpek2k openmp opengl openal png therads lzma lzo gnome -cups "
MAKEOPTS="-j10"
FEATURES="parallel-fetch"
INPUT_DEVICES="keyborad mouse"
VIDEO_CARDS="nvidia"
LINGUAS=" zh zh_CN"
ALSA_CARDS="hda-intel"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/ http://mirrors.sohu.com/gentoo/"
顺便一提2nd Generation i7 指定gcc -march=native 后,自动设置的优化选项是这样的:
# echo "" | gcc -march=native -v -E - 2>&1 | grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.1/cc1 -E -quiet -v - -D_FORTIFY_SOURCE=2 -march=corei7-avx -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mavx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=corei7-avx
继续安装:
# cp -L /etc/resolv.conf /mnt/gentoo/etc/
# mount -t proc none /mnt/gentoo/proc
# mount -o bind /dev /mnt/gentoo/dev
# chroot /mnt/gentoo /bin/bash
# env-update
>> Regenerating /etc/ld.so.cache...
# source /etc/profile
# emerge --sync
# eselect profile list
Available profile symlink targets:
[1] default/linux/amd64/10.0
[2] default/linux/amd64/10.0/desktop
[3] default/linux/amd64/10.0/desktop/gnome *
[4] default/linux/amd64/10.0/desktop/kde
[5] default/linux/amd64/10.0/developer
[6] default/linux/amd64/10.0/no-multilib
[7] default/linux/amd64/10.0/server
[8] hardened/linux/amd64
[9] hardened/linux/amd64/selinux
[10] hardened/linux/amd64/no-multilib
[11] hardened/linux/amd64/no-multilib/selinux
[12] selinux/2007.0/amd64
[13] selinux/2007.0/amd64/hardened
[14] selinux/v2refpolicy/amd64
[15] selinux/v2refpolicy/amd64/desktop
[16] selinux/v2refpolicy/amd64/developer
[17] selinux/v2refpolicy/amd64/hardened
[18] selinux/v2refpolicy/amd64/server
# eselect profile set 3
#nano -w /etc/conf.d/clock
#cat /etc/conf.d/clock
CLOCK="local"
# emerge gentoo-sources
# emerge dmraid
# cd /usr/src/linux
# lspci
# emerge genkernel --dmraid --menuconfig
#genkernel --dmraid initramfs
# nano -w /etc/fstab
#cat /etc/fstab
/dev/mapper/isw_bfcfcafdga_Ra3 / ext4 defaults,noatime 1 0
/dev/mapper/isw_bfcfcafdga_Ra4 /home ext4 defaults,noatime 1 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#nano -w /etc/conf.d/hostname
#nano -w /etc/conf.d/net
#cat /etc/conf.d/net
config_eth0="192.168.1.102 netmask 255.255.255.0"
routes_eth0="default via 192.168.1.1 "
#ln -s /etc/init.d/net /etc/init.d/net.eth0
# rc-update add net.eth0 default
# passwd
# emerge syslog-ng
# rc-update add syslog-ng default
# emerge vixie-cron
# rc-update add vixie-cron default
# cd /root/
#wget http://r8168.googlecode.com/files/r8168-8.025.00.tar.bz2
然后写grub配置文件,我在windows下使用windows的BCD启动Grub4dos,menu.list
timeout 2
title Gentoo Linux
root (hd0,2)
kernel /boot/kernel-genkernel-x86_64-3.0.4-gentoo dodmraid root=/dev/mapper/isw_bfcfcafdga_Ra4
initrd /boot/initramfs-genkernel-x86_64-3.0.4-gentoo
退出Live CD 关机拆掉老8139网卡,启动后很顺利一切正常。。。。
继续编译网卡驱动
# tar xf r8168-8.025.00.tar.bz2 && cd r8168-8.025.00
#make
#cp src/r8168.ko /lib/modules/3.0.4-gentoo/kernel/drivers/net/
#depmod && modprobe r8168
#/etc/init.d/net.eth0 restart
终于能上网了,现在升级下glibc和gcc。
#cat /etc/portage/package.unmask
=sys-devel/gcc-4.6.1-r1
#cat /etc/portage/package.keywords
=sys-devel/gcc-4.6.1-r1 **
emerge -pv glibc
******
[ebuild R ] sys-libs/glibc-2.13-r4 USE="gd (multilib) nls -debug -glibc-omitfp (-hardened) -profile (-selinux) -vanilla" 0 kB
******
#emerge glibc
#emerge gcc
# gcc-config x86_64-pc-linux-gnu-4.6.1
# source /etc/profile
# emerge --oneshot -av libtool
再次编译glibc
#emerge glibc
然后重新用新版gcc和glibc重新编译内核
# cd /usr/src/linux
# emerge genkernel --dmraid --menuconfig
#genkernel --dmraid initramfs
再次重启一切正常,继续安装必要软件和桌面环境
#emerge alsa-lib alsa-utils dbus ntfs3g
# rc-update add alsasound default
# rc-update add dbus default
# rc-update add acpid default
# emerge xorg-server 我的USE明显那啥了,这一步连gtk2 qt4等都编译好了,等了50多分钟=。=在make.conf里配置过,所以连nvidia二进制驱动也自动装上了
# emerge xf86-input-keyboard xf86-input-mouse xf86-input-evdev
# eselect opengl set nvidia
#emerge ttf-bitstream-vera arphicfonts wqy-bitmapfont corefonts ttf-bitstream-vera wqy-zenhei wqy-microhei
#emerge gnome 又等了一个半小时左右。。。。
#emerge gdm
cat /etc/conf.d/xdm
# We always try and start X on a static VT. The various DMs normally default
# to using VT7. If you wish to use the xdm init script, then you should ensure
# that the VT checked is the same VT your DM wants to use. We do this check to
# ensure that you haven't accidentally configured something to run on the VT
# in your /etc/inittab file so that you don't get a dead keyboard.
CHECKVT=7
# What display manager do you use ? [ xdm | gdm | kdm | kdm-4.3 | gpe | entrance ]
# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
#
# KDE-specific note:
# - If you are using kdeprefix go with "kdm-4.Y", e.g. "kdm-4.3".
# You can find possible versions by looking at the directories in /usr/kde/.
# - Else, if you are using KDE 3 enter "kdm-3.5"
# - Else, if you are using KDE 4 enter "kdm" without a version
DISPLAYMANAGER="gdm"
# useradd w -d /home/w -s /bin/bash
# passwd w
# nvidia-xconfig
# /etc/init.d/xdm start
成功进入Gnome
#emerage firefox 后跑google js v8 测试。。。。。
CPU 给力就是爽阿。。。。仅仅用了一个下午就完成了Gnome环境附带QT Firefox Mplayer等基础软件,Gentoo刚刚装好,正在学习中。。。。。。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|