1# Setting Up the Environment<a name="EN-US_TOPIC_0000001174270689"></a> 2 3- [Environment Requirements](#section179175261196) 4 - [Hardware](#section5840424125014) 5 - [Software](#section965634210501) 6 7- [Installing Linux Build Tools](#section182916865219) 8 - [Changing Linux Shell to Bash](#section1715027152617) 9 - [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251) 10 - [Installing File Packing Tools and JVM](#section16199102083717) 11 12 13## Environment Requirements<a name="section179175261196"></a> 14 15### Hardware<a name="section5840424125014"></a> 16 17- Hi3516D V300 IoT camera development board 18- USB-to-serial cable and network cable \(The Windows workstation is connected to the Hi3516D V300 development board through the USB-to-serial cable and network cable.\) 19 20The following figure shows the hardware connections. 21 22**Figure 1** Hardware connections<a name="fig38451744110"></a> 23 24 25### Software<a name="section965634210501"></a> 26 27> **NOTICE:** 28>This section describes how to use an installation package to set up the compilation and development environment. If you are going to use Docker to set up the environment, skip this section and [Installing Linux Build Tools](#section182916865219). 29 30The following table describes the tools required for setting up the general environment for a Linux server of the Hi3516 development board and how to obtain these tools. 31 32**Table 1** Development tools and obtaining methods 33 34<a name="table6299192712513"></a> 35<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="13.081308130813083%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>Development Tool</p> 36</th> 37<th class="cellrowborder" valign="top" width="19.921992199219922%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>Description</p> 38</th> 39<th class="cellrowborder" valign="top" width="66.996699669967%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>How to Obtain</p> 40</th> 41</tr> 42</thead> 43<tbody><tr id="row167343191518"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p467443191517"><a name="p467443191517"></a><a name="p467443191517"></a>bash</p> 44</td> 45<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p0674153114151"><a name="p0674153114151"></a><a name="p0674153114151"></a>Processes CLI commands.</p> 46</td> 47<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p116746312151"><a name="p116746312151"></a><a name="p116746312151"></a>System configuration</p> 48</td> 49</tr> 50<tr id="row14885193315201"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p> 51</td> 52<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>Provides a basic software package for compilation and building.</p> 53</td> 54<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>Internet</p> 55</td> 56</tr> 57<tr id="row52253812238"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p28007392236"><a name="p28007392236"></a><a name="p28007392236"></a>dosfstools, mtools, and mtd-utils</p> 58</td> 59<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p98008390232"><a name="p98008390232"></a><a name="p98008390232"></a>Pack files.</p> 60</td> 61<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p280018394233"><a name="p280018394233"></a><a name="p280018394233"></a>apt-get install</p> 62</td> 63</tr> 64<tr id="row29204072315"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p5921190162318"><a name="p5921190162318"></a><a name="p5921190162318"></a>Java virtual machine (JVM)</p> 65</td> 66<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p17921110152311"><a name="p17921110152311"></a><a name="p17921110152311"></a>Compiles, debugs, and runs Java programs.</p> 67</td> 68<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p16921805237"><a name="p16921805237"></a><a name="p16921805237"></a>apt-get install</p> 69</td> 70</tr> 71</tbody> 72</table> 73 74## Installing Linux Build Tools<a name="section182916865219"></a> 75 76> **NOTICE:** 77>- If you acquire the source code using an HPM component or HPM CLI tool, you do not need to install **hc-gen**. 78>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **hc-gen**. When installing the compilation tool, ensure that its environment variable path is unique. 79 80### Changing Linux Shell to Bash<a name="section1715027152617"></a> 81 82Check whether bash is used as the shell. 83 84``` 85ls -l /bin/sh 86``` 87 88If **/bin/sh -\> bash** is not displayed, do as follows to change shell to bash. 89 90**Method 1:** Run the following command on the device and then click **No**. 91 92``` 93sudo dpkg-reconfigure dash 94``` 95 96**Method 2:** Run the first command to delete **sh** and then run the second command to create a new soft link. 97 98``` 99sudo rm -rf /bin/sh 100sudo ln -s /bin/bash /bin/sh 101``` 102 103### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a> 104 105Install the software. 106 107``` 108sudo apt-get install build-essential gcc g++ make zlib* libffi-dev 109``` 110 111### Installing File Packing Tools and JVM<a name="section16199102083717"></a> 112 1131. Start a Linux server. 1142. Install the dosfstools, mtools, mtd-utils, Java Runtime Environment \(JRE\), and Java SDK. 115 116 ``` 117 sudo apt-get install dosfstools mtools mtd-utils default-jre default-jdk 118 ``` 119 120 121