summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
authorJonathan Bauer2019-08-12 15:04:56 +0200
committerJonathan Bauer2019-08-12 15:04:56 +0200
commit12d951f61029fbf3d5362de51dbabdc933efd0e2 (patch)
tree7d82d0074a04261819419bda84e9d47570fa0b64 /builder
parent[slx-network] fix symlink handling (diff)
downloadsystemd-init-12d951f61029fbf3d5362de51dbabdc933efd0e2.tar.gz
systemd-init-12d951f61029fbf3d5362de51dbabdc933efd0e2.tar.xz
systemd-init-12d951f61029fbf3d5362de51dbabdc933efd0e2.zip
[slx-network] minor fixes
Diffstat (limited to 'builder')
-rw-r--r--builder/modules.d/slx-network/hooks/copy-network-files.sh16
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/udhcpc-trigger.stage42
2 files changed, 11 insertions, 7 deletions
diff --git a/builder/modules.d/slx-network/hooks/copy-network-files.sh b/builder/modules.d/slx-network/hooks/copy-network-files.sh
index 759867bd..10073b7a 100644
--- a/builder/modules.d/slx-network/hooks/copy-network-files.sh
+++ b/builder/modules.d/slx-network/hooks/copy-network-files.sh
@@ -3,10 +3,9 @@
type -p warn &> /dev/null || . /lib/dracut-lib.sh
if [ -n "$NEWROOT" ]; then
- # backup network configuration files found within stage4
- # before copying ours over.
- for file in /etc/{hostname,resolv.conf,hosts}; do
- if [ -e "$file" ]; then
+ # backup network configuration files found in stage4
+ for file in /etc/{hostname,hosts,resolv.conf}; do
+ if [ ! -e "$file" ]; then
warn "Missing '$file' - won't move it to stage4. "
continue
fi
@@ -15,14 +14,17 @@ if [ -n "$NEWROOT" ]; then
fi
cp -af "$file" "${NEWROOT}/etc"
done
- # move resolv.conf to /opt/openslx to detect we are managing it
+ # special handling for resolv.conf:
+ # move it to /opt/openslx to detect we are managing it
mkdir -p "${NEWROOT}/opt/openslx"
mv "${NEWROOT}/etc/resolv.conf" "${NEWROOT}/opt/openslx/resolv.conf"
ln -s "/opt/openslx/resolv.conf" "${NEWROOT}/etc/resolv.conf"
- # finally make sure we have rdns helper
+
+ # HACK: finally make sure we have rdns helper
+ # This should be done more elegantly one day...
rdns="$(type -p rdns)"
if [ -n "$rdns" ]; then
- cp "$rdns" "${NEWROOT}/opt/openslx/bin"
+ cp -f "$rdns" "${NEWROOT}/opt/openslx/bin"
fi
fi
true
diff --git a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage4 b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage4
index b51328ca..a7e8d3aa 100755
--- a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage4
+++ b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage4
@@ -15,6 +15,8 @@ fi
RESOLV_CONF="/opt/openslx/resolv.conf"
THIS_RESOLV="/run/network/${SLX_PXE_NETIF}.resolv"
+mkdir -p "/run/network"
+
rebuild_resolv_conf () {
# Don't do anything if the active resolv.conf is not ours
# Also this will not run resolvconf update.d... No idea if we should still do so...