From 272227fbf24a2e22244059d63b99f9cc3694dda0 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 24 Feb 2010 08:49:37 +0000 Subject: [PATCH] defect 2947777: add the subroutine getTftpDir git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5278 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index edbd241b4..941527c82 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1245,6 +1245,46 @@ sub getInstallDir #-------------------------------------------------------------------------------- +=head3 getTftpDir + + Get location of the directory, used to hold network boot files. + + Arguments: + none + Returns: + path to TFTP directory defined at site.tftpdir. + Globals: + none + Error: + none + Example: + $tftpdir = xCAT::Utils->getTftpDir(); + Comments: + none + +=cut + +#-------------------------------------------------------------------------------- + +sub getTftpDir +{ + # Default tftpdir location. Used by default in most Linux distros. + my $tftpdir = "/tftpboot"; + + # Try to lookup real tftpdir place. + my @tftpdir1 = get_site_attribute("tftpdir"); + + # Use fetched value, incase successful database lookup. + if ($tftpdir1[0]) + { + $tftpdir = $tftpdir1[0]; + } + + return $tftpdir; +} + +#-------------------------------------------------------------------------------- + =head3 getHomeDir Get the path the user home directory from /etc/passwd.