免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 801 | 回复: 1
打印 上一主题 下一主题

做了一张自动安装的linux安装盘 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-06 15:46 |只看该作者 |倒序浏览
原来很简单的,我用的是redhat
1.需要disk1下的/images/boot.iso
2.用ultraiso提取isolinux下的isolinux.cfg文件,修改后更新
修改其中的
label linux
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom
label ks
  kernel vmlinuz
  append ks initrd=initrd.img ks=nfs:nfsserver.domain.com:/var/ftp/incoming/autoinstall.cfg
3.这里需要用一台机器开nfs服务,将redhat的几个iso文件都放在下面。这里采用nfsserver.domain.com,exports文件如下
#cat /etc/exports
/var/ftp        *
iso文件放在nfsserver.domain.com /var/ftp/pub/rhel3

4.cfg文件制作,可以用redhat-config-kickstart你喜欢的类型
我这里有2个cfg文件
ks.cfg:用ultraiso放在boot.iso的根目录下
内容如下:
#Generated by Kickstart Configurator

#System  language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 cs_CZ da_DK nl_NL fr_FR de_DE is_IS it_IT ja_JP.eucJP ko_KR.eucKR no_NO pt_PT ru_RU.k0I8r sl_SI es_ES sv_SE uk_UA --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$/REHUsmZ$r3vBM54c7iCUu9RsgnB4X/
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=nfsserver.domain.com --dir=/var/ftp/pub/rhel3
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext3 --size 100
part / --fstype ext3 --size 3096 --grow
part swap --size 512
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#XWindows configuration information
xconfig --depth=24 --resolution=800x600 --defaultdesktop=GNOME --startxonboot
#Package install information
%packages --resolvedeps
@ X Window System
@ GNOME Desktop Environment
@ KDE Desktop Environment
@ Editors
@ Engineering and Scientific
@ Graphical Internet
@ Text-based Internet
@ Office/Productivity
@ Sound and Video
@ Graphics
@ Games and Entertainment
@ Authoring and Publishing
@ Server Configuration Tools
@ Web Server
@ Mail Server
@ Windows File Server
@ DNS Name Server
@ FTP Server
@ News Server
@ Network Servers
@ Development Tools
@ Kernel Development
@ X Software Development
@ GNOME Software Development
@ KDE Software Development
@ Administration Tools
@ System Tools
@ Printing Support
%post
ifconfig eth0|grep "inet addr"|awk '{print $2}'| mail -s "Linux install fininshed " bitizerg@hotmail.com

第二个文件放在nfsserver.domain.com /var/ftp/incoming/autoinstall.cfg
内容如下
#Generated by Kickstart Configurator

#System  language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 cs_CZ da_DK nl_NL fr_FR de_DE is_IS it_IT ja_JP.eucJP ko_KR.eucKR no_NO pt_PT ru_RU.k0I8r sl_SI es_ES sv_SE uk_UA --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$/REHUsmZ$r3vBM54c7iCUu9RsgnB4X/
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=nfsserver.domain.com --dir=/var/ftp/pub/rhel3
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext3 --size 100
part / --fstype ext3 --size 3096 --grow
part swap --size 4096
#System authorization infomation
auth  --useshadow  --enablemd5
#Network information
#umcomment it after fininshed
#network --bootproto=dhcp --device=eth0
#modify ip address before install,and comment it after fininshed
network --bootproto=static --ip=111.111.111.111 --netmask=255.255.252.0 --gateway=111.111.111.1 --nameserver=111.111.111.25 --device=eth0
#Firewall configuration
firewall --disabled
#XWindows configuration information
xconfig --depth=24 --resolution=800x600 --defaultdesktop=GNOME --startxonboot
#Package install information
%packages --resolvedeps
@ X Window System
@ GNOME Desktop Environment
@ KDE Desktop Environment
@ Editors
@ Engineering and Scientific
@ Graphical Internet
@ Text-based Internet
@ Office/Productivity
@ Sound and Video
@ Graphics
@ Games and Entertainment
@ Authoring and Publishing
@ Server Configuration Tools
@ Web Server
@ Mail Server
@ Windows File Server
@ DNS Name Server
@ FTP Server
@ News Server
@ Network Servers
@ Development Tools
@ Kernel Development
@ X Software Development
@ GNOME Software Development
@ KDE Software Development
@ Administration Tools
@ System Tools
@ Printing Support
#@ everything
#kernel
#grub
%post
ifconfig eth0|grep "inet addr"|awk '{print $2}'| mail -s "Linux install fininshed " bitizerg@hotmail.com


5.将boot.iso刻盘
可完成一下功能
启动后直接回车(or一直等待):采用光盘的ks.cfg,自动安装全部packages,ip由dhcp获得,所有分区都会被清楚
用ks命令:用nfsserver.domian.com的autoinstall.cfg安装,采用其中指定的ip地址,当你需要安装一台新机器的时候,必须修改其中的ip地址
安装顺利的话,完成后会有邮件到你邮箱

论坛徽章:
0
2 [报告]
发表于 2005-04-06 15:51 |只看该作者

做了一张自动安装的linux安装盘

建议需要做安装盘的朋友在刻盘前用vmware做一下实验先,如果安装全部packages的话,需要6g空间。
如果只是需要全部packages的话,只需要
@ everything
kernel
grub
就可以了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP