mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +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:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user