LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 5388|回复: 22

[小结]新手利用Ubuntu liveCD在T400上安装 GentooAMD64(欢迎指正,因为我KDE没装成功)

[复制链接]
发表于 2009-7-1 10:34:12 | 显示全部楼层 |阅读模式
新配了计算机,所以就鼓气勇气装gentoo,确实非常难装,现在基本能熟练赚最小的gentoo系统(行命令形式)。不知道是否会继续用它,所以把装机体会贴出来。在此感谢坛上的各位的热心帮助!

主要参考资料:
gentoo官网上的安装手册:
http://www.gentoo.org/doc/zh_cn/ ... ok-amd64.xml?full=1
网上关于T400安装的wiki
http://en.gentoo-wiki.com/wiki/Lenovo_T400
一个国外的博客文章:
http://www.cosy.sbg.ac.at/~shuber/misc-t400.php


Step1:
利用Ubuntu liveCD启动计算机。说明一下:最开始是因为用mini install CD启动后,找不到网卡,所以,想到用ubuntu的liveCD,后来发现用它安装系统,有个好处是可以查网络资料。哈哈

Step2:
确认可以上网,我的现象是要手动点一下网络连接图标,才能自动获得IP。哈哈,要是不能上网,当然就安装不成功了

Step3:
启动一个终端(Applications->Accessories->Terminal),并切换到root用户。
代码:
      sudo -s

Step4:
为了能参考安装手册,需要在mnt目录下创建一个gentoo目录。
代码:
       cd /
       cd mnt
       mkdir gentoo

到这一步,如果想了解详细的安装步骤,哈哈,就可以按照手册的指导来进行了。分区以及对分区设置文件系统的事情,请参考手册,我这里从手册的第4步开始:

下面开始创建相应的目录和做相应的挂载工作:
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot  #这步不是第一次,并且不是格式化机器,可以不做
mount /dev/sda1 /mnt/gentoo/boot
 楼主| 发表于 2009-7-1 10:43:30 | 显示全部楼层
Step5:

按照手册上步骤开始下载相关文件(由于是校园网,所以从清华下)
ftp://ftp3.tsinghua.edu.cn/mirror/gentoo/releases/amd64/current/
利用LIVECD中的浏览器FIREFOX下载文件:
stage3-amd64-20090625.tar.bz2

ftp://ftp3.tsinghua.edu.cn/mirror/gentoo/snapshots/
下载文件:
portage-latest.tar.bz2

由于下载文件缺省在桌面,所以将文件拷贝到手册说的位置(哈哈,尽量向手册靠拢)
ls /home/ubuntu/Desktop #看下有没有这些文件
cp  /home/ubuntu/Desktop/portage-*.tar.bz2  /mnt/gentoo
rm  /home/ubuntu/Desktop/portage-*.tar.bz2
cp /home/ubuntu/Desktop/stage3-*.tar.bz2 /mnt/gentoo
rm /home/ubuntu/Desktop/stage3-*.tar.bz2

按照手册要求,解压缩文件:
cd /mnt/gentoo
tar xvjpf stage3-*.tar.bz2
tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr

