Commit b9d0d49d authored by Claes Sjofors's avatar Claes Sjofors

Sev node built from 'Build Node'

parent ac582029
...@@ -288,10 +288,12 @@ reload_cnvobjects() ...@@ -288,10 +288,12 @@ reload_cnvobjects()
reload_continue "Pass convert objects in loaded database" reload_continue "Pass convert objects in loaded database"
for cdb in $databases; do # Only directory volume
echo "-- Convert volume $cdb" # for cdb in $databases; do
wb_cmd -q -v $cdb @$pwr_exe/upgrade_pb.pwr_com # echo "-- Convert volume $cdb"
done # wb_cmd -q -v $cdb @$pwr_exe/upgrade_pb.pwr_com
# done
wb_cmd -q @$pwr_exe/upgrade_pb.pwr_com
reload_status=$reload__success reload_status=$reload__success
} }
...@@ -638,6 +640,7 @@ usage() ...@@ -638,6 +640,7 @@ usage()
cnvdump Convert dumpfiles. cnvdump Convert dumpfiles.
renamedb Rename old databases. renamedb Rename old databases.
loaddb Load databases. loaddb Load databases.
cnvobjects Convert objects.
compile Compile all plcprograms in the database compile Compile all plcprograms in the database
createload Create new loadfiles. createload Create new loadfiles.
buildnodes Build all nodes in the project. buildnodes Build all nodes in the project.
...@@ -679,7 +682,7 @@ for db in $tmp; do ...@@ -679,7 +682,7 @@ for db in $tmp; do
fi fi
done done
passes="savedirectory classvolumes cnvdump renamedb loaddb compile createload buildnodes createpackage" passes="savedirectory classvolumes cnvdump renamedb loaddb cnvobjects compile createload buildnodes createpackage"
#echo "Pass: $passes" #echo "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [savedirectory] > " echo -n "Enter start pass [savedirectory] > "
......
...@@ -33,104 +33,51 @@ ...@@ -33,104 +33,51 @@
# the source code of Proview (the version used to produce the # the source code of Proview (the version used to produce the
# combined work), being distributed under the terms of the GNU # combined work), being distributed under the terms of the GNU
# General Public License plus this exception. # General Public License plus this exception.
! #
! #
! Script for upgrading Profinet modules during upgrading from V5.4 to V5.5, # Script for upgrading SevNodeConfig during upgrading from V5.5 to V5.6,
! #
! Sets the Slot attribute.
!
function int is_numeric( string s)
string s1;
int ret = 0;
int len;
s1 = extract( 1, 1, s);
if ( s1 == "0" || s1 == "1" || s1 == "2" || s1 == "3" || s1 == "4" || s1 == "5" || s1 == "6" || s1 == "7" || s1 == "8" || s1 == "9") # Add a RootVolumeConfig and RootVolumeLoad object and
ret = 1; # set the LoadFiles bit in Distribute.Components.
endif #
len = strlen(s);
if ( len > 1)
s1 = extract( 2, 1, s);
if ( s1 == "0" || s1 == "1" || s1 == "2" || s1 == "3" || s1 == "4" || s1 == "5" || s1 == "6" || s1 == "7" || s1 == "8" || s1 == "9")
ret = 1;
endif
endif
return ret;
endfunction
function int set_slot( string mclass) main()
string name; string sevnode;
string sname; string volume;
string snum;
int num;
string attr; string attr;
string parent;
string child; string child;
string class;
string sysobj;
int components;
verify(0); verify(0);
name = GetClassList( mclass); sevnode = GetClassList( "SevNodeConfig");
while ( name != "") while ( sevnode != "")
attr = sevnode + ".Volume";
volume = GetAttribute( attr);
sname = CutObjectName( name, 1); CreateObject( volume, "RootVolumeLoad", sevnode, 1);
snum = extract( 2, 5, sname);
num = is_numeric( snum); sysobj = GetClassList( "$System");
if ( num == 1) CreateObject( volume, "RootVolumeConfig", sysobj, 3);
num = snum; child = GetChild( sevnode);
attr = name + ".Slot";
SetAttribute( attr, num);
printf( "%s %d\n", name, num);
else
# Count siblings
parent = GetParent( name);
child = GetChild( parent);
num = 1;
while ( child != "") while ( child != "")
if ( child == name) class = GetObjectClass( child);
attr = name + ".Slot"; if ( class == "Distribute")
SetAttribute( attr, num); attr = child + ".Components";
printf( "%s %d\n", name, num); components = GetAttribute( attr);
components = components | 2;
SetAttribute( attr, components);
break; break;
endif endif
child = GetNextSibling( child); child = GetNextSibling( child);
num++;
endwhile endwhile
endif
name = GetNextObject( name);
sevnode = GetNextObject( sevnode);
endwhile endwhile
return 1;
endfunction
main()
set_slot( "PnModule");
set_slot( "BaseFcPPO3PnModule");
set_slot( "ABB_ACS880_PnModule");
set_slot( "Siemens_Di4_PnModule");
set_slot( "Siemens_Di2_PnModule");
set_slot( "Siemens_Do4_PnModule");
set_slot( "Siemens_Do2_PnModule");
set_slot( "Siemens_Di32_PnModule");
set_slot( "Siemens_D16_PnModule");
set_slot( "Siemens_Dx16_PnModule");
set_slot( "Siemens_Di8_PnModule");
set_slot( "Siemens_Do32_PnModule");
set_slot( "Siemens_Do16_PnModule");
set_slot( "Siemens_Do8_PnModule");
set_slot( "Siemens_Ai8_PnModule");
set_slot( "Siemens_Ai4_PnModule");
set_slot( "Siemens_Ai2_PnModule");
set_slot( "Siemens_Ao8_PnModule");
set_slot( "Siemens_Ao4_PnModule");
set_slot( "Sinamics_Tgm1_PnModule");
save /quiet
endmain endmain
\ No newline at end of file
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
! !
SObject pwrb:Class SObject pwrb:Class
!/** !/**
! @Version 1.0 ! @Version 1.1
! @Group ProjectConfiguration ! @Group ProjectConfiguration
! @Summary Configures a proview storage environment node. ! @Summary Configures a proview storage environment node.
! The SevNodeConfig object configures a proview storage environment node. ! The SevNodeConfig object configures a proview storage environment node.
...@@ -49,8 +49,8 @@ SObject pwrb:Class ...@@ -49,8 +49,8 @@ SObject pwrb:Class
! The SevNodeConfig object is created in the project volume as a child to ! The SevNodeConfig object is created in the project volume as a child to
! a BusConfig-object in the node-hierachy. ! a BusConfig-object in the node-hierachy.
! !
! A root volumes has to be registred for the node. The volume is only used to give ! A root volumes has to be registred and configured for the node. The volume
! the node a unique identity, and no database is created for the volume. ! should contain a SevServer object in the node hierarchy.
! !
! @b See also ! @b See also
! @classlink NodeConfig pwrb_nodeconfig.html ! @classlink NodeConfig pwrb_nodeconfig.html
...@@ -124,11 +124,12 @@ SObject pwrb:Class ...@@ -124,11 +124,12 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Name of the rootvolume of the node. ! Obsolete since V5.6.0.
!*/ !*/
Object Volume $Attribute 7 Object Volume $Attribute 7
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$String80" Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_INVISIBLE
EndBody EndBody
EndObject EndObject
!/** !/**
......
...@@ -313,7 +313,7 @@ void wb_build::all( int no_export, int no_classvolumes, int no_flowfiles) ...@@ -313,7 +313,7 @@ void wb_build::all( int no_export, int no_classvolumes, int no_flowfiles)
m_sts = sumsts; m_sts = sumsts;
} }
void wb_build::node( char *nodename, void *volumelist, int volumecnt) void wb_build::node( char *nodename, int nodetype, void *volumelist, int volumecnt)
{ {
lfu_t_volumelist *vlist = (lfu_t_volumelist *)volumelist; lfu_t_volumelist *vlist = (lfu_t_volumelist *)volumelist;
pwr_tTime vtime; pwr_tTime vtime;
...@@ -430,7 +430,7 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt) ...@@ -430,7 +430,7 @@ void wb_build::node( char *nodename, void *volumelist, int volumecnt)
if ( opt.force || opt.manual || rebuild) { if ( opt.force || opt.manual || rebuild) {
m_sts = lfu_create_bootfile( nodename, (lfu_t_volumelist *)volumelist, volumecnt, m_sts = lfu_create_bootfile( nodename, nodetype, (lfu_t_volumelist *)volumelist, volumecnt,
opt.debug); opt.debug);
if ( ODD(m_sts)) if ( ODD(m_sts))
wb_log::log( wlog_eCategory_NodeBuild, nodename, 0); wb_log::log( wlog_eCategory_NodeBuild, nodename, 0);
......
...@@ -56,6 +56,10 @@ typedef enum { ...@@ -56,6 +56,10 @@ typedef enum {
bld_ePass_AfterNode bld_ePass_AfterNode
} bld_ePass; } bld_ePass;
typedef enum {
bld_eNodeType_Node,
bld_eNodeType_Sev
} bld_eNodeType;
class wb_build : public wb_status class wb_build : public wb_status
{ {
...@@ -65,7 +69,7 @@ class wb_build : public wb_status ...@@ -65,7 +69,7 @@ class wb_build : public wb_status
void classlist( pwr_tCid cid); void classlist( pwr_tCid cid);
void all( int no_export = 0, int no_classvolumes = 0, int no_flowfiles = 0); void all( int no_export = 0, int no_classvolumes = 0, int no_flowfiles = 0);
void node( char *nodename, void *volumelist, int volumecnt); void node( char *nodename, int nodetype, void *volumelist, int volumecnt);
void volume(); void volume();
void rootvolume( pwr_tVid vid); void rootvolume( pwr_tVid vid);
void classvolume( pwr_tVid vid); void classvolume( pwr_tVid vid);
......
...@@ -58,7 +58,7 @@ static pwr_tStatus PostCreate ( ...@@ -58,7 +58,7 @@ static pwr_tStatus PostCreate (
pwr_tMask comp; pwr_tMask comp;
comp = pwr_mDistrComponentMask_UserDatabase | comp = pwr_mDistrComponentMask_UserDatabase |
// pwr_mDistrComponentMask_LoadFiles | pwr_mDistrComponentMask_LoadFiles |
// pwr_mDistrComponentMask_ApplFile | // pwr_mDistrComponentMask_ApplFile |
// pwr_mDistrComponentMask_XttHelpFile | // pwr_mDistrComponentMask_XttHelpFile |
// pwr_mDistrComponentMask_RHostFiles | // pwr_mDistrComponentMask_RHostFiles |
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include "wb_trv.h" #include "wb_trv.h"
#include "wb_lfu.h" #include "wb_lfu.h"
#include "wb_log.h" #include "wb_log.h"
#include "wb_build.h"
#include "co_dbs.h" #include "co_dbs.h"
#include "cow_msgwindow.h" #include "cow_msgwindow.h"
#include "co_cnf.h" #include "co_cnf.h"
...@@ -275,6 +276,7 @@ pwr_tStatus lfu_create_loadfile( ...@@ -275,6 +276,7 @@ pwr_tStatus lfu_create_loadfile(
*************************************************************************/ *************************************************************************/
pwr_tStatus lfu_create_bootfile( pwr_tStatus lfu_create_bootfile(
char *nodeconfigname, char *nodeconfigname,
int nodetype,
lfu_t_volumelist *volumelist, lfu_t_volumelist *volumelist,
int volumecount, int volumecount,
int debug) int debug)
...@@ -391,6 +393,12 @@ pwr_tStatus lfu_create_bootfile( ...@@ -391,6 +393,12 @@ pwr_tStatus lfu_create_bootfile(
volumelist_ptr++; volumelist_ptr++;
utl_toupper( vollistname_upper, volumelist_ptr->p1); utl_toupper( vollistname_upper, volumelist_ptr->p1);
} }
if ( nodetype == bld_eNodeType_Sev) {
fprintf( file, "pwrs 0.0.0.1\n");
fprintf( file, "pwrb 0.0.0.2\n");
}
fclose( file); fclose( file);
break; break;
...@@ -660,7 +668,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -660,7 +668,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
int found; int found;
pwr_tObjid envobjid; pwr_tObjid envobjid;
pwr_tObjid dbobjid; pwr_tObjid dbobjid;
pwr_tClassId cid, ccid; pwr_tClassId cid, ccid, vcid;
pwr_tObjid volobjid; pwr_tObjid volobjid;
int size; int size;
pwr_tString80 *path_ptr; pwr_tString80 *path_ptr;
...@@ -746,10 +754,10 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -746,10 +754,10 @@ pwr_tStatus lfu_SaveDirectoryVolume(
ODD(sts); ODD(sts);
sts = ldh_GetNextSibling( ldhses, envobjid, &envobjid)) { sts = ldh_GetNextSibling( ldhses, envobjid, &envobjid)) {
sts = ldh_GetObjectClass( ldhses, envobjid, &cid); sts = ldh_GetObjectClass( ldhses, envobjid, &vcid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_WbEnvironment) { if ( vcid == pwr_cClass_WbEnvironment) {
if ( k != 1) if ( k != 1)
continue; continue;
...@@ -785,14 +793,14 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -785,14 +793,14 @@ pwr_tStatus lfu_SaveDirectoryVolume(
// Get xxxVolumeLoad objects // Get xxxVolumeLoad objects
sts = ldh_GetChild( ldhses, envobjid, &volobjid); sts = ldh_GetChild( ldhses, envobjid, &volobjid);
while ( ODD(sts)) { while ( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, volobjid, &cid); sts = ldh_GetObjectClass( ldhses, volobjid, &vcid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_RootVolumeLoad || if ( vcid == pwr_cClass_RootVolumeLoad ||
cid == pwr_cClass_SubVolumeLoad || vcid == pwr_cClass_SubVolumeLoad ||
cid == pwr_cClass_ClassVolumeLoad || vcid == pwr_cClass_ClassVolumeLoad ||
cid == pwr_cClass_DetachedClassVolumeLoad || vcid == pwr_cClass_DetachedClassVolumeLoad ||
cid == pwr_cClass_SharedVolumeLoad ) { vcid == pwr_cClass_SharedVolumeLoad ) {
sts = ldh_ObjidToName( ldhses, volobjid, ldh_eName_Object, sts = ldh_ObjidToName( ldhses, volobjid, ldh_eName_Object,
volume_name, sizeof(volume_name), &size); volume_name, sizeof(volume_name), &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -806,7 +814,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -806,7 +814,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
if ( !strcmp( name, volname)) { if ( !strcmp( name, volname)) {
found = 1; found = 1;
switch (cid) { switch (vcid) {
case pwr_cClass_RootVolumeLoad : case pwr_cClass_RootVolumeLoad :
strcpy( classname, "RootVolume"); strcpy( classname, "RootVolume");
break; break;
...@@ -843,17 +851,17 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -843,17 +851,17 @@ pwr_tStatus lfu_SaveDirectoryVolume(
sts = ldh_GetNextSibling( ldhses, volobjid, &volobjid); sts = ldh_GetNextSibling( ldhses, volobjid, &volobjid);
} }
} }
else if ( cid == pwr_cClass_RootVolumeConfig || else if ( vcid == pwr_cClass_RootVolumeConfig ||
cid == pwr_cClass_SubVolumeConfig || vcid == pwr_cClass_SubVolumeConfig ||
cid == pwr_cClass_ClassVolumeConfig || vcid == pwr_cClass_ClassVolumeConfig ||
cid == pwr_cClass_DetachedClassVolumeConfig || vcid == pwr_cClass_DetachedClassVolumeConfig ||
cid == pwr_cClass_SharedVolumeConfig || vcid == pwr_cClass_SharedVolumeConfig ||
cid == pwr_cClass_CloneVolumeConfig || vcid == pwr_cClass_CloneVolumeConfig ||
cid == pwr_cClass_ExternVolumeConfig ) { vcid == pwr_cClass_ExternVolumeConfig ) {
if ( ! (cid == pwr_cClass_ClassVolumeConfig || cid == pwr_cClass_DetachedClassVolumeConfig) && if ( ! (vcid == pwr_cClass_ClassVolumeConfig || vcid == pwr_cClass_DetachedClassVolumeConfig) &&
k == 0) k == 0)
continue; continue;
if ( (cid == pwr_cClass_ClassVolumeConfig || cid == pwr_cClass_DetachedClassVolumeConfig) && if ( (vcid == pwr_cClass_ClassVolumeConfig || vcid == pwr_cClass_DetachedClassVolumeConfig) &&
k == 1) k == 1)
continue; continue;
...@@ -871,7 +879,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -871,7 +879,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
found = 1; found = 1;
bool out_of_range = false; bool out_of_range = false;
switch (cid) { switch (vcid) {
case pwr_cClass_RootVolumeConfig : case pwr_cClass_RootVolumeConfig :
strcpy( classname, "RootVolume"); strcpy( classname, "RootVolume");
if ( volumelist_ptr->volume_id < cdh_cUserVolMin || if ( volumelist_ptr->volume_id < cdh_cUserVolMin ||
...@@ -924,7 +932,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -924,7 +932,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
syntax_error = 1; syntax_error = 1;
} }
switch (cid) { switch (vcid) {
case pwr_cClass_RootVolumeConfig : case pwr_cClass_RootVolumeConfig :
case pwr_cClass_SubVolumeConfig : case pwr_cClass_SubVolumeConfig :
case pwr_cClass_ClassVolumeConfig : case pwr_cClass_ClassVolumeConfig :
...@@ -937,10 +945,10 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -937,10 +945,10 @@ pwr_tStatus lfu_SaveDirectoryVolume(
"Database", (char **) &dbenum, &size); "Database", (char **) &dbenum, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if (( (cid == pwr_cClass_ClassVolumeConfig || if (( (vcid == pwr_cClass_ClassVolumeConfig ||
cid == pwr_cClass_DetachedClassVolumeConfig) && *dbenum == 2) || vcid == pwr_cClass_DetachedClassVolumeConfig) && *dbenum == 2) ||
( !(cid == pwr_cClass_ClassVolumeConfig || ( !(vcid == pwr_cClass_ClassVolumeConfig ||
cid == pwr_cClass_DetachedClassVolumeConfig) && *dbenum == 1)) { vcid == pwr_cClass_DetachedClassVolumeConfig) && *dbenum == 1)) {
sts = ldh_GetObjectPar( ldhses, envobjid, "RtBody", sts = ldh_GetObjectPar( ldhses, envobjid, "RtBody",
"Server", (char **) &server, &size); "Server", (char **) &server, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -1022,7 +1030,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1022,7 +1030,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
syntax_error = 1; syntax_error = 1;
} }
else { else {
switch (cid) { switch (vcid) {
case pwr_cClass_RootVolumeConfig : case pwr_cClass_RootVolumeConfig :
case pwr_cClass_SubVolumeConfig : case pwr_cClass_SubVolumeConfig :
case pwr_cClass_SharedVolumeConfig : { case pwr_cClass_SharedVolumeConfig : {
...@@ -1030,18 +1038,18 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1030,18 +1038,18 @@ pwr_tStatus lfu_SaveDirectoryVolume(
int *dbenum_p = 0; int *dbenum_p = 0;
char *server_p = 0; char *server_p = 0;
ldh_eVolRep volrep; ldh_eVolRep volrep;
pwr_tCid vcid; pwr_tCid volcid;
pwr_tString40 server = ""; pwr_tString40 server = "";
switch ( cid) { switch ( vcid) {
case pwr_cClass_RootVolumeConfig: case pwr_cClass_RootVolumeConfig:
vcid = pwr_eClass_RootVolume; volcid = pwr_eClass_RootVolume;
break; break;
case pwr_cClass_SubVolumeConfig: case pwr_cClass_SubVolumeConfig:
vcid = pwr_eClass_SubVolume; volcid = pwr_eClass_SubVolume;
break; break;
case pwr_cClass_SharedVolumeConfig: case pwr_cClass_SharedVolumeConfig:
vcid = pwr_eClass_SharedVolume; volcid = pwr_eClass_SharedVolume;
break; break;
default: ; default: ;
} }
...@@ -1073,7 +1081,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1073,7 +1081,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
data = (lfu_sCreaDb *) calloc( 1, sizeof(*data)); data = (lfu_sCreaDb *) calloc( 1, sizeof(*data));
strcpy( data->name, volumelist_ptr->volume_name); strcpy( data->name, volumelist_ptr->volume_name);
data->vid = volumelist_ptr->volume_id; data->vid = volumelist_ptr->volume_id;
data->cid = vcid; data->cid = volcid;
data->ldhses = ldhses; data->ldhses = ldhses;
data->volrep = volrep; data->volrep = volrep;
strcpy( data->server, ""); strcpy( data->server, "");
...@@ -1115,7 +1123,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1115,7 +1123,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
data = (lfu_sCreaDb *) calloc( 1, sizeof(*data)); data = (lfu_sCreaDb *) calloc( 1, sizeof(*data));
strcpy( data->name, volumelist_ptr->volume_name); strcpy( data->name, volumelist_ptr->volume_name);
data->vid = volumelist_ptr->volume_id; data->vid = volumelist_ptr->volume_id;
data->cid = vcid; data->cid = volcid;
data->ldhses = ldhses; data->ldhses = ldhses;
data->volrep = volrep; data->volrep = volrep;
strcpy( data->server, server); strcpy( data->server, server);
...@@ -1176,7 +1184,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1176,7 +1184,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
data = (lfu_sCreaDb *) calloc( 1, sizeof(*data)); data = (lfu_sCreaDb *) calloc( 1, sizeof(*data));
strcpy( data->name, volumelist_ptr->volume_name); strcpy( data->name, volumelist_ptr->volume_name);
data->vid = volumelist_ptr->volume_id; data->vid = volumelist_ptr->volume_id;
if ( cid == pwr_cClass_DetachedClassVolumeConfig) if ( vcid == pwr_cClass_DetachedClassVolumeConfig)
data->cid = pwr_eClass_DetachedClassVolume; data->cid = pwr_eClass_DetachedClassVolume;
else else
data->cid = pwr_eClass_ClassVolume; data->cid = pwr_eClass_ClassVolume;
...@@ -1216,7 +1224,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1216,7 +1224,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
data = (lfu_sCreaDb *) calloc( 1, sizeof(*data)); data = (lfu_sCreaDb *) calloc( 1, sizeof(*data));
strcpy( data->name, volumelist_ptr->volume_name); strcpy( data->name, volumelist_ptr->volume_name);
data->vid = volumelist_ptr->volume_id; data->vid = volumelist_ptr->volume_id;
if ( cid == pwr_cClass_DetachedClassVolumeConfig) if ( vcid == pwr_cClass_DetachedClassVolumeConfig)
data->cid = pwr_eClass_DetachedClassVolume; data->cid = pwr_eClass_DetachedClassVolume;
else else
data->cid = pwr_eClass_ClassVolume; data->cid = pwr_eClass_ClassVolume;
...@@ -1253,7 +1261,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1253,7 +1261,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
break; break;
} }
if ( cid == pwr_cClass_DetachedClassVolumeConfig) if ( vcid == pwr_cClass_DetachedClassVolumeConfig)
fprintf( wblfile, "Volume %s pwr_eClass_DetachedClassVolume %s\nEndVolume\n", fprintf( wblfile, "Volume %s pwr_eClass_DetachedClassVolume %s\nEndVolume\n",
volume_name, cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0)); volume_name, cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0));
else else
...@@ -1328,7 +1336,9 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1328,7 +1336,9 @@ pwr_tStatus lfu_SaveDirectoryVolume(
sts = ldh_GetObjectClass( ldhses, nodeobjid, &cid); sts = ldh_GetObjectClass( ldhses, nodeobjid, &cid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_NodeConfig) { if ( cid == pwr_cClass_NodeConfig ||
cid == pwr_cClass_SevNodeConfig) {
sts = ldh_ObjidToName( ldhses, nodeobjid, ldh_eName_Object, sts = ldh_ObjidToName( ldhses, nodeobjid, ldh_eName_Object,
nodeconfig_name, sizeof(nodeconfig_name), &size); nodeconfig_name, sizeof(nodeconfig_name), &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -1348,9 +1358,13 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1348,9 +1358,13 @@ pwr_tStatus lfu_SaveDirectoryVolume(
} }
/* Check SecondaryNode.NodeName attribute */ /* Check SecondaryNode.NodeName attribute */
if ( cid == pwr_cClass_NodeConfig) {
sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody", sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody",
"SecondaryNode.NodeName", &secondary_nodename_ptr, &size); "SecondaryNode.NodeName", &secondary_nodename_ptr, &size);
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
}
else
secondary_nodename_ptr = 0;
/* Check OperatingSystem attribute */ /* Check OperatingSystem attribute */
sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody", sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody",
...@@ -1377,6 +1391,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1377,6 +1391,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
} }
/* Check SimulateSingleProcess attribute */ /* Check SimulateSingleProcess attribute */
if ( cid == pwr_cClass_NodeConfig) {
sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody", sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody",
"SimulateSingleProcess", (char **)&single_scan_ptr, &size); "SimulateSingleProcess", (char **)&single_scan_ptr, &size);
...@@ -1386,7 +1401,6 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1386,7 +1401,6 @@ pwr_tStatus lfu_SaveDirectoryVolume(
sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody", sts = ldh_GetObjectPar( ldhses, nodeobjid, "RtBody",
"SimulateSingleScanTime", (char **)&scantime_ptr, &size); "SimulateSingleScanTime", (char **)&scantime_ptr, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if (EVEN(sts)) return sts;
if ( *scantime_ptr == 0) { if ( *scantime_ptr == 0) {
char msg[200]; char msg[200];
...@@ -1400,7 +1414,9 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1400,7 +1414,9 @@ pwr_tStatus lfu_SaveDirectoryVolume(
else else
scantime = 0; scantime = 0;
free( (char *) single_scan_ptr); free( (char *) single_scan_ptr);
}
else
scantime = 0;
lfu_check_appl_file( ldhses, nodename_ptr, *bus_number_ptr); lfu_check_appl_file( ldhses, nodename_ptr, *bus_number_ptr);
// lfu_check_opt_file( ldhses, nodename_ptr, *bus_number_ptr, (pwr_mOpSys) os); // lfu_check_opt_file( ldhses, nodename_ptr, *bus_number_ptr, (pwr_mOpSys) os);
...@@ -1411,14 +1427,14 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1411,14 +1427,14 @@ pwr_tStatus lfu_SaveDirectoryVolume(
/* Find the volumes in this node */ /* Find the volumes in this node */
sts = ldh_GetChild( ldhses, nodeobjid, &volobjid); sts = ldh_GetChild( ldhses, nodeobjid, &volobjid);
while ( ODD(sts)) { while ( ODD(sts)) {
sts = ldh_GetObjectClass( ldhses, volobjid, &cid); sts = ldh_GetObjectClass( ldhses, volobjid, &vcid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid == pwr_cClass_RootVolumeLoad || if ( vcid == pwr_cClass_RootVolumeLoad ||
cid == pwr_cClass_SubVolumeLoad || vcid == pwr_cClass_SubVolumeLoad ||
cid == pwr_cClass_ClassVolumeLoad || vcid == pwr_cClass_ClassVolumeLoad ||
cid == pwr_cClass_DetachedClassVolumeLoad || vcid == pwr_cClass_DetachedClassVolumeLoad ||
cid == pwr_cClass_SharedVolumeLoad ) { vcid == pwr_cClass_SharedVolumeLoad ) {
sts = ldh_ObjidToName( ldhses, volobjid, ldh_eName_Object, sts = ldh_ObjidToName( ldhses, volobjid, ldh_eName_Object,
volume_name, sizeof(volume_name), &size); volume_name, sizeof(volume_name), &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -1451,17 +1467,18 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1451,17 +1467,18 @@ pwr_tStatus lfu_SaveDirectoryVolume(
} }
if ( j == 0) if ( j == 0)
fprintf( file, "%s %s %s %s %d %d %f\n", fprintf( file, "%s %s %s %s %d %d %f %d\n",
volume_name, volume_name,
cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0), cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0),
nodeconfig_name, nodeconfig_name,
nodename_ptr, nodename_ptr,
*bus_number_ptr, *bus_number_ptr,
os, os,
scantime); scantime,
cid == pwr_cClass_SevNodeConfig ? bld_eNodeType_Sev : bld_eNodeType_Node);
else if ( j == 1) else if ( j == 1)
// Secondary node // Secondary node
fprintf( file, "%s %s %s(%s) %s %d %d %f\n", fprintf( file, "%s %s %s(%s) %s %d %d %f %d\n",
volume_name, volume_name,
cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0), cdh_VolumeIdToString( 0, 0, volumelist_ptr->volume_id, 0, 0),
secondary_nodename_ptr, secondary_nodename_ptr,
...@@ -1469,7 +1486,8 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1469,7 +1486,8 @@ pwr_tStatus lfu_SaveDirectoryVolume(
secondary_nodename_ptr, secondary_nodename_ptr,
*bus_number_ptr, *bus_number_ptr,
os, os,
scantime); scantime,
bld_eNodeType_Node);
break; break;
} }
volumelist_ptr++; volumelist_ptr++;
...@@ -1484,11 +1502,13 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1484,11 +1502,13 @@ pwr_tStatus lfu_SaveDirectoryVolume(
} }
sts = ldh_GetNextSibling( ldhses, volobjid, &volobjid); sts = ldh_GetNextSibling( ldhses, volobjid, &volobjid);
} }
if ( strcmp( secondary_nodename_ptr, "") == 0) if ( secondary_nodename_ptr == 0 ||
strcmp( secondary_nodename_ptr, "") == 0)
break; break;
} }
if ( nodename_ptr != null_nodename) if ( nodename_ptr != null_nodename)
free( nodename_ptr); free( nodename_ptr);
if ( secondary_nodename_ptr)
free( secondary_nodename_ptr); free( secondary_nodename_ptr);
free( (char *) os_ptr); free( (char *) os_ptr);
} }
...@@ -2071,71 +2091,6 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2071,71 +2091,6 @@ pwr_tStatus lfu_SaveDirectoryVolume(
} }
fclose( fp); fclose( fp);
} }
if ( nodeo.cid() == pwr_cClass_SevNodeConfig) {
// Print a bootfile also
char timstr[40];
pwr_tObjName volstr;
pwr_tVolumeId vid;
sprintf( filename, pwr_cNameBoot,
load_cDirectory, cdh_Low(nodevect[idx].nodename),
bus_number);
dcli_translate_filename( filename, filename);
file = fopen( filename, "w");
if ( !file) {
printf( "** Error, Unable to open bootfile, %s", filename);
return LFU__NOFILE;
}
time_AtoAscii(NULL, time_eFormat_DateAndTime, timstr,sizeof(timstr));
fprintf( file, "%s\n", timstr);
sts = utl_get_systemobject( ldhses, &systemobjid, systemname,
systemgroup);
if ( EVEN(sts)) {
fprintf( file, "\n");
fprintf( file, "\n");
}
else {
fprintf( file, "%s\n", systemname);
fprintf( file, "%s\n", systemgroup);
}
/* Check that there is a rootvolume for this node */
found = 0;
for ( wb_object volo = nodeo.first(); volo; volo = volo.after()) {
if ( volo.cid() == pwr_cClass_RootVolumeLoad) {
strcpy( volstr, volo.name());
/* Check that the name is in the global volume list */
found = 0;
volumelist_ptr = volumelist;
for ( int j = 0; j < volumecount; j++) {
if ( cdh_NoCaseStrcmp( volstr, volumelist_ptr->volume_name) == 0) {
found = 1;
vid = volumelist_ptr->volume_id;
break;
}
volumelist_ptr++;
}
if ( !found) {
char msg[200];
sprintf( msg, "Error, Volume not configured in global volume list, %s\n", volstr);
MsgWindow::message( 'E', msg, msgw_ePop_Default);
}
}
}
if ( found) {
fprintf( file, "-\n");
fprintf( file, "%s %s\n", volstr, cdh_VolumeIdToString( 0, 0, vid, 0, 0));
fprintf( file, "pwrs 0.0.0.1\n");
fprintf( file, "pwrb 0.0.0.2\n");
}
fclose( file);
}
break; break;
} }
default: ; default: ;
...@@ -3433,12 +3388,14 @@ int lfu_create_bootfiles ( ...@@ -3433,12 +3388,14 @@ int lfu_create_bootfiles (
{ {
int sts; int sts;
char node_array[30][80]; char node_array[30][80];
int nodetype[30];
int found; int found;
int nr, i, j; int nr, i, j;
lfu_t_volumelist *volumelist; lfu_t_volumelist *volumelist;
lfu_t_volumelist *volumelist_ptr; lfu_t_volumelist *volumelist_ptr;
int volumecount; int volumecount;
pwr_tString40 nodeconfigname; pwr_tString40 nodeconfigname;
int nodeconfigtype;
/* Load the bootlist */ /* Load the bootlist */
sts = lfu_volumelist_load( pwr_cNameBootList, sts = lfu_volumelist_load( pwr_cNameBootList,
...@@ -3470,6 +3427,7 @@ int lfu_create_bootfiles ( ...@@ -3470,6 +3427,7 @@ int lfu_create_bootfiles (
utl_toupper( nodeconfigname, volumelist_ptr->p1); utl_toupper( nodeconfigname, volumelist_ptr->p1);
if ( !strcmp( nodeconfigname, node_array[i])) if ( !strcmp( nodeconfigname, node_array[i]))
{ {
nodetype[i] = atoi(volumelist_ptr->p6);
found = 1; found = 1;
break; break;
} }
...@@ -3483,7 +3441,7 @@ int lfu_create_bootfiles ( ...@@ -3483,7 +3441,7 @@ int lfu_create_bootfiles (
/* Create the bootfiles */ /* Create the bootfiles */
for ( i = 0; i < nr; i++) for ( i = 0; i < nr; i++)
{ {
sts = lfu_create_bootfile( node_array[i], volumelist, volumecount, sts = lfu_create_bootfile( node_array[i], nodetype[i], volumelist, volumecount,
debug); debug);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -3500,7 +3458,8 @@ int lfu_create_bootfiles ( ...@@ -3500,7 +3458,8 @@ int lfu_create_bootfiles (
if ( strcmp( nodeconfigname, volumelist_ptr->p1)) if ( strcmp( nodeconfigname, volumelist_ptr->p1))
{ {
strcpy( nodeconfigname, volumelist_ptr->p1); strcpy( nodeconfigname, volumelist_ptr->p1);
sts = lfu_create_bootfile( nodeconfigname, nodeconfigtype = atoi( volumelist_ptr->p6);
sts = lfu_create_bootfile( nodeconfigname, nodeconfigtype,
volumelist, volumecount, debug); volumelist, volumecount, debug);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
} }
......
...@@ -128,6 +128,7 @@ pwr_tStatus lfu_volumelist_load( const char *filename, ...@@ -128,6 +128,7 @@ pwr_tStatus lfu_volumelist_load( const char *filename,
pwr_tStatus lfu_create_loadfile( ldh_tSesContext ldhses); pwr_tStatus lfu_create_loadfile( ldh_tSesContext ldhses);
pwr_tStatus lfu_create_bootfile( char *nodeconfigname, pwr_tStatus lfu_create_bootfile( char *nodeconfigname,
int nodetype,
lfu_t_volumelist *volumelist, lfu_t_volumelist *volumelist,
int volumecount, int volumecount,
int debug); int debug);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment