diff options
author | Jonathan Bauer | 2019-08-12 12:29:16 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-08-12 12:29:16 +0200 |
commit | 435d97600b17889a4053845eb4ed593bcb927a6d (patch) | |
tree | 31dbd8913f3782231da19bb073c45d60acb16392 /builder | |
parent | [slx-network] fix missing link for resolv.conf (diff) | |
download | systemd-init-435d97600b17889a4053845eb4ed593bcb927a6d.tar.gz systemd-init-435d97600b17889a4053845eb4ed593bcb927a6d.tar.xz systemd-init-435d97600b17889a4053845eb4ed593bcb927a6d.zip |
[slx-network] fix symlink handling
Diffstat (limited to 'builder')
-rw-r--r-- | builder/modules.d/slx-network/hooks/copy-network-files.sh | 10 |
1 files changed, 8 insertions, 2 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 10725595..759867bd 100644 --- a/builder/modules.d/slx-network/hooks/copy-network-files.sh +++ b/builder/modules.d/slx-network/hooks/copy-network-files.sh @@ -1,13 +1,19 @@ #!/bin/bash +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 "${NEWROOT}/${file}" ]; then + if [ -e "$file" ]; then + warn "Missing '$file' - won't move it to stage4. " + continue + fi + if [ -e "${NEWROOT}/${file}" ] || [ -h "${NEWROOT}/${file}" ]; then mv "${NEWROOT}/${file}" "${NEWROOT}/${file}.stage4" fi - cp -f "$file" "${NEWROOT}/etc" + cp -af "$file" "${NEWROOT}/etc" done # move resolv.conf to /opt/openslx to detect we are managing it mkdir -p "${NEWROOT}/opt/openslx" |