summaryrefslogtreecommitdiff
path: root/build_and_run_steps.txt
blob: 176e8b7c91b135ea7b6aed54490177f0c26dd37f (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
This instruction contains the information on how to build and run SDL depending on target OS and HMI type
For some extra build optionsi or in case of some Troubleshooting, look into doc/extra_build_and_run_options.txt


1) General workspace preparation
  1.1: Linux workspace preparation:
    1.1.1: Install Ubuntu/Xubuntu 12.04 or higher
    1.1.2: Configure source repositories (check "Canonical Partners" repositories in Update Manager->Settings->SW source).
            Note: Fore Ubuntu 12.04 "Update Manager->Settings->Other Software"
    1.1.3: Perform "sudo apt-get install git" command in terminal.
    1.1.4: Clone git repository with "git clone https://adc.luxoft.com/stash/scm/ford/applink.git ".
        Note: System will request your credentials.
    1.1.5. Switch to current release branch: "git checkout release/release_SDL_RB_Yx.x".
            Note: you can get list of branches with command "$ git branch -a | grep release_SDL_RB"
            Note: in above cases the <Project_Root_Src> is the path to 'Project_Root_Src' git folder (e.g. "/home/user_name/Work/Project_Root_src").
    1.1.6: SSH configuration on Linux host:
        Install Open-SSH server (For Xubuntu run "sudo apt-get install ssh", for Ubuntu run "sudo apt-get install openssh-server").
        Note: Restart computer if necessary.

  1.2: QNX workspace preparation
    1.2.1: Download and install VMware Player from https://my.vmware.com/web/vmware/downloads
    1.2.2: Download the archived QNX image for VMware from ftp://ford-applink.luxoft.com/Distrs/QNX/QNX_SDP_6.5.0.tar.gz
    1.2.3: Extract image from archive and open it in VMware
            Note: QNX image has root with empty pass and user with pass 'user'. SSH is configured
    1.2.4: Log as root.
    1.2.5: Run “passwd user” and set the new user id (just press enter), group (just press enter) and non-empty password.
    1.2.6: Run "ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key".
    1.2.7: Run "ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key".
    1.2.9: Set up sshd to run at time login.
            Create file "/etc/profile.d/sshd.sh" with command "/usr/sbin/sshd"
    1.2.10: Set up USB access mode
              1.2.10.1: If file "/etc/rc.d/rc.local" is either absent or empty then copy file "<Project_Root_Src>/qnx/rc.local" to folder "/etc/rc.d"
              1.2.10.2: If file "/etc/rc.d/rc.local" exists and is nonempty then append the last line of file "<Project_Root_Src>/qnx/rc.local" to its end

2) Build and run on Linux with web HMI.
  2.1: Build SDL:
    2.1.1: Run "sudo -E ./setup_env.sh" to install all mandatory packages.
      Note: You should run setup_env.sh before first build of specific configuration.
      Note: More information about setup_env.sh flags you can get from doc/extra_build_and_run_options.txt
    2.1.2: Make build directory "$mkdir <Project_QNX_Build_WebHMI>  && cd <Project_QNX_Build_WebHMI>"
    2.1.3: Configure build "cmake <Project_Root_Src>".
    2.1.4: Build and install third party libs.
      Note: this step has to be done just once for each combination of target system (Linux/QNX) and CPU architecture (x86/armv7).
        "$ make 3rd_party"
        "$ sudo make install-3rd_party"
    2.1.5 Run build process "$make install"

  2.2 Run SDL:
    2.2.1: Go to the binary folder "cd <Project_Linux_Build_WebHMI>/bin".
    2.2.2: If Web HMI and SDL are running on separate computers:
        2.2.2.1: LinHost: update SDL config file “<Project_Root_Src>/src/appMain/smartDeviceLink.ini”: find  “ServerAddress = ” there and replace the value with <SDL server address>.
        2.2.2.2: LinHost: update Web HMI network parameters: in file "<Project_Root_Src>/src/components/HMI/app/Flags.js" find “WEBSOCKET_URL: ” and replace the value ("ws://localhost:8087") with <SDL server address>. (e.g. "url: "ws://<SDL adress>:8087"")
            Note: <SDL server address> is the IP of the computer where SDL is running.
    2.2.3: Prepare Policy.
            "$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:."
            "$ export LD_LIBRARY_PATH"
           Note: If libPolicy.so is in other place then use following format:
                LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_POLICY_LIBRARY>
    2.2.4. Run SDL "$ ./smartDeviceLinkCore".
           Note: HMI shall be started automatically.

3) Build and run on Linux with Qt HMI.
  3.1: Build step:
    3.1.1: Run "sudo -E ./setup_env.sh -qt" to install all mandatory packages.
      Note: You should run setup_env.sh only on first building target configuration.
      Note: More information about setup_env.sh flags you can get from doc/extra_build_and_run_options.txt
    3.1.2: Make build directory
              "$ mkdir <Project_Linux_Build_Qt>  && cd <Project_Linux_Build_Qt>
    3.1.3: Configure build "cmake <Project_Root_Src> -DHMI=qt".
    3.1.4: Build and install third party libs.
      Note: this step has to be done just once for each combination of target system (Linux/QNX) and CPU architecture (x86/armv7).
        "$ make 3rd_party"
        "$ sudo make install-3rd_party"
    3.1.5: Run "sudo ldconfig" to configure dynamic linker run-time bindings.
    3.1.6: Run build process “$make install”

  3.2 Run SDL:
    3.2.1: Go to the binary folder "cd <Project_Linux_Build_Qt>/bin".
    3.2.2: If HMI and SDL are running on separate computers:
        2.2.2.1: Set up "export DBUS_SESSION_BUS_ADDRESS=tcp:host=<HOST>,port=<PORT>" on HMI side (e.g. "export DBUS_SESSION_BUS_ADDRESS=tcp:host=192.168.243.131,port=8087").
    3.2.2: Prepare Policy.
          "$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:."
          "$ export LD_LIBRARY_PATH"
            Note: If libPolicy.so is in other place then use following format:
              LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_POLICY_LIBRARY>
    3.2.3. Run SDL "$ ./smartDeviceLinkCore".
         Note: HMI shall be started automatically.

