Skip to content

Instantly share code, notes, and snippets.

@gotnix
Created February 10, 2012 15:58
Show Gist options
  • Save gotnix/1790460 to your computer and use it in GitHub Desktop.
Save gotnix/1790460 to your computer and use it in GitHub Desktop.
install Gentoo shell history
Gentoo Linux handbook zh_CN
http://www.gentoo.org/doc/zh_cn/handbook/
Gentoo Linux AMD64 handbook zh_CN
http://www.gentoo.org/doc/zh_cn/handbook/handbook-amd64.xml
其他選擇:使用 genkernel
http://www.gentoo.org/doc/zh_tw/handbook/handbook-ppc.xml?part=1&chap=7#genkernel
http://www.gentoo.org/doc/zh_tw/handbook/handbook-amd64.xml?part=1&chap=7#genkernel
# Partion your HD and mkfs
# Active the swap partion
swapon /dev/sda2
# Mount your root partion.
mount /dev/sda3 /mnt/gentoo/
# mkdir for mount point of other partions.
mkdir /mnt/gentoo/boot/
mkdir /mnt/gentoo/usr/
mkdir /mnt/gentoo/var/
mkdir /mnt/gentoo/home/
# Mount the other partion
mount /dev/sda1 /mnt/gentoo/boot/
mount /dev/sda5 /mnt/gentoo/usr/
mount /dev/sda6 /mnt/gentoo/var/
mount /dev/sda7 /mnt/gentoo/home/
# Modify the system date and time
## install the stage3 && the protage ##
# Config the CFLAGS, MAKEOPTS
CFLAGS="-march=core2 -mtune=generic -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
USE="-gtk -gnome qt3 qt4 kde dvd alsa cdr dvdr mmx sse sse2 ipv6 hal udev session X bash-completion wifi m17n-lib cjk unicode usb"
# Select a mirror site
mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
# Copy DNS resolver configure file.
cp -L /etc/resolv.conf /mnt/gentoo/etc/
# Mount VFS
mount -t proc none /mnt/gentoo/proc/
mount -o bind /dev /mnt/gentoo/dev/
#chroot into native gentoo
chroot /mnt/gentoo/ /bin/bash
env-update
source /etc/profile
export PS1="(Chroot) $PS1"
# Updaate Portage Tree
emerge --sync
OR
emerge --sync --quiet
# Make a right choice for a profile
eselect profile list
eselect profile set 5
# set USE for KDE
# Set glibc Locales
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.UTF-8 UTF-8
zh_CN.GB2312 GB2312
locale-gen
#Set time zone
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# install kernel source
emerge gentoo-sources
# Config Linux kernel
精简LINUX内核配置及快速编译的方法汇总
http://www.path8.net/tn/archives/4781
http://www.path8.net/tn/archives/3521
http://www.gentoo.org/doc/zh_cn/kernel-config.xml
http://linux.vbird.org/linux_basic/0540kernel.php
http://www.cnblogs.com/unicode/archive/2010/05/19/1739675.html
# Config /etc/fstab
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1 /boot ext2 defaults,noatime 1 2
/dev/sda3 / ext4 defaults 0 1
/dev/sda5 /usr ext4 defaults,noatime 0 0
/dev/sda6 /var jfs defaults,noatime 0 0
/dev/sda7 /home jfs defaults 0 0
/dev/sr0 /mnt/cdrom auto noauto,ro 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
# Install GRUB and config
default 0
timeout 10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Gentoo Linux 3.2.1-r2.imtz
root (hd0,0)
kernel /kernel-3.2.1-gentoo-r2imtz root=/dev/ram0 real_root=/dev/sda3
append="video=uvesafb:mtrr:3,ywrap,1280x768-32@60"
exit
cd
umount /dev/sda{7,6,5,1}
umount /mnt/gentoo/{proc,dev}/
umount /dev/sda3
LINGUAS="zh_CN zh en"
LANG="zh_CN.UTF-8"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment