back port sysclone support

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16287 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sjing 2013-05-14 03:06:00 +00:00
parent 985de85cad
commit cac34c9f5a
2 changed files with 20 additions and 41 deletions

View File

@ -1486,6 +1486,16 @@ sub mksysclone
my %hents =
%{$hmtab->getNodesAttribs(\@nodes,
['serialport', 'serialspeed', 'serialflow'])};
my @entries = xCAT::TableUtils->get_site_attribute("xcatdport");
my $port_entry = $entries[0];
my $xcatdport="3001";
if ( defined($port_entry)) {
$xcatdport = $port_entry;
}
my @entries = xCAT::TableUtils->get_site_attribute("master");
my $master_entry = $entries[0];
require xCAT::Template;
# Warning message for nodeset <noderange> install/netboot/statelite
@ -1557,7 +1567,7 @@ sub mksysclone
{
$xcatmaster = $ient->{xcatmaster};
} else {
$xcatmaster = '!myipfn!';
$xcatmaster = $master_entry;
}
my $osinst;
@ -1714,47 +1724,15 @@ sub mksysclone
my $ramdisk_size = 200000;
if (
-r "$installroot/sysclone/images/$imagename/etc/systemimager/boot/kernel"
and $kernpath = "$installroot/sysclone/images/$imagename/etc/systemimager/boot/kernel"
and -r "$installroot/sysclone/images/$imagename/etc/systemimager/boot/initrd.img"
and $initrdpath = "$installroot/sysclone/images/$imagename/etc/systemimager/boot/initrd.img"
-r "$tftpdir/xcat/genesis.kernel.$arch"
and $kernpath = "$tftpdir/xcat/genesis.kernel.$arch"
and -r "$tftpdir/xcat/genesis.fs.$arch.lzma"
and $initrdpath = "$tftpdir/xcat/genesis.fs.$arch.lzma"
)
{
#TODO: driver slipstream, targetted for network.
# Copy the install resource to /tftpboot and check to only copy once
my $docopy = 0;
my $tftppath;
my $rtftppath; # the relative tftp path without /tftpboot/
if ($imagename) {
$tftppath = "$tftpdir/xcat/osimage/$imagename";
$rtftppath = "xcat/osimage/$imagename";
unless ($donetftp{$imagename}) {
$docopy = 1;
$donetftp{$imagename} = 1;
}
} else {
$tftppath = "/$tftpdir/xcat/$os/$arch/$profile";
$rtftppath = "xcat/$os/$arch/$profile";
unless ($donetftp{"$os|$arch|$profile|$tftpdir"}) {
$docopy = 1;
$donetftp{"$os|$arch|$profile|$tftpdir"} = 1;
}
}
if ($docopy) {
mkpath("$tftppath");
copy($kernpath,"$tftppath/vmlinuz");
copy($initrdpath,"$tftppath/initrd.img");
&insert_dd($callback, $os, $arch, "$tftppath/initrd.img", $driverupdatesrc, $netdrivers);
}
#We have a shot...
my $ent = $rents{$node}->[0];
my $sent = $hents{$node}->[0];
$instserver = $xcatmaster;
if ($ent and $ent->{nfsserver}) {
$instserver=$ent->{nfsserver};
}
my $kcmdline =
"ramdisk_size=$ramdisk_size";
@ -1825,6 +1803,7 @@ sub mksysclone
$kcmdline .= "n8r";
}
}
$kcmdline .= " xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
#$kcmdline .= " noipv6";
# add the addkcmdline attribute to the end
# of the command, if it exists
@ -1836,8 +1815,8 @@ sub mksysclone
#}
my $k;
my $i;
$k = "$rtftppath/vmlinuz";
$i = "$rtftppath/initrd.img";
$k = "xcat/genesis.kernel.$arch";
$i = "xcat/genesis.fs.$arch.lzma";
$bptab->setNodeAttribs(
$node,
@ -1852,7 +1831,7 @@ sub mksysclone
{
$callback->(
{
error => ["Kernel and initrd not found in $installroot/sysclone/images/$imagename"],
error => ["Kernel and initrd not found in $tftpdir/xcat"],
errorcode => [1]
}
);

View File

@ -544,7 +544,7 @@ sub sysclone_prepclient {
$rsp->{data}->[0] = qq{Preparing osimage $osimage on $node.};
xCAT::MsgUtils->message("D", $rsp, $callback);
my $cmd = "export PERL5LIB=/usr/lib/perl5/site_perl/;LANG=C si_prepareclient --server $server --my-modules --yes";
my $cmd = "export PERL5LIB=/usr/lib/perl5/site_perl/;LANG=C si_prepareclient --server $server --no-uyok --yes";
my $output = xCAT::Utils->runxcmd(
{
command => ["xdsh"],