4) Build and run on QNX with Web HMI
  4.1:Build project:
    4.1.1: Run "sudo -E ./setup_env.sh -qnx" to install all mandatory packages.
      Note: You should run setup_env.sh only on first building target configuration.
      Note: More information about setup_env.sh flags you can get from doc/extra_build_and_run_options.txt
    4.1.2: Download and install QNX SDP 6.5.0 SP1 cross platform tools for Linux (http://www.qnx.com/download/download/21179/qnxsdp-6.5.0-201007091524-linux.bin).
            Note: it is necessary to obtain license key: either trial or commercial one (Register on http://www.qnx.com/ website, enter 'QNX product evaluation' and apply for a license key).
            Note: during tools installation mark "GNU Public Licence Utility" check-box.
    4.1.3: Make build directory (Linux Host )
        "$ mkdir <Project_QNX_Build_WebHMI>  && cd <Project_QNX_Build_WebHMI>
    4.1.4: Configure build:
        "$ cmake <Project_Root_Src> -DCMAKE_TOOLCHAIN_FILE=<Project_Root_Src>/qnx_6.5.0_linux_x86.cmake".
    4.1.5: Make third party libs:
        "$ make 3rd_party"
        "$ sudo make install-3rd_party"
    4.1.6 Run build process “$make install”

  4.2: Run project
    4.2.1: Log as root (QNX host)
    4.2.2: QnxServ: download binary folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_WebHMI>/bin/* ./” .
    4.2.3: QnxServ: download 3rd party folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_WebHMI>/3rd_party/* ./” .
    4.2.4: Prepare Policy.
        "$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:."
        "$ export LD_LIBRARY_PATH"
       Note: If libPolicy.so is in other place then use following format:
            LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_POLICY_LIBRARY>
    4.2.5: Prepare log4cxx
       "$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_3RD_PARTY_LIBS>"
       "$ e.g. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../3rd_party/lib"
    4.2.6: QnxHost: update SDL config file “smartDeviceLink.ini”: find  “ServerAddress = ” there and replace the value with <SDL server address>.
    4.2.7: LinHost: update Web HMI network parameters: in file "<Project_Root_Src>/src/components/HMI/app/Flags.js" find “WEBSOCKET_URL: ” and replace the value ("ws://localhost:8087") with <SDL server address>. (e.g. "url: "ws://<SDL adress>:8087"")
           Note: <SDL server address> is the IP of the computer where SDL is running.
    4.2.8: start SDL “su -c ./smartDeviceLinkCore”.
    4.2.9. LinHost: start Chrome “chromium-browser '<Project_Root_Src>/src/components/HMI/index.html'”.
           Note: in case there is no connection with Web HMI probably it is necessary to add QNX Server IP to "no_proxy" config.


5) Build and run SDLCore on QNX with Qt HMI runed on Linux
  5.1:Build Project
    5.1.1: Run "sudo -E ./setup_env.sh -qnx -qt" to install all mandatory packages.
      Note: You should run setup_env.sh only on first building target configuration.
      Note: More information about setup_env.sh flags you can get from doc/extra_build_and_run_options.txt
    5.1.2: Download and install QNX SDP 6.5.0 SP1 cross platform tools for Linux (http://www.qnx.com/download/download/21179/qnxsdp-6.5.0-201007091524-linux.bin).
            Note: it is necessary to obtain license key: either trial or commercial one (Register on http://www.qnx.com/ website, enter 'QNX product evaluation' and apply for a license key).
            Note: during tools installation mark "GNU Public Licence Utility" check-box.
    5.1.3: Create build directory
        "$ mkdir <Project_QNX_Build_Qt>  && cd <Project_QNX_Build_Qt>
    5.1.4: Prepare build:
        “$ cmake <Project_Root_Src> -DCMAKE_TOOLCHAIN_FILE=<Project_Root_Src>/qnx_6.5.0_linux_x86.cmake -DHMI=qt -DCMAKE_BUILD_TYPE=Release”.
    5.1.5: Build and install third party libs.
          Note: this step has to be done just once for each combination of target system (Linux/QNX) and CPU architecture (x86/armv7).
            "$ make 3rd_party"
            "$ sudo make install-3rd_party"
    5.1.6: Run build process “$ make install”

    5.2: Run project
      5.2.1: On Linux host set up "export DBUS_SESSION_b BUS_ADDRESS=tcp:host=<HOST>,port=<PORT>" on HMI side (e.g. "export DBUS_SESSION_BUS_ADDRESS=tcp:host=192.168.243.131,port=8087").
      5.2.2: On qnx host Log as root.
      5.2.3: QnxServ: download binary folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_Qt>/bin/* ./” .
      5.2.4: QnxServ: download 3rd party folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_Qt>/3rd_party/* ./” .
      5.2.5: Prepare Policy.
          "$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:."
          "$ export LD_LIBRARY_PATH"
         Note: If libPolicy.so is in other place then use following format:
              LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_POLICY_LIBRARY>
      5.2.6: Prepare log4cxx
         "$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_3RD_PARTY_LIBS>"
         "$ e.g. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../3rd_party/lib"
      5.2.7: Prepare D-Bus:
          5.2.7.1:  Add the following lines in the file "/usr/etc/dbus-1/session.conf":
                "<listen>tcp:host=IP-OF-YOUR-QNX-PC,port=PORT-FOR-LISTEN</listen><allow_anonymous/>"
                (e.g. "<listen>tcp:host=192.168.243.131,port=8087</listen><allow_anonymous/>).
          5.2.7.2: Execute
            "$ DBUS_SESSION_BUS_ADDRESS=`<PATH_TO_DBUS_DAEMON_BINARY>/dbus-daemon --config-file=<PATH_TO_DBUS_DAEMON_CONFIG>/session.conf --fork --print-address`"
            (e.g. DBUS_SESSION_BUS_ADDRESS=`../3rd_party/bin/dbus-daemon --config-file=../3rd_party/etc/dbus-1/session.conf --fork --print-address`)
            "$ export DBUS_SESSION_BUS_ADDRESS"

            Note: it might be necessary to create directory session.d in the same folder with session.conf
            e.g. mkdir ../3rd_party/etc/dbus-1/session.d

            Note: D-Bus can be started automatically:
            Copy dbus-daemon binary and config to system folders, e.g.

          5.2.7.3: Execute
            "$ cp ../3rd_party/bin/dbus-daemon /usr/bin"
            "$ cp -r ../3rd_party/etc/dbus-1 /etc"
            "$ mkdir /etc/dbus-1/session.d"
          5.2.7.4: Create file "/etc/profile.d/dbus.sh" with command

              "if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
                DBUS_SESSION_BUS_ADDRESS=`/usr/bin/dbus-daemon --fork --config-file=/etc/dbus-1/session.conf --print-address`
                export DBUS_SESSION_BUS_ADDRESS
              fi"
              Note: In this case system has to be rebooted and this step is no more needed
      5.2.8: start SDL “su -c ./smartDeviceLinkCore”.
          Note: If SDL unexpectedly terminates (with any error) check that real IP of QNX Server is same to IP in "/etc/dbus-1/session.conf"
      5.2.9: On Linux host goto "<Project_Linux_Build_Qt>/bin" folder and execute "<QT_HOME_DIR>/qmlscene -I ./hmi/plugins ./hmi/MainWindow.qml" command.

6) Build and run SDLCore on QNX with Qt HMI runed on Qnx
  6.1:Build Project
    6.1.1: Run "sudo -E ./setup_env.sh -qnx -qt" to install all mandatory packages.
      Note: You should run setup_env.sh only on first building target configuration.
      Note: More information about setup_env.sh flags you can get from doc/extra_build_and_run_options.txt
    6.1.2: Download and install QNX SDP 6.5.0 SP1 cross platform tools for Linux (http://www.qnx.com/download/download/21179/qnxsdp-6.5.0-201007091524-linux.bin).
            Note: it is necessary to obtain license key: either trial or commercial one (Register on http://www.qnx.com/ website, enter 'QNX product evaluation' and apply for a license key).
            Note: during tools installation mark "GNU Public Licence Utility" check-box.
    6.1.3: Create build directory
        "$ mkdir <Project_QNX_Build_Qt>  && cd <Project_QNX_Build_Qt>
    6.1.4: Prepare build:
        “$ cmake <Project_Root_Src> -DCMAKE_TOOLCHAIN_FILE=<Project_Root_Src>/qnx_6.5.0_linux_x86.cmake -DHMI=qt -DCMAKE_BUILD_TYPE=Release”.
    6.1.5: Build and install third party libs.
          Note: this step has to be done just once for each combination of target system (Linux/QNX) and CPU architecture (x86/armv7).
            "$ make 3rd_party"
            "$ sudo make install-3rd_party"
    6.1.6: Run build process “$ make install”

    6.2: Run project
      6.2.1: Log as root (QNX host)
      6.2.2: QnxServ: download binary folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_Qt>/bin/* ./” .
      6.2.3: QnxServ: download 3rd party folder “scp -r <linux_host_user>@<linux_host_ip>:/<Project_QNX_Build_Qt>/3rd_party/* ./” .
      6.2.4: Prepare Policy.
          "$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:."
          "$ export LD_LIBRARY_PATH"
         Note: If libPolicy.so is in other place then use following format:
              LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_POLICY_LIBRARY>
      6.2.5: Prepare log4cxx
         "$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PATH_TO_3RD_PARTY_LIBS>"
         "$ e.g. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../3rd_party/lib"
      6.2.6: Prepare D-Bus:
          6.2.6.1: Execute
            "$ DBUS_SESSION_BUS_ADDRESS=`<PATH_TO_DBUS_DAEMON_BINARY>/dbus-daemon --config-file=<PATH_TO_DBUS_DAEMON_CONFIG>/session.conf --fork --print-address`"
            (e.g. DBUS_SESSION_BUS_ADDRESS=`../3rd_party/bin/dbus-daemon --config-file=../3rd_party/etc/dbus-1/session.conf --fork --print-address`)
            "$ export DBUS_SESSION_BUS_ADDRESS"

            Note: it might be necessary to create directory session.d in the same folder with session.conf
            e.g. mkdir ../3rd_party/etc/dbus-1/session.d

            Note: D-Bus can be started automatically:
            Copy dbus-daemon binary and config to system folders, e.g.
                cp ../3rd_party/bin/dbus-daemon /usr/bin
                cp -r ../3rd_party/etc/dbus-1 /etc
                mkdir /etc/dbus-1/session.d

          6.2.6.3: Create file "/etc/profile.d/dbus.sh" with command
              "if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
                DBUS_SESSION_BUS_ADDRESS=`/usr/bin/dbus-daemon --fork --config-file=/etc/dbus-1/session.conf --print-address`
                export DBUS_SESSION_BUS_ADDRESS
              fi"
              Note: In this case system has to be rebooted and this step is no more needed
      6.2.7: start SDL “su -c ./smartDeviceLinkCore”.
          Note: If SDL unexpectedly terminates (with any error) check that real IP of QNX Server is same to IP in "/etc/dbus-1/session.conf"