Files
new_install/operation/install.txt
2014-03-04 14:55:03 +08:00

221 lines
6.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1.格式化分区:
swaplinux(ext3、ext2、jfs、xfs、reiserfs)fat
format_partition.sh
输入:
stdin
1partition分区
2filesystem文件系统类型
输出:
success:
@ format $devname success
返回值:
1 argument error
2 deivce node doesn't exist
3 filesystem no implement
127 format partition utils not found
Usage
单个处理: echo "/dev/sda1 ext2" | ./format_partition.sh
批量处理:文件格式和单个处理一致
说明需要处理swap分区。
2.挂载分区
mount_partition.sh
输入:
stdin
1partition块设备
2mountpoint挂载点
3filesystem文件系统类型
4)filsystem options文件系统选项
这个为可选参数不传这个参数会有默认的选项文件系统是ext2|ext3|reiserfs会以acl的选项挂载其他则为defaults
输出:
success:
@ mount $devname success
返回值:
1 argument error
2 device node doesn't exist
32 mount failure
Usage
单个处理echo "/dev/sda1 / ext3" |./mount_partition.sh
批量处理:文件格式和单个处理一致
说明不处理swap分区。
3.安装软件包install_pkg.sh
输入:
stdin
1. pkgname
argument:
[--help] show usage
[-s|--source] package source directory, if not specify, default is /Rocky/packages.
输出: sucess:
@ install $pkgname success.
返回值:
1 argument error
2 source directory $PKG_SOURCE_DIR doesn't exist
3 pkgname doesn't exist in source directory
Usage
单个处理echo "acl" |./install_pkg.sh -s /Rocky/packages
批量处理:文件格式和单个处理一致
说明:
1.由安装程序生成/var/lib/pkg/db的空文件
2.默认用/Rocky/packages下面的软件包如果不指定-s参数。
4.配置、生成系统文件:
配置fstabconfigure_fstab.sh
输入:
stdin
1block devices块设备
2mount point挂载点
3filesystem type文件系统类型
以下参数为可选参数如果不指定会有默认的配置如果指定5)那么4也需要指定依次类推
4fs_mntops ext2|ext3|reiserfs的默认配置是acl其他都是defaults。
5fs_freq默认配置swap是0其他都是1
6fs_passno默认配置swap是0其他都是1
输出:
返回值:
1 argument error
2 fstab doesn't exist
Usage
单个处理echo "/dev/hda2 /home ext3"|./configure_fstab.sh
批量处理:文件格式和单个处理一致
说明:
1.需要处理swap;
2.块设备如果是swap则转成by-id其他都转成by-uuid
这个是因为udev-117的udevinfo不能查出查出raid的by-id也不能查出swap的uuid。
生成issue文件
generate_issue.sh
输入:
argument
[--help] show usage
[-v|--version] version of OS
[-a|--arch] architecture of OS
[-r|--release] release of OS(base or security)
[-d|--date] date of generate OS
输出:
返回值:
1 argument error
说明:
1.生成$TARGET/etc/issue文件一般TARGET/mnt
2.可以只给一个参数,但是这样其他参数则为空值。
配置网络:
configure_network.sh
输入:
argument
<-t|--type> "static" or "dynamic"
static argument:
<-h|--hostname> hostname
<-i|--ip> ip address
<-n|--netmask> netmask
<-g|--gateway> gateway
<-d|--domainname> domainname
[-p|--pdns] priamaryDNS
[-s|--sdns] secondaryDNS
[-e|--device] network device. if no configure, default is eth0.
dynamic argument:
<-h|--hostname> hostname
[-e|--device] network device. if no configure, default is eth0.
输出:
返回值:
1 argument error
2 ip/netmask/gateway address incorrect
3 hosts/resolv.conf/ifcfg-eth0/network doesn't exist
Usage
./configure_network.sh -t static -h QinBo -d in.linx -i 192.168.1.110 -n 255.255.255.0 -g 192.168.1.254 -p 172.16.0.254
说明:
1.type必须为static或者dynamic
2.不管哪种typehostname是必须的
3.type=static的时候IP、域名、子网掩码、网关是必须的
4.device多网卡的时候可以指定用哪个网卡默认用的是eth0。
做自启服务:
mk_serv_autoboot.sh
输入:
stdin
1package name软件包名字自启动服务所在软件包
2boot script启动脚本
3boot service需要启动的服务
4boot number启动号
输出:
返回值:
1argument error
2boot script doesn't exist
Usage
单个处理echo "netkit-base inetd rsh S310"|./mk_serv_autoboot.sh
批量处理:文件格式和单个处理一致
说明:
默认在/etc/rc.d/{rc3.d,rc5.d}建立链接。
5.拷贝kernel、modules和生成initrd
copy_kernels.sh
输入:
输出:
返回值:
1 kernel directory/modules directory/initrd.gz/makeinitrd doesn't exist
说明:
1.此脚本从 /Rocky/kernels和/Rocky/modules目录下拷贝kernel和modules
2.把/Rocky/initrd/initrd.gz拷贝到硬盘上的/boot/initrd.gz.old
3.生成initrd调用原来的makeinitrd脚本生成。
6.生成bootloader对应的配置文件,安装bootloader
configure_bootloader_cnf.sh
配置bootloader配置文件
输入:
arguments:
[--help] show this message
<-t|--type> boot loader type:grub,etc.
<-r|--root> partition mount by root
[-b|--boot] partition mount by boot (optional,if the boot is not mount by stand alone)
[-k|--kparameter] kernel parameter
[-o|--osversion] OS version
输出:
返回值:
1 argument error
2 bootloader type doesn't specify
3 bootloader no implement
4 bootloader configuration file doesn't exist
说明:
grub对grub软件包里面的grub.conf.sample($TARGET/boot/grub/)进行相应的修改,
产生新的文件:$TARGET/boot/grub/menu.lst
install_bootloader.sh
安装bootloader
输入:
arguments:
[--help] show this message
<-t|--type> boot loader type:grub,etc.
输出:
返回值:
1 argument error
2 bootloader type doesn't specify
3 bootloader no implement
127 bootloader utils not found
说明:
此脚本把grub装在第一块硬盘上面因为bios默认会从第一块硬盘启动
这样bios就能找到我们的装上去的gurb从而正确引导系统。
7.安装完成执行的脚本
exec_finish_install.sh
输入:无
输出:无
返回值:
根据具体执行脚本的返回值来确定0是成功
Usage
exec_finish_install.sh按照次序依次执行/usr/lib/new_install/operation/finish_install目录下的可执行脚本
99finish_install.sh
原来的firstboot.sh