summaryrefslogtreecommitdiffstats
path: root/util/ks.cfg
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2015-10-12 05:32:17 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-10-12 05:32:17 +0000
commit2cbacbc060805b446769def612253798f3b7fb03 (patch)
tree1619e8bde3ff9f988b7f7a7bd9ce7a8a5f2cf867 /util/ks.cfg
parentd27248783e7f49f4edb3a584ffd06c56c61b32c5 (diff)
parent80c770bb093ad2af54171de1a2c4630536d4daf0 (diff)
Merge "bugfix: libvirt_type should be kvm when host is barebetal mode"
Diffstat (limited to 'util/ks.cfg')
-rw-r--r--util/ks.cfg24
1 files changed, 21 insertions, 3 deletions
diff --git a/util/ks.cfg b/util/ks.cfg
index 7d70e6f2..9e33f42f 100644
--- a/util/ks.cfg
+++ b/util/ks.cfg
@@ -166,7 +166,11 @@ function save_nic_cfg() {
}
function save_gateway() {
- echo GATEWAY=$gw >> /etc/sysconfig/network
+ if [[ -z $external_gw ]]; then
+ echo GATEWAY=$gw >> /etc/sysconfig/network
+ else
+ echo GATEWAY=$external_gw >> /etc/sysconfig/network
+ fi
search="domain $domain\nsearch $domain"
echo -e "${search}\nnameserver 127.0.0.1" > /etc/resolv.conf
[ $dns1 ] && echo -e "${search}\nnameserver $dns1" > /etc/resolv.conf
@@ -175,7 +179,11 @@ function save_gateway() {
[ $dns2 ] && echo "nameserver $dns2" >> /etc/dnsmasq.upstream
if [[ -z "$dns1" && -z "$dns2" ]]; then
- echo "nameserver $gw" >> /etc/resolv.conf
+ if [[ -z $external_gw ]]; then
+ echo "nameserver $gw" >> /etc/resolv.conf
+ else
+ echo "nameserver $external_gw" >> /etc/resolv.conf
+ fi
fi
}
# Default FQDN
@@ -184,19 +192,29 @@ hostname="compass"
for I in `cat /proc/cmdline`; do case "$I" in *=*) eval $I;; esac ; done
domain=$hostname
gw=$gw
+ex_gw=$external_gw
install_ip=$install_ip
install_netmask=$install_netmask
install_intf="eth1"
install_hwaddr=`ifconfig $install_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
+save_nic_cfg $install_intf $install_ip $install_netmask $install_hwaddr
+
mgmt_ip=$mgmt_ip
mgmt_netmask=$mgmt_netmask
mgmt_intf="eth0"
mgmt_hwaddr=`ifconfig $mgmt_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
-save_nic_cfg $install_intf $install_ip $install_netmask $install_hwaddr
save_nic_cfg $mgmt_intf $mgmt_ip $mgmt_netmask $mgmt_hwaddr
+
+external_ip=$external_ip
+external_netmask=$external_mask
+external_intf="eth2"
+external_hwaddr=`ifconfig $external_intf | grep -i hwaddr | sed -e 's#^.*hwaddr[[:space:]]*##I'`
+
+save_nic_cfg $external_intf $external_ip $external_netmask $external_hwaddr
+
save_gateway
# already chroot