aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2017-10-06 11:31:40 +0300
committerRiku Voipio <riku.voipio@linaro.org>2017-10-06 11:40:30 +0300
commit38db4758f19d0181e36a982a1f109391880c97df (patch)
tree0b23506e81264553f233fb0e085970bb307b483f
parent82376fdf93d4247ebcc92f348d4469dc92c3dd43 (diff)
Fix hostname and resolving
Hostname was not being properly set up, and we need resolv.conf symlink for final images. Change-Id: Icd6674ca0c740917047a2c8b51a0246178508ee7
-rw-r--r--files/etc/hostname/DEBIAN1
-rw-r--r--files/etc/hostname/preinst10
-rw-r--r--files/etc/hosts/DEBIAN8
-rw-r--r--files/etc/hosts/preinst10
-rw-r--r--scripts/DEBIAN/21-hostname2
-rwxr-xr-xscripts/LINARO/99-cleanup3
6 files changed, 32 insertions, 2 deletions
diff --git a/files/etc/hostname/DEBIAN b/files/etc/hostname/DEBIAN
new file mode 100644
index 0000000..b638194
--- /dev/null
+++ b/files/etc/hostname/DEBIAN
@@ -0,0 +1 @@
+${HOSTNAME}
diff --git a/files/etc/hostname/preinst b/files/etc/hostname/preinst
new file mode 100644
index 0000000..ee32e3a
--- /dev/null
+++ b/files/etc/hostname/preinst
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+# template expansion
+
+# $1 is the class name used
+# $2 is the path to the file copied
+
+envsubst < $2 > $2.tmp
+mv $2.tmp $2
+
diff --git a/files/etc/hosts/DEBIAN b/files/etc/hosts/DEBIAN
new file mode 100644
index 0000000..b087251
--- /dev/null
+++ b/files/etc/hosts/DEBIAN
@@ -0,0 +1,8 @@
+127.0.0.1 localhost
+127.0.1.1 ${HOSTNAME}
+
+# The following lines are desirable for IPv6 capable hosts
+::1 localhost ip6-localhost ip6-loopback
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+
diff --git a/files/etc/hosts/preinst b/files/etc/hosts/preinst
new file mode 100644
index 0000000..ee32e3a
--- /dev/null
+++ b/files/etc/hosts/preinst
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+# template expansion
+
+# $1 is the class name used
+# $2 is the path to the file copied
+
+envsubst < $2 > $2.tmp
+mv $2.tmp $2
+
diff --git a/scripts/DEBIAN/21-hostname b/scripts/DEBIAN/21-hostname
new file mode 100644
index 0000000..b2213e3
--- /dev/null
+++ b/scripts/DEBIAN/21-hostname
@@ -0,0 +1,2 @@
+#!/bin/bash
+fcopy -M /etc/hosts /etc/hostname
diff --git a/scripts/LINARO/99-cleanup b/scripts/LINARO/99-cleanup
index 37e6a03..42ced20 100755
--- a/scripts/LINARO/99-cleanup
+++ b/scripts/LINARO/99-cleanup
@@ -1,7 +1,6 @@
#! /bin/bash
-rm -f $target/etc/resolv.conf \
- $target/etc/udev/rules.d/70-persistent-net.rules \
+rm -f $target/etc/udev/rules.d/70-persistent-net.rules \
$target/lib/udev/write_net_rules \
$target/etc/mailname \
$target/etc/machine-id \