|
|
响应版主号召,硬着头皮发贴
感谢:Hauser,Fleta,kohno三位大侠.
准备:1.Grub4Dos 2.gentoo-ix86-1.2.iso 3.install-x86-universal-2004.3-r1.iso
第一步:安装基本系统。
有很多人说gentoo的起步太高,其实并非如此,说白了也无非就是一行行的脚本累积。我在第一次安装的时候选用了Hauser和Fleta的硬盘安装方法。为了兄弟们方便就贴在这了 ,并加了一些自己的心得。
找一个vfat分区,把gentoo-ix86-1.2.iso里的isolinux拷入,然后建一gentoo的目录,把install-x86-universal-2004.3-r1.iso里的distfiles,snapshots,stages拷入.
设置grub
- title From HD
- root (hd0,6) (按自己的情況改分区号)
- kernel /isolinux/kernel devfs=nomount vga=normal load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=22000 root=/dev/ram0 rw
- initrd /isolinux/rescue.gz
复制代码
将以下脚本拷入gentoo目录(原文里本来是3个script,我分成了4个,因为那个passwd一行似乎有点儿问题,所以打算单独执行passwd)
step1:
- #mke2fs -j /dev/hda10 #(initialize the boot partition)
- #mkswap /dev/hda8 #(initialize the swap partition)
- swapon /dev/hda8 #(Activate the swap partition)
- #mke2fs -j /dev/hda12 #(if you want to use ext3 for your root partition)
- mkreiserfs -f /dev/hda12 #(if you want to use reiserfs)
- #mkfs.xfs -f /dev/hda12 #(if you want to use xfs)
- mount /dev/hda12 /mnt/linux #(Mount the root partition)
- mkdir /mnt/linux/boot #(Create the boot mountpoint)
- mount /dev/hda10 /mnt/linux/boot #(Mount the boot partition)
- echo "Now set your system time! For instance, to set the date to October 29th, 16:21 in the year 2004, type: date 102916212004"
复制代码
step2:注意第2行,选择与你机器最相应的stage
- cd /mnt/linux #(Go to the mountpoint where the root partition has been mounted)
- tar xjvpf /mnt/win/gentoo/stages/stage3-x86-2004.3.tar.bz2 #(P4 choose stage3-pentium4-2004.3.tar.bz2)
- tar -xvjf /mnt/win/gentoo/snapshots/portage-20041022.tar.bz2 -C /mnt/linux/usr #(unpack a portage tree)
- mkdir /mnt/linux/usr/portage/distfiles #(Create a directory for distfiles)
- cp /mnt/win/gentoo/distfiles/* /mnt/linux/usr/portage/distfiles/ #(copy over distfiles)
- cp -L /etc/resolv.conf /mnt/linux/etc/resolv.conf #(Copy over nameserver information)
- mount -t proc none /mnt/linux/proc #(Mount the proc filesystem)
- cp /mnt/win/gentoo/step3 /mnt/linux #(Copy over the step3 script)
- echo "
- Now you can run step3!"
- chroot /mnt/linux /bin/bash #(Chroot into the new environment)
复制代码
step3:
- env-update && source /etc/profile #(Load the necessary variables)
- ln -sf /usr/share/zoneinfo/Hongkong /etc/localtime #(Set timezone information)
- #nano -w /etc/make.conf #(Optional: edit make.conf)
- nano -w /etc/fstab #(edit fstab)
- echo tux > /etc/hostname #(Set the system hostname)
- echo home.net > /etc/dnsdomainname #(Set the system domainname)
- echo nis.home.net > /etc/nisdomainname #(Set the system nisdomainname)
- echo "192.168.1.1 tux.home.net tux" >> /etc/hosts #(Set the hostsfile)
- echo "Have fun with Gentoo!
- " >> /etc/issue #(Set the greeting message)
- rc-update add domainname default #(Domain name init script)
- rc-update add numlock default #(Switch on numlock)
- nano -w /etc/conf.d/net #(Setup networking; dhcp-users should set iface_eth0="dhcp")
- rc-update add net.eth0 default #(Start networking automatically at boot)
- nano -w /etc/rc.conf #(Further system configurations)
- echo "
- Now you need to set your root password!"
复制代码
step4:
- echo "tts/0" >> /etc/securetty #(Let root to be able to log on through the serial console)
- emerge metalog #(install a system logger)
- rc-update add metalog default #(add it to the default runlevel)
- #emerge xfsprogs #(if you've chosen to use xfs)
- emerge reiserfsprogs #(if you've chosen to use reiserfs)
- emerge dhcpcd #(if you need to use dhcp)
- emerge genkernel #(prepare to compile a kernel)
- emerge gentoo-dev-sources #(install a kernel source)
- genkernel --menuconfig all #(save your config when exit)
- emerge hotplug #(install hotplug)
- rc-update add hotplug default #(Add it to the default runlevel)
- cd /boot #(Optional: it's just a precautionary step)
- ln -s . boot
- #emerge grub #(If you want to keep your Grub-for-Dos,skip the following)
- #echo "default 0
- #timeout 15
- #color cyan/blue white/blue
- #title=Gentoo Linux 2.6.9-r1
- #root (hd0,0)
- #kernel (hd0,9)/boot/kernel-2.6.9-gentoo-r1 root=/dev/hda12 video=vesafb:ywrap,mtrr,1024x768-16@85
- #initrd (hd0,9)/boot/initrd-2.6.9-gentoo-r1" >> /boot/grub/grub.conf
- #nano -w /boot/grub/grub.conf #just to check
- #grub
- echo "OK, your system is ready, now you may exit and reboot!"
复制代码
以上的脚本一定要仔细阅读,根据自己的情况认真修改,特别是分区那几行,一不小心就会格错分区!
确保万无一失之后就可以重启机器,进入grub,从From HD引导.
看到提示符后来执行step1:
- # mkdir /mnt/win
- # mount -t vfat /dev/hda7 /mnt/win
- # /mnt/win/gentoo/step1
复制代码
根据提示设置系统时间!
执行step2:
执行step3:
如果你上面的脚本没设好,可能不能运行step3,这时你需要重新挂载vfat
注意这里提示你修改fstab,千万别以为它和其他发行版一样系统默认的就行,仔细看你会发现里面全是/dev/BOOT,/dev/ROOT,/dev/SWAP,把BOOT,ROOT,SWAP换成你的实际分区号吧.
修改rc.conf时注意把CLOCK="UTC"改成CLOCK="local";如果你想用gnome启动就把最后一行的#XSESSION="Gnome"的#去掉.想用kde启动就XSESSION="kde-3.3.0".
- # mkdir /mnt/win
- # mount -t vfat /dev/hda7 /mnt/win
- # cd /mnt/win/gentoo/
- # step3
复制代码
在这里设置root密码
执行step4:
重启之后恭喜您的gentoo的基本系统已经完成!
第二步.安装桌面.
在这之前要挂载那个install-x86-universal-2004.3-r1.iso
- # mkdir /usr/portages/packages
- # mount -o loop /your/path/install-x86-universal-2004.3-r1.iso /usr/portages/packages
- # emerge -a kde # or gnome
复制代码
执行完之后要reboot才能配置xorg,我用的是偷懒的办法 ,让系统自己检测:
测试一下:
- # Xorg -config /root/xorg.conf.new
复制代码
没什么问题就mv到/etc/X11/xorg.conf
哦,差点儿忘了,这样生成的xorg.conf不支持鼠标滚轮,没关系我们可以在里面Section "InputDevice"的鼠标设置块里加入以下代码
- Option "Emulate3Buttons" "false"
- Option "ZAxisMapping" "4 5"
复制代码
现在可以startx了! |
|