forked from magnusfeuer/genivi_software_management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_swm.sh
executable file
·89 lines (69 loc) · 2.32 KB
/
start_swm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
#
# (c) 2015 - Jaguar Land Rover.
#
# Mozilla Public License 2.0
#
# Ubuntu Software Manager Loader launch script
#
PID_FNAME=/tmp/swm_pidlist
killswm () {
for i in $(cat $PID_FNAME); do
kill $i
done
exit 0
}
if [ "$(id -u)" != "0" ]
then
echo "How about sudo..."
exit 1
fi
usage() {
echo "Usage: ${0} [-r] [-i]"
echo " -r Reset completed operation database"
echo " -i Run in interactive mode. Start sota_client separately"
exit 255
}
SWLM_ARG=""
INTERACTIVE=false
while getopts ":ri" opt; do
case $opt in
r)
SWLM_ARG="-r"
;;
i)
INTERACTIVE="true"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
export PYTHONPATH="${PWD}/common/"
rm -f $PID_FNAME
gnome-terminal --geometry 80x15+0+0 -x bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;Package Manager\007\"; cd package_manager;python package_manager.py"
gnome-terminal --geometry 80x15+0+500 -x bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;Partition Manager\007\";cd partition_manager; python partition_manager.py"
gnome-terminal --geometry 80x15+0+1000 -x \bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;ECU1 Module Loader\007\"; cd module_loader_ecu1; python module_loader_ecu1.py"
gnome-terminal --geometry 80x24+0+1500 -x bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;Software Loading Manager\007\";cd software_loading_manager; python software_loading_manager.py ${SWLM_ARG}"
gnome-terminal --geometry 80x15+0+2000 -x bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;Lifecycle Manager\007\";cd lifecycle_manager; python lifecycle_manager.py"
gnome-terminal --geometry 80x20+0+2500 -x bash -c "echo \$BASHPID >> $PID_FNAME; echo -ne \"\033]0;HMI\007\";cd hmi;python hmi.py"
trap killswm INT
if [ "${INTERACTIVE}" = "false" ]
then
cd sota_client
echo "Running SOTA client with HMI user confirmation turned off. Use -c to turn on"
python sota_client.py -u sample_app_1.2.3 -i ../sample_update.upd -s xxx -d "Sample Update Description"
read x
killswm
exit 0
fi
echo "Please run"
echo
echo " cd sota_client"
echo " sudo PYTHONPATH=\"\${PWD}/../common/\" python sota_client.py -u sample_app_1.2.3 -c -i ../sample_update.upd -s xxx -d \"Sample Update Description\""
echo
echo "to start package use case."
echo
echo "Press Enter shut down Software Manager"
read x
killswm