diff --git a/xCAT-nbroot/xcat-core-nbroot.spec b/xCAT-nbroot/xcat-core-nbroot.spec
index 83c8a745b..2d3cb92f3 100644
--- a/xCAT-nbroot/xcat-core-nbroot.spec
+++ b/xCAT-nbroot/xcat-core-nbroot.spec
@@ -46,6 +46,7 @@ rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot
 cd $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot
 tar zxvf %{SOURCE1}
+chmod 755 etc/S40network bin/getdestiny bin/getdestiny.awk bin/getipmi bin/getipmi.awk
 cd -
 
 
diff --git a/xCAT-server-2.0/lib/xcat/plugins/centos.pm b/xCAT-server-2.0/lib/xcat/plugins/centos.pm
index c67a315c9..a45fad09d 100644
--- a/xCAT-server-2.0/lib/xcat/plugins/centos.pm
+++ b/xCAT-server-2.0/lib/xcat/plugins/centos.pm
@@ -188,12 +188,12 @@ sub mkinstall {
     my $os = $ent->{os};
     my $arch = $ent->{arch};
     my $profile = $ent->{profile};
-    unless (-r $::XCATPREFIX."/share/xcat/install/centos/".$ent->{profile}.".tmpl") {
+    unless (-r $::XCATROOT."/share/xcat/install/centos/".$ent->{profile}.".tmpl") {
       $callback->({error=>["No kickstart template exists for ".$ent->{profile}],errorcode=>[1]});
       next;
     }
     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir
-    xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/centos/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node);
+    xCAT::Template->subvars($::XCATROOT."/share/xcat/install/centos/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node);
     mkpath "/install/postscripts/";
     xCAT::Postage->writescript($node,"/install/postscripts/".$node);
     if (-r "/install/$os/$arch/images/pxeboot/vmlinuz" 
diff --git a/xCAT-server-2.0/lib/xcat/plugins/conserver.pm b/xCAT-server-2.0/lib/xcat/plugins/conserver.pm
index 35e5c585b..a1527f7e5 100644
--- a/xCAT-server-2.0/lib/xcat/plugins/conserver.pm
+++ b/xCAT-server-2.0/lib/xcat/plugins/conserver.pm
@@ -174,7 +174,7 @@ sub donodeent {
     push @$content," port ".$cfgent->{termport}.";\n";
   } else { #a script method...
     push @$content,"  type exec;\n";
-    push @$content,"  exec ".$::XCATPREFIX."/share/xcat/cons/".$cmeth." ".$node.";\n"
+    push @$content,"  exec ".$::XCATROOT."/share/xcat/cons/".$cmeth." ".$node.";\n"
   }
   push @$content,"}\n";
   push @$content,"#xCAT END $node CONS\n";
diff --git a/xCAT-server-2.0/lib/xcat/plugins/rhel.pm b/xCAT-server-2.0/lib/xcat/plugins/rhel.pm
index 878c6b50c..cf8a77ca1 100644
--- a/xCAT-server-2.0/lib/xcat/plugins/rhel.pm
+++ b/xCAT-server-2.0/lib/xcat/plugins/rhel.pm
@@ -182,23 +182,23 @@ sub mkinstall {
     my $os = $ent->{os};
     my $arch = $ent->{arch};
     my $profile = $ent->{profile};
-    unless (-r $::XCATPREFIX."/share/xcat/install/rh/".$ent->{profile}.".tmpl" or 
-            -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl" or
-            -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl" or
-            -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl") {
+    unless (-r $::XCATROOT."/share/xcat/install/rh/".$ent->{profile}.".tmpl" or 
+            -r $::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl" or
+            -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl" or
+            -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl") {
       $callback->({error=>["No kickstart template exists for ".$ent->{profile}],errorcode=>[1]});
       next;
     }
     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir
     
-    if ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl" ) { 
-       xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$os.$arch.tmpl","/install/autoinst/".$node,$node);
-    } elsif ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl" ) { 
-       xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$arch.tmpl","/install/autoinst/".$node,$node);
-    } elsif ( -r $::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl" ) { 
-       xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/$profile.$os.tmpl","/install/autoinst/".$node,$node);
+    if ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl" ) { 
+       xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$os.$arch.tmpl","/install/autoinst/".$node,$node);
+    } elsif ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl" ) { 
+       xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$arch.tmpl","/install/autoinst/".$node,$node);
+    } elsif ( -r $::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl" ) { 
+       xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/$profile.$os.tmpl","/install/autoinst/".$node,$node);
     } else {
-       xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/rh/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node);
+       xCAT::Template->subvars($::XCATROOT."/share/xcat/install/rh/".$ent->{profile}.".tmpl","/install/autoinst/".$node,$node);
     }
     mkpath "/install/postscripts/";
     xCAT::Postage->writescript($node,"/install/postscripts/".$node);
diff --git a/xCAT-server-2.0/lib/xcat/plugins/sles.pm b/xCAT-server-2.0/lib/xcat/plugins/sles.pm
index bf3746b92..777a602ef 100644
--- a/xCAT-server-2.0/lib/xcat/plugins/sles.pm
+++ b/xCAT-server-2.0/lib/xcat/plugins/sles.pm
@@ -53,23 +53,23 @@ sub mkinstall {
     my $arch = $ent->{arch};
     my $profile = $ent->{profile};
     unless (
-        -r $::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl" or
-        -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl" or
-        -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl" or
-        -r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl"
+        -r $::XCATROOT."/share/xcat/install/sles/$profile.tmpl" or
+        -r $::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl" or
+        -r $::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl" or
+        -r $::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl"
         ) {
       $callback->({error=>["No AutoYaST template exists for ".$ent->{profile}],errorcode=>[1]});
       next;
     }
     #Call the Template class to do substitution to produce a kickstart file in the autoinst dir
-    if (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl") {
-        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$os.$arch.tmpl","/install/autoinst/$node",$node);
-    } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl") {
-        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$arch.tmpl","/install/autoinst/$node",$node);
-    } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl") {
-        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.$os.tmpl","/install/autoinst/$node",$node);
-    } elsif (-r $::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl") {
-        xCAT::Template->subvars($::XCATPREFIX."/share/xcat/install/sles/$profile.tmpl","/install/autoinst/$node",$node);
+    if (-r $::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl") {
+        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$os.$arch.tmpl","/install/autoinst/$node",$node);
+    } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl") {
+        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$arch.tmpl","/install/autoinst/$node",$node);
+    } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl") {
+        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.$os.tmpl","/install/autoinst/$node",$node);
+    } elsif (-r $::XCATROOT."/share/xcat/install/sles/$profile.tmpl") {
+        xCAT::Template->subvars($::XCATROOT."/share/xcat/install/sles/$profile.tmpl","/install/autoinst/$node",$node);
     }
     mkpath "/install/postscripts/";
     xCAT::Postage->writescript($node,"/install/postscripts/".$node);
