/etc/init.d/sshd start
passwd
以便使用putty、ssh client远程登录上传stage等(有时在线下载很慢,而局域网上传很快)
准备磁盘:fdisk /dev/sda
/dev/sda1 : /boot 100M(32-100M) 设启动笔记-a/dev/sda2 : / 20G/dev/sda3 : /home 20G/dev/sda5 : /swap 1G (内存< 512 MB,分区分配2倍内存大小的空间;> 1024 MB,可以分配较少的空间甚至不需要swap 分区。)-t 82
mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda2mkfs.ext4 /dev/sda3mkswap /dev/sda5
mount /dev/sda2 /mnt/gentoomkdir /mnt/gentoo/bootmount /dev/sda1 /mnt/gentoo/bootmkdir /mnt/gentoo/homemount /dev/sda3 /mnt/gentoo/homeswapon /dev/sda5
2. 安装系统安装stage及portage:date
如果显示的日期/时间不正确,可以使用date MMDDhhmmYYYY命令
cd /mnt/gentoolinks http://www.gentoo.org/main/en/mirrors.xml
选择国内速度较快的镜像,进入releases/x86/autobuilds/目录里。你将会看到所有适合你的计算机体系结构的stage文件(它们也可能放在各个独立的子体系名称的子目录里)。选择一个,然后按D来下载。下载完以后,再按Q退出浏览器。
或使用SSH Secure Shell登录上传stage3文件
tar xvjpf stage3-*.tar.bz2
links http://www.gentoo.org/main/en/mirrors.xml
或使用SSH Secure Shell登录上传portage文件
tar -xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr (install a Portage snapshot)
编译前准备: nano -w /mnt/gentoo/etc/portage/make.conf
CFLAGS="-march=native -O2 -pipe"CXXFLAGS="${CFLAGS}" # 两个变量使用相同的设置MAKEOPTS="-j3" #MAKEOPTS定义在安装软件的时候同时可以产生并行编译的数目,CPU数目加一是个不错的选择
查看cpu信息:
cat PRoc/cpuinfo
mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.confmirrorselect -i -r -o >> /mnt/gentoo/etc/portage/make.conf
cp -L /etc/resolv.conf /mnt/gentoo/etc/
3. Chroot进入新系统环境:Chroot:mount -t proc none /mnt/gentoo/procmount --rbind /dev /mnt/gentoo/devmount --rbind /sys /mnt/gentoo/sys
chroot /mnt/gentoo /bin/bashsource /etc/profileexport PS1="(chroot) $PS1"
新环境配置:emerge --sync (Updating the Portage tree)或emerge-webrsync(fetch the latest portage snapshot)
eselect profile listeselect profile set ×
ls /usr/share/zoneinfoecho "Europe/Brussels" > /etc/timezoneemerge --config sys-libs/timezone-data
nano -w /etc/locale.genlocale-gen
env-update && source /etc/profile
4. 编译内核:emerge gentoo-sourcesls -l /usr/src/linux
手动编译内核:cd /usr/src/linuxmake menuconfig
必须启用的选项:显卡:Xorg/Configuration声卡:ALSA网卡:根据具体网卡芯片型号,查看wiki。网卡芯片驱动查询:Linux Wireless
其他选项根据需要添加,不了解保持默认即可:
make && make modules_install
cp arch/x86_64/boot/bzImage /boot/kernel-3.10.10-gentoo
使用genkernel编译内核:emerge genkernel
zcat /proc/config.gz > /usr/share/genkernel/arch/x86_64/kernel-config
genkernel --menuconfig all
一旦genkernel运行完成,一个包括全部模块和initrd的内核将被建立。在后面配置引导程序时我们将会用到这个内核和initrd。请记下内核和initrd的名字,因为您将在配置引导程序的时候用到他们。initrd将会在启动真正的系统前自动识别硬件(如同安装光盘一样)。
ls /boot/kernel* /boot/initramfs*
5. 配置系统系统信息:nano -w /etc/fstab
Host name, Domainname, etc
nano
新闻热点
疑难解答