summaryrefslogtreecommitdiffstats
path: root/build/f_isoroot/f_kscfg
diff options
context:
space:
mode:
authorStefan K. Berg <stefan.k.berg@ericsson.com>2016-01-28 10:02:00 +0100
committerStefan K. Berg <stefan.k.berg@ericsson.com>2016-01-28 10:02:00 +0100
commita1e787440c7487368c813834a72bd08137bbbcf9 (patch)
treefb73722a1811ea0605ece623e44ee5e7a26bc559 /build/f_isoroot/f_kscfg
parent9bd8e7fef767a5ce0fb481dbf20335ce4f280553 (diff)
Rebase of ks.cfg due to upstream changes
Change-Id: I488851ded40e88180359d545259ec0631416d32d Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
Diffstat (limited to 'build/f_isoroot/f_kscfg')
-rw-r--r--build/f_isoroot/f_kscfg/ks.cfg7
-rw-r--r--build/f_isoroot/f_kscfg/ks.cfg.orig7
2 files changed, 14 insertions, 0 deletions
diff --git a/build/f_isoroot/f_kscfg/ks.cfg b/build/f_isoroot/f_kscfg/ks.cfg
index 1787db8c9..356a56267 100644
--- a/build/f_isoroot/f_kscfg/ks.cfg
+++ b/build/f_isoroot/f_kscfg/ks.cfg
@@ -346,6 +346,13 @@ if [[ ! -z $ifname ]]; then
awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
fi
+# Add self entry to /etc/hosts
+ipaddr=$(echo $ip | cut -d: -f1)
+hostname=$(echo $ip | cut -d: -f5)
+# Use default hostname if missing from parameters
+[ -z "$hostname" ] && hostname="fuel.domain.tld"
+short=$(echo $hostname | cut -d. -f1)
+echo -e "${ipaddr} ${hostname} ${short}" >> /etc/hosts
%end
diff --git a/build/f_isoroot/f_kscfg/ks.cfg.orig b/build/f_isoroot/f_kscfg/ks.cfg.orig
index 60e124ae3..0305aa77e 100644
--- a/build/f_isoroot/f_kscfg/ks.cfg.orig
+++ b/build/f_isoroot/f_kscfg/ks.cfg.orig
@@ -346,6 +346,13 @@ if [[ ! -z $ifname ]]; then
awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
fi
+# Add self entry to /etc/hosts
+ipaddr=$(echo $ip | cut -d: -f1)
+hostname=$(echo $ip | cut -d: -f5)
+# Use default hostname if missing from parameters
+[ -z "$hostname" ] && hostname="fuel.domain.tld"
+short=$(echo $hostname | cut -d. -f1)
+echo -e "${ipaddr} ${hostname} ${short}" >> /etc/hosts
%end