|
原贴在此:http://forums.gentoo.org/viewtopic.php?t=265946 乃采薇大侠的新作。
为庆祝中文版面的开办,我写了个简便的安装法,给那些〝心急〞的新手做个参考。我的灵感来自:http://forums.gentoo.org/viewtopic.php?t=265226及http://www.linuxsir.cn/forum.php?mod=viewthread&tid=133814,所以在这里先向kohno和Fleta表示感谢。 另外有个英文版在此处。
假设:您只有windows,没有软盘,光驱,没装vmware,但却装了Grub for DOS。
首先找个mirror下载一个1.2的minimal映像档,如:http://ftp.isu.edu.tw/pub/Linux/ ... gentoo-ix86-1.2.iso
约16MB左右吧;然后下个2004.3 LiveCD 的映像档:http://ftp.isu.edu.tw/pub/Linux/ ... ersal-2004.3-r1.iso
找一个vfat的分区,将1.2的minimal映像文件里的isolinux拷贝过去,然后建一个gentoo的目录,把2004.3 LiveCD 里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
-
复制代码
将以下几个scripts也拷至那个gentoo的目录里:
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:
- 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 #(Extract a stage3 tarball...)
- 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!"
- passwd
- 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!"
复制代码
注意要根据自己的具体情况改一改这几个scripts,真是用的话先要做好资料备份。虽然在我的机器上试过没问题,但不保证在阁下的机子上不出事呦!
首先你得准备好linux分区,你可以在windows里用Partition Magic或进了安装界面用fdisk。fdisk的用法手册里说得很清楚,我就不写了。
从Grub里用"From HD"那项开机,按了几次Enter后你会看到个提示符。挂载好那个vfat分区,然后执行step1:
- # mount -t vfat /dev/hda7 /mnt/win
- # /mnt/win/gentoo/step1
复制代码
设置好系统时间后,执行step2:
当你看到'Now you can run step3!'的语句,你已经进入chroot的环境了,然后执行step3:
- # ls (你会看到确实进入了chroot的环境了)
- #./step3
复制代码
首先会提示你修改fstab,然后是/etc/conf.d/net, /etc/rc.conf等。设定好root密码后大约十几二十分你会看到menuconfig的画面,配置好kernel后差不多就可以了。如果你想继 续用Grub-for-DOS,Gentoo的grub可以不装,但是Grub-for-DOS别忘了为Gentoo加个选项呦。
整个安装过程应不会超过一个小时,由于基本上是自动的,也免去了敲打指令之苦。不过轻松之余还希望新手仔细看看手册,搞清楚每个步骤的含意,以进一步了解Gentoo。 |
|