按照手册要求,编辑make.conf文件:
gedit /mnt/gentoo/etc/make.conf
偷个懒,就从别人博客中(http://www.cosy.sbg.ac.at/~shuber/misc-t400.php)
和网友blackwhite(http://www.linuxsir.cn/bbs/private.php?do=showpm&pmid=103932)
的内容拷贝过来,当然自己作了很小很小的调整

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /etc/make.conf.example for a more detailed example.
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"


MAKEOPTS="-j3"
#FEATURES="parallel-fetch"

PORTAGE_NICENESS=3
ALSA_CARDS="hda-intel"

GENTOO_MIRRORS="ftp://ftp3.tsinghua.edu.cn/mirror/gentoo"
SYNC="rsync://mirror.averse.net/gentoo-portage"

USE="-esd -gnome -gstreamer -motif X a52 aac acpi alsa arts at4 bash-completion bittorrent
bzip2 c++ cdparanoia cdr dbus dhcp dirac divx dri dvd dvdr dvdread encode exif ffmpeg fuse
gimp gtk irc jpeg kde kdeprefix lame laptop latex logrotate mikmod mmx mp2 mp3 mp4 mp4live mpeg
mpeg2 mplayer nomotif -nptl nsplugin ogg ogm opengl png pstricks samba scim sdl sid smp sse sse2
sse3 ssse3 unicode vcd vim-syntax wifi wma wmf wmp xcb xinerama xorg xulrunner svg hal"

INPUT_DEVICES="keyboard mouse synaptics evdev"
VIDEO_CARDS="intel"
LINGUAS="en"

哈哈,我是准备装KDE的,所以有不少KDE相关的USE,另外VIDEO_CARDS="intel"是否修改,哈哈,我还想再试验试验
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-1 11:21:17 | 显示全部楼层
Step6:

接着按手册来动作,就是备份网络
cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -o bind /proc /mnt/gentoo/proc/
mount -o bind /dev /mnt/gentoo/dev/
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"

到此时为止,进入自己的系统了。最直接的区别就是不能用gedit这样的编辑器了,要编辑必须要改用nano了。
用nano也不错,由于在liveCD中,拷贝复制一样可以进行,所以不用担心,不用当心 :)

emerge --sync

进行区域设置
nano -w /etc/locale.gen
所设置的内容和手册不一样,加了一些我认为需要的支持
en_US.UTF-8 UTF-8
en_US ISO-8859-1
zh_CN.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN GB2312
zh_HK.UTF-8 UTF-8
zh_HK BIG5-HKSCS
zh_SG.UTF-8 UTF-8
zh_SG.GBK GBK
zh_SG GB2312
zh_TW.EUC-TW EUC-TW
zh_TW.UTF-8 UTF-8
zh_TW BIG5

执行代码
locale-gen
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-1 11:31:37 | 显示全部楼层
Step7:

code:
ls /usr/share/zoneinfo
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
emerge gentoo-sources
emerge pciutils  #此非必须,但装上也好吧
emerge genkernel
cd /usr/src/linux
# nano -w ./.config



最关键的步骤,重复次数最多的,让我最头疼的,到现在也弄不明白的步骤。就是配置内核。
(用哪种好,论坛上有讨论...,我用手动配置)
make menuconfig
不过虽然是手动配置,我还是偷懒了,
用博客的配置文件
http://www.cosy.sbg.ac.at/~shuber/files/kernel.config.2-6-29.T400
同时还要注意的是,如果config文件不是命名为.conf,也可以载入,不过在载入后,要保存为.config,否则会出错(提示没有.config文件,或者编译不正确?) edit the video card config. device->graphics->(mode change to include)


继续按手册干活:
make && make modules_install
cp arch/x86_64/boot/bzImage /boot/kernel-2.6.29-gentoo-r5
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-1 13:04:25 | 显示全部楼层
step 8:
  1. nano -w /etc/fstab
复制代码
contents:
/dev/sda1               /boot           ext2            noauto,noatime  1 2
/dev/sda3               /               ext3            noatime         0 1
/dev/sda4               /home           ext3            noatime         0 0
/dev/sda2               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,user     0 0

# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
#  use almost no memory if not populated with files)
shm                     /dev/shm        tmpfs           nodev,nosuid,noexec     0 0
  1. nano -w /etc/conf.d/net
复制代码
内容:config_eth0=("dhcp")
  1. rc-update add net.eth0 default
复制代码
  1. passwd
复制代码
  1. nano -w /etc/conf.d/clock
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-1 13:15:17 | 显示全部楼层
step 9:
  1. emerge syslog-ng
  2. rc-update add syslog-ng default
  3. USE="-gtk" emerge evms
  4. emerge dhcpcd
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-1 13:22:14 | 显示全部楼层
step10 :
  1. emerge grub
  2. ls /boot
  3. nano -w /boot/grub/grub.conf
  4. grep -v rootfs /proc/mounts > /etc/mtab
  5. grub-install --no-floppy /dev/sda
复制代码
到现在,基本的gentoo就安装好了,也基本正常
  1. exit
  2. cd
  3. umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
  4. reboot
  5. #重起后,添加用户
  6. useradd -m -G audio,cdrom,usb,plugdev,video,wheel -s /bin/bash 用户名
  7. passwd 用户名
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-3 13:26:05 | 显示全部楼层
我的硬件列表如下:
42X6336 SBB INT.CORE2DUOPROCP8600
42V8012 VBB MS WIN VISTA HOME BASIC
44C1269 SBB GEN WIN VIS HOBAS 32 US E
42X6319 ** SBB 14.1 WXGA TFT, W / CAM
42X6313 SBB INT.GRAPH.MEDIAACCELX4500
42X6303 VBB 1GBPC3-8500 1067MHZ1DIMM(后加了条1G内存)
42X6355 SBB KYB US ENGLISH
42X6322 SBB ULTRNAV(TRACKP+TOUCHPAD)
42X6348 SBB 160GB HDD/5400RPM
42X6345 SBB DVDRECORD.8XMAXDUAL,ULTBAY
42X6312 VBB EXPR.CARDSLOTXN7-1M.CARDR.
62P6054 VBB INTEGR.BLUETOOTH PAN
44C2615 SBB THINKPAD 11B/G WLAN PCI 3
42X6328 SBB INTG.WIR.WIDENET UPGRAD.
42V9337 SBB 4 CELL LI-ION BATERRY
41W1787 SBB CPK NORTH AMERICA
42X6388 SBB LPACK US ENGLISH



在Ubuntu liveCD,计算机工作正常,用命令
lspci -k
可以看到如下信息:
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
        Kernel driver in use: agpgart-intel
        Kernel modules: intel-agp
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:03.0 Communication controller: Intel Corporation Mobile 4 Series Chipset MEI Controller (rev 07)
00:03.2 IDE interface: Intel Corporation Mobile 4 Series Chipset PT IDER Controller (rev 07)
00:03.3 Serial controller: Intel Corporation Mobile 4 Series Chipset AMT SOL Redirection (rev 07)
        Kernel driver in use: serial
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
        Kernel driver in use: e1000e
        Kernel modules: e1000e
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
        Kernel driver in use: uhci_hcd
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
        Kernel driver in use: uhci_hcd
00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
        Kernel driver in use: uhci_hcd
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
        Kernel driver in use: ehci_hcd
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
        Kernel driver in use: HDA Intel
        Kernel modules: snd-hda-intel
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
        Kernel driver in use: pcieport-driver
        Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
        Kernel driver in use: pcieport-driver
        Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
        Kernel driver in use: pcieport-driver
        Kernel modules: shpchp
00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
        Kernel driver in use: pcieport-driver
        Kernel modules: shpchp
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
        Kernel driver in use: uhci_hcd
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
        Kernel driver in use: uhci_hcd
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
        Kernel driver in use: uhci_hcd
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
        Kernel driver in use: ehci_hcd
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
        Kernel modules: iTCO_wdt
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
        Kernel driver in use: ahci
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
        Kernel modules: i2c-i801
03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
        Kernel driver in use: ath5k_pci
        Kernel modules: ath_pci, ath5k
15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
        Kernel driver in use: yenta_cardbus
        Kernel modules: yenta_socket
15:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)
        Kernel driver in use: ohci1394
        Kernel modules: firewire-ohci, ohci1394
