diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 856ca8edd..5c684821c 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -126,11 +126,16 @@ sub setstate { } } } + my $hassymlink = eval { symlink("",""); 1 }; foreach $ip (keys %ipaddrs) { my @ipa=split(/\./,$ip); my $pname = sprintf("%02X%02X%02X%02X",@ipa); unlink($tftpdir."/pxelinux.cfg/".$pname); - link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname); + if ($hassymlink) { + symlink($node,$tftpdir."/pxelinux.cfg/".$pname); + } else { + link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname); + } } } diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 7bf460aa4..65a74deff 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -135,11 +135,16 @@ sub setstate { } } } + my $hassymlink = eval { symlink("",""); 1 }; foreach $ip (keys %ipaddrs) { my @ipa=split(/\./,$ip); my $pname = sprintf("%02x%02x%02x%02x",@ipa); unlink($tftpdir."/etc/".$pname); - link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname); + if ($hassymlink) { + symlink($node,$tftpdir."/etc/".$pname); + } else { + link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname); + } } }