diff --git a/xCAT-server-2.0/sbin/xcatd b/xCAT-server-2.0/sbin/xcatd
index 69e41eb75..939faeaaa 100755
--- a/xCAT-server-2.0/sbin/xcatd
+++ b/xCAT-server-2.0/sbin/xcatd
@@ -298,6 +298,7 @@ until ($quit) {
         $domain = $tmp->{value};
     }
     $peerhost = gethostbyaddr($connection->peeraddr,AF_INET6);
+    unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); }
     $peerhost =~ s/\.$domain\.*$//;
     $peerhost =~ s/-eth\d*$//;
     $peerhost =~ s/-myri\d*$//;
diff --git a/xCAT-server-2.0/share/xcat/cons/ipmi b/xCAT-server-2.0/share/xcat/cons/ipmi
index 512b15665..a1b8be87d 100755
--- a/xCAT-server-2.0/share/xcat/cons/ipmi
+++ b/xCAT-server-2.0/share/xcat/cons/ipmi
@@ -1,5 +1,11 @@
 #!/usr/bin/env perl
 # IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
+BEGIN
+{
+    $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
+}
+$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
+use lib "$::XCATROOT/lib/perl";
 use xCAT::Table;
 my $dba;
 my $ipmitab = xCAT::Table->new('ipmi');