Set up a Yocto image for raspberry - TeamViewer Support
<main>
<article class="userContent">
<p><br></p><p>The <a href="https://www.yoctoproject.org/" rel="nofollow noreferrer ugc">Yocto Project</a> enables the creation of custom Linux-based systems for embedded devices.</p><p>The <strong>TeamViewer IoT Agent</strong> will run on<strong> Yocto Linux devices</strong> given minimum requirements and configurations are met.</p><p>This article is an example of how to build Yocto Image with TeamViewer IoT Agent for Raspberry using the layer provided in GitHub.</p><p>For more information visit Information see <a href="https://github.com/teamviewer/meta-teamviewer-iot-agent" rel="nofollow noreferrer ugc">https://github.com/teamviewer/meta-teamviewer-iot-agent</a>.</p><p>📌<strong>Note: </strong>When using <strong>ssh</strong> with the built image, the username is <strong>root</strong> and the password is <strong>raspberry</strong>.</p><p><br></p><h3></h3><h2 data-id="what-you-will-need">What you will need</h2><p>Make sure that you have prepared the following points:</p><ul><li>The edge device is set up with a TeamViewer IoT Agent.</li><li>The edge device is connected to the internet.</li><li>Your PC is set up with the TeamViewer Client.</li><li>Your login credentials for the edge device (user name, and password).</li><li>Installed dependencies (based on the operating system of Raspberry). For more information see <a href="https://docs.yoctoproject.org/ref-manual/system-requirements.html#required-packages-for-the-build-host" rel="nofollow noreferrer ugc">Required Packages for the Build Host</a>.</li></ul><p><br></p><h3 data-id="-1"></h3><h2 data-id="setup">Setup</h2><p>1. On your PC open the <strong>TeamViewer Client</strong> and log in.</p><p>2. On the left side open the <strong>Computers & Contacts</strong> tab.</p><p>3. Double-click the <strong>device</strong>.</p><ul><li>The Control Window opens and the connection will be established.</li></ul><p>4. In the <strong>Control Window</strong> on the top open the <strong>Remote Terminal</strong> tab.</p><p>5. Type in your user password and press enter.</p><p>6. Clone the <strong>poky project’s zeus branch</strong>. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">git clone --branch=zeus git://git.yoctoproject.org/poky.git && cd poky
</pre><p>7. Clone the <strong>Raspberry</strong> and the <strong>TeamViewer IoT Agent meta-packages</strong>. In the terminal type in the following commands and press return:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">git clone --branch=zeus git://git.yoctoproject.org/meta-raspberrypi
git clone --branch=zeus https://github.com/teamviewer/meta-teamviewer-iot-agent
</pre><p>8. Configure the <strong>environment</strong>. In the terminal type in the following command and press return.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">source oe-init-build-env
</pre><p>9. Add layers to <strong>bitbake</strong>. In the terminal type in the following commands and press return:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">bitbake-layers add-layer ../meta-raspberrypi
bitbake-layers add-layer ../meta-teamviewer-iot-agent
</pre><p>10. Change the <strong>target machine</strong> on the configuration file and set the init manager to the <strong>system</strong>. In the terminal type in the following commands and press return:</p><pre class="code codeBlock" spellcheck="false" tabindex="0">echo 'MACHINE = "raspberrypi3"' >> conf/local.conf
echo 'DL_DIR = "${TOPDIR}/downloads"' >> conf/local.conf
echo 'CONNECTIVITY_CHECK_URIS = "https://www.google.com/"' >> conf/local.conf
echo '#Set Systemd to Init Manager' >> conf/local.conf
echo 'DISTRO_FEATURES_append = " systemd"' >> conf/local.conf
echo 'DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"' >> conf/local.conf
echo 'VIRTUAL-RUNTIME_init_manager = "systemd"' >> conf/local.co
</pre><p>11. Append <strong>ssh</strong> and <strong>TeamViewer IoT Agent</strong> layer. In the terminal type in the following commands and press return. Type in the user name and password when prompted.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">echo '#Append TeamViewer IoT agent layer' >> conf/local.conf
echo 'IMAGE_INSTALL_append += " teamviewer-iot-agent"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE ?= "50000"' >> conf/local.conf
echo 'CORE_IMAGE_EXTRA_INSTALL += "openssh"' >> conf/local.conf
echo 'INHERIT += "extrausers"' >> conf/local.conf
echo 'EXTRA_USERS_PARAMS = "usermod -P raspberry root;"' >> conf/local.conf
</pre><p>12. Optional: Install <strong>Xvfb server</strong> (see <a href="https://community.teamviewer.com/English/kb/articles/109825-set-up-the-remote-screen-via-x11" rel="nofollow noreferrer ugc">Set up the Remote Screen via X11</a>) on the edge device to be able to use X11 features. In the terminal type in the following command and press return. Type in the user name and password when prompted.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">echo '#X11' >> conf/local.conf
echo 'DISTRO_FEATURES_append += " X11"' >> conf/local.conf
</pre><p>13. Optional: Enable <a href="https://community.teamviewer.com/English/kb/articles/109819-edge-management" rel="nofollow noreferrer ugc">Edge Management</a> on the edge device. In the terminal type in the following commands and press return. Type in the user name and password when prompted.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">git clone --branch=zeus git://git.openembedded.org/meta-openembedded ../meta-openembedded
git clone --branch=zeus git://git.yoctoproject.org/meta-virtualization ../meta-virtualization
sed -i '$d' conf/bblayers.conf
echo ' ${TOPDIR}/../meta-openembedded/meta-oe ' >> conf/bblayers.conf
echo ' ${TOPDIR}/../meta-openembedded/meta-multimedia ' >> conf/bblayers.conf
echo ' ${TOPDIR}/../meta-openembedded/meta-networking ' >> conf/bblayers.conf
echo ' ${TOPDIR}/../meta-openembedded/meta-python ' >> conf/bblayers.conf
echo ' ${TOPDIR}/../meta-openembedded/meta-filesystems ' >> conf/bblayers.conf
echo ' ${TOPDIR}/../meta-virtualization ' >> conf/bblayers.conf
echo ' "' >> conf/bblayers.conf
bitbake-layers show-layers
echo '#Docker layer for supporting Edge services' >> conf/local.conf
echo 'DISTRO_FEATURES_append += " virtualization"' >> conf/local.conf
echo 'IMAGE_ROOTFS_EXTRA_SPACE = "400000"' >> conf/local.conf
</pre><p>14. Start the build type. In the terminal type in the following command and press return. Type in the user name and password when prompted.</p><pre class="code codeBlock" spellcheck="false" tabindex="0">bitbake core-image-minimal
</pre><p>You can find the target image <code class="code codeInline" spellcheck="false" tabindex="0">tmp/deploy/images/raspberrypi3/</code> here with core-image-minimal-raspberrypi3 prefix. In case of failure or new bash (terminal) creation, after all the steps are executed, you need to go to the project’s directory and start again from step 8 <strong>Configure Environment</strong>.</p><p><br></p><h3 data-id="-2"></h3>
</article>
</main>