红联Linux门户
Linux帮助

请教ks脚本的一个问题

发布时间:2017-09-21 13:14:26来源:红联作者:kejidong
# Kickstart file automatically generated by anaconda.

#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
#network --onboot yes --device eth0 --mtu=1500 --noipv4 --noipv6 --noipv6
network --onboot yes --device em1 --noipv4 --noipv6
rootpw --iscrypted $6$ycNxgLJ2HWNgXb.d$RMK0ApCoitL4T13c/WMsNZPDmLlYaEWRKKvms/1bwMMyZ8drvrcV16aNitedqRuuFes8EFfWvvJHy6/
firewall --disabled
authconfig --enableshadow --passalgo=md5
selinux --disabled
timezone --utc Asia/Shanghai
#bootloader --location=mbr
bootloader --append="rhgb crashkernel=auto quiet" --location=mbr
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --all --drives=sda --initlabel
part /boot --fstype=ext4 --size=200 --ondisk=sda
part swap --size=65500 --ondisk=sda
part / --size=200 --grow --ondisk=sda


# Reboot after installation
reboot
%packages
@base
@chinese-support
@core
@debugging
@development
@fonts
@graphical-admin-tools
@input-methods
@java-platform
@legacy-unix
@network-file-system-client
@remote-desktop-clients
@system-management-snmp
@server-policy
@system-management
@system-admin-tools
@workstation-policy
mtools
sgpio
device-mapper-persistent-data
systemtap-client
jpackage-utils
tcp_wrappers

%post
#sed -i 's/SELINUX=enforcing/SELINUX=disabled/gi' /etc/selinux/config
echo "search localdomain" > /etc/resolv.conf
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 202.106.196.115" >> /etc/resolv.conf
echo "DNS has changed"
#mount cdrom
mkdir -p /soft/
mount /tmp/cdrom /soft
cp -rf /mnt/Packages/zabbix_agent_DDapp-2.2.3-1.x86_641.rpm /opt
cd /opt
rpm -ivh /opt/zabbix_agent_DDapp-2.2.3-1.x86_641.rpm
umount /soft/
#close cdrom
eject
#reboot
reboot -f
%end

首先我是菜鸟,想弄个定制的iso总是报错,麻烦哪位大师给指点一下,谢谢!
第一个安装时网卡重命名报错,用内注释掉那条就可以。
#network --onboot yes --device eth0 --mtu=1500 --noipv4 --noipv6 --noipv6
network --onboot yes --device em1 --noipv4 --noipv6
第二个是指定分区也报错,去掉就可以。
clearpart --all --drives=sda --initlabel
part /boot --fstype=ext4 --size=200 --ondisk=sda
part swap --size=65500 --ondisk=sda
part / --size=200 --grow --ondisk=sda
第三个是最后执行的脚本我在网上查多好多方法都试过,但都是执行不了。
%post
#sed -i 's/SELINUX=enforcing/SELINUX=disabled/gi' /etc/selinux/config
echo "search localdomain" > /etc/resolv.conf
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 202.106.196.115" >> /etc/resolv.conf
echo "DNS has changed"
#mount cdrom
mkdir -p /soft/
mount /tmp/cdrom /soft
cp -rf /mnt/Packages/zabbix_agent_DDapp-2.2.3-1.x86_641.rpm /opt
cd /opt
rpm -ivh /opt/zabbix_agent_DDapp-2.2.3-1.x86_641.rpm
umount /soft/
文章评论

共有 0 条评论

e乐彩票计划群 幸运时时彩 大有彩票开户 极速赛车单双公式计划 大富彩票计划群 安徽快3 趣彩彩票计划群 山东11选5计划 趣彩彩票计划群 123彩票计划群