LinuxSir.cn,穿越时空的Linuxsir!

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

是否需要翻译本文-安装GENTOO 1.4正式版快速指南(GRP机制)

[复制链接]
发表于 2003-8-9 00:30:58 | 显示全部楼层 |阅读模式
安装GENTOO 1.4正式版快速指南(GRP机制)
今天正式从头到尾看了一遍安装说明,做了些摘录整理,得到了这个QUICK GUILD快速指南,大部分还没有翻译,不过大家应该都看得懂,提供给那些不愿意花1个小时去看官方安装说明而且准备使用GRP软件管理机制的人(要记得我是花了额外的一个小时来整理本文档哦)。
STEP 1:download the 2 CD set下载两张CD集
The first CD ("CD 1") is called "Live CD Installation" and is a bootable CD-ROM, meaning that you can put "CD 1" in your drive and run Gentoo Linux directly from the CD. You can then use this CD-based version of Gentoo to install Gentoo Linux 1.4 to your hard disk. In addition to containing a bootable Gentoo Linux environment, CD 1 contains everything you need to install Gentoo Linux quickly, even without a connection to the Internet. In addition, several pre-compiled packages are also included on CD 1, such as the ever-important XFree86 X server. If you have an ISO CD-ROM image file for CD 1, its name will end in "-cd1.iso".

In contrast, the second CD ("CD 2") isn't bootable and contains lots of pre-built packages for your system. Included on this CD are optimized versions of packages such as KDE, GNOME, OpenOffice, Mozilla, Evolution and others. CD 2 is optional and is intended for those people who are interested in installing Gentoo Linux very quickly. The packages included on CD 2 typically take about 36 hours to compile from source on a typical modern single-processor system. If you have an ISO CD-ROM image file for CD 2, its name will end in "-cd2.iso".

WHAT IS GRP?什么是GRP
Note: A complete Gentoo Linux 2-CD set contains the Gentoo Reference Platform, which is a complete pre-built Gentoo Linux system including GNOME, KDE, Mozilla and OpenOffice. The Gentoo Reference Platform ("GRP") was created to allow rapid Gentoo Linux package installations for those who need this capability. The "compile from source" functionality, which is the cornerstone of Gentoo Linux, will always be a fully-supported installation option as well. The purpose of the GRP is to make Gentoo Linux more convenient for some users, without impacting Gentoo's powerful "compile from source" installation process in any way.

STEP 2:boot from cdrom enter the base-system从光盘启动进入基系统。

boot from "CD 1" enter no thing or enter: gentoo noraid nohotplug

after systerm ready these some config need to do:
Net-Setup 网卡设置
Code listing 4.4: Net-Setup Script
# net-setup eth0
or
Code listing 4.6: Static IP Network Configuration
# ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
# route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE

DNS resolv 域名解析设置
Code listing 4.7: /etc/resolv.conf template
domain mydomain.com
nameserver 10.0.0.1
nameserver 10.0.0.2

Proxy 代理服务器设置
Code listing 4.8: Setting a Proxy
If the proxy restricts HTTP traffic:
# export http_proxy="machine.company.com:1234"
If the proxy restricts FTP traffic:
# export ftp_proxy="machine.company.com"
If the proxy restricts RSYNC traffic:
# export RSYNC_PROXY="machine.company.com"

fdisk: 磁盘分区
Code listing 6.3: Starting up fdisk
# fdisk /dev/hda

Creating filesystems: 创建文件系统
Code listing 6.14: Initializing our partitions (example)
# mke2fs -j /dev/hda1
# mkswap /dev/hda2
# mkreiserfs /dev/hda3

Mount Partitions 加载分区
# swapon /dev/hda2
# 激活交换分区
# mount /dev/hda3 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot


STEP 3:Stage tarballs and chroot 展开安装文件包准备未来的根系统
Code listing 8.2: Unpacking the Stages

要用GRP必须使用stage3-*.tar.bz2的文件包
# cd /mnt/gentoo
Change "stage3" to "stage2" or "stage1" if you want to start from these stages instead.
If you downloaded your stage tarball, change the path below to begin with "/mnt/gentoo/"
instead of "/mnt/cdrom/stages/".
# tar -xvjpf /mnt/cdrom/stages/stage3-*.tar.bz2

