昨天抽空又做了一个干净的虚拟机 gentoo64用的2011年1月的minicd和portage还有stage3
前面的分区什么的步骤就跳过了
就从chroot开始了
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# cd /
# mount -t proc proc /mnt/gentoo/proc/
# mount -o bind /dev/ /mnt/gentoo/dev/
# cp -L /etc/resolv.conf /mnt/gentoo/etc/
# chroot /mnt/gentoo/ /bin/bash
# env-update && source /etc/profile
$ emacs /etc/make.conf
[/ccn]
[ccn lang="c" tab_size="4" theme="blackboard" width="550" ]
USE="mmx sse sse2
jpeg gif tiff png cairo
fbcondecor subversion xcb glitz svg
hal mysql imap libwww maildir sasl ssl"
# oci8-instant-client oracle
APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user au\
toindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation re\
write setenvif speling status unique_id userdir usertrack vhost_alias proxy proxy_connect proxy_http proxy_balancer"
APACHE2_MPMS="worker"
#LINGUAS="zh_CN zh"
MAKEOPTS="-j4"
ACCEPT_LICENSE="*"
GENTOO_MIRRORS="http://mirrors.sohu.com/gentoo ftp://mirrors.sohu.com/gentoo http://mirrors.xmu.edu.cn/gentoo ftp://mirrors.xmu.edu\
.cn/gentoo http://mirrors.163.com/gentoo"
[/ccn]
编译 就直接用的genkernel
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# emerge -av gentoo-sources genkernel
# genkernel --menuconfig --bootloader=grub all
# time emerge syslog-ng vixie-cron grub
# nano -w /etc/fstab
[/ccn]
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1 /boot ext2 noauto,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# rc-update add syslog-ng default
# rc-update add vixie-cron default
# rc-update add sshd default
# rc-update add net.eth0 default
[/ccn]
修改密码 千万别忘
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# passwd root
[/ccn]
启动配置
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# grub
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 18 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub> quit
[/ccn]
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# nano -w /boot/grub/grub.conf
default 0
timeout 5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Gentoo Linux 2.6.31-r10
root (hd0,0)
kernel /kernel-genkernel-x86_64-2.6.36-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 doscsi udev vga=791
initrd /initramfs-genkernel-x86_64-2.6.36-gentoo-r5
[/ccn]
中文化
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# nano -w /etc/env.d/100i18n
LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
# nano -w /etc/locale.gen
加入
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.GBK GBK
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
[/ccn]
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# locale-gen
[/ccn]
时区设置
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# cp -ruv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# nano -w /etc/conf.d/clock
TIMEZONE="Asia/Shanghai"
[/ccn]
安装一些常用工具
[ccn lang="bash" tab_size="4" theme="blackboard" width="550" ]
# emerge -av emacs lrzsz gentoolkit eix ufed genlop euses portage-utils dbus rar unrar unzip lvm2 netkit-telnetd nfs-utils
[/ccn]