2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

SLE15: Fix /etc/resolv.conf overwrite

In SLE15 /etc/resolv.conf is a symlink to /run/netconfig/resolv.conf.
The package sysconfig-netconfig creates the symlink to /run/netconfig/resolv.conf on the host OS.
It does not stay in the chroot environment.
Therefore, genimage overwrites /etc/resolv.conf of the host.
Let's not create a dummy file if /etc/resolv.conf is a symlink.
This commit is contained in:
Markus Hilger 2020-01-20 00:48:21 +01:00
parent 74daba97ee
commit b26e6bcb7b

View File

@ -1999,9 +1999,12 @@ sub generic_post { # This function is meant to leave the image in a state approx
print $cfgfile "NETWORKING=yes\n";
close($cfgfile);
open($cfgfile, ">", "$rootimg_dir/etc/resolv.conf");
print $cfgfile "#Dummy resolv.conf to make boot cleaner";
close($cfgfile);
# SLE15 has a symlink to /run/netconfig/resolv.conf and does not need a dummy file
if (! -l "$rootimg_dir/etc/resolv.conf") {
open($cfgfile, ">", "$rootimg_dir/etc/resolv.conf");
print $cfgfile "#Dummy resolv.conf to make boot cleaner";
close($cfgfile);
}
# Create the ifcfg-x file for diskless node. But keep the ONBOOT=no
# to skip the break of nfs-based boot