GRP package/snapshot steps 使用光盘自带的portage-yyyymmdd.tar.bz2来略过emerge sync这步(如果你连在网上的话还是推荐emerge sync更好,这步是为了不能上网的用户准备的)
GRP Users: There is a Portage snapshot on the Live CD. You will need to use this snapshot so that you can skip the emerge sync step later in this document, since emerge sync requires a network connection. Untar this snapshot as follows:
Code listing 8.3: Using Portage snapshot
Replace yyyymmdd with the datestamp in the filename.
# tar -xvjf /mnt/cdrom/snapshots/portage-yyyymmdd.tar.bz2 -C /mnt/gentoo/usr


把光盘上的包文件拷贝到/usr/portage/distfiles和/usr/portage/packages/中去。
Code listing 8.4: Copying GRP files
# cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles
# cp -a /mnt/cdrom/packages/ /mnt/gentoo/usr/portage/packages/

Entering the chroot 切换根目录
Code listing 8.5: Prepping and entering the chroot environment
# mount -t proc proc /mnt/gentoo/proc
# cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# chroot /mnt/gentoo /bin/bash
# env-update
Regenerating /etc/ld.so.cache...
# source /etc/profile
(The above points your shell to the new paths and updated binaries)



Setting your time zone 设置时区
Code listing 14.1: Creating a symbolic link for time zone
# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime


Modifying /etc/fstab for your machine根据你的机器修改/etc/fstab
Code listing 15.1: Editing fstab
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It is safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs> <mount point> <type> <opts> <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.

/dev/BOOT /boot ext2 noauto,noatime 1 2
/dev/ROOT / ext3 noatime 0 1
/dev/SWAP none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
proc /proc proc defaults 0 0



STEP 3-2 安装系统内核
GENTOO有两种方式安装系统内核一种是通用的make menuconfig,另一种是gentoo特有的genkernel全自动式编译。
我想尝试genkernel

Code listing 16.1: Emerging Kernel Sources
# emerge -k sys-kernel/gentoo-sources

Code listing 16.3: Running genkernel
# genkernel
Gentoo Linux genkernel, version 1.4
Copyright 2003 Gentoo Technologies, Inc., Bob Johnson, Daniel Robbins
Distributed under the GNU General Public License version 2

Settings:
compile optimization: 1 processor(s)
source tree: /usr/src/linux-2.4.20-gaming-r3
config: gentoo (customized)
config loc: /etc/kernels/config-2.4.20-gaming-r3
initrd config: (default) /etc/kernels/settings

* Running "make oldconfig"... [ ok ]
* Logging to /var/log/genkernel.log... [ ok ]
* Starting 2.4.20-gaming-r3 build... [ ok ]
* Running "make dep"... [ ok ]
* Running "make bzImage"... [ ok ]
* Running "make modules"... [ ok ]
* Running "make modules_install"... [ ok ]
* Moving bzImage to /boot/kernel-2.4.20-gaming-r3... [ ok ]
* Building busybox... [ ok ]
* Creating initrd... [ ok ]

* Build completed successfully!

* Please specify /boot/kernel-2.4.20-gaming-r3 and /boot/initrd-2.4.20-gaming-r3
* when customizing your boot loader configuration files.

内核编译完后,再安装hotplug包,使你的系统支持热插拔(即插即用)
Code listing 16.4: Emerging and enabling hotplug

# emerge -k hotplug
# rc-update add hotplug default
rc-update这个命令用来修改系统运行集rc

还可以添加一些其他的内核硬件支持包
Finally, you should emerge ebuilds for any additional hardware that is on your system. Here is a list of kernel-related ebuilds that you could emerge:

比如NVIDIA的显卡:
Ebuild Purpose Command
nvidia-kernel Accelerated NVIDIA graphics for XFree86 emerge -k nvidia-kernel

Installing a system logger 安装系统日志管理器:
Code listing 16.8: Emerging System Logger of Choice

# emerge -k app-admin/sysklogd
# rc-update add sysklogd default
or
# emerge -k app-admin/syslog-ng
# rc-update add syslog-ng default
or
# emerge -k app-admin/metalog
# rc-update add metalog default
or
# emerge -k app-admin/msyslog
# rc-update add msyslog default


Code listing 16.10: Choosing a CRON Daemon 安装系统定时后台管理器
# emerge -k sys-apps/dcron
# rc-update add dcron default
# crontab /etc/crontab
or
# emerge -k sys-apps/fcron
# rc-update add fcron default
# crontab /etc/crontab
or
# emerge -k sys-apps/vcron
# rc-update add vcron default
You do not need to run crontab /etc/crontab if using vcron.


Code listing 18.1: Setting the root Password 设置root口令
# passwd

