diff options
Diffstat (limited to 'agl-documentation')
96 files changed, 3375 insertions, 0 deletions
diff --git a/agl-documentation/.gitignore b/agl-documentation/.gitignore new file mode 100644 index 0000000..74c6cd6 --- /dev/null +++ b/agl-documentation/.gitignore @@ -0,0 +1,5 @@ +.vscode +build +**/node_modules +**/_book +**/nohup.out diff --git a/agl-documentation/LICENSE b/agl-documentation/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/agl-documentation/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/agl-documentation/README.md b/agl-documentation/README.md new file mode 100644 index 0000000..bf38bb2 --- /dev/null +++ b/agl-documentation/README.md @@ -0,0 +1,35 @@ +# SDK devkit + +This repository holds AGL documentation (written by the IoT.bzh team) which is + not yet merged into official AGL repository. + +## How to generate pdf + +Documentation is based on [gitbook](https://www.gitbook.com/). +To install locally gitbook: + +```bash +npm install -g gitbook-cli +``` + +To generate documentation: + +```bash +./gen_all_docs.sh +``` + +or to generate one individual doc manually: +You must install calibre first : + +```bash +sudo apt install calibre +``` + +```bash +gitbook pdf ./sdk-devkit ./build/sdk-devkit.pdf +``` + +## Notes / TODO + +* Add Iot.Bzh logo in header instead of IoT.Bzh text +* Write a plugin based on svg + convert to generate cover. diff --git a/agl-documentation/candevstudio/book.json b/agl-documentation/candevstudio/book.json new file mode 100644 index 0000000..464e1b6 --- /dev/null +++ b/agl-documentation/candevstudio/book.json @@ -0,0 +1,11 @@ +{ + "title": "CanDevStudio Quickstart", + "subtitle": "Developer Documentation", + "description": "Candevstudio quickstart to launch it and use it", + "keywords": "AGL, Quickstart, candevstudio, can", + "author": "IoT.Bzh Team", + "website": "http://iot.bzh", + "published": "May 2018", + "version": "0.1", + "pdf_filename": "CanDevStudio" +} diff --git a/agl-documentation/candevstudio/docs/0-Doc-Revisions.md b/agl-documentation/candevstudio/docs/0-Doc-Revisions.md new file mode 100644 index 0000000..3485a4e --- /dev/null +++ b/agl-documentation/candevstudio/docs/0-Doc-Revisions.md @@ -0,0 +1,6 @@ +Document revisions +================== + +| Date | Version | Designation | Author | +|-------------|---------|--------------------------------------|-------------------------| +| 17 May 1018 | 0.1 | Initial release | C.Benier [ Iot.bzh ] | diff --git a/agl-documentation/candevstudio/docs/1_Usage.md b/agl-documentation/candevstudio/docs/1_Usage.md new file mode 100644 index 0000000..c926e9e --- /dev/null +++ b/agl-documentation/candevstudio/docs/1_Usage.md @@ -0,0 +1,17 @@ +# Usage + +You can find the installation part +[here](http://docs.automotivelinux.org/master/docs/devguides/en/dev/reference/host-configuration/docs/5_Candevstudio.html). + +The official repo of CanDevStudio is a subpart of GENIVI and can be found +[here](https://github.com/GENIVI/CANdevStudio/). + +Launch it with following command: + +```bash +CANdevStudio +``` + +Then start a new project. + +![CANdevStudio general screenshot](pictures/CANdevStudio.png) diff --git a/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md b/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md new file mode 100644 index 0000000..60a7ff6 --- /dev/null +++ b/agl-documentation/candevstudio/docs/2_can_device_socketcan_backend.md @@ -0,0 +1,35 @@ +# Bringing up a CAN device using socketcan backend + +* [Using a supported Linux CAN device](https://www.elinux.org/CAN_Bus): + +```bash +# Find your interface name (e.g. can0) +ip link +# Configure bitrate +sudo ip link set can0 type can bitrate 1000000 +# Bring the device up +sudo ip link set can0 up +# Optionally configure CAN termination +sudo ip link set can0 type can termination 1 +``` + +## Using slcand + +* Based on FTDI Serial driver +* Requires slcand to "convert" serial device to SocketCAN. +* Officially supported in Linux Kernel v2.6.38 + +```bash +# Create SocketCAN device from serial interface +sudo slcand -o -c -s8 -S1000000 /dev/ttyUSB0 can0 +# Bring the device up +sudo ip link set can0 up +``` + +## Using builtin Linux kernel virtual CAN module vcan + +```bash +sudo modprobe vcan +sudo ip link add dev can0 type vcan +sudo ip link set can0 up +``` diff --git a/agl-documentation/candevstudio/docs/3_Add_CAN_Device.md b/agl-documentation/candevstudio/docs/3_Add_CAN_Device.md new file mode 100644 index 0000000..d41b99c --- /dev/null +++ b/agl-documentation/candevstudio/docs/3_Add_CAN_Device.md @@ -0,0 +1,32 @@ +# Add a CAN device in CANdevStudio + +Start a new project and grab a ***CanDevice*** from the left pane in the +***Device Layer*** section and drop it on the grid workspace. Right-Click on it +and open its ***Properties***. Here you have to set the ***backend*** and the +***interface*** name you'll want to use. Backend available are: + +- socketcan: CAN stack present by default in the Linux Kernel. This use Linux socket and open source CAN device driver (More information here). +- systeccan: CAN bus backend using the SYS TEC CAN adapters. +- peakcan: CAN bus plugin using the PEAK CAN adapters. +- tinycan: CAN bus plugin using the MHS CAN adapters. +- vectorcan: CAN bus plugin using the Vector CAN adapters. + +More details about CANdevStudio CAN bus support [here](http://doc.qt.io/qt-5.10/qtcanbus-backends.html). + +***Interface*** is the name of the device you want to use. Bring up your CAN device and use the following command to find out which one are available: + +```bash +ip link +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 + link/ether 90:b1:1c:6b:b2:21 brd ff:ff:ff:ff:ff:ff +3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000 + link/ether 52:54:00:56:86:80 brd ff:ff:ff:ff:ff:ff +4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000 + link/ether 52:54:00:56:86:80 brd ff:ff:ff:ff:ff:ff +5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default + link/ether 02:42:81:38:a8:75 brd ff:ff:ff:ff:ff:ff +12: can0: <NOARP,UP,LOWER_UP> mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/can +``` diff --git a/agl-documentation/candevstudio/docs/4_Configure_CanRawSender_Node.md b/agl-documentation/candevstudio/docs/4_Configure_CanRawSender_Node.md new file mode 100644 index 0000000..a78bfd2 --- /dev/null +++ b/agl-documentation/candevstudio/docs/4_Configure_CanRawSender_Node.md @@ -0,0 +1,19 @@ +# Configure a CanRawSender node + +CanRawSender node lets you set a predefined list of CAN Raw messages to send. + +![CanRawSender screenshot](pictures/canrawsender.png) + +Click on the + sign to add as much as needed signals to send. For each signals, you has to define: + +- the CAN arbitration ID +- Data load +- Loop checkbox make the signal repeat infinitely +- Interval is used with loop to define how much time between 2 sends + +Once clicked on ***Play*** button in the main Window to launch the simulation, +then each signals will be sent in the same order than defined in the +CanRawSender node then using interval to repeat themselves. + +Signals without ***loop*** checked will not be sent, you have to click manually +on the ***Send*** button to trigger a sending. diff --git a/agl-documentation/candevstudio/docs/5_Using_CanRawView.md b/agl-documentation/candevstudio/docs/5_Using_CanRawView.md new file mode 100644 index 0000000..39d3615 --- /dev/null +++ b/agl-documentation/candevstudio/docs/5_Using_CanRawView.md @@ -0,0 +1,9 @@ +# Using CanRawView + +***CanRawViewer*** is pretty simple to use, once simulation launched you'll see +signal flows in the window. You can use ***Clear*** button to wipe the window. + +![CanRawViewer screenshot](pictures/canrawviewer.png) + +Use the ***Combine*** button to stack by arbitration ID the CAN signals. +Then only the latest signal for each arbitration ID will be displayed. diff --git a/agl-documentation/candevstudio/docs/README.md b/agl-documentation/candevstudio/docs/README.md new file mode 100644 index 0000000..242b010 --- /dev/null +++ b/agl-documentation/candevstudio/docs/README.md @@ -0,0 +1,19 @@ +# Introduction + +Development tool for CAN bus simulation. + +CANdevStudio is a part of GENIVI project, you can find the github repository +[here](https://github.com/GENIVI/CANdevStudio) and the documentation +[here](https://at.projects.genivi.org/wiki/display/PROJ/CANdevStudio). + +| *Meta* | *Data* | +| -- | -- | +| **Title** | {{ config.title }} | +| **Author** | {{ config.author }} | +| **Description** | {{ config.description }} | +| **Keywords** | {{ config.keywords }} | +| **Language** | English | +| **Published** | Published {{ config.published }} as an electronic book | +| **Updated** | {{ gitbook.time }} | +| **Collection** | Open-source | +| **Website** | [{{ config.website }}]({{ config.website }}) | diff --git a/agl-documentation/candevstudio/docs/SUMMARY.md b/agl-documentation/candevstudio/docs/SUMMARY.md new file mode 100644 index 0000000..3da9fdf --- /dev/null +++ b/agl-documentation/candevstudio/docs/SUMMARY.md @@ -0,0 +1,9 @@ +# Summary + +* [Document revisions](0-Doc-Revisions.md) + +* [Usage](1_Usage.md) +* [Bringing up a CAN device using socketcan backend](2_can_device_socketcan_backend.md) +* [Add a CAN device in CANdevStudio](3_Add_CAN_Device.md) +* [Configure a CanRawSender node](4_Configure_CanRawSender_Node.md) +* [Using CanRawView](5_Using_CanRawView.md) diff --git a/agl-documentation/candevstudio/docs/api-services-book.yml b/agl-documentation/candevstudio/docs/api-services-book.yml new file mode 100644 index 0000000..fd14ac9 --- /dev/null +++ b/agl-documentation/candevstudio/docs/api-services-book.yml @@ -0,0 +1,20 @@ +type: books +books: +- + id: candevstudio + title: CanDevStudio Quickstart + description: CanDevStudio Quickstart documentation + keywords: + author: "IotBzh" + version: master + chapters: + - url: 1_Usage.md + name: Usage Guide + - url: 2_can_device_socketcan_backend.md + name: Bringing up a CAN device using socketcan backend + - url: 3_Add_CAN_Device.md + name: Add a CAN device in CANdevStudio + - url: 4_Configure_CanRawSender_Node.md + name: Configure a CanRawSender node + - url: 5_Using_CanRawView.md + name: Using CanRawView diff --git a/agl-documentation/candevstudio/docs/pictures/CANdevStudio.png b/agl-documentation/candevstudio/docs/pictures/CANdevStudio.png Binary files differnew file mode 100644 index 0000000..c944e02 --- /dev/null +++ b/agl-documentation/candevstudio/docs/pictures/CANdevStudio.png diff --git a/agl-documentation/candevstudio/docs/pictures/canrawsender.png b/agl-documentation/candevstudio/docs/pictures/canrawsender.png Binary files differnew file mode 100644 index 0000000..766ca63 --- /dev/null +++ b/agl-documentation/candevstudio/docs/pictures/canrawsender.png diff --git a/agl-documentation/candevstudio/docs/pictures/canrawviewer.png b/agl-documentation/candevstudio/docs/pictures/canrawviewer.png Binary files differnew file mode 100644 index 0000000..f20488b --- /dev/null +++ b/agl-documentation/candevstudio/docs/pictures/canrawviewer.png diff --git a/agl-documentation/candevstudio/docs/resources/iotbzh_logo.png b/agl-documentation/candevstudio/docs/resources/iotbzh_logo.png Binary files differnew file mode 100644 index 0000000..ae6bc48 --- /dev/null +++ b/agl-documentation/candevstudio/docs/resources/iotbzh_logo.png diff --git a/agl-documentation/candevstudio/docs/resources/iotbzh_logo_small.png b/agl-documentation/candevstudio/docs/resources/iotbzh_logo_small.png Binary files differnew file mode 100644 index 0000000..6a98c60 --- /dev/null +++ b/agl-documentation/candevstudio/docs/resources/iotbzh_logo_small.png diff --git a/agl-documentation/candevstudio/mkdocs.yml b/agl-documentation/candevstudio/mkdocs.yml new file mode 100644 index 0000000..66604b4 --- /dev/null +++ b/agl-documentation/candevstudio/mkdocs.yml @@ -0,0 +1,10 @@ +site_name: AGL Application Framework Binder +theme: readthedocs +docs_dir: docs +pages: +- 'Document revisions' : '0-Doc-Revisions.md' +- 'Usage': '1_Usage.md' +- 'Bringing up a CAN device using socketcan backend': '2_can_device_socketcan_backend.md' +- 'Add a CAN device in CANdevStudio': '3_Add_CAN_Device.md' +- 'Configure a CanRawSender node': '4_Configure_CanRawSender_Node.md' +- 'Using CanRawView': '5_Using_CanRawView.md' diff --git a/agl-documentation/gen_all_docs.sh b/agl-documentation/gen_all_docs.sh new file mode 100755 index 0000000..daf1fb7 --- /dev/null +++ b/agl-documentation/gen_all_docs.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +cd $(dirname $0) +CURDIR=$(pwd) + +FORMAT=pdf +#DEBUG_FLAG=--debug +DEBUG_FLAG= + +DRY= +[ "$1" = "-dry" ] && DRY=echo + +OUT_DIR=./build +[ -d $OUT_DIR ] || mkdir -p $OUT_DIR + +cat <<EOF | { while read doc_dir ; do $DRY iot-gendocs.sh -rp $doc_dir -o $OUT_DIR $DEBUG_FLAG $FORMAT; done } +./sdk-devkit +./host-configuration +./candevstudio +EOF + diff --git a/agl-documentation/host-configuration/book.json b/agl-documentation/host-configuration/book.json new file mode 100644 index 0000000..fadcb68 --- /dev/null +++ b/agl-documentation/host-configuration/book.json @@ -0,0 +1,11 @@ +{ + "title": "AGL Host Configuration", + "subtitle": "Developer Documentation", + "description": "Install AGL tools from OBS repo", + "keywords": "AGL, OBS, Install, repo, host", + "author": "IoT.Bzh Team", + "website": "http://iot.bzh", + "published": "May 2018", + "version": "0.1", + "pdf_filename": "AGL-Host-Configuration" +} diff --git a/agl-documentation/host-configuration/docs/0-Doc-Revisions.md b/agl-documentation/host-configuration/docs/0-Doc-Revisions.md new file mode 100644 index 0000000..3485a4e --- /dev/null +++ b/agl-documentation/host-configuration/docs/0-Doc-Revisions.md @@ -0,0 +1,6 @@ +Document revisions +================== + +| Date | Version | Designation | Author | +|-------------|---------|--------------------------------------|-------------------------| +| 17 May 1018 | 0.1 | Initial release | C.Benier [ Iot.bzh ] | diff --git a/agl-documentation/host-configuration/docs/0-build-microservice-overview.md b/agl-documentation/host-configuration/docs/0-build-microservice-overview.md new file mode 100755 index 0000000..57d7981 --- /dev/null +++ b/agl-documentation/host-configuration/docs/0-build-microservice-overview.md @@ -0,0 +1,55 @@ +# Overview + +You can develop Microservices on your native Linux machine quickly +by following the workflow in this section. +This workflow takes advantage of RPM or Debian packages,which are available +through the +[OpenSUSE Build Service (OBS)](https://build.opensuse.org/). +You can install these +[packages](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive) +and bypass the +[Yocto Project](https://yoctoproject.org) build cycles described in the +"[Developing an AGL Image](../../getting_started/reference/getting-started/image-workflow-intro.html)" section. + +Using this workflow, you can start to code, execute, and debug Microservice +bindings directly on your host. This flow works for many cases for which +no specific hardware is required, or when you can plug hardware directly +into your native Linux host's USB port such as a Controller Area Network +([CAN](https://en.wikipedia.org/wiki/CAN_bus)) bus Adapter or a Media +Oriented Systems Transport +([MOST](https://en.wikipedia.org/wiki/MOST_Bus)) Controller. + +The following figure and list overview the Microservice Native Development +process. +You can learn about the steps in the process by reading through the +remaining sections. + +<center><img src="pictures/microservice-workflow-native.png"></center> + +1. **Verify Your Build Host:** + Make sure you have a native Linux host. + For the example used in this section (i.e. `helloworld-service`), be sure your + Linux distribution is a recent version of Debian, Ubuntu, OpenSUSE, or Fedora. + +2. **Download and Install AGL Packages:** + Download and install the + [near-zero](https://en.wikipedia.org/wiki/Zero_Install) packages + from the OBS. + +3. **Install the Binder Daemon:** + Install the Binder Daemon, which is a part of the + [AGL Application Framework (AFM)](../../apis_services/reference/af-main/0-introduction.html). + The daemon allows you to connect applications to required services. + +4. **Get Your Source Files:** + For this section, you clone the `helloworld-service` binding repository. + You also need to make sure you have some other required packages to build + that specific binding. + +5. **Build and Run Your Service Natively (Optional Tool Use):** + Build your binding on your Linux host using native tools. + Once the binding is built, you can run it to make sure it functions + as expected. + + Optionally use extra tools once your binding is building and running + smoothly in the native environment. diff --git a/agl-documentation/host-configuration/docs/0_Abstract.md b/agl-documentation/host-configuration/docs/0_Abstract.md new file mode 100644 index 0000000..0bb7aca --- /dev/null +++ b/agl-documentation/host-configuration/docs/0_Abstract.md @@ -0,0 +1,11 @@ +# Host Configuration + +## Abstract + +The purpose of this section is to help developers to natively develop and debug +AGL microservices.\ +Thanks to OBS, packages for debian/ubuntu, openSUSE and +fedora distributions are available and can be installed on developer host. + +At first hand, the idea is to easily handle native development of AGL services +and at second hand to run the same services on targets/boards. diff --git a/agl-documentation/host-configuration/docs/1-verify-build-host.md b/agl-documentation/host-configuration/docs/1-verify-build-host.md new file mode 100755 index 0000000..bc7b158 --- /dev/null +++ b/agl-documentation/host-configuration/docs/1-verify-build-host.md @@ -0,0 +1,24 @@ +# Verify Your Build Host + +In order to build a Microservice binding natively, you need to be using a +supported Linux distribution. +In general, a recent version of Debian, Ubuntu, OpenSUSE, and Fedora works. +Following is a specific list of supported distributions: + +* [Debian](https://www.debian.org/releases/) 9.0 +* [Ubuntu](https://wiki.ubuntu.com/Releases) 16.04, 16.10, 17.10, and 18.04 +* [OpenSUSE](https://en.opensuse.org/openSUSE:Roadmap) Leap 15.0 and Tumbleweed +* [Fedora](https://fedoraproject.org/wiki/Releases) 27, 28, 29, and Rawhide. + +Exporting the `DISTRO` environment variable defines the distribution. +Following are examples: + +```bash +export DISTRO="Debian_9.0" +export DISTRO="xUbuntu_16.04" +export DISTRO="xUbuntu_16.10" +export DISTRO="xUbuntu_17.10" +export DISTRO="xUbuntu_18.04" +``` + +Set the `DISTRO` environment appropriately. diff --git a/agl-documentation/host-configuration/docs/1_Prerequisites.md b/agl-documentation/host-configuration/docs/1_Prerequisites.md new file mode 100644 index 0000000..14eacec --- /dev/null +++ b/agl-documentation/host-configuration/docs/1_Prerequisites.md @@ -0,0 +1,175 @@ +# Prerequisites for package installation + +There are different repos for AGL packages depending on the version, it is +possible to install all of them and switching between them. + +To install latest (master) version you must set REVISION variable as follow : + +```bash +export REVISION=Master +``` + +You can find all available repos [here](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive#). + +For more details about OBS, please visit [LinuxAutomotive page on OBS](https://build.opensuse.org/project/show/isv:LinuxAutomotive). + +## Add repo for debian distro + +Avalable distro values are + +```bash +export DISTRO="Debian_9.0" +export DISTRO="xUbuntu_16.04" +export DISTRO="xUbuntu_16.10" +export DISTRO="xUbuntu_17.10" +export DISTRO="xUbuntu_18.04" +``` + +Install the repository: + +```bash +export REVISION=Master +export DISTRO="xUbuntu_18.04" +wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/Release.key | sudo apt-key add - +sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF +#AGL +deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/ ./ +EOF" +sudo apt-get update +``` + +## Add repo for openSuse distro + +```bash +#available distro values are openSUSE_Leap_42.3 openSUSE_Tumbleweed +export REVISION=Master +source /etc/os-release; export DISTRO=$(echo $PRETTY_NAME | sed "s/ /_/g") +sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +sudo zypper --gpg-auto-import-keys ref +``` + +## Add repo for fedora distro + +```bash +#available distro values are Fedora_27 Fedora_28 Fedora_Rawhide +export REVISION=Master +source /etc/os-release ; export DISTRO="${NAME}_${VERSION_ID}" +sudo wget -O /etc/yum.repos.d/isv:LinuxAutomotive:AGL_${REVISION}.repo http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +``` + +## Switch between repos + +First, let's check our installed AGL repos. + +### Debian distro + +```bash +cat /etc/apt/sources.list.d/AGL.list +``` + +### openSuse distro + +```bash +zypper repos | grep AGL +``` + +### Fedora distro + +```bash +dnf repolist --all | grep AGL +``` + +Make sure that you have what you need installed. +With the commands above you should see which repos are enabled/disabled. +To switch between two repos you just have to disable your current AGL repo and +enable the wanted repo. +It's a little bit different for Debian distros, see the example right down +below. + +### Example for Debian distro + +I'm on Master and I want an ElectricEel revision. + +```bash +export OLDR=Master +export NEWR=ElectricEel +sudo sed -i "s/${OLDR}/${NEWR}/g" /etc/apt/sources.list.d/AGL.list +sudo apt-get update +``` + +### Example for openSuse distro + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | No | ---- | ---- + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +I want my master repo enabled. Here ElectricEel repo is at the 4th line and Master at 5th line, so we have to enter: + +```bash +$ sudo zypper mr -d 4 && sudo zypper mr -e 5 +Repository 'isv_LinuxAutomotive_AGL_ElectricEel' has been successfully disabled. +Repository 'isv_LinuxAutomotive_AGL_Master' has been successfully enabled. +sudo zypper refresh +``` + +In this command "-d" stands for disable and "-e" enable + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | No | ---- | ---- + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +### Example for Fedora distro + +```bash +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL disabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux enabled +``` + +I want my ElectricEel repo enabled. + +```bash +dnf config-manager --set-disabled isv_LinuxAutomotive_AGL_Master +dnf config-manager --set-enabled isv_LinuxAutomotive_AGL_FunkyFlounder +``` + +```bash +$ dnf repolist --all | grep AGL +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL enabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux disabled +``` + +Now you have to [install the app-framework-binder](http://docs.automotivelinux.org/master/docs/devguides/en/dev/reference/host-configuration/docs/2_AGL_Application_Framework.html) diff --git a/agl-documentation/host-configuration/docs/2-download-packages.md b/agl-documentation/host-configuration/docs/2-download-packages.md new file mode 100755 index 0000000..dea2347 --- /dev/null +++ b/agl-documentation/host-configuration/docs/2-download-packages.md @@ -0,0 +1,230 @@ +# Download Packages + +Different repositories exist for different AGL releases.\ +You need to download and install the packages based on your version +of AGL. + +## Set the `REVISION` Environment Variable + +All the packages reside in repositories managed by the +[OpenSUSE Build Service (OBS)](https://build.opensuse.org/).\ +You can see the packages +[here](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive#). + +Currently, support exists for the following AGL releases: + +* ElectricEel +* FunkyFlounder +* GrumpyGuppy +* HappyHalibut +* Master + +You need to set the `REVISION` environment variable to the AGL release you +are using.\ +For this example, set and export `REVISION` as "Master". + +```bash +export REVISION=Master +``` + +For additional details about OBS, see +[LinuxAutomotive page on OBS](https://build.opensuse.org/project/show/isv:LinuxAutomotive). + +## Make Sure Your `DISTRO` Environment Variable is Set + +The `DISTRO` environment variable needs to be correctly set for your +Linux distribution.\ +See the +"[Verify Your Build Host](./1-verify-build-host.html)" +section for information on how to set this variable. + +## Install the Repository + +```bash +Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease +Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease +Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease +Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease +Ign:5 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease +Hit:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease +Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release +Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease +Reading package lists... Done +``` + +Not sure why you get the `Ign` on line 5.\ +I guess InRelease does not exist. + +If you don't have a `/etc/apt/sources.list.d/AGL.list` file to even start with, +and you run through the whole thing, you get the following output: + +```bash +$ sudo apt-get update +Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease +Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease +Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease +Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] +Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] +Ign:6 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease +Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release +Get:9 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] +Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [902 kB] +Fetched 1,225 kB in 1s (803 kB/s) +Reading package lists... Done +``` + +Following are example commands that show how to install the package repository +based on various values of `DISTRO` and `REVISION`: + +### Ubuntu and "Master" + +```bash +export REVISION=Master +export DISTRO="xUbuntu_18.04" +wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/Release.key | sudo apt-key add - +sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF +#AGL +deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/ ./ +EOF" +sudo apt-get update +``` + +You can see the installed repository using the following command: + +```bash +cat /etc/apt/sources.list.d/AGL.list +``` + +### OpenSUSE and "Master" + +```bash +export DISTRO="openSUSE_Leap_15.0" +export REVISION=Master +source /etc/os-release; export DISTRO=$(echo $PRETTY_NAME | sed "s/ /_/g") +sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +sudo zypper --gpg-auto-import-keys ref +``` + +You can see the installed repository using the following command: + +```bash +zypper repos | grep AGL +``` + +### Fedora and "Master" + +```bash +export DISTRO="Fedora_28" +export REVISION=Master +source /etc/os-release ; export DISTRO="${NAME}_${VERSION_ID}" +sudo wget -O /etc/yum.repos.d/isv:LinuxAutomotive:AGL_${REVISION}.repo http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +``` + +You can see the installed repository using the following command: + +```bash +dnf repolist --all | grep AGL +``` + +## Switching Between Repositories + +The commands in the previous section showed you how to install the packages +from a specific repository and how to verify whether or not the packages +are enabled or disabled. +You can switch between different repositories. +You must disable your current AGL repository and then enable the repository +designated for the switch. + +Following is an example for Debian distributions: + +### Example for Debian distro + +Suppose you are on "master" and you want the "ElectricEel" AGL revision. + +```bash +export OLDR=Master +export NEWR=ElectricEel +sudo sed -i "s/${OLDR}/${NEWR}/g" /etc/apt/sources.list.d/AGL.list +sudo apt-get update +``` + +### Example for openSuse distro + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | No | ---- | ---- + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +Now, you want your "master" repository enabled. +In the above output, the "ElectricEel" repository is at the fourth line +and the "master" repository is at the fifth line. +Thus, enter the following: + +```bash +$ sudo zypper mr -d 4 && sudo zypper mr -e 5 +Repository 'isv_LinuxAutomotive_AGL_ElectricEel' has been successfully disabled. +Repository 'isv_LinuxAutomotive_AGL_Master' has been successfully enabled. +sudo zypper refresh +``` + +**NOTE:** In the previous command, the "-d" option is used for "disable" and the +"-e" option is used for "enable". + +Following are the results: + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | No | ---- | ---- + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +### Example for Fedora distro + +```bash +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL disabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux enabled +``` + +The following commands enable the "ElectricEel" repository: + +```bash +dnf config-manager --set-disabled isv_LinuxAutomotive_AGL_Master +dnf config-manager --set-enabled isv_LinuxAutomotive_AGL_FunkyFlounder +``` + +```bash +$ dnf repolist --all | grep AGL +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL enabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux disabled +``` diff --git a/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md b/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md new file mode 100644 index 0000000..31a6104 --- /dev/null +++ b/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md @@ -0,0 +1,43 @@ +# AGL Application Framework + +The binder provides a way to connect applications to the services that it +needs. + +It provides a fast way to securely offer APIs to applications written in any +language and running almost anywhere. + +## Install the AGL application framework + +Use the right command line according to your distro + +### **Debian** + +```bash +sudo apt-get install agl-app-framework-binder-dev +``` + +### **openSUSE** + +```bash +sudo zypper install agl-app-framework-binder-devel +``` + +### **Fedora** + +```bash +sudo dnf install agl-app-framework-binder-devel +``` + +To have environment variables set correctly to be able to use app-framework-binder just after the installation, you need to either logout/login or you can just manually source this file : + +```bash +source /etc/profile.d/agl-app-framework-binder.sh +``` + +Note that this file will be source automatically for every new session. + +## AGL application framework documentation + +You can find the AGL application framework documentation + [here](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/af-main/0-introduction.html +). diff --git a/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md b/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md new file mode 100755 index 0000000..19158eb --- /dev/null +++ b/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md @@ -0,0 +1,80 @@ +# Installing the Binder Daemon + +The Application Framework Binder Daemon (`afb-daemon`), which is a part of +the AGL Application Framework, provides a way to connect applications to +required services.\ +It provides a fast way to securely offer APIs to applications that are +written in any language and that can run almost anywhere. + +You can learn more about the AGL Application Framework in the +"[AGL Framework Overview](../../apis_services/reference/af-main/0-introduction.html)" +section.\ +You can learn more about the `aft-daemon` in the +"[Binder Overview](../../apis_services/reference/af-binder/afb-overview.html)" +section. + +## Installing on Debian + +Use the following commands if your native Linux machine uses the Debian +distribution: + +```bash +sudo apt-get install agl-app-framework-binder-dev +``` + +## Installing on OpenSUSE + +Use the following commands if your native Linux machine uses the OpenSUSE +distribution: + +```bash +sudo zypper install agl-app-framework-binder-devel +``` + +## Installing on Fedora + +Use the following commands if your native Linux machine uses the Fedora +distribution: + +```bash +sudo dnf install agl-app-framework-binder-devel +``` + +## Setting Your Environment Variables + +Regardless of your system's distribution, you need to set certain environment +variables correctly in order to use the daemon (i.e. `app-framework-binder`). + +Commands that define and export these environment variables exist in the +`agl-app-framework-binder.sh` file, which is created when +you install the daemon: + +```bash +#---------- AGL %{name} options Start ---------" +# Object: AGL cmake option for binder/bindings +export LD_LIBRARY_PATH=/opt/AGL/lib64:${LD_LIBRARY_PATH} +export LIBRARY_PATH=/opt/AGL/lib64:${LIBRARY_PATH} +export PKG_CONFIG_PATH=/opt/AGL/lib64/pkgconfig:${PKG_CONFIG_PATH} +export PATH=/opt/AGL/bin:$PATH +#---------- AGL options End --------- +``` + +You can make sure these environment variables are correctly set by doing +one of the following: + +* **Logout and Log Back In:** + + Logging out and then logging back in correctly sets the environment + variables. + +* **Manually Source the `agl-app-framework-binder.sh` File:** + + Source the following command: + + ```bash + source /etc/profile.d/agl-app-framework-binder.sh + ``` + + **NOTE:** + Creating a new session automatically sources the `agl-app-framework-binder.sh` + file. diff --git a/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md b/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md new file mode 100644 index 0000000..6ac6d90 --- /dev/null +++ b/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md @@ -0,0 +1,85 @@ +# Binding Build Example + +Now that you have installed the AGL Application Framework, you will be guided through the installation of the [helloworld-service](https://github.com/iotbzh/helloworld-service) binding. + +## Install git, cmake, gcc, g++ and json-c + +### Debian + +```bash +sudo apt-get install git cmake gcc g++ libjson-c-dev +``` + +### openSuse + +```bash +sudo zypper install git cmake gcc gcc-c++ libjson-c-devel +``` + +### Fedora + +```bash +sudo dnf install git cmake gcc gcc-c++ json-c-devel.x86_64 +``` + +## Clone the helloworld-service repository + +Sources of the [helloworld-service](https://github.com/iotbzh/helloworld-service) binding are available at IoT.BZH's GitHub. + +```bash +git clone "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-helloworld" +cd agl-service-helloworld +``` + +## Built it + +```bash +./autobuild/linux/autobuild package +``` + +or manually + +```bash +mkdir build +cd build +cmake .. +make +``` + +## Run it + +Refer to the "Running" section of [this](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/af-binder/afb-binding-writing.html#sample-binding-tuto-1) page + +## Troubleshooting + +### systemd and/or libmicrohttpd + +If you encounter an error message like this one : + +```shell +-- Checking for module 'libmicrohttpd>=0.9.55' +-- No package 'libmicrohttpd' found +CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message): + A required package was not found +Call Stack (most recent call first): + /usr/share/cmake/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal) + conf.d/app-templates/cmake/cmake.d/01-build_options.cmake:92 (PKG_CHECK_MODULES) + conf.d/app-templates/cmake/common.cmake:77 (include) + conf.d/cmake/config.cmake:184 (include) + CMakeLists.txt:3 (include) +``` + +Open the config.cmake file located in helloworld-service/conf.d/cmake/ +and add a # to the beginning of the "libsystemd>=222" and "libmicrohttpd>=0.9.55". +The end result should look something like this + +```CMake + set (PKG_REQUIRED_LIST + json-c + #libsystemd>=222 + afb-daemon + #libmicrohttpd>=0.9.55 + ) +``` + +Once this is done return to the "Build it!" section of this page. diff --git a/agl-documentation/host-configuration/docs/4-getting-source-files.md b/agl-documentation/host-configuration/docs/4-getting-source-files.md new file mode 100755 index 0000000..5a7563c --- /dev/null +++ b/agl-documentation/host-configuration/docs/4-getting-source-files.md @@ -0,0 +1,65 @@ +# Getting Your Source Files + +Now that you have your host ready, packages installed, and the binder +daemon ready, you can get your source files together. +This example uses the `helloworld-service` binding, which is +a project hosted on GitHub, is written in the C programming language, +depends on the `libjson-c` library, and uses `cmake` for building. + +## Install Programs and Libraries You Need for this Example + +For this example, you need to have the following installed on your host: + +```bash +git +cmake +pkg-config +gcc +g++ +json-c +``` + +**NOTE:** If you are building a different binding, you need to make sure +you have all the programs and libraries needed to build that particular +binding. + +### Installing on Debian + +Use the following commands if your native Linux machine uses the Debian +distribution: + +```bash +sudo apt-get install git cmake pkg-config gcc g++ libjson-c-dev +``` + +### Installing on OpenSUSE + +Use the following commands if your native Linux machine uses the OpenSUSE +distribution: + +```bash +sudo zypper install git cmake pkg-config gcc gcc-c++ libjson-c-devel +``` + +### Installing on Fedora + +Use the following commands if your native Linux machine uses the Fedora +distribution: + +```bash +sudo dnf install git cmake pkg-config gcc gcc-c++ json-c-devel.x86_64 +``` + +## Cloning the helloworld-service repository + +Use Git to create a local repository of the +[helloworld-service](https://github.com/iotbzh/helloworld-service) binding from +[IoT.BZH](https://iot.bzh/en/). +The following command creates a repository named `helloworld-service` in the +current directory. +The "--recurse-submodules" option ensures that all submodules (i.e. repositories +within `helloworld-service`) are initialized and cloned as well. + +```bash +git clone https://github.com/iotbzh/helloworld-service.git --recurse-submodules +``` diff --git a/agl-documentation/host-configuration/docs/4_AGL_XDS.md b/agl-documentation/host-configuration/docs/4_AGL_XDS.md new file mode 100644 index 0000000..5f06c19 --- /dev/null +++ b/agl-documentation/host-configuration/docs/4_AGL_XDS.md @@ -0,0 +1,31 @@ +# AGL XDS + +AGL X(cross) Development System (XDS) provides a multi-platform cross +development tool with near-zero installation. + +* xds-agent: a client/agent that should run on your local / user development machine when you use XDS. +* xds-cli: a command line tool used to control / interface X(cross) Development System, it can be used in addition to XDS DASHBOARD. +* xds-gdb: a wrapper on gdb debugger for X(cross) Development System. + +## AGL XDS for debian + +```bash +sudo apt-get install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS for openSUSE + +```bash +sudo zypper install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS for fedora + +```bash +sudo dnf install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS Documentation + +You can find the XDS documentation + [here](http://docs.automotivelinux.org/master/docs/devguides/en/dev/reference/xds/part-1/0_Abstract.html). diff --git a/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md b/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md new file mode 100755 index 0000000..3bde906 --- /dev/null +++ b/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md @@ -0,0 +1,110 @@ +# Building and Running Your Service Natively + +The next step in the binder development process is to build your +binder and run it using your native Linux system. + +**NOTE:** This section assumes using the `helloworld-service` example +and completion of the previous steps in this +"[Building Microservices Natively](./0-build-microservice-overview.html)" +section. + +## Building the Service + +Move to the cloned `helloworld-service` repository and build the service +using either of the following methods: + +* ```bash + cd helloworld-service + ./conf.d/autobuild/linux/autobuild package + ``` + +* ```bash + cd helloworld-service + mkdir build + cd build + cmake .. + make + ``` + +## Running the Service + +You use the Application Framework Binder Daemon (`afb-daemon`) to +bind one instance of an application or service to the rest of the system. +In this example, you are binding an instance of `helloworld-service` +to the rest of the system: + +```bash +afb-daemon --binding helloworld.so --port 3333 --token '' +``` + +The previous command starts `afb-daemon` and loads the `helloworld.so` +binding. +The daemon is now listening on port 3333 of the `localhost`. + +## Testing the Service + +Refer to the +[AGL Test Framework](../../apis_services/#agl-test-framework) topic in the +"APIs & Services" topic. +You can test your `helloworld-service` binding using the `afm-test` tool. + +Examine the generic example describing how to launch the tests suite +[here](../../apis_services/reference/afb-test/3_Launch_the_tests.html). +This example can help you understand how to test your helloworld binding +instance. + +## Using Optional Tools + +Once you have built and run your micro-service successfully using your +native Linux system, you should consider using some additional +development tools: X(Cross) Development System (XDS) and +the Controller Area Network (CAN) Development Studio (CANdevStudio). + +* **XDS:** Cross-compiles and ports your AGL image to your target hardware. +For information on XDS, see the +"[X(cross) Development System: User's Guide](../reference/xds/part-1/xds-overview.html)" +section. + +* **CANdevStudio:** Simulates CAN signals such as ignition status, +doors status, or reverse gear by every automotive developer. +For information on CANdevStudio, see the +"[CANdevStudio Quickstart](../../apis_services/reference/candevstudio/1_Usage.html)" +section. + +## Troubleshooting + +### systemd and/or libmicrohttpd + +If you encounter an error message similar to the following, +you need to make some changes to your `cmake` file: + +```shell +-- Checking for module 'libmicrohttpd>=0.9.60' +-- No package 'libmicrohttpd' found +CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message): + A required package was not found +Call Stack (most recent call first): + /usr/share/cmake/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal) + conf.d/app-templates/cmake/cmake.d/01-build_options.cmake:92 (PKG_CHECK_MODULES) + conf.d/app-templates/cmake/common.cmake:77 (include) + conf.d/cmake/config.cmake:184 (include) + CMakeLists.txt:3 (include) +``` + +Open the `config.cmake` file located in `helloworld-service/conf.d/cmake/` directory +and add a hash character (i.e. #) to the beginning of the "libsystemd>=222" +and "libmicrohttpd>=0.9.60" strings. +Following is an example of the edits: + +```CMake + set (PKG_REQUIRED_LIST + json-c + #libsystemd>=222 + afb-daemon + #libmicrohttpd>=0.9.60 + ) +``` + +After making these changes, rebuild the service again as described in the +"[Building the Service](./4-getting-source-files.html#building-the-service)" +section previously on this page. diff --git a/agl-documentation/host-configuration/docs/5_Candevstudio.md b/agl-documentation/host-configuration/docs/5_Candevstudio.md new file mode 100644 index 0000000..6118315 --- /dev/null +++ b/agl-documentation/host-configuration/docs/5_Candevstudio.md @@ -0,0 +1,35 @@ +# CANdevStudio + +CANdevStudio is a CAN bus simulation software.\ +It can work with variety of CAN hardware interfaces (e.g.): + +* Microchip +* Vector +* PEAK-Systems +* even without it (vcan and cannelloni) + +CANdevStudio enables to simulate CAN signals such as +ignition status, doors status or reverse gear by every automotive developer. + +## CANdevStudio for debian + +```bash +sudo apt-get install CANdevStudio +``` + +## CANdevStudio for openSUSE + +```bash +sudo zypper install CANdevStudio +``` + +## CANdevStudio for fedora + +```bash +sudo dnf install CANdevStudio +``` + +## CANdevStudio Quickstart + +The CANdevStudio Quickstart can be found +[here](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/candevstudio/docs/1_Usage.html). diff --git a/agl-documentation/host-configuration/docs/README.md b/agl-documentation/host-configuration/docs/README.md new file mode 100644 index 0000000..b1c50df --- /dev/null +++ b/agl-documentation/host-configuration/docs/README.md @@ -0,0 +1,20 @@ +# Introduction + +AGL Automotive Grade Linux Automotive Grade Linux is a collaborative open +source project that is bringing together automakers, suppliers and technology +companies to accelerate the development and adoption of a fully open software +stack for the connected car. + +![Automotive grade linux screenshot](pictures/Automotive_grade_linux.png) + +| *Meta* | *Data* | +| -- | -- | +| **Title** | {{ config.title }} | +| **Author** | {{ config.author }} | +| **Description** | {{ config.description }} | +| **Keywords** | {{ config.keywords }} | +| **Language** | English | +| **Published** | Published {{ config.published }} as an electronic book | +| **Updated** | {{ gitbook.time }} | +| **Collection** | Open-source | +| **Website** | [{{ config.website }}]({{ config.website }}) | diff --git a/agl-documentation/host-configuration/docs/SUMMARY.md b/agl-documentation/host-configuration/docs/SUMMARY.md new file mode 100644 index 0000000..1d164c0 --- /dev/null +++ b/agl-documentation/host-configuration/docs/SUMMARY.md @@ -0,0 +1,10 @@ +# Summary + +* [Document revisions](0-Doc-Revisions.md) + +* [Abstract](0_Abstract.md) +* [Prerequisites](1_Prerequisites.md) +* [AGL Application Framework Installation](2_AGL_Application_Framework.md) +* [Binding Build Example](3_Binding_Build_Example.md) +* [AGL XDS Installation.md](4_AGL_XDS.md) +* [CanDevStudio Installation](5_Candevstudio.md) diff --git a/agl-documentation/host-configuration/docs/devguides-book.yml b/agl-documentation/host-configuration/docs/devguides-book.yml new file mode 100644 index 0000000..3eacca6 --- /dev/null +++ b/agl-documentation/host-configuration/docs/devguides-book.yml @@ -0,0 +1,22 @@ +type: books +books: +- + id: host-configuration + title: Building Microservices Natively + description: Host Configuration documentation + keywords: + author: "IotBzh" + version: master + chapters: + - url: 0-build-microservice-overview.md + name: Overview + - url: 1-verify-build-host.md + name: Verify Your Build Host + - url: 2-download-packages.md + name: Download Packages + - url: 3-installing-binder-daemon.md + name: Installing the Binder Daemon + - url: 4-getting-source-files.md + name: Getting Your Source Files + - url: 5-building-and-running-service-natively.md + name: Building and Running Your Service Natively diff --git a/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png b/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png Binary files differnew file mode 100644 index 0000000..46291dd --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png diff --git a/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png b/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png Binary files differnew file mode 100644 index 0000000..c944e02 --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png diff --git a/agl-documentation/host-configuration/docs/pictures/HVAC.jpg b/agl-documentation/host-configuration/docs/pictures/HVAC.jpg Binary files differnew file mode 100644 index 0000000..79175fb --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/HVAC.jpg diff --git a/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg b/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg Binary files differnew file mode 100644 index 0000000..1901f4c --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg diff --git a/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png b/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png Binary files differnew file mode 100755 index 0000000..1c38d2a --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png diff --git a/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png b/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png Binary files differnew file mode 100644 index 0000000..ae6bc48 --- /dev/null +++ b/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png diff --git a/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png b/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png Binary files differnew file mode 100644 index 0000000..6a98c60 --- /dev/null +++ b/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png diff --git a/agl-documentation/host-configuration/mkdocs.yml b/agl-documentation/host-configuration/mkdocs.yml new file mode 100644 index 0000000..ca03607 --- /dev/null +++ b/agl-documentation/host-configuration/mkdocs.yml @@ -0,0 +1,11 @@ +site_name: AGL Application Framework Binder +theme: readthedocs +docs_dir: docs +pages: +- 'Document revisions' : '0-Doc-Revisions.md' +- '0. Abstract': '0_Abstract.md' +- '1. Prequisites': '1_Prerequisites.md' +- '2. AGL Application Framework Installation': '2_AGL_Application_Framework.md' +- '3. Binding Build Example': '3_Binding_Build_Example.md' +- '4. AGL XDS Installation.md': '4_AGL_XDS.md' +- '5. CanDevStudio Installation': '5_Candevstudio.md' diff --git a/agl-documentation/sdk-devkit/book.json b/agl-documentation/sdk-devkit/book.json new file mode 100644 index 0000000..a27df96 --- /dev/null +++ b/agl-documentation/sdk-devkit/book.json @@ -0,0 +1,11 @@ +{ + "title": "AGL Development Kit", + "subtitle": "Developer Documentation", + "description": "Build from scratch an image and your first AGL application", + "keywords": "AGL, Development, SDK, Build, scratch, Porter, docker, container, application", + "author": "IoT.Bzh Team", + "website": "http://iot.bzh", + "published": "March 2017", + "version": "3.1", + "pdf_filename": "AGL-Development-Kit" +} diff --git a/agl-documentation/sdk-devkit/docs/0-Doc-Revisions.md b/agl-documentation/sdk-devkit/docs/0-Doc-Revisions.md new file mode 100644 index 0000000..ab5867b --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/0-Doc-Revisions.md @@ -0,0 +1,12 @@ +Document revisions +================== + +| Date | Version | Designation | Author | +|-------------|---------|--------------------------------------|-------------------------| +| 11 Feb 2016 | 0.1 | Initial release | S. Desneux [ Iot.bzh ] <br> Y. Gicquel [ Iot.bzh ] | +| 18 Feb 2016 | 0.2 | Fixes, multi-platform (Windows, Mac) | M.Bachmann [ Iot.bzh] | +| 29 Feb 2016 | 0.3 | Fixes for multi-platform | M.Bachmann [ Iot.bzh] | +| 29 Feb 2016 | 1.0 | Final Review | S. Desneux [ IoT.bzh ] | +| 29 Mar 2016 | 1.1 | Public version without proprietary drivers | S. Desneux [ IoT.bzh ] <br> Y. Gicquel [ Iot.bzh ] | +| 15 Jul 2016 | 2.0 | Update for AGL 2.0, SDK generation <br> & installation added | S. Desneux [ IoT.bzh] <br> M.Bachmann [IoT.bzh] | +| 20 Mar 2017 | 3.1 | Convert doc sources to markdown <br> Align on AGL Chinook | S. Douheret [ IoT.bzh ] <br> S.Desneux [ IoT.bzh ] | diff --git a/agl-documentation/sdk-devkit/docs/README.md b/agl-documentation/sdk-devkit/docs/README.md new file mode 100644 index 0000000..e1bb79c --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/README.md @@ -0,0 +1,24 @@ +# Introduction + +AGL Development Kit allows developers and integrators to rebuild complete bootable images +from source code, as well as developing new applications for AGL. + +It leverages Docker capabilities to propose a unified environment suitable for most development tasks: + +* compatible with AGL 3.x (based on Yocto/Poky 2.x) +* support all AGL boards inc. reference boards (Renesas, Intel) +* low-level development of drivers +* system services development and integration +* applications development (build, deploy, debug) using AGL SDK and AGL Application Framework + +| *Meta* | *Data* | +| -- | -- | +| **Title** | {{ config.title }} | +| **Author** | {{ config.author }} | +| **Description** | {{ config.description }} | +| **Keywords** | {{ config.keywords }} | +| **Language** | English | +| **Published** | Published {{ config.published }} as an electronic book | +| **Updated** | {{ gitbook.time }} | +| **Collection** | Open-source | +| **Website** | [{{ config.website }}]({{ config.website }}) | diff --git a/agl-documentation/sdk-devkit/docs/SUMMARY.md b/agl-documentation/sdk-devkit/docs/SUMMARY.md new file mode 100644 index 0000000..110d4c9 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/SUMMARY.md @@ -0,0 +1,18 @@ +# Summary + +* [Document revisions](0-Doc-Revisions.md) + +* [Part 1 - Build AGL image from scratch](part-1/1_0_Abstract.md) + * [Deploy an image using containers](part-1/1_1-Deploy_image.md) + * [Setting up your operating system](part-1/1_2-Setting-up-your_os.md) + * [Install AGL Yocto image for Porter board using Docker container](part-1/1_3-Install-agl-for-porter.md) + * [Inside the container](part-1/1_4-Inside-the-container.md) + * [Build an image for Porter board](part-1/1_5-Build-image-Porter.md) + * [Porter image deployment on target](part-1/1_6-Porter-image-deployment.md) + * [AGL SDK compilation and installation](part-1/1_7-SDK-compilation-installation.md) + +* [Part 2 - Build your 1st application](part-2/2_0_Abstract.md) + * [Initializing SDK environment and templates](part-2/2_1-Init-sdk-env.md) + * [Trying out the template](part-2/2_2-Trying-out-template.md) + * [Developing smoothly with the container](part-2/2_3-Dev-with-container.md) + * [Creating your own hybrid application](part-2/2_4-Use-app-templates.md) diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_0_Abstract.md b/agl-documentation/sdk-devkit/docs/part-1/1_0_Abstract.md new file mode 100644 index 0000000..46bf74e --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_0_Abstract.md @@ -0,0 +1,27 @@ +# Part 1 - Build AGL image from scratch + +## Abstract + +The AGL DevKit allows developers to rebuild a complete bootable image +and its associated SDK from source code.\ +It uses Yocto/Poky version 2.x with latest version of Renesas BSP and + enables low-level development of drivers and system services. + +The AGL DevKit contains: + +- This guide, which describes how to create a Docker container able to + build AGL images and associated SDKs.\ + The container is also suitable to build AGL Applications + independently of Yocto/Bitbake. +- Applications templates and demos available on Github, to start + developing various types of applications independently of Yocto: + - services + - native applications + - HTML5 applications + - ... +- A documentation guide "**AGL Devkit - Build your 1st AGL + Application**" which explains how to use the AGL SDK to create applications + based on templates. + +*This document focuses on building from scratch an AGL image for Porter +board, within a Docker container, and then install the associated SDK.* diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_1-Deploy_image.md b/agl-documentation/sdk-devkit/docs/part-1/1_1-Deploy_image.md new file mode 100644 index 0000000..52319b1 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_1-Deploy_image.md @@ -0,0 +1,47 @@ +# Deploy an image using containers + +## Motivation + +The Yocto build environment is subject to many variations depending on: + +- Yocto/Poky/OpenEmbedded versions and revisions +- Specific layers required for building either the BSP or the whole distribution +- Host distribution and version [1] +- User environment + +In particular, some recent Linux host distributions (Ubuntu 15.x, Debian +8.x, OpenSUSE 42.x, CentOS 7.x) do not officially support building with +Yocto 2.0. +Unfortunately, there's no easy solution to solve this kind of +problem: + +- we will still observe for quite a long time a significant gap + between the latest OS versions and a fully certified build environment. + +To circumvent those drawbacks and get more deterministic results amongst +the AGL community of developers and integrators, using virtualization is +a good workaround. +A Docker container is now available for AGL images: + +- it is faster, easier and less error-prone to use a prepared Docker + container because it provides all necessary components to build and + deploy an AGL image, including a validated base OS, independently of the + user's host OS. + +Moreover, light virtualization mechanisms used by Docker +do not add much overhead when building: + +- performances are nearly equal to native mode. + +[1] *The list of validated host distros is defined in the Poky distro, in +the file `meta-yocto/conf/distro/poky.conf` and also at [http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#detailed-supported-distros](http://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#detailed-supported-distros)* + +## Prerequisites + +To run an AGL Docker image, the following prerequisites must be +fulfilled: + +- You must run a 64-bit operating system, with administrative rights, +- Docker engine v1.8 or greater must be installed, +- An internet connection must be available to download the Docker + image on your local host. diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_2-Setting-up-your_os.md b/agl-documentation/sdk-devkit/docs/part-1/1_2-Setting-up-your_os.md new file mode 100644 index 0000000..2420c68 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_2-Setting-up-your_os.md @@ -0,0 +1,217 @@ +# Setting up your operating system + +In this section, we describe the Docker installation procedure depending +on your host system. We will be focusing on the most popular systems; +for a full list of supported operating systems, please refer to Docker +online documentation: [https://docs.docker.com/](https://docs.docker.com/) + +## Linux (Ubuntu / Debian) + +At the time of writing, Docker project supports these Ubuntu/Debian +releases: + +- Ubuntu Yakkety 16.10 +- Ubuntu Xenial 16.04 LTS +- Ubuntu Trusty 14.04 LTS +- Debian 8.0 (64-bit) +- Debian 7.7 (64-bit) + +For an updated list of supported distributions, you can refer to the +Docker project website, at these locations: + +- [https://docs.docker.com/engine/installation/linux/debian/](https://docs.docker.com/engine/installation/linux/debian/) +- [https://docs.docker.com/engine/installation/linux/ubuntu/](https://docs.docker.com/engine/installation/linux/ubuntu/) + +Here are the commands needed to install the Docker engine on your local +host: + +```bash +sudo apt-get update +sudo apt-get install wget curl +wget -qO- https://get.docker.com/ | sh +``` + +This will register a new location in your "sources.list" file and +install the "docker.io" package and its dependencies: + +```bash +$ cat /etc/apt/sources.list.d/docker.list +$ deb [arch=amd64] https://apt.dockerproject.org/repo ubuntu-xenial main +$ docker --version +Docker version 17.03.0-ce, build 60ccb22 +``` + +It is then recommended to add your user to the new "docker" system +group: + +```bash +sudo usermod -aG docker *<your-login>* +``` + +... and after that, to log out and log in again to have these credentials +applied. + +You can reboot your system or start the Docker daemon using: + +```bash +sudo service docker start +``` + +If everything went right, you should be able to list all locally +available images using: + +```bash +$ docker images +REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE +``` + +In our case, no image is available yet, but the environment is ready to +go on. + +A SSH client must also be installed: + +```bash +sudo apt-get install openssh-client +``` + +## Windows © (7, 8, 8.1, 10) + +**WARNING: although Windows© can work for this purpose, not only are lots +of additional steps needed, but the build process performance itself is +suboptimal. Please consider moving to Linux for a better experience.** + +We will be downloading the latest Docker Toolbox at the following +location: + +[*https://www.docker.com/docker-toolbox*](https://www.docker.com/docker-toolbox) + +and by clicking on the "*Download (Windows)*" button: + +![window install windows 1](pictures/docker_install_windows_1.png)\ +We will answer "Yes", "Next" and "Install" in the next dialog boxes. + +![window install windows 2](pictures/docker_install_windows_2.png){style width:60%;} + +![window install windows 3](pictures/docker_install_windows_3.png){style width:48%; float:left; margin-right:0.3em} +![window install windows 4](pictures/docker_install_windows_4.png){style width:48%; float:right} + +![window install windows 5](pictures/docker_install_windows_5.png) + +We can then start it by double-clicking on the "Docker Quickstart +Terminal" icon: + +![window install windows 6](pictures/docker_install_windows_6.png) + +It will take a certain amount time to setup everything, until this +banner appears: + +![window install windows 7](pictures/docker_install_windows_7.png) + +Docker Toolbox provides a 1 Gb RAM/20 Go HDD virtual machine; this is +clearly insufficient for our needs. Let us expand it to 4 Gb RAM/50 +HDD (*these are minimal values; feel free to increase them if your computer +has more physical memory and/or free space*) : + +```bash +export VBOXPATH=/c/Program\ Files/Oracle/VirtualBox/ +export PATH="$PATH:$VBOXPATH" + +docker-machine stop default + +VBoxManage.exe modifyvm default --memory 4096 +VBoxManage.exe createhd --filename build.vmdk --size 51200 --format VMDK +VBoxManage.exe storageattach default --storagectl SATA --port 2 --medium build.vmdk --type hdd + +docker-machine start default + +docker-machine ssh default "sudo /usr/local/sbin/parted --script /dev/sdb mklabel msdos" +docker-machine ssh default "sudo /usr/local/sbin/parted --script /dev/sdb mkpart primary ext4 1% 99%" +docker-machine ssh default "sudo mkfs.ext4 /dev/sdb1" +docker-machine ssh default "sudo mkdir /tmp/sdb1" +docker-machine ssh default "sudo mount /dev/sdb1 /tmp/sdb1" +docker-machine ssh default "sudo cp -ra /mnt/sda1/* /tmp/sdb1" + +docker-machine stop default + +VboxManage.exe storageattach default --storagectl SATA --port 2 --medium none +VboxManage.exe storageattach default --storagectl SATA --port 1 --medium build.vmdk --type hdd + +docker-machine start default +``` + +We will then finalize the setup: + +```bash +VboxManage.exe modifyvm default --natpf1 sshredir,tcp,127.0.0.1,2222,,2222 +docker-machine start default +docker-machine ssh default "echo mkdir /sys/fs/cgroup/systemd | sudo tee /var/lib/boot2docker/bootlocal.sh" +docker-machine restart default +``` + +A SSH client must also be installed. We will grab *PuTTY* at the +following URL: +[*http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe*](http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe) + +## Mac OS X © + +We will be downloading the latest Docker Toolbox at the following +location: +[https://www.docker.com/docker-toolbox](https://www.docker.com/docker-toolbox) + +and by clicking on the "*Download (Mac)*" button: + +![window install macro 1](pictures/docker_install_macos_1.png) + +We will answer "Continue" and "Install" in the next dialog boxes: + +![window install macro 2](pictures/docker_install_macos_2.png) + +![window install macro 3](pictures/docker_install_macos_3.png){style width:80%;} +![window install macro 4](pictures/docker_install_macos_4.png){style width:80%;} + +Then, when we go to our "Applications" folder, we now have a "Docker" +subfolder where we can start "Docker Quickstart Terminal": + +![window install macro 5](pictures/docker_install_macos_5.png) + +It will take a certain amount of time to setup everything, until this +banner appears: + +![window install macro 6](pictures/docker_install_macos_6.png) + +Docker Toolbox provides a 1 Gb RAM/20 Go HDD virtual machine; this is +clearly insufficient for our needs. Let us expand it to 4 Gb RAM/50 +HDD (*these are minimal values; feel free to increase them if your computer +has more physical memory and/or free space*) : + +```bash +docker-machine stop default + +VboxManage modifyvm default --memory 4096 +VboxManage createhd --filename build.vmdk --size 51200 --format VMDK +VboxManage storageattach default --storagectl SATA --port 2 --medium build.vmdk --type hdd + +docker-machine start default + +docker-machine ssh default "sudo /usr/local/sbin/parted --script /dev/sdb mklabel msdos" +docker-machine ssh default "sudo /usr/local/sbin/parted --script /dev/sdb mkpart primary ext4 1% 99%" +docker-machine ssh default "sudo mkfs.ext4 /dev/sdb1" +docker-machine ssh default "sudo mkdir /tmp/sdb1" +docker-machine ssh default "sudo mount /dev/sdb1 /tmp/sdb1" +docker-machine ssh default "sudo cp -ra /mnt/sda1/* /tmp/sdb1" + +docker-machine stop default + +VboxManage storageattach default --storagectl SATA --port 2 --medium none +VboxManage storageattach default --storagectl SATA --port 1 --medium build.vmdk --type hdd + +docker-machine start default +``` + +We will then finalize the setup: + +```bash +VboxManage modifyvm default --natpf1 sshredir,tcp,127.0.0.1,2222,,2222 +docker-machine ssh default "echo mkdir /sys/fs/cgroup/systemd | sudo tee /var/lib/boot2docker/bootlocal.sh" +docker-machine restart default +``` diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_3-Install-agl-for-porter.md b/agl-documentation/sdk-devkit/docs/part-1/1_3-Install-agl-for-porter.md new file mode 100644 index 0000000..905eb2a --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_3-Install-agl-for-porter.md @@ -0,0 +1,276 @@ +# Install AGL Yocto image for Porter board using Docker container + +## Overview + +This section gives details on a procedure which allows system developers +and integrators to set up a the build environment image on their local +host. + +The prepared environment is deployed and available thanks to lightweight +virtualization containers using Docker technology +(See [https://www.docker.com/](https://www.docker.com/)). +The pre-built image for AGL development activities is currently designed to be +accessed using SSH Protocol. + +## Download the docker image + +At the time of writing, we distribute the image as a compressed archive +which can be downloaded faster as its footprint is around 226 MB. You +can then import it into Docker with the following command: + +```bash +curl https://download.automotivelinux.org/AGL/snapshots/sdk/docker/docker_agl_worker-3.0.tar.xz | docker load +``` + +You can check that the new Docker image is available by running the +`docker images` command : + +```bash +$ docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +docker.automotivelinux.org/agl/worker 3.0 18a6db4db383 2 months ago 925 MB +``` + +*Note*: if you want to rebuild from scratch this docker image, you should +use scripts located into `docker-worker-generator` repository. + +```bash +git clone https://gerrit.automotivelinux.org/gerrit/AGL/docker-worker-generator +``` + +Then, please refer to `README.md` file for more details. + +## Start the container + +<a id="anchor-start-container"></a> + +Once the image is available on your local host, you can start the +container and the SSH service. We'll also need a local directory on the +host to store bitbake mirrors (download cache and sstate cache): this +mirror helps to speed up builds. + +First, create a local directory and make it available to everyone: + +```bash +MIRRORDIR=<your path here, ~/mirror for example>; +mkdir -p $MIRRORDIR +chmod 777 $MIRRORDIR +``` + +Then we can start the docker image using the following command: + +```bash +docker run \ + --publish=2222:22 \ + --publish=8000:8000 \ + --publish=69:69/udp --publish=10809:10809 \ + --detach=true --privileged \ + --hostname=bsp-devkit --name=bsp-devkit \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v $MIRRORDIR:/home/devel/mirror \ + docker.automotivelinux.org/agl/worker:3.0 +``` + +Then, you can check that the image is running with the following +command: + +```bash +$ docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +3126423788bd docker.automotivelinux.org/agl/worker:3.0 "/usr/bin/wait_for..." 2 seconds ago Up 2 seconds 0.0.0.0:2222->22/tcp, 0.0.0.0:69->69/udp, 0.0.0.0:8000->8000/tcp, 0.0.0.0:10809->10809/tcp bsp-devkit +``` + +The container is now ready to be used. A dedicated user has been +declared: + +- login: **devel** +- password: **devel** + +The following port redirections allow access to some services in the +container: + +- port 2222: SSH access using `ssh -p 2222 devel@localhost` +- port 8000: access to Toaster WebUI through [http://localhost:8000/](http://localhost:8000/) + when started (see Yocto documentation) +- ports 69 (TFTP) and 10809 (NBD): used for network boot (future enhancement) + +For easier operations, you can copy your ssh identity inside the +container: + +```bash +ssh-copy-id -p 2222 <devel@localhost> # password is 'devel' +``` + +## Connect to Yocto container through SSH + +The DevKit container provides a pre-built set of tools which can be +accessed through a terminal by using Secure Shell protocol (SSH). + +### Linux, Mac OS X © + +On Linux-based systems, you may need to install an SSH client. + +To launch the session, you can enter the following under Linux or Mac OS X: + +```bash +ssh -p 2222 devel@localhost +``` + +The password is "**devel**". You should obtain the following prompt +after success: + +```bash +devel@localhost's password: **devel** + +The programs included with the Debian GNU/Linux system are free +software; the exact distribution terms for each program are described in the +individual files in /usr/share/doc/*/copyright. + +Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent +permitted by applicable law. +[11:28:27] devel@bsp-devkit:~$ +``` + +### Windows © + +You will need *PuTTY*, downloaded during the setup +section. Run it using its icon: + +![windows putty 1](pictures/windows_putty_1.png){style width:60px;} + +We can then connect to "**localhost**" on port +"**2222**". + +![windows putty 2](pictures/windows_putty_2.png){style width:60%;} + +Credentials are the same as for Linux: user is "**devel**" with password +"**devel**". + +## Set up a persistent workspace + +<a id="anchor-setup-persist-wks"></a> + +AGL Docker image brings a set of tools and here we describe a way to +prepare a "shared directory" on your local host accessible from the +container. The aim of this shared directory is to allow your ongoing +developments to stay independent from the container upgrades. + +Please note this whole procedure is not mandatory, but highly +recommended as it will save disk space later when you will deploy the SD +card image on your target. + +### From Linux host using a shared directory + +Current docker implementation has a limitation about UID:GID mapping +between hosts and containers. In the long run, the planned mechanism is +to use the "user namespace" feature. But for now, we propose another +approach unfortunately less flexible. + +We can use a directory on the local host with a dedicated Unix group +using a common GID between the host and the container. This GID has been +fixed to "1664" ([see](https://en.wikipedia.org/wiki/Beer_in_France)) +and can be created on your linux host using the following commands: + +```bash +sudo groupadd --gid 1664 agl-sdk +sudo usermod -aG agl-sdk *<your-login>* +``` + +If this GID is already used on your local host, you will have to use it +for this sharing purpose as well. In case this is not possible, another +option to exchange workspace data can be the use of a network service +(like SSH, FTP) of the container and from your local host. + +Once the GID is ready to use, we can create a shared directory (not as +'root', but as your normal user): + +```bash +cd +mkdir $HOME/agl-workspace +sudo chgrp agl-sdk $HOME/agl-workspace +chmod ug+w $HOME/agl-workspace +``` + +And run the Docker image with the shared directory (new volume): + +```bash +$ docker run \ + --publish=2222:22 \ + --publish=8000:8000 \ + --publish=69:69/udp --publish=10809:10809 \ + --detach=true --privileged \ + --hostname=bsp-devkit --name=bsp-devkit \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v $MIRRORDIR:/home/devel/mirror \ + -v $HOME/agl-workspace:/xdt/workspace \ <--- shared directory + docker.automotivelinux.org/agl/worker:3.0 +``` + +### From Windows © host using a shared directory + +We will create a shared directory for our user: + +```bash +mkdir /c/Users/$USERNAME/agl-workspace +``` + +And run the Docker image with the shared directory (new volume): + +```bash +$ docker run \ + --publish=2222:22 --publish=8000:8000 \ + --publish=69:69/udp --publish=10809:10809 \ + --detach=true --privileged --hostname=bsp-devkit \ + --name=bsp-devkit \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v $MIRRORDIR:/home/devel/mirror \ + -v /c/Users/$USERNAME/agl-workspace:/xdt/workspace \ <--- shared directory + docker.automotivelinux.org/agl/worker:3.0 +``` + +### From the container using a remote directory (SSHFS) + +It's also possible to mount a remote directory inside the container if +the source host is running a ssh server. In that case, we will use a SSH +connection from the host to the container as a control link, and another +SSH connection from the container to the host as a data link. + +To do so, you can start the container normally as described in +[Start container chapter](#anchor-start-container), start an SSH session and +run the following commands to install the package "sshfs" inside the container: + +```bash +sudo apt-get update +sudo apt-get install -y sshfs +``` + +NB: sudo will ask for the password of the user "**devel**", which is +"**devel**". + +Now, if we want to mount the remote dir '/data/workspace' with user +'alice' on host 'computer42', then we would run: + +```bash +$ sshfs alice@computer42:/data/workspace -o nonempty $XDT_WORKSPACE +... +Password: <enter alice password on computer42> +``` + +NB: the directory on the remote machine must be owned by the remote user + +Verify that the mount is effective: + +```bash +$ df /xdt/workspace +Filesystem 1K-blocks Used Available Use% Mounted on +alice@computer42:/data/workspace 103081248 7138276 95612016 7% /xdt/workspace +``` + +From now, the files created inside the container in /xdt/workspace are +stored 'outside', in the shared directory with proper uid/gid. + +To unmount the shared directory, you can run: + +```bash +$sudo umount $XDT_WORKSPACE +``` diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_4-Inside-the-container.md b/agl-documentation/sdk-devkit/docs/part-1/1_4-Inside-the-container.md new file mode 100644 index 0000000..3380b22 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_4-Inside-the-container.md @@ -0,0 +1,76 @@ +# Inside the container + +## Features + +Container features: + +- a Debian 8.5 based system with an SSH server listening on tcp/22, +- a dedicated user is defined to run the SSH session: **devel** + (password: **devel**) +- a script named "prepare_meta" for preparing the build environment + +## File system organization and shared volume + +The image has been designed with a dedicated file-system hierarchy. Here it is: + +```bash +devel@bsp-devkit:/$ **tree -L 2 /xdt** +/xdt +|-- build +| `-- conf +| |-- bblayers.conf +| |-- local.conf +| [snip] +|-- ccache +|-- downloads +|-- meta +| |-- agl-manifest +| |-- meta-agl +| |-- meta-agl-demo +| |-- meta-agl-extra +| |-- meta-amb +| |-- meta-intel +| |-- meta-intel-iot-security +| |-- meta-iot-agl +| |-- meta-oic +| |-- meta-openembedded +| |-- meta-qt5 +| |-- meta-renesas +| |-- meta-rust +| |-- meta-security-isafw +| `-- poky +|-- sdk +|-- sources +|-- sstate-cache +| |-- 00 +| |-- 01 +| |-- 02 +| |-- 03 +| |-- 04 +| |-- 05 +| |-- 06 +| |-- 07 + [snip] +`-- workspace +``` + +Noticeably, the BSP related features are located in the dedicated "/xdt" +directory. + +This directory contains sub-directories, and in particular the +following: + +- **build**: will contain the result of the build process, including + an image for the Porter board. +- **downloads**: (optional) contain the Yocto download cache, a + feature which will locally store the upstream projects sources codes + and which is fulfilled when an image is built for the first time. + When populated, this cache allow the user to built without any + connection to Internet. +- **meta**: contains the pre-selected Yocto layers required to built + the relevant AGL image for the Porter board. +- **sstate-cache**: (optional) contain the Yocto shared state + directory cache, a feature which store the intermediate output of + each task for each recipe of an image. This cache enhance the image + creation speed time by avoiding Yocto task to be run when they are + identical to a previous image creation. diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_5-Build-image-Porter.md b/agl-documentation/sdk-devkit/docs/part-1/1_5-Build-image-Porter.md new file mode 100644 index 0000000..a13e9d3 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_5-Build-image-Porter.md @@ -0,0 +1,175 @@ +# Build an image for Porter board + +In this section, we will go on the image compilation for the Porter +board within the Docker container. + +## Download Renesas proprietary drivers + +For the Porter board, we first need to download the proprietary drivers +from Renesas web site. The evaluation version of these drivers can be +found here: + +[http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp](http://www.renesas.com/secret/r_car_download/rcar_demoboard.jsp) + +under the **Target hardware: R-Car H2, M2 and E2** section: + +![renesas download](pictures/renesas_download.jpg) + +Note that you have to register with a free account on MyRenesas and +accept the license conditions before downloading them. The operation is +fast and simple but nevertheless mandatory to access evaluation of non +open-source drivers for free. + +Once you register, you can download two zip files: store them in a +directory visible from the container, for example in the directory +`$MIRRORDIR/proprietary-renesas-r-car` (`$MIRRORDIR` was created +previously in section [Start the container](#anchor-start-container) and adjust +the permissions. The zip files should then be visible from the inside of the +container in `/home/devel/mirror`: + +```bash +$ chmod +r /home/devel/mirror/proprietary-renesas-r-car/*.zip +$ ls -l /home/devel/mirror/proprietary-renesas-r-car/ +total 8220 +-rw-r--r-- 1 1000 1000 6047383 Jul 11 11:03 R-Car_Series_Evaluation_Software_Package_for_Linux-20151228.zip +-rw-r--r-- 1 1000 1000 2394750 Jul 11 11:03 R-Car_Series_Evaluation_Software_Package_of_Linux_Drivers-20151228.zip +``` + +## Setup the build environment + +We should first prepare the environment to build images. + +This can be easily done thanks to a helper script named `prepare_meta`. +This script does the following: + +- check for an updated version at + [https://github.com/iotbzh/agl-manifest](https://github.com/iotbzh/agl-manifest) +- pull Yocto layers from git repositories, following a snapshot manifest +- setup build configuration (build/conf files) + +The following options are available: + +```bash +devel@bsp-devkit:~$ prepare_meta -h +prepare_meta [options] + +Options: + -f|--flavour <flavour[/tag_or_revision]> + what flavour to us + default: 'iotbzh' + possible values: 'stable','unstable','testing', 'iotbzh' ... see agl-manifest git repository + -o|--outputdir <destination_dir> + output directory where subdirectories will be created: meta, build, ... + default: current directory (.) + -l|--localmirror <directory> + specifies a local mirror directory to initialize meta, download_dir or sstate-cache + default: none + -r|--remotemirror <url> + specifies a remote mirror directory to be used at build time for download_dir or sstate-cache + default: none + -p|--proprietary <directory> + Directory containing Renesas proprietary drivers for RCar platform (2 zip files) + default: none + -e|--enable <option> + enable a specific option + available options: ccache, upgrade + -d|--disable <option> + disable a specific option + available options: ccache, upgrade + -t|--target <name> + target platform + default: porter + valid options: intel-corei7-64, qemux86, qemux86-64, wandboard + -h|--help + get this help + +Example: + prepare_meta -f iotbzh/master -o /tmp/xdt -l /ssd/mirror -p /vol/xdt/proprietary-renesas-rcar/ -t porter +``` + +In our case, we can start it with the following arguments: + +- build in `/xdt` (-o /xdt) +- build for porter board (`-t porter`) +- build the 'iotbzh' flavour (`-f iotbzh`), which contains the standard + AGL layers + security and app framework. Flavours are stored in the + agl-manifest repository. +- Use a local mirror (`-l <mirror path>`). This directory may + contain some directories generated in a previous build: `downloads`, + `sstate-cache`, `ccache`, `meta`. If found, the mirror directories + will be specified in configuration files. +- specify proprietary drivers location (`-p <drivers path>`) + +So we can run the helper script: + +```bash +devel@bsp-devkit:~$ prepare_meta -o /xdt -t porter -f rel2.0 -l /home/devel/mirror/ -p /home/devel/mirror/proprietary-renesas-r-car/ -e wipeconfig +[...] +=== setup build for porter +Using proprietary Renesas drivers for target porter +=== conf: build.conf +=== conf: download caches +=== conf: sstate caches +=== conf: local.conf +=== conf: bblayers.conf.inc -> bblayers.conf +=== conf: porter_bblayers.conf.inc -> bblayers.conf +=== conf: bblayers_proprietary.conf.inc is empty +=== conf: porter_bblayers_proprietary.conf.inc is empty +=== conf: local.conf.inc is empty +=== conf: porter_local.conf.inc is empty +=== conf: local_proprietary.conf.inc is empty +=== conf: porter_local_proprietary.conf.inc is empty +===================================================================== + +Build environment is ready. To use it, run: + +# source /xdt/meta/poky/oe-init-build-env /xdt/build + +then + +# bitbake agl-demo-platform +``` + +Now, the container shell is ready to build an image for Porter. + +## Launch the build + +To start the build, we can simply enter the indicated commands: + +```bash +devel@bsp-devkit:~$ . /xdt/build/agl-init-build-env +### Shell environment set up for builds. ### + +You can now run 'bitbake <target>' + +Common target are: + + agl-demo-platform + +devel@bsp-devkit:/xdt/build$ bitbake agl-demo-platform +[snip] +NOTE: Tasks Summary: Attempted 5108 tasks of which 4656 didn't need to +be rerun and all succeeded. + +Summary: There were 19 WARNING messages shown. +``` + +Without mirror, it will take a few hours to build all the required +component of the AGL distribution, depending on: your host machine CPU, +disk drives types and internet connection. + +## Updating the local mirror + +Optionally, at the end of the build, some directories may be synced to +the mirror dir, for future usage: + +- `/xdt/meta`: contains all layers used to build AGL +- `/xdt/downloads`: download cache (avoid fetching source from remote sites) +- `/xdt/sstate-cache`: binary build results (avoid recompiling sources) + +This can be done with the following command: + +```bash +$ for x in meta downloads sstate-cache; do rsync -Pav \ + --delete /xdt/$x /home/devel/mirror/$x; done +``` diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_6-Porter-image-deployment.md b/agl-documentation/sdk-devkit/docs/part-1/1_6-Porter-image-deployment.md new file mode 100644 index 0000000..2c2bc2f --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_6-Porter-image-deployment.md @@ -0,0 +1,257 @@ +# Porter image deployment on target + +Once the Porter image has been built with Yocto, we can deploy it on an +empty SD card to prepare its use on the target. + +## SD card image creation + +First, we need to generate an SD card disk image file. For this purpose, +a helper script is provided within the container. Here below is the way +to use it. + +### Linux, Mac OS X © + +```bash +cd /xdt/build +mksdcard /xdt/build/tmp/deploy/images/porter/agl-demo-platform-porter-20XXYYZZxxyyzz.rootfs.tar.bz2 /home/devel/mirror +``` + +### Windows © + +```bash +cd /xdt/build +sudo dd if=/dev/zero of=/sprs.img bs=1 count=1 seek=4G +sudo mkfs.ext4 /sprs.img +sudo mkdir /tmp/sprs +sudo mount /sprs.img /tmp/sprs +sudo mksdcard /xdt/build/tmp/deploy/images/porter/agl-demo-platform-porter-20XXYYZZxxyyzz.rootfs.tar.bz2 +/tmp/sprs/sdcard.img +xz -dc /tmp/sprs/sdcard.img.xz > $XDT_WORKSPACE/agl-demo-platform-porter-sdcard.img +``` + +You should get the following prompt during the `mksdcard` step: + +```bash +Creating the image agl-demo-platform-porter-sdcard.img ... +0+0 records in +0+0 records out +0 bytes (0 B) copied, 6.9187e-05 s, 0.0 kB/s +mke2fs 1.42.12 (29-Aug-2014) +Discarding device blocks: done +Creating filesystem with 524287 4k blocks and 131072 inodes +Filesystem UUID: 5307e815-9acd-480b-90fb-b246dcfb28d8 +Superblock backups stored on blocks: + 32768, 98304, 163840, 229376, 294912 + +Allocating group tables: done +Writing inode tables: done +Creating journal (8192 blocks): done +Writing superblocks and filesystem accounting information: done + +Extracting image tarball... +done + +Image agl-demo-platform-porter-sdcard.img created! + +Set the following uboot environment +setenv bootargs_console 'console=ttySC6,38400 ignore_loglevel' +setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60' +setenv bootargs_root 'root=/dev/mmcblk0p1 rootdelay=3 rw rootfstype=ext3 rootwait' +setenv bootmmc '1:1' +setenv bootcmd_sd 'ext4load mmc ${bootmmc} 0x40007fc0 boot/uImage+dtb' +setenv bootcmd 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root}; run bootcmd_sd; bootm 0x40007fc0' +saveenv + +NB: replace bootmmc value '1:1' with '0:1' or '2:1' to access the good slot + use 'ext4ls mmc XXX:1' to test access + +$ ls -lh $XDT_WORKSPACE +-rw-r--r-- 1 devel devel 2.0G Feb 15 14:13 agl-demo-platform-porter-sdcard.img + +``` + +After the disk image is created, we can copy it on the SD card itself +using an SD card adapter. To do so, we need to gain access to the SD +card image file from our host machine. + +If you already share a directory between your host machine and the +container (as described in section [Set up a persistent workspace](#anchor-setup-persist-wks)), +this state is already reached and you go directly on sections relating the SD +card image installation. + +Otherwise, you need to copy the SD card image file out of the container +and into your host machine using SSH protocol: + +- On Linux and Mac OS X hosts, you can use the `scp` command, which is part of + the OpenSSH project, +- On Windows hosts, you can use the + [`pscp.exe`](http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe) + binary, which is part of the [PuTTY project](http://www.putty.org/). + +## Deployment from a Linux or Mac OS X host + +Now that the SD card image is ready, the last step required is to +"flash" it onto the SD card itself. + +First, you need an SD card adapter connected to your host machine. +Depending on your adapter type and OS, the relevant block device can +change. Mostly, you can expect: + +- `/dev/sdX` block device; usually for external USB adapters on + Linux hosts. +- `/dev/mmcblkN`: when using a laptop internal adapter on Linux + hosts. +- `/dev/diskN`: on Mac OS X hosts. + +### Linux + +If you do not know which block device you should use, you can check the +kernel logs using the following command to figure out what is the +associated block devices: + +```bash +$ dmesg | grep mmcblk +$ dmesg | grep sd +[...snip...] +[1131831.853434] sd 6:0:0:0: [sdb] 31268864 512-byte logical blocks: (16.0 GB/14.9 GiB) +[1131831.853758] sd 6:0:0:0: [sdb] Write Protect is on +[1131831.853763] sd 6:0:0:0: [sdb] Mode Sense: 4b 00 80 08 +[1131831.854152] sd 6:0:0:0: [sdb] No Caching mode page found +[1131831.854157] sd 6:0:0:0: [sdb] Assuming drive cache: write through +[1131831.855174] sd 6:0:0:0: [sdb] No Caching mode page found +[1131831.855179] sd 6:0:0:0: [sdb] Assuming drive cache: write through +[...snip...] +$ +``` + +In this example, no `mmcblk` device where found, but a 16.0GB disk was +listed and can be accessed on **`/dev/sdb`** which in our case is the +physical SD card capacity. + +The command `lsblk` is also a good solution to explore block devices: + +```bash +$ lsblk +NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +sda 8:0 0 931.5G 0 disk +|--sda1 8:1 0 8G 0 part / +|--sda2 8:2 0 16G 0 part [SWAP] +|--sda3 8:3 0 907.5G 0 part + |--vg0-usr 254:0 0 32G 0 lvm /usr + |--vg0-data 254:1 0 200G 0 lvm /data + |--vg0-home 254:2 0 100G 0 lvm /home + |--vg0-var 254:3 0 8G 0 lvm /var + |--vg0-docker 254:4 0 100G 0 lvm /docker +sdb 8:16 0 223.6G 0 disk +|--sdb1 8:17 0 223.6G 0 part /ssd +sdc 8:32 1 3.7G 0 disk <-- SD card plugged into USB card reader +|--sdc1 8:33 1 2G 0 part <-- +sr0 11:0 1 1024M 0 rom +``` + +In this example, the 4GB device `/dev/sdc` is listed as removable +(column RM) and corresponds to a SD Card plugged into an USB card +reader. + +Finally, as we know the block device which corresponds to our SD card, +we can raw-copy the image on it using the following command __**from your +host terminal**__ : (replace `/dev/sdZ` by the appropriate device) + +```bash +$ xzcat ~/mirror/agl-demo-platform-porter-20XXYYZZxxyyzz.raw.xz | sudo dd of=/dev/sdZ bs=1M +2048+0 records in +2048+0 records out +2147483648 bytes (2.0 GB) copied, 69 s, 39.2 MB/s +$ sync +``` + +This will take few minutes to copy and sync. You should not remove the +card from its slot until both commands succeed. + +Once it is finished, you can unplug the card and insert it in the +micro-SD card slot on the Porter board, and perform a power cycle to +start your new image on the target. + +__**NB:**__ The output format is also suitable to `bmaptool` utility (source +code available here: [https://github.com/01org/bmap-tools](https://github.com/01org/bmap-tools): +this significantly speeds up the copy as only relevant data are written on +the Sdcard (filesystem "holes" are not written). It's also supporting +direct access to URLs pointing to compressed images. + +### Mac OS X © + +If you do not know which block device you should use, you can use the +`diskutil` tool to list them: + +```bash +$ diskutil list +[...snip...] + +/dev/disk2 +#: TYPE NAME SIZE IDENTIFIER +0: Fdisk_partition_scheme 7.9 GB disk2 +1: Linux 7.9 GB disk2s1 +[...snip...] +$ +``` + +In this example, we have a 8.0GB disk which can be accessed on +**`/dev/disk2`** which in our case is the physical SD card capacity. + +Finally, as we know the block device which accesses our SD card, we can +raw-copy the image on it using the following command __from your host +terminal__: + +```bash +$ xzcat ~/mirror/agl-demo-platform-porter-20XXYYZZxxyyzz.raw.xz | sudo dd of=/dev/disk2 bs=1M +2048+0 records in +2048+0 records out +2147483648 bytes (2.0 GB) copied, 69 s, 39.2 MB/s +$ sync +``` + +This will take few minutes to copy and sync. You should not remove the +card from its slot until both commands succeed. + +Once it is finished, you can unplug the card and insert it in the +micro-SD card slot on the Porter board, and perform a power cycle to +start your new image on the target. + +## Deployment from a Windows host + +Now that the SD card image is ready, the last step required is to "flash" it +onto the SD card itself. + +First, you need an SD card adapter connected to your host machine. + +We will then use the `Win32DiskImager` program which we will download at +this URL: + +[http://sourceforge.net/projects/win32diskimager/](http://sourceforge.net/projects/win32diskimager/) + +and by clicking on this button: +![windows win32diskimager 1](pictures/windows_win32diskimager_1.png) + +We will then install it: + +![windows win32diskimager 2](pictures/windows_win32diskimager_2.png){style width:48%; float:left; margin-right:0.3em} +![windows win32diskimager 3](pictures/windows_win32diskimager_3.png){style width:48%; float:right} + +And then start it with its icon: +![windows win32diskimager 4](pictures/windows_win32diskimager_4.png) + +We can then click on the "blue folder" button to select our .img file +(uncompress the XZ image first using utilities like 7zip for example). + +**After having verified that the drive letter on the +right matches our SD card reader**, we click on the "**Write**" button +to start the flashing process. + +![windows win32diskimager 5](pictures/windows_win32diskimager_5.png) + +This will take few minutes to copy and sync. You should not remove the +card from its slot until both commands succeed. + +Once it is finished, you can unplug the card and insert it in the +micro-SD card slot on the Porter board, and perform a power cycle to +start your new image on the target. diff --git a/agl-documentation/sdk-devkit/docs/part-1/1_7-SDK-compilation-installation.md b/agl-documentation/sdk-devkit/docs/part-1/1_7-SDK-compilation-installation.md new file mode 100644 index 0000000..6fe789b --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/1_7-SDK-compilation-installation.md @@ -0,0 +1,49 @@ +# AGL SDK compilation and installation + +Now that we have both a finalized development container and a deployed +Porter image, let us create and install the SDK (Software Development +Kit), so that we can develop new components for our image. + +Going back to the container, let's generate our SDK files: + +```bash +bitbake agl-demo-platform-crosssdk +``` + +This will take some time to complete. + +Alternatively, you can download a prebuilt SDK file suitable for AGL 2.0 +on automotivelinux website: + +```bash +mkdir -p /xdt/build/tmp/deploy/sdk +cd /xdt/build/tmp/deploy/sdk +wget https://download.automotivelinux.org/AGL/release/chinook/3.0.2/porter-nogfx/deploy/sdk/poky-agl-glibc-x86_64-core-image-minimal-cortexa15hf-neon-toolchain-3.0.0+snapshot.sh +``` + +Once you have the prompt again, let's install our SDK to its final +destination. For this, run the script `install_sdk` with the SDK +auto-installable archive as argument: + +```bash +install_sdk /xdt/build/tmp/deploy/sdk/poky-agl-glibc-x86_64-core-image-minimal-cortexa15hf-neon-toolchain-3.0.0+snapshot.sh +``` + +The SDK files should be now installed in `/xdt/sdk`: + +```bash +$ tree -L 2 /xdt/sdk +/xdt/sdk/ +|-- environment-setup-cortexa15hf-neon-agl-linux-gnueabi +|-- site-config-cortexa15hf-neon-agl-linux-gnueabi +|-- sysroots +| |-- cortexa15hf-neon-agl-linux-gnueabi +| |-- x86_64-aglsdk-linux +`-- version-cortexa15hf-neon-agl-linux-gnueabi +``` + +You can now use them to develop new services, and native/HTML +applications. + +Please refer to the document entitled "Build Your 1st AGL Application" +to learn how to do this. diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_1.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_1.png Binary files differnew file mode 100644 index 0000000..10036f1 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_1.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_2.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_2.png Binary files differnew file mode 100644 index 0000000..d720bb9 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_2.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_3.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_3.png Binary files differnew file mode 100644 index 0000000..5e9ec54 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_3.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_4.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_4.png Binary files differnew file mode 100644 index 0000000..3cf3e8e --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_4.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_5.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_5.png Binary files differnew file mode 100644 index 0000000..d1c5b0d --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_5.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_6.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_6.png Binary files differnew file mode 100644 index 0000000..80818e8 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_macos_6.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_1.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_1.png Binary files differnew file mode 100644 index 0000000..cc412d0 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_1.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_2.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_2.png Binary files differnew file mode 100644 index 0000000..18ecf1a --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_2.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_3.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_3.png Binary files differnew file mode 100644 index 0000000..29272b5 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_3.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_4.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_4.png Binary files differnew file mode 100644 index 0000000..1ff33e4 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_4.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_5.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_5.png Binary files differnew file mode 100644 index 0000000..a7f2c5b --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_5.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_6.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_6.png Binary files differnew file mode 100644 index 0000000..685ddb9 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_6.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_7.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_7.png Binary files differnew file mode 100644 index 0000000..900ef44 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/docker_install_windows_7.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/renesas_download.jpg b/agl-documentation/sdk-devkit/docs/part-1/pictures/renesas_download.jpg Binary files differnew file mode 100644 index 0000000..a4bdc29 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/renesas_download.jpg diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_1.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_1.png Binary files differnew file mode 100644 index 0000000..ecae750 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_1.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_2.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_2.png Binary files differnew file mode 100644 index 0000000..09ecd52 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_putty_2.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_1.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_1.png Binary files differnew file mode 100644 index 0000000..2276c5b --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_1.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_2.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_2.png Binary files differnew file mode 100644 index 0000000..2485849 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_2.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_3.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_3.png Binary files differnew file mode 100644 index 0000000..38d94e3 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_3.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_4.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_4.png Binary files differnew file mode 100644 index 0000000..68a5fa6 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_4.png diff --git a/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_5.png b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_5.png Binary files differnew file mode 100644 index 0000000..e4aade2 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-1/pictures/windows_win32diskimager_5.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/2_0_Abstract.md b/agl-documentation/sdk-devkit/docs/part-2/2_0_Abstract.md new file mode 100644 index 0000000..e7eae95 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/2_0_Abstract.md @@ -0,0 +1,25 @@ +# Part 2 - Build your 1st application + +## Abstract + +In the first part of this document, entitled "** Build AGL image from scratch**", +we rebuilt a complete bootable AGL image from source code. We also generated +and installed related SDK files in our development container. +This document describes the next step: using the SDK to build applications and +deploy them on a target board running an AGL image. + +AGL DevKit as a whole contains: + +- "**AGL Devkit - Image and SDK for porter**" guide for preparing a + Docker container with AGL SDK, ready to build AGL applications +- Application templates and demos, allowing developers to start developing + various types of applications: + - Services + - Native applications + - HTML5 applications + - ... +- This guide, focused on how to use these applications templates + +*This document focuses on: initializing the SDK environment, building the +development templates, modifying them, and installing them on the +target.* diff --git a/agl-documentation/sdk-devkit/docs/part-2/2_1-Init-sdk-env.md b/agl-documentation/sdk-devkit/docs/part-2/2_1-Init-sdk-env.md new file mode 100644 index 0000000..c6cf67a --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/2_1-Init-sdk-env.md @@ -0,0 +1,79 @@ +# Initializing SDK environment and templates + +## Initializing the SDK environment + +*(This document assumes that you are logged inside the **bsp-devkit** Docker +container, used to produce Rcar Gen3 BSP image and AGL SDK in the +previous **"SDK quick setup"** document)* + +To be able to use the toolchain and utilities offered by AGL SDK, it is +necessary to source the proper setup script. This script is in the SDK +root folder and is named `/xdt/sdk/environment-setup-*` (full name +depends on the target machine) + +For Rcar Gen3 boards, we source the required SDK environment variables like +this: + +```bash +source /xdt/sdk/environment-setup-aarch64-agl-linux +``` + +To verify that it succeeded, we should obtain a non-empty result for +this command: + +```bash +echo $CONFIG_SITE | grep sdk /xdt/sdk/site-config-aarch64-agl-linux +``` + +## Application categories + +We provide multiple development templates for the AGL SDK: + +- Service + + A Service is a headless background process, allowing Bindings to expose + various APIs accessible through the transports handled by the application + framework, which are currently: + - [HTTP REST (HTTP GET, POST...)](https://en.wikipedia.org/wiki/Representational_state_transfer) + - [WebSocket](https://en.wikipedia.org/wiki/WebSocket) + - [D-Bus](https://www.freedesktop.org/wiki/Software/dbus/) + +- Native application + + A Native application is a compiled application, generally written in C/C++, + accessing one or more services, either by its own means or using a helper + library with HTTP REST/WebSocket capabilities. + + *(our template is written in C and uses the "libafbwsc" helper library + available in the app-framework-binder source tree on AGL Gerrit)* + +- HTML5 application + + An HTML5 application is a web application, generally written with a framework + (AngularJS, Zurb Foundation...), accessing services with its built-in HTTP + REST/WebSocket capabilities. + +- Legacy application + + A legacy application contains a native application not made for AGL + Application Framework but launched by it. For such application, only + security setup is made. + +## Getting helloworld templates + +Application Framework _helloworld_ example live in a dedicated Git +Repository, currently hosted on GitHub at the following address: + +[https://github.com/iotbzh/helloworld-service](https://github.com/iotbzh/helloworld-service) + +To get the templates in our development container, let us simply clone +the source repository: + +```bash +$ cd ~ +$ git clone --recursive https://github.com/iotbzh/helloworld-service +Cloning into 'helloworld-service'... +[...snip...] +Resolving deltas: 100% (125/125), done. +Checking connectivity... done. +``` diff --git a/agl-documentation/sdk-devkit/docs/part-2/2_2-Trying-out-template.md b/agl-documentation/sdk-devkit/docs/part-2/2_2-Trying-out-template.md new file mode 100644 index 0000000..e477755 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/2_2-Trying-out-template.md @@ -0,0 +1,134 @@ +# Trying out the templates + +In this section, we describe how to build the various templates, how to +package them and finally how to deploy and run them on the target board. + +Every template is stored in a single directory and is independent of the +rest of the tree: each template can be used as a foundation for a fresh +new application. + +For deployment, we assume that the target board is booted with an AGL +image and available on the network. Let us use the `BOARDIP` variable +for the board IP address (replace by appropriate address or hostname) +and test the SSH connection: + +```bash +$ export BOARDIP=1.2.3.4 +$ ssh root@$BOARDIP cat /etc/os-release +ID="poky-agl" +NAME="Automotive Grade Linux" +VERSION="1.0+snapshot-20160717 (master)" +VERSION_ID="1.0+snapshot-20160717" +PRETTY_NAME="Automotive Grade Linux 1.0+snapshot-20160717 (master)" +``` + +## Building + +All operations are executed inside the Docker "Devkit" container. For +convenience, a build script named `autobuild` can build template and +package at once. + +Compile the service: + +```bash +$ cd ~/helloworld-service/ +$ ./conf.d/autobuild/agl/autobuild package +-- The C compiler identification is GNU 6.3.1 +-- The CXX compiler identification is GNU 6.3.1 +[snip] +[100%] Generating helloworld-service.wgt +NOTICE: -- PACKING widget helloworld-service.wgt from directory /home/claneys/Workspace/Sources/IOTbzh/helloworld-service/build/package +++ Install widget file using in the target : afm-util install helloworld-service.wgt +``` + +This produced a `helloworld-service.wgt` package. Let us copy it to the +target: + +```bash +$ scp helloworld-service.wgt root@$BOARDIP:~/ +helloworld-service.wgt 100% 24KB 24.3KB/s 00:00 +``` + +## Installing on the target + +And then, in a separate window, log in to the target board: + +```bash +ssh root@$BOARDIP +``` + +and install our packages: + +```bash +$ afm-util install helloworld-service.wgt +{ "added": "helloworld-service@1.0" } +``` + +We can verify that they were correctly installed by listing all +available applications: + +```bash +$ afm-util list +[ { "description": "The name says it all!", "name": "helloworld-service", "shortname": "", "id": "helloworld-service@1.0", "version": "1.0", "author": "Stephane Desneux <sdx@iot.bzh>", "author-email": "", "width": "", "height": "" } ] +``` + +## Running the template + +Even if the template is mostly skeleton application, we can still +start them and see them in action. + +Once installed Application Framework created appropriate systemD unit file +to get able to manage the application. You can directly connect to the unix +socket to get connected to the application template, it will be launched +automatically if not already started. + +when systemD receives a connection to an existing socket that it handles, it +launch the associated application using its service unit. Service unit is +generated by wgtpkg-unit at installation, its content depends of the +`config.xml` configuration file located in its specific directory +(`/var/local/lib/afm/applications/<appname>/<version>/config.xml`). + +Generation is controlled by the global `/etc/afm/afm-unit.conf` config +file. + +This file defines how various applications types are handled by the +system and application framework. + +### Run and connect to the service + +Let us first run the Service: + +```bash +$ afm-util run helloworld-service@1.0 +1 +``` + +Then confirm it is running: + +```bash +$ afm-util ps +[ { "runid": 20091, "pids": [ 20091 ], "state": "running", "id": "helloworld-service@1.0" } ] +$ ps -ef | grep afb +ps -ef|grep afb +root 5764 3876 0 15:34 ? 00:00:00 /usr/bin/afb-daemon --rootdir=/var/local/lib/afm/applications/helloworld-service/1.0 --workdir=/home/root/app-data/helloworld-service --roothttp=htdocs --binding=/var/local/lib/afm/applications/helloworld-service/1.0/lib/afb-helloworld.so --ws-server=sd:helloworld --no-httpd +``` + +We can see that an afb-daemon (Binder) process for this Service started +and get a websocket server up, meaning that an unix socket is available +from directory `/var/run/user/<uid>/apis/ws` named as the api name. +We also see that the shared library as been loaded as binding using `binding` +flag. + +A Service has no user interface, but we can still try the binding API. +Looking at the Service source code, we see that the Service implements +an API named '**helloworld**' providing a `ping` verb. Let us try to launch +a websocket client connected to that service invoking the `ping` verb. + +First as we don't know security token used to launch the service, we still can +connect to through the unix socket and use the websocket client demo: + +```bash +$ afb-daemon --ws-client=/var/run/user/0/apis/ws/helloworld --port=12345 --token='' --roothttp=. +$ afb-client-demo ws://localhost:12345/api?token= helloworld ping +ON-REPLY 1:helloworld/ping: {"response":"Make the World great again!","jtype":"afb-reply","request":{"status":"success","info":"Ping Binder Daemon tag=pingSample count=2 query=\"null\"","uuid":"2edcfee9-943b-40d7-a0c6-08a31141f045"}} +``` diff --git a/agl-documentation/sdk-devkit/docs/part-2/2_3-Dev-with-container.md b/agl-documentation/sdk-devkit/docs/part-2/2_3-Dev-with-container.md new file mode 100644 index 0000000..eb83c8f --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/2_3-Dev-with-container.md @@ -0,0 +1,93 @@ +# Developing smoothly with the container + +The previous chapter pretty much illustrated the virtues of the Docker +container by letting you compile AGL applications, independently of your +host machine. + +There is one catch, though, in that the container does not feature a +full graphical environment similar to those which developers are used to. +But this can be circumvented. + +For this reason, and before we start developing our own apps, we will +explain how to get the best from the provided development container. + +## Remote display + +<a id="anchor-remote-display"></a> + +Apart from popular console tools such as `vi, git, patch, diff...` our +container also features graphical applications: `gvim` text editor, +`gitg` frontend for Git, `gvimdiff` ... + +You can display them on your host machine by taking advantage of X11 +protocol remoting capabilities. The procedure differs depending on your +host machine. + +### Linux + +You have to connect to your container by specifying the `-X` option: + +```bash +ssh -X -p 2222 devel@localhost +``` + +and then any graphical window, such as `gvim`'s, should display on your +host screen. + +### Mac OS X + +You have to connect to your container by specifying the `-X` option: + +```bash +ssh -X -p 2222 devel@localhost +``` + +together with a running X11 server such as XQuartz. + +XQuartz was included in old versions such as 10.5 Leopard; you can find it +under `Applications -> Utilities -> X11`. +For more recent versions starting from 10.6.3, you may have to download and +install it from the following URL: +[https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.9.dmg](https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.9.dmg) +(it will end up in the same location). + +![mac x11](pictures/mac_x11_logo.png) + +And then after having activated the "X11" icon, any graphical window, such as +`gvim`'s, should display on your host screen. + +### Windows + +You have to use PuTTY, as suggested in the previous "**Image and SDK +for porter**" document, together with a running X server such as Xming +([https://sourceforge.net/projects/xming/files/latest/download](https://sourceforge.net/projects/xming/files/latest/download)). + +Before connecting with PuTTY as usual, you have to go +to `Connection -> SSH -> X11` and check the `Enable X11 forwarding` checkbox. + +![putty config](pictures/putty_config.png) + +Then, if Xming is installed and running, as displayed +in the bottom right of the screen: + +![xming server](pictures/xming_server.png) + +any graphical window, such as `gvim`'s, should display on your screen. + +## Installing new applications (IDE...) + +The container has access to the whole Linux Debian distribution library, +and can benefit of only package available for it. + +For instance, to install the popular Eclipse IDE, please type: + +```bash +sudo apt-get install eclipse +``` + +And then, using the method described in section ["Remote display"](anchor-remote-display), +you can run it on your host screen by just typing: + +```bash +eclipse +``` diff --git a/agl-documentation/sdk-devkit/docs/part-2/2_4-Use-app-templates.md b/agl-documentation/sdk-devkit/docs/part-2/2_4-Use-app-templates.md new file mode 100644 index 0000000..363333c --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/2_4-Use-app-templates.md @@ -0,0 +1,362 @@ +# AGL CMake templates + +Files used to build an application, or binding, project with the +AGL Application Framework. + +To build your AGL project using these templates, you have to install +them within your project and adjust compilation option in `config.cmake`.\ +For technical reasons, you also have to specify **cmake** target in +sub CMakeLists.txt installed.\ +Make a globbing search to find source files +isn't recommended now to handle project build especially in a multiuser +project because CMake will not be aware of new or removed source files. + +You'll find usage samples here: + +- [helloworld-service](https://github.com/iotbzh/helloworld-service) +- [low-level-can-service](https://gerrit.automotivelinux.org/gerrit/apps/low-level-can-service) +- [high-level-viwi-service](https://github.com/iotbzh/high-level-viwi-service) +- [audio-binding](https://github.com/iotbzh/audio-binding) +- [unicens2-binding](https://github.com/iotbzh/unicens2-binding) + +## Quickstart + +### Initialization + +To use these templates files on your project just install the reference files using +**git submodule** then use `config.cmake` file to configure your project specificities : + +```bash +git submodule add https://gerrit.automotivelinux.org/gerrit/apps/app-templatesconf.d/app-templates conf.d/app-templates +mkdir conf.d/cmake +cp conf.d/app-templates/cmake/config.cmake.sample conf.d/cmake/config.cmake +``` + +Edit the copied config.cmake file to fit your needs. + +Now, create your top CMakeLists.txt file which include `config.cmake` file. + +An example is available in **app-templates** submodule that you can copy and +use: + +```bash +cp conf.d/app-templates/cmake/CMakeLists.txt CMakeLists.txt +``` + +### Create your CMake targets + +For each target part of your project, you need to use ***PROJECT_TARGET_ADD*** +to include this target to your project. + +Using it, make available the cmake variable ***TARGET_NAME*** until the next +***PROJECT_TARGET_ADD*** is invoked with a new target name. + +So, typical usage defining a target is: + +```cmake +PROJECT_TARGET_ADD(SuperExampleName) --> Adding target to your project + +add_executable/add_library(${TARGET_NAME}.... --> defining your target sources + +SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES.... --> fit target properties +for macros usage + +INSTALL(TARGETS ${TARGET_NAME}.... +``` + +### Targets PROPERTIES + +You should set properties on your targets that will be used to package your +apps in a widget file that could be installed on an AGL system. + +Specify what is the type of your targets that you want to be included in the +widget package with the property **LABELS**: + +Choose between: + +- **BINDING**: Shared library that be loaded by the AGL Application Framework +- **HTDOCS**: Root directory of a web app +- **DATA**: Resources used by your application +- **EXECUTABLE**: Entry point of your application executed by the AGL + Application Framework + +```cmake +SET_TARGET_PROPERTIES(${TARGET_NAME} + PREFIX "afb-" + LABELS "BINDING" + OUTPUT_NAME "file_output_name") +``` + +> **TIP**: You should use the prefix _afb-_ with your **BINDING* targets which +> stand for **Application Framework Binding**. + +## More details: Typical project architecture + +A typical project architecture would be : + +```tree +<project-root-path> +│ +├── conf.d/ +│ ├── autobuild/ +│ │ ├── agl +│ │ │ └── autobuild +│ │ ├── linux +│ │ │ └── autobuild +│ │ └── windows +│ │ └── autobuild +│ ├── app-templates/ +│ │ ├── README.md +│ │ ├── autobuild/ +│ │ │ ├── agl +│ │ │ │ └── autobuild.in +│ │ │ ├── linux +│ │ │ │ └── autobuild.in +│ │ │ └── windows +│ │ │ └── autobuild.in +│ │ ├── cmake/ +│ │ │ ├── config.cmake.sample +│ │ │ ├── export.map +│ │ │ └── macros.cmake +│ │ ├── deb/ +│ │ │ └── config.deb.in +│ │ ├── rpm/ +│ │ │ └── config.spec.in +│ │ └── wgt/ +│ │ ├── config.xml.in +│ │ ├── config.xml.in.sample +│ │ ├── icon-default.png +│ │ ├── icon-html5.png +│ │ ├── icon-native.png +│ │ ├── icon-qml.png +│ │ └── icon-service.png +│ ├── packaging/ +│ │ ├── config.spec +│ │ └── config.deb +│ ├── cmake +│ │ └── config.cmake +│ └── wgt +│ └── config.xml.in +├── <libs> +├── <target> +│ └── <files> +├── <target> +│ └── <file> +└── <target> + └── <files> +``` + +| # | Parent | Description | +| - | -------| ----------- | +| \<root-path\> | - | Path to your project. Hold master CMakeLists.txt and general files of your projects. | +| conf.d | \<root-path\> | Holds needed files to build, install, debug, package an AGL app project | +| app-templates | conf.d | Git submodule to app-templates AGL repository which provides CMake helpers macros library, and build scripts. config.cmake is a copy of config.cmake.sample configured for the projects. SHOULD NOT BE MODIFIED MANUALLY !| +| autobuild | conf.d | Scripts generated from app-templates to build packages the same way for differents platforms.| +| cmake | conf.d | Contains at least config.cmake file modified from the sample provided in app-templates submodule. | +| wgt | conf.d | Contains at least config.xml.in template file modified from the sample provided in app-templates submodule for the needs of project (See config.xml.in.sample file for more details). | +| packaging | conf.d | Contains output files used to build packages. | +| \<libs\> | \<root-path\> | External dependencies libraries. This isn't to be used to include header file but build and link statically specifics libraries. | Library sources files. Can be a decompressed library archive file or project fork. | +| \<target\> | \<root-path\> | A target to build, typically library, executable, etc. | + +### Update app-templates submodule + +You may have some news bug fixes or features available from app-templates +repository that you want.\ +To update your submodule proceed like the following: + +```bash +git submodule update --remote +git commit -s conf.d/app-templates +``` + +This will update the submodule to the HEAD of master branch repository. + +You could just want to update at a specified repository tag or branch or commit +, here are the method to do so: + +```bash +cd conf.d/app-templates +# Choose one of the following depending what you want +git checkout <tag_name> +git checkout --detach <branch_name> +git checkout --detach <commit_id> +# Then commit +cd ../.. +git commit -s conf.d/app-templates +``` + +### Build a widget + +#### config.xml.in file + +To build a widget you need a _config.xml_ file describing what is your apps and +how Application Framework would launch it.\ +This repo provide a simple default file _config.xml.in_ that should work +for simple application without interactions with others bindings. + +It is recommanded that you use the sample one which is more complete. You can +find it at the same location under the name _config.xml.in.sample_ (stunning +isn't it).\ +Just copy the sample file to your _conf.d/wgt_ directory and name it +_config.xml.in_, then edit it to fit your needs. + +> ***CAUTION*** : The default file is only meant to be use for a +> simple widget app, more complicated ones which needed to export +> their api, or ship several app in one widget need to use the provided +> _config.xml.in.sample_ which had all new Application Framework +> features explained and examples. + +#### Using cmake template macros + +To leverage all cmake templates features, you have to specify ***properties*** +on your targets.\ +Some macros will not works without specifying which is the target type. + +As the type is not always specified for some custom targets, like an ***HTML5*** +application, macros make the difference using ***LABELS*** property. + +Choose between: + +- **BINDING**: Shared library that be loaded by the AGL Application Framework +- **HTDOCS**: Root directory of a web app +- **DATA**: Resources used by your application +- **EXECUTABLE**: Entry point of your application executed by the AGL + Application Framework + +Example: + +```cmake +SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES + LABELS "HTDOCS" + OUTPUT_NAME dist.prod + ) +``` + +If your target output is not named as the ***TARGET_NAME***, you need to specify +***OUTPUT_NAME*** property that will be used by the ***populate_widget*** macro. + +Use the ***populate_widget*** macro as latest statement of your target +definition. Then at the end of your project definition you should use the macro +***build_widget*** that make an archive from the populated widget tree using the +`wgtpkg-pack` Application Framework tools. + +## Macro reference + +### PROJECT_TARGET_ADD + +Typical usage would be to add the target to your project using macro +`PROJECT_TARGET_ADD` with the name of your target as parameter. + +Example: + +```cmake +PROJECT_TARGET_ADD(low-can-demo) +``` + +> ***NOTE***: This will make available the variable `${TARGET_NAME}` +> set with the specificied name. This variable will change at the next call +> to this macros. + +### project_subdirs_add + +This macro will search in all subfolder any `CMakeLists.txt` file. If found then +it will be added to your project.\ +This could be use in an hybrid application by example where the binding +lay in a sub directory. + +Usage : + +```cmake +project_subdirs_add() +``` + +You also can specify a globbing pattern as argument to filter which folders +will be looked for. + +To filter all directories that begin with a number followed by a dash the +anything: + +```cmake +project_subdirs_add("[0-9]-*") +``` + +## Advanced customization + +### Including additionnals cmake files + +Advanced tuning is possible using addionnals cmake files that are included +automatically from some specifics locations.\ +They are included in that order: + +- Project CMake files normaly located in _\<project-root-path\>/conf.d/app-templates/cmake/cmake.d_ +- Home CMake files located in _$HOME/.config/app-templates/cmake.d_ +- System CMake files located in _/etc/app-templates/cmake.d_ + +CMake files has to be named using the following convention: `XX-***.cmake`, +where `XX` are numbers, `***` file name (ie. `99-my_customs.cmake`). + +So, saying that you should be aware that every normal cmake variables used at +project level could be overwrited by home or system located cmake files if +variables got the same name.\ +Exceptions are cached variables set using **CACHE** keyword: + +Example: + +```cmake +set(VARIABLE_NAME 'value string random' CACHE STRING 'docstring') +``` + +### Include customs templated scripts + +As well as for additionnals cmake files you can include your own templated +scripts that will be passed to cmake command `configure_file`. + +Just create your own script to the following directories: + +- Home location in _$HOME/.config/app-templates/scripts_ +- System location in _/etc/app-templates/scripts_ + +Scripts only needs to use the extension `.in` to be parsed and configured by +CMake command. + +## Autobuild script usage + +### Generation + +To be integrated in the Yocto build workflow you have to generate `autobuild` +scripts using _autobuild_ target. + +To generate those scripts proceeds: + +```bash +mkdir -p build +cd build +cmake .. && make autobuild +``` + +You should see _conf.d/autobuild/agl/autobuild_ file now. + +### Available targets + +Here are the available targets available from _autobuild_ scripts: + +- **clean** : clean build directory from object file and targets results. +- **distclean** : delete build directory +- **configure** : generate project Makefile from CMakeLists.txt files. +- **build** : compile all project targets. +- **package** : build and output a wgt package. + +You can specify variables that modify the behavior of compilation using +the following variables: + +- **CONFIGURE_ARGS** : Variable used at **configure** time. +- **BUILD_ARGS** : Variable used at **build** time. +- **DEST** : Directory where to output ***wgt*** file. + +Variable as to be in CMake format. (ie: BUILD_ARGS="-DC_FLAGS='-g -O2'") + +Usage example: + +```bash +./conf.d/autobuild/wgt/autobuild package DEST=/tmp +``` diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/cpu_hybrid_qml.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/cpu_hybrid_qml.png Binary files differnew file mode 100644 index 0000000..c3b35f5 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/cpu_hybrid_qml.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/html5_app.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/html5_app.png Binary files differnew file mode 100644 index 0000000..62b8d5e --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/html5_app.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app.png Binary files differnew file mode 100644 index 0000000..bfb09b3 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app_on_target.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app_on_target.png Binary files differnew file mode 100644 index 0000000..f4639dd --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_html5_app_on_target.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_qml_app.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_qml_app.png Binary files differnew file mode 100644 index 0000000..d27dfb2 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/hybrid_qml_app.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/mac_x11_logo.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/mac_x11_logo.png Binary files differnew file mode 100644 index 0000000..6dace7d --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/mac_x11_logo.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/putty_config.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/putty_config.png Binary files differnew file mode 100644 index 0000000..56f8d88 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/putty_config.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/qml_app.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/qml_app.png Binary files differnew file mode 100644 index 0000000..30f574d --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/qml_app.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/web-runtime_app.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/web-runtime_app.png Binary files differnew file mode 100644 index 0000000..c15e98d --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/web-runtime_app.png diff --git a/agl-documentation/sdk-devkit/docs/part-2/pictures/xming_server.png b/agl-documentation/sdk-devkit/docs/part-2/pictures/xming_server.png Binary files differnew file mode 100644 index 0000000..566cec7 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/part-2/pictures/xming_server.png diff --git a/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo.png b/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo.png Binary files differnew file mode 100644 index 0000000..ae6bc48 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo.png diff --git a/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo_small.png b/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo_small.png Binary files differnew file mode 100644 index 0000000..6a98c60 --- /dev/null +++ b/agl-documentation/sdk-devkit/docs/resources/iotbzh_logo_small.png diff --git a/agl-documentation/sdk-devkit/mkdocs.yml b/agl-documentation/sdk-devkit/mkdocs.yml new file mode 100644 index 0000000..c340a9d --- /dev/null +++ b/agl-documentation/sdk-devkit/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: AGL Application Framework Binder +theme: readthedocs +docs_dir: docs +pages: +- 'Document revisions' : '0-Doc-Revisions.md' +- 'Part 1 - Build AGL image from scratch': + - 'Abstract' : 'part-1/1_0_Abstract.md' + - '1. Deploy an image using containers' : 'part-1/1_1-Deploy_image.md' + - '2. Setting up your operating system' : 'part-1/1_2-Setting-up-your_os.md' + - '3. Install AGL Yocto image for Porter board using Docker container' : 'part-1/1_3-Install-agl-for-porter.md' + - '4. Inside the container' : 'part-1/1_4-Inside-the-container.md' + - '5. Build an image for Porter board' : 'part-1/1_5-Build-image-Porter.md' + - '6. Porter image deployment on target' : 'part-1/1_6-Porter-image-deployment.md' + - '7. AGL SDK compilation and installation' : 'part-1/1_7-SDK-compilation-installation.md' +- 'Part 2 - Build your 1st application' : + - 'Abstract' : 'part-2/2_0_Abstract.md' + - '1. Initializing SDK environment and templates' : 'part-2/2_1-Init-sdk-env.md' + - '2. Trying out the templates' : 'part-2/2_2-Trying-out-templates.md' + - '3. Developing smoothly with the container' : 'part-2/2_3-Dev-with-container.md' + - '4. Creating your own hybrid application' : 'part-2/2_4-Creating-hybrid-app.md' |