LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 9964|回复: 25

Gentoo2004.2半自动安装

[复制链接]
发表于 2004-8-20 13:05:04 | 显示全部楼层 |阅读模式
闲来无事在vmware里试装了下2004.2。请注意这贴不是教程,只是描述下我个人的做法,新手得明白个中道理才好跟从,而且应根据自己的情况加以变化。

安装很简单,首先按手册的讲解配置好网络及用fdisk划好分区,然后执行step1,step2,step3执行档即可完成基本系统的安装。如果不出意外,一个半小时内应可完成。step执行档可置于软盘,或放到自己email里装的时候下载,或直接加入LiveCD里(linux下用mkisofs,windows下可用ultraiso)更好。
划好分区后,执行step1(我把那些执行档加入LiveCD里了;):
# /mnt/cdrom/step1
(如果你用reiserfs,建立文件系统的时候,可能要你按一下“y”) 等看到提示“Now date your system time!”,用date设定你的系统时间,例子:
# date 042516212004
Sun Apr 25 16:21:18 CEST 2004
格式:date MMDDhhmmYYYY syntax (Month, Day, hour, minute and Year)
然后执行step2:
# /mnt/cdrom/step2
这一步大约需时15至25分钟不等,全自动的,除非你想编辑/etc/make.conf(我选择装好了系统后再慢慢改)。等看到提示“Now you can run step3!"便可执行step3了:
# /step3
首先会提示你修改fstab,然后是/etc/conf.d/net, /etc/rc.conf(这个我只是改一下CLOCK="local"),然后你得设定root密码(提示”Now you need to set your root password!")。等大约十几二十分钟后你会看到menuconfig的画面,配置好kernel后(在vmware里装的朋友别忘了把Device Drivers-->SCSI device support-->SCSI low-level drivers-->BusLogic SCSI support编进kernel),又得等约二十分钟你得编辑grub.conf了,已经有个版了,你只需改一下分区就可以了。
最后你会看到grub的安装画面(官方文档里提到的grub-install似乎不大好用):
grub > root (
按两下Tab,你会看到可用的分区,选了之后
grub > setup (
按一下Tab,然后改成类似setup (hd0)或setup (sda0)这样子就会将grub装到MBR里了。然后quit退出。
想一想如果没有什么需要改的,就可以exit退出chroot环境并reboot了!

看一下以下这些step执行档就知道我不过是把那些要用到的命令写进去而已,这样做的好处一是省得打那么多的命令(也容易打错嘛),二是怕遗漏某一步(几小时晕头脑胀的过程,漏掉一步可能性还是挺高的)。有兴趣的朋友可以试试!
step1:
  1. mkswap /dev/sda2
  2. swapon /dev/sda2
  3. mke2fs /dev/sda1
  4. #mkreiserfs /dev/sda3  #if you want to use reiserfs
  5. mkfs.xfs -f /dev/sda3  #if you want to use xfs
  6. mount /dev/sda3 /mnt/gentoo
  7. mkdir /mnt/gentoo/boot
  8. mount /dev/sda1 /mnt/gentoo/boot
  9. echo "
  10. Now date your system time!"
复制代码

step2:
  1. cd /mnt/gentoo
  2. tar xjvpf /mnt/cdrom/stages/stage3-x86-2004.2.tar.bz2
  3. tar -xvjf /mnt/cdrom/snapshots/portage-20040710.tar.bz2 -C /mnt/gentoo/usr
  4. mkdir /mnt/gentoo/usr/portage/distfiles
  5. cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/
  6. #nano -w /mnt/gentoo/etc/make.conf
  7. cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
  8. mount -t proc none /mnt/gentoo/proc
  9. cp /mnt/cdrom/step3 /mnt/gentoo  #only needed if the step scripts have been put on the CD!
  10. echo "
  11. Now you can run step3!"
  12. chroot /mnt/gentoo /bin/bash
复制代码

step3:
  1. env-update && source /etc/profile
  2. ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  3. nano -w /etc/fstab  #
  4. echo tux > /etc/hostname
  5. echo home.net > /etc/dnsdomainname
  6. echo nis.home.net > /etc/nisdomainname
  7. echo "192.168.1.1     tux.home.net       tux" >> /etc/hosts
  8. echo "Have fun with Gentoo! - Fleta
  9. " >> /etc/issue
  10. rc-update add domainname default
  11. rc-update add numlock default
  12. nano -w /etc/conf.d/net  #
  13. rc-update add net.eth0 default
  14. nano -w /etc/rc.conf  #
  15. echo "
  16. Now you need to set your root password!"
  17. passwd
  18. echo "tts/0" >> /etc/securetty
  19. emerge metalog
  20. rc-update add metalog default
  21. emerge xfsprogs  #if you've chosen to use xfs
  22. #emerge reiserfsprogs  #if you've chosen to use reiserfs
  23. emerge genkernel
  24. emerge gentoo-dev-sources
  25. genkernel --menuconfig all  #
  26. emerge hotplug
  27. rc-update add hotplug default
  28. cd /boot
  29. ln -s . boot
  30. emerge grub
  31. echo "default 0
  32. timeout 15
  33. color cyan/blue white/blue

  34. title=Gentoo Linux 2.6.7-r11
  35. root (hd0,0)
  36. kernel /boot/kernel-2.6.7-gentoo-r11 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 vga=791 splash=silent
  37. initrd /boot/initrd-2.6.7-gentoo-r11" >> /boot/grub/grub.conf
  38. nano -w /boot/grub/grub.conf #just to check
  39. grub
复制代码
发表于 2004-8-20 16:38:42 | 显示全部楼层
呵呵,好像以前有个什么脚本比较智能的安装gentoo,具体什么名字我倒是忘了。
发表于 2004-8-20 18:11:56 | 显示全部楼层
楼主的grub.conf可能有潜在的问题,如果有独立的boot分区,一般应该这样写:
root (hd0,0)
kernel /kernel-2.6.7-gentoo-r11 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 vga=791 splash=silent
initrd /initrd-2.6.7-gentoo-r11
但如果/boot里有个boot的link的话,写成kernel /boot/kernel-2.6.7-gentoo-r11。。。就没问题。如果没这个link,可以自己建一个:
# cd /boot
# ln -s . boot
 楼主| 发表于 2004-8-20 18:35:28 | 显示全部楼层
谢谢hauser,我也发觉有问题,已经把那个link的命令加进去了!
发表于 2004-8-20 21:35:45 | 显示全部楼层
可以无网络安装吗?
 楼主| 发表于 2004-8-20 23:36:16 | 显示全部楼层
最初由 torres 发表
可以无网络安装吗?

当然可以,整个过程本来就不需要网络。我提了下配置好网络只是为了安装后方便使用,毕竟没网络的系统用起来忒没劲的,是不是?
发表于 2004-8-21 09:17:48 | 显示全部楼层
我记下来了。。。。HAUSER和FELETA兄的半自动化不错。。加精

PS: 小锁兄说的那个在哪?
发表于 2004-8-21 10:04:21 | 显示全部楼层
汉颜,我不过是提了点小建议而已,这贴是Fleta的。
小锁说的那个可能是指GLIS
 楼主| 发表于 2004-8-21 16:34:52 | 显示全部楼层
装好基本系统后,我换了packages的那张盘,重启后试了下执行这样一个脚本:
  1. useradd fleta -m -G users,wheel,audio,tty,games -s /bin/bash  #增添用户fleta
  2. passwd fleta  
  3. mkdir -p /usr/portage/packages  #准备安装GRP包
  4. mount /dev/cdrom /usr/portage/packages
  5. emerge -ka xfce4 mozilla-firefox gnome-terminal #大约十来分种吧
  6. env-update && source /etc/profile
  7. xorgconfig  #配置x
  8. cp /root/xorg.conf.new /etc/X11/xorg.conf
  9. echo "exec firefox&
  10. exec startxfce4
  11. " > /home/fleta/.xinitrc
  12. chown fleta /home/fleta/.xinitrc  #随便写了个xinitrc
复制代码

重启后以fleta登入,然后:
$ startx
就可以看到xfce+firefox了!不过screen比正常小了一截!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2004-8-21 16:37:20 | 显示全部楼层
应该是x没配置好,这个还挺麻烦的!:confused:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表