2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

fix bug 4667:rhels6.5 diskful installation failed with netboot=yaboot

This commit is contained in:
ertaozh 2015-05-18 04:45:04 -04:00
parent ae636e0afa
commit a08d3b3aad
2 changed files with 18 additions and 14 deletions

View File

@ -361,7 +361,8 @@ sub update_export {
push @tmp_options, "insecure";
$need_update = 1;
}
push @new_export, join(',',@tmp_options);
my $option = join(',',@tmp_options);
push @new_export, "/install *($option)";
} else {
push @new_export, $line;
}
@ -391,7 +392,7 @@ sub update_syslog {
close($syslog_fd);
unless (grep /local2.*nimol\.log/, @curr_syslog) {
my $new_syslog_fd;
open($new_syslog_fd, ">>", "/etc/exports");
open($new_syslog_fd, ">>", "/etc/rsyslog.conf");
print $new_syslog_fd "local2.* /var/log/nimol.log\n";
close($new_syslog_fd);
#system("service rsyslog restart");
@ -412,6 +413,7 @@ sub create_imgconf_file {
my $bootimg_link = "/tftpboot/vios/nodes";
my $relative_path = $bootimg_link;
$relative_path =~ s/^\/tftpboot//;
$bootimg_root =~ s/^\/tftpboot//;
# check the dir where the bootimage link file and bootimage configuration file stored
unless (-e $bootimg_link) {
mkpath($bootimg_link);
@ -430,10 +432,11 @@ sub create_imgconf_file {
unless (defined($rootpw)) {
return "Unable to find requested password from passwd, with key=vios,username=padmin";
}
unless (-e $bootimg_root."/viobootimg") {
chdir($bootimg_link);
unless (-e "../../".$bootimg_root."/viobootimg") {
return "Unable to find VIOS bootimg file";
}
chdir($bootimg_link);
foreach my $node (@$nodes) {
my $bootimg_conf_fd;
my $gateway = $nethash{$node}{gateway};
@ -444,7 +447,7 @@ sub create_imgconf_file {
my $master_ip = xCAT::NetworkUtils->getipaddr($master);
my $node_ip = xCAT::NetworkUtils->getipaddr($node);
unless (-e "$node") {
symlink($bootimg_root."/viobootimg", "$node");
symlink("../../".$bootimg_root."/viobootimg", "$node");
}
if (-e $bootimg_link."/$node.info") {
unlink($bootimg_link."/$node.info");

View File

@ -679,11 +679,12 @@ sub process_request {
#}
if ($do_dhcpsetup) {
if (%osimagenodehash) {
chdir("$tftpdir");
unless (-e "$tftpdir/yb/node") {
system("mkdir -p $tftpdir/yb/node");
}
chdir("$tftpdir/yb/node");
foreach my $osimage (keys %osimagenodehash) {
unless (-e "$tftpdir/yb/node") {
system("mkdir -p $tftpdir/yb/node");
}
my $osimgent = $osimagetab->getAttribs({imagename => $osimage },'osvers');
my $osentry = $osimgent->{'osvers'};
@ -702,10 +703,10 @@ sub process_request {
}
if (($osv =~ /rh/ and int($osn) >= 6) or
($osv =~ /sles/ and int($osn) >= 11)) {
my $fpath = "/yb/". $osentry."/yaboot";
foreach my $tmp_node (@{$osimagenodehash{$osimage}}) {
unless (-e "yb/node/yaboot-$tmp_node") {
symlink("yb/$osentry/yaboot", "yb/node/yaboot-$tmp_node");
unless (-e "yaboot-$tmp_node") {
symlink("../$osentry/yaboot", "yaboot-$tmp_node");
#symlink("/tftpboot/yb/$osentry/yaboot", "yb/node/yaboot-$tmp_node");
}
}
if ($::YABOOT_request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command
@ -718,8 +719,8 @@ sub process_request {
}
} else {
foreach my $tmp_node (@{$osimagenodehash{$osimage}}) {
unless (-e "yb/node/yaboot-$tmp_node") {
symlink("yaboot", "yb/node/yaboot-$tmp_node");
unless (-e "yaboot-$tmp_node") {
symlink("../../yaboot", "yb/node/yaboot-$tmp_node");
}
}