15:00.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)
        Kernel driver in use: sdhci-pci
        Kernel modules: sdhci-pci
15:00.3 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev ff)
        Kernel driver in use: ricoh-mmc
        Kernel modules: ricoh_mmc
15:00.4 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 11)
15:00.5 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 11)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-3 15:12:22 | 显示全部楼层
下面开始装KDE,还没有调试成功。


主要参考:
http://www.gentoo.org/proj/en/de ... 5-upgrade-guide.xml(英文版)
http://www.gentoo.org/proj/zh_cn ... 5-upgrade-guide.xml(中文版)

哈哈,先安装HAL(http://www.linuxeden.com/blog/?u ... ewspace-itemid-4635),
手册中也不明确说明,结果就因为这个没有装的缘故,格式了3遍,花了3天工夫呀。
#先确定USE中将hal打开了
emerge hal
rc-update add hald default # 安装后的提示


变了USE后,
应该"emerge -aDNqv world"--因为那个是全局的,可以让所有程序支持hal。

emerge xorg-server

按照这个说明
emerge portage-utils; qlist -I -C x11-drivers/


emerge -av xf86-video-intel #必须在X11装完后
emerge xf86-input-keyboard xf86-input-mouse xf86-input-evdev xf86-input-synaptics
emerge xf86-input-evdev

env-update
source /etc/profile

/**********************
# http://www.linuxsir.cn/bbs/thread353203.html

累不累阿.......

测试X 的时候可以用
代码:

X && sleep 10 && killall X

用Ctrl-Alt-Backspace可退出后屏幕

不用重启

umask kde 安装 autounmask
代码:

autounmask =kde-base/kdebase-meta-version


**************************************/



# Xorg -configure

# X -config /root/xorg.conf.new #模式不正常,鼠标倒是能正常工作。 Ctrl-Alt-Backspace来退出后屏幕没任何东西。

安装Xfce

基础

首先,确定你已经按照如何配置X服务器所说的安装好了Xorg。

接着,请确认/etc/make.conf文件里的USE标记;你可能至少想要USE="-gnome -kde -qt3 -qt4 X dbus hal startup-notification xscreensaver"。

emerge --update --deep --new world

用etc-update来更新etc下的配置文件

emerge portage-utils; qlist -I -C x11-drivers
回复 支持 反对

使用道具 举报

发表于 2009-7-3 17:56:58 | 显示全部楼层
其实和  mini CD 安装差不多的 不过可以复制粘贴省事不少。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表