Commit 81d2a9e0 authored by Claes Sjofors's avatar Claes Sjofors

upgrade.sh adapted to V4.7.0

parent 6433dcd1
...@@ -27,11 +27,16 @@ let reload__loaddb=4 ...@@ -27,11 +27,16 @@ let reload__loaddb=4
let pass__continue=1 let pass__continue=1
let pass__execute=2 let pass__execute=2
#v44_root="/data1/pwr/x4-4-4/rls_dbg" #v44_root="/data1/pwr/x4-4-4/rls_dbg"
v45_root="/usr/pwr45" if [ -e /usr/pwr46 ]; then
v46_root="/usr/pwr46"
fi
if [ -e /data1/pwr/x4-6-0/rls_dbg ]; then
v46_root="/data1/pwr/x4-6-0/rls_dbg"
fi
reload_dumpdb() reload_dumpdb()
{ {
# Dump V4.4 databases # Dump V4.6 databases
reload_checkpass "dumpdb" $start_pass reload_checkpass "dumpdb" $start_pass
if [ $pass_status -ne $pass__execute ]; then if [ $pass_status -ne $pass__execute ]; then
...@@ -41,6 +46,17 @@ reload_dumpdb() ...@@ -41,6 +46,17 @@ reload_dumpdb()
reload_continue "Pass dump database" reload_continue "Pass dump database"
export pwrp_db=$pwrp_root/common/db
tmp=`eval ls -1d $pwrp_db/*.db`
databases=""
for db in $tmp; do
db=${db##/*/}
db="${db%.*}"
if [ "$db" != "rt_eventlog" ]; then
databases="$databases $db"
fi
done
dmpfiles=`eval ls $pwrp_db/*.wb_dmp` dmpfiles=`eval ls $pwrp_db/*.wb_dmp`
if [ ! -z "$dmpfiles" ]; then if [ ! -z "$dmpfiles" ]; then
rm $pwrp_db/*.wb_dmp rm $pwrp_db/*.wb_dmp
...@@ -51,11 +67,13 @@ reload_dumpdb() ...@@ -51,11 +67,13 @@ reload_dumpdb()
dump_file=$pwrp_db/$cdb.wb_dmp dump_file=$pwrp_db/$cdb.wb_dmp
echo "Dumping volume $cdb in $dump_file" echo "Dumping volume $cdb in $dump_file"
export pwr_load=$v44_root/os_linux/hw_x86/exp/load export pwr_load=$v46_root/os_linux/hw_x86/exp/load
$v44_root/os_linux/hw_x86/exp/exe/wb_cmd -v $cdb wb dump/out=\"$dump_file\" $v46_root/os_linux/hw_x86/exp/exe/wb_cmd -v $cdb wb dump/out=\"$dump_file\"
export pwr_load=$pwrb_root/os_linux/hw_x86/exp/load export pwr_load=$pwrb_root/os_linux/hw_x86/exp/load
# wb_cmd -v $cdb wb dump/out=\"$dump_file\" # wb_cmd -v $cdb wb dump/out=\"$dump_file\"
done done
export pwrp_db=$pwrp_root/src/db
} }
reload_classvolumes() reload_classvolumes()
...@@ -141,8 +159,13 @@ reload_dirvolume() ...@@ -141,8 +159,13 @@ reload_dirvolume()
reload_continue "Pass dirvolume" reload_continue "Pass dirvolume"
wb_cmd create volume/directory if [ -e "$pwrp_db/directory.wb_dmp" ]; then
wb_cmd wb load /load=\"$pwrp_db/directory.wb_dmp\" echo "$pwrp_db/directory.wb_dmp -> $pwrp_db/directory.wb_load"
mv $pwrp_db/directory.wb_dmp $pwrp_db/directory.wb_load
fi
#wb_cmd create volume/directory
#wb_cmd wb load /load=\"$pwrp_db/directory.wb_dmp\"
} }
reload_cnvclassvolume() reload_cnvclassvolume()
...@@ -380,6 +403,74 @@ EOF ...@@ -380,6 +403,74 @@ EOF
reload_status=$reload__success reload_status=$reload__success
} }
reload_directorystructure()
{
reload_checkpass "directorystructure" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass change directory structure"
machine=`eval uname -m`
if [ $machine != "x86_64" ]; then
machine="x86"
fi
platform=$machine"_linux"
mkdir $pwrp_root/bld
mkdir $pwrp_root/src
# mv $pwrp_root/src $pwrp_root/
mv $pwrp_root/login $pwrp_root/src/
mv $pwrp_root/common/db $pwrp_root/src/
mv $pwrp_root/common/src/pop $pwrp_root/src/
if [ -e $pwrp_root/common/doc ]; then
mv $pwrp_root/common/doc $pwrp_root/src/
else
mkdir $pwrp_root/src/doc
fi
mv $pwrp_root/common/src/rtt $pwrp_root/src/
mv $pwrp_root/common/src/tlog $pwrp_root/src/
mv $pwrp_root/common/src/rttbld $pwrp_root/common/
mv $pwrp_root/common/src $pwrp_root/src/appl
mkdir $pwrp_root/src/cnf
mv $pwrp_root/common $pwrp_root/bld/
if [ -e $pwrp_root/x86_linux ]; then
mv $pwrp_root/x86_linux $pwrp_root/bld/
mkdir $pwrp_root/bld/x86_64_linux
mkdir $pwrp_root/bld/x86_64_linux/exe
mkdir $pwrp_root/bld/x86_64_linux/lib
mkdir $pwrp_root/bld/x86_64_linux/obj
mkdir $pwrp_root/bld/x86_64_linux/lis
fi
if [ -e $pwrp_root/x86_64_linux ]; then
mv $pwrp_root/x86_64_linux $pwrp_root/bld/
mkdir $pwrp_root/bld/x86_linux
mkdir $pwrp_root/bld/x86_linux/exe
mkdir $pwrp_root/bld/x86_linux/lib
mkdir $pwrp_root/bld/x86_linux/obj
mkdir $pwrp_root/bld/x86_linux/lis
fi
if [ -e $pwrp_load/ld_appl_*.txt ]; then
mv $pwrp_load/ld_appl_*.txt $pwrp_cnf/
fi
if [ -e $pwrp_root/bld/x86_linux/exe/xtt_help.dat ]; then
mv $pwrp_root/bld/x86_linux/exe/xtt_help.dat $pwrp_cnf/
fi
if [ -e $pwrp_pop/xtt_setup.pwr_com ]; then
mv $pwrp_pop/xtt_setup.rtt_com $pwrp_cnf
fi
if [ -e $pwrp_pop/Rt_xtt ]; then
mv $pwrp_pop/Rt_xtt $pwrp_cnf
fi
reload_status=$reload__success
}
reload_exit() reload_exit()
{ {
source pwrp_env.sh setdb source pwrp_env.sh setdb
...@@ -453,12 +544,20 @@ usage() ...@@ -453,12 +544,20 @@ usage()
{ {
cat << EOF cat << EOF
upgrade.sh Upgrade from V4.5 to V4.6 upgrade.sh Upgrade from V4.6 to V4.7
Pass Pass
convertge Convert Ge graphs. dumpdb Dump database to textfile \$pwrp_db/'volume'.wb_dmp
directorystructure Change directory structure.
classvolumes Create loadfiles for classvolumes.
renamedb Rename old databases.
dirvolume Create directory volume.
loaddb Load dumpfiles.
compile Compile all plcprograms in the database
createload Create new loadfiles.
createboot Create bootfiles for all nodes in the project.
EOF EOF
} }
...@@ -496,14 +595,14 @@ for db in $tmp; do ...@@ -496,14 +595,14 @@ for db in $tmp; do
fi fi
done done
passes="convertge" passes="dumpdb directorystructure classvolumes renamedb dirvolume loaddb compile createload createboot"
#echo "Pass: $passes" #echo "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [convertge] > " echo -n "Enter start pass [dumpdb] > "
read start_pass read start_pass
if [ -z $start_pass ]; then if [ -z $start_pass ]; then
start_pass="convertge" start_pass="dumpdb"
fi fi
for cpass in $passes; do for cpass in $passes; do
......
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