Code listing 18.2: Adding a user 增加一个用户
# useradd your_user -m -G users,wheel,audio -s /bin/bash
# passwd your_user

Code listing 19.1: Configuring Hostname 主机名
# echo mymachine > /etc/hostname

Code listing 19.2: Configuring Domainname 域名
# echo mydomain.com > /etc/dnsdomainname

Code listing 20.1: Hosts Template /etc/hosts文件模板
127.0.0.1 localhost
# the next line contains your IP for your local LAN and your associated machine name
192.168.1.1 mymachine.mydomain.com mymachine



启动时的网卡设置
STEP1:如果你的NETCARD在内核中是编译为模块则请修改这个文件:
Code listing 21.1: /etc/modules.autoload
This is assuming that you are using a 3com card.
Check /lib/modules/`uname -r`/kernel/drivers/net for your card.
3c59x
让它在启动时自动加载(我的编译进内核了,不是模块)
提一下内核选项里面:
realtek8029网卡要选NE2000及其兼容
realtek8039也有相应选项
STEP2:编辑/etc/conf.d/net在这里填入IP、NETMASK,BROADCAST,GATEWAY
iface_eth0="54.1.42.104 broadcast 54.1.42.255 netmask 255.255.255.0"
gateway="eth0/54.1.42.1"
STEP3:编辑/etc/resolv.conf在这里填入DNS的信息:
nameserver 210.12.63.3
STEP4:rc-update add net.eth0 default

安装GRUB启动管理器
Code listing 23.1: Installing GRUB
# emerge -k grub
# grub

Code listing 23.2: GRUB on the MBR
grub> root (hd0,0) (Your boot partition)
grub> setup (hd0) (Where the boot record is installed; here, it is the MBR)

Code listing 23.4: grub.conf for GRUB
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# If you compiled your own kernel, use something like this:
title=My example Gentoo Linux
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/hda3

# If you're using genkernel, use something like this instead:
title=My example Gentoo Linux (genkernel)
root (hd0,0)
kernel (hd0,0)/boot/kernel-KV root=/dev/hda3
initrd (hd0,0)/boot/initrd-KV

# Below needed only for people who dual-boot
title=Windows XP
root (hd0,5)
chainloader (hd0,5)+1

Using framebuffer 使用framebuffer--高分辨率的控制台方式
640x480 800x600 1024x768 1280x1024
8 bpp 769 771 773 775
16 bpp 785 788 791 794
32 bpp 786 789 792 795

GRUB-users will have to append vga=xxx to the kernel (hd0,0)... line.

Using GRP 使用GRP机制来安装其余的二进制包(不需要编译,这是GENTOO 1.4最大最快捷的特点,也是我准备试验Gentoo1.4的主要原因)
Code listing 25.1: Installing from GRP
# USE="bindist" emerge -k xfree
// (USE="bindist" must be set while installing GRP packages that use XFree86)

必须在前面加USE="bindist"然后再接emerge -k 程序名才能安装
Now various other applications can be installed the same way. For example:
Code listing 25.3: Installing KDE from GRP
# USE="bindist" emerge -k kde

STEP 3-3
Code listing 26.1: Rebooting the System 重启动
# etc-update
# exit
(This exits the chrooted shell; you can also type ^D)
# cd /
# umount /mnt/gentoo/boot
# umount /mnt/gentoo/proc
# umount /mnt/gentoo
# reboot


STEP 4:gentoo-stats这个是一个为了帮助gentoo公司来统计用户使用程序信息的程序,如果不能上网就装了没用,
但是个人上网的用户还是建议大家安装一个,并加入后台运行,我们没用盗版难道还怕人统计吗!?自豪
Code listing 27.1: Installing gentoo-stats
# emerge gentoo-stats (Installs gentoo-stats)
# gentoo-stats --new (Obtains a new system ID)

Code listing 27.2: Updating gentoo-stats with cron
0 0 * * 0,4 /usr/sbin/gentoo-stats --update > /dev/null

目前还是纸上谈兵,明天动工。磨刀不误砍柴工。

单选投票, 共有 32 人参与投票
37.50% (12)
28.12% (9)
6.25% (2)
28.12% (9)
您所在的用户组没有投票权限
发表于 2003-8-9 08:59:14 | 显示全部楼层
# cp -a /mnt/cdrom/packages/ /mnt/gentoo/usr/portage/packages/

这个命令好像有错误吧

应该是:
# cp -a /mnt/cdrom/packages/ /mnt/gentoo/usr/portage/

不知道偶说得对不对
回复

使用道具 举报

 楼主| 发表于 2003-8-9 13:48:09 | 显示全部楼层

最简化的命令集

# net-setup eth0

# fdisk /dev/hda
# mke2fs -j /dev/hda1
# mkswap /dev/hda2
# mkreiserfs /dev/hda3

# swapon /dev/hda2
# mount /dev/hda3 /mnt/gentoo
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot

# tar -xvjpf /mnt/cdrom/stages/stage3-pentium4-20030726.tar.bz2 -C /mnt/gentoo
# tar -xvjf /mnt/cdrom/snapshots/portage-20030731.tar.bz2 -C /mnt/gentoo/usr

# cp -R /mnt/cdrom/distfiles /mnt/gentoo/usr/portage/distfiles
# cp -a /mnt/cdrom/packages/ /mnt/gentoo/usr/portage/packages/

# mount -t proc proc /mnt/gentoo/proc
# cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime

# nano /etc/fstab
/dev/BOOT /boot ext2 noauto,noatime 1 2
/dev/ROOT / ext3 noatime 0 1
/dev/SWAP none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
proc /proc proc defaults 0 0

# emerge -k sys-kernel/gentoo-sources
# genkernel
# emerge -k hotplug
# rc-update add hotplug default
# emerge -k nvidia-kernel

# emerge -k app-admin/sysklogd
# rc-update add sysklogd default

# emerge -k sys-apps/dcron
# rc-update add dcron default
# crontab /etc/crontab

# passwd
# useradd dreamrise -m -G users,wheel,audio -s /bin/bash
# passwd dreamrise

# echo BlardGen > /etc/hostname
# echo BlardGen.com > /etc/dnsdomainname
# nano /etc/hosts
54.1.42.104 BlardGen www.BlardGen.com
# nano /etc/modules.autoload
ne2k-pci #Check /lib/modules/`uname -r`/kernel/drivers/net for your card.
# nano /etc/conf.d/net
iface_eth0="54.1.42.104 broadcast 54.1.42.255 netmask 255.255.255.0"
gateway="eth0/54.1.42.1"
# nano /etc/resolv.conf
nameserver 210.12.63.3
# rc-update add net.eth0 default

# emerge -k grub
# grub
grub> root (hd0,0) (Your boot partition)
grub> setup (hd0) (Where the boot record is installed; here, it is the MBR)
# nano /boot/grub/grub.conf
vga=791

# USE="bindist" emerge -k xfree
# USE="bindist" emerge -k kde

# etc-update
# exit
# cd /
# umount /mnt/gentoo/boot && umount /mnt/gentoo/proc && umount /mnt/gentoo
# reboot

# emerge gentoo-stats (Installs gentoo-stats)
# gentoo-stats --new (Obtains a new system ID)
回复

使用道具 举报

发表于 2003-8-9 14:19:27 | 显示全部楼层
能翻的话最好了,作为一个补充..
回复

使用道具 举报

发表于 2003-8-10 01:13:33 | 显示全部楼层

#chroot出现非法指令!

在这之前的安装一切正常但在输入
"#chroot /mnt/gentoo /bin/bash"出现
Illegal instruction
好向是不正确的提示吧!希望班主能帮我解决这个问题!
在这之后就无法继续安装下去了.不知道朋友们是否也遇到过这中问题?不知是什么原因引起的.能在伙伴的帮助下能够知道出现此现象的原因.为后来的Gentoo爱好这铺平道路!谢谢大家的帮助!
回复

使用道具 举报

发表于 2003-8-10 10:09:20 | 显示全部楼层
怎么知道自己的网卡是编译进内核还是模块化?
回复

使用道具 举报

发表于 2003-8-10 10:18:13 | 显示全部楼层
genkernel那一步产生的bzImage名字叫kernel-2.4.20-gaming-r3

要在/boot里创建一个连接吧
ln -s kernel-2.4.20-gaming-r3 bzImage
回复

使用道具 举报

发表于 2003-8-10 10:58:19 | 显示全部楼层
# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime
我看过,没有/usr/share/zoneinfo/path/to/timezonefile路径
(我用stage3)

# emerge -k sys-kernel/gentoo-sources
这一步时就自动连网啊,不是在硬盘安装??
回复

使用道具 举报

发表于 2003-8-10 12:43:36 | 显示全部楼层
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
回复

使用道具 举报

发表于 2003-8-10 13:16:43 | 显示全部楼层
To nathaniel:
自动连网,应该是前面cp时候的问题
回复

使用道具 举报

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

本版积分规则

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