From 66bddcad5d8ccaf5e3a12484dc78b9f90dc0aa64 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 9 Sep 2008 22:28:30 +0000 Subject: [PATCH] -Switch to using symbolic rather than hard links as possible git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2112 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/pxe.pm | 7 ++++++- xCAT-server/lib/xcat/plugins/yaboot.pm | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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); + } } }