這里是最直接的安裝方法,官方文檔:
http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml
可能你會(huì)遇到個(gè)不爽的問題:
grub-install --no-floppy /dev/sda 時(shí)候
end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 0
Buffer I/O error on device fd0,logical block 0
可能你等了很久會(huì)有反應(yīng),但是那樣很不爽,這樣吧,Ctr+C終結(jié)
nano /boot/grub/device.map
在列表中刪除fd0
下面?zhèn)浞菀幌掳惭b過程:
- # 配置網(wǎng)絡(luò)環(huán)境
- ifconfig eth0 192.168.0.150 netmask 255.255.255.0 up
- route add default gw 192.168.0.1
- echo nameserver 192.168.0.253> /etc/resolv.conf
- echo nameserver 192.168.0.254 >> /etc/resolv.conf
-
- # 看是否能通
- ping -c 3 www.gentoo.org
-
- # 修改root密碼
- passwd
- # abc123 abc123
-
- #啟動(dòng)
- /etc/init.d/sshd start
-
- # ssh遠(yuǎn)程,如果不方便原機(jī)器操作
-
-
- #=========================================================================
-
- # 分區(qū)
- fdisk /dev/sda
-
- # Disk /dev/sda: 999.7 GB, 999653638144 bytes
- # 255 heads, 63 sectors/track, 121534 cylinders
- # Units = cylinders of 16065 * 512 = 8225280 bytes
- # Disk identifier: 0x698ef8db
-
- Device Boot Start End Blocks Id System
- /dev/sda1 1 14 112423+ 83 Linux
- /dev/sda2 15 276 2104515 83 Linux
- /dev/sda3 277 9729 75931222+ 83 Linux
-
- #=========================================================================
-
- # 格式化
- mkfs.ext3 /dev/sda1
- mkswap /dev/sda2
- mkfs.ext3 /dev/sda3
-
- # 激活交換分區(qū)
- swapon /dev/sda2
-
- # 掛載分區(qū)
- mount /dev/sda3 /mnt/gentoo
- mkdir /mnt/gentoo/boot
- mount /dev/sda1 /mnt/gentoo/boot
-
- scp lighttpd@192.168.0.129:/home/lighttpd/stage3-i486-20100413.tar.bz2 .
- scp lighttpd@192.168.0.129:/home/lighttpd/portage-20100413.tar.bz2 .
- # links http://www.gentoo.org/main/en/mirrors.xml
- # 下載 /pub/gentoo/releases/x86/current-iso/stage3-i686-20091006.tar.bz2
- # 下載 /pub/gentoo/releases/x86/current-iso/stage3-i686-20091006.tar.bz2.DIGESTS
- # 下載 /pub/gentoo/releases/snapshots/current/portage-latest.tar.bz2
- # 下載 /pub/gentoo/releases/snapshots/current/portage-latest.tar.bz2.md5sum
- # 解壓
- mv stage3-i486-20100413.tar.bz2 /mnt/gentoo/
- mv portage-20100413.tar.bz2 /mnt/gentoo/
- cd /mnt/gentoo
- tar xvjpf stage3-i486-20100413.tar.bz2
- tar -xvjf portage-20100413.tar.bz2 -C /mnt/gentoo/usr
-
- #=========================================================================
-
- mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
-
- #=========================================================================
-
- mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
-
- #=========================================================================
- # 拷貝DNS信息
- cp -L /etc/resolv.conf /mnt/gentoo/etc/
-
- # 掛載/proc和/dev文件系統(tǒng)
- mount -t proc none /mnt/gentoo/proc
- mount -o bind /dev /mnt/gentoo/dev
-
-
- # chroot到新環(huán)境里
- chroot /mnt/gentoo /bin/bash
- env-update
- source /etc/profile
- export PS1="(chroot) $PS1"
-
- #更新Portage樹
- emerge --sync
- # 如果系統(tǒng)警告你有一個(gè)新版本的Portage可用,你可以使用emerge --oneshot portage來更新它。
-
- eselect profile list
- # 切換profile
- eselect profile set 6
-
- #=========================================================================
- 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
- }
- #=========================================================================
- # 運(yùn)行l(wèi)ocale-gen。它會(huì)產(chǎn)生所有你在/etc/locale.gen文件里指定的locale。
- locale-gen
-
-
- 編輯全局變量
- # nano -w /etc/env.d/02locale
- {
- LANG="en_US"
- LC_CTYPE="zh_CN.UTF-8"
- }
-
- env-update && source /etc/profile
-
- 修改系統(tǒng)語言
- locale
- export LANG=en_US
- export LC_CTYPE=zh_CN.UTF-8
- locale
-
- # 7.a. 時(shí)區(qū)
- cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-
- # 安裝內(nèi)核源碼
- # 如果有內(nèi)核源碼就不用下面的命令來下載了
- emerge gentoo-sources
-
- cd /usr/src/linux
- make menuconfig
-
-
- # 編譯內(nèi)核
- make && make modules_install
-
- cp arch/i386/boot/bzImage /boot/kernel-2.6.30-gentoo-r6
-
- # 8. 配置系統(tǒng)
- nano -w /etc/fstab
- # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
- {
- /dev/sda1 /boot ext3 defaults,noatime 1 2
- /dev/sda3 / ext3 noatime 0 1
- /dev/sda2 none swap sw 0 0
- #/dev/cdrom /mnt/cdrom auto noauto,user 0 0
- }
-
- # 設(shè)定主機(jī)名
- nano -w /etc/conf.d/hostname
- # Set to the hostname of this machine
- HOSTNAME="gentoo_0"
-
- nano -w /etc/conf.d/net
- {
- modules=( "ifconfig" )
-
- config_eth0=( "192.168.0.150 netmask 255.255.255.0 brd 192.168.0.255" )
- routes_eth0=( "default via 192.168.0.1" )
- }
-
- # 添加net.eth0到默認(rèn)的運(yùn)行級別
- rc-update add net.eth0 default
-
- # 設(shè)置root密碼
- passwd
-
- # 必要安裝系統(tǒng)日志工具
-
- emerge syslog-ng
- rc-update add syslog-ng default
-
- # 可選:Cron守護(hù)進(jìn)程
- emerge vixie-cron
- rc-update add vixie-cron default
-
- # 可選:文件索引
- emerge slocate
-
- # 實(shí)用工具
- emerge usbutils
- emerge pciutils
- # USE="-gtk" emerge evms
-
-
- # 配置引導(dǎo)程序
- # 安裝GRUB
- emerge grub
- # 創(chuàng)建/boot/grub/grub.conf
- nano -w /boot/grub/grub.conf
- {
- default 0
- timeout 30
- #splashimage=(hd0,0)/boot/grub/splash.xpm.gz
-
- title Gentoo Linux 2.6.32-gentoo-r7
- root (hd0,0)
- kernel /boot/kernel-2.6.32-gentoo-r7 root=/dev/sda3
- #kernel /boot/kernel-2.6.30-gentoo-r6 root=/dev/sda3 video=uvesafb:mtrr:3,ywrap,1024x768-32@85
-
- title Gentoo Linux 2.6.32-gentoo-r7 (rescue)
- root(hd0,0)
- kernel /boot/kernel-2.6.32-gentoo-r7 root=/dev/sda3 init=/bb
-
- }
-
- # 創(chuàng)建/etc/mtab
- grep -v rootfs /proc/mounts > /etc/mtab
- # 執(zhí)行g(shù)rub-install ,可能會(huì)遇到問題:nano /boot/grub/device.map 刪除fd0,這是一個(gè)已知的BUG
- grub-install --no-floppy /dev/sda
-
-
- # 卸載所有分區(qū)和重啟
-
- exit
- cd
- umount /mnt/gentoo/boot /mnt/gentoo/dev /mnt/gentoo/proc /mnt/gentoo
- reboot
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。