Skip to content

Commit

Permalink
Add support for basic version
Browse files Browse the repository at this point in the history
Signed-off-by: Le Jin <[email protected]>
  • Loading branch information
Le Jin committed May 9, 2020
0 parents commit 6ba8769
Show file tree
Hide file tree
Showing 157 changed files with 59,710 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
isar/
24 changes: 24 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
image: kasproject/kas-isar:2.0

variables:
GIT_STRATEGY: clone

all:
stage: build
script:
- export http_proxy=$HTTP_PROXY
- export https_proxy=$HTTPS_PROXY
- export ftp_proxy=$FTP_PROXY
- export no_proxy=$NO_PROXY

# only needed as long as we depend on private ssh-based repos
- mkdir -m 0700 ~/.ssh
- echo "host *" > ~/.ssh/config
- echo "StrictHostKeyChecking no" >> ~/.ssh/config
- echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519
- chmod 0600 ~/.ssh/id_ed25519

- kas build kas-iot2050-example.yml
- kas build kas-iot2050-example.yml:kas/opt/preempt-rt.yml
- sudo rm -rf build/tmp
- kas build kas-iot2050-boot-advanced.yml
61 changes: 61 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Contributing

We welcome contributions in several forms, e.g.

* Sponsoring
* Documenting
* Testing
* Coding
* etc.

Please read [14 Ways to Contribute to Open Source without Being a Programming Genius or a Rock Star](https://smartbear.com/blog/test-and-monitor/14-ways-to-contribute-to-open-source-without-being/ ).

Please check issue page and look for unassigned ones or create a new one.

Working together in an open and welcoming environment is the foundation of our
success, so please respect our [Code of Conduct](CODE_OF_CONDUCT.md).

## Guidelines

### Workflow

We use the
[Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow)
and review all changes we merge to master.

We appreciate any contributions, so please use the [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow)
and send us `Merge Requests`
17 changes: 17 additions & 0 deletions COPYING.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Meta IOT2050
M: Jan Kiszka <[email protected]>
M: Bao Chengsu <[email protected]>
M: Le Jin <[email protected]>

127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# META-IOT2050

This [Isar](https://github.com/ilbers/isar) layer contains recipes,
configuration and other artifacts that are specific to Debian-based
IOT2050 product.

## Build example image

Before building the system, you will need to install docker on build host.
For example under Debian Linux

```shell
sudo apt install docker.io
```

Then build the example image

```shell
./kas-docker --isar build kas-iot2050-example.yml
```

Build the example RT image, for example

```shell
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/preempt-rt.yml
```

Using 3rd-party mirrors, for example

```shell
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/mirror-example.yml
```

After build complete, the final image is under

```text
build/tmp/deploy/images/iot2050/iot2050-image-example-isar-iot2050.wic.img
```

## Build user SDK
>>>
**Note:** Current SDK only supports Linux x86-64 host machine
>>>
```shell
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/sdk.yml
```

After build complete, the SDK tarball is located at

```text
build/tmp/deploy/images/iot2050/sdk-isar-arm64.tar.xz
```

Please follow the further instruction file `README.sdk` under the SDK tarball

## Clean build result

```shell
./kas-docker --isar clean
```

## Build released version

First checkout the desired tag. Then build the image or sdk by appending the `kas/opt/package-lock.yml`:

```shell
# example image
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/package-lock.yml

# example rt image
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/preempt-rt.yml:kas/opt/package-lock.yml

# bootloader for advanced board
./kas-docker --isar build kas-iot2050-boot-advanced.yml:kas/opt/package-lock.yml

# bootloader for basic board
./kas-docker --isar build kas-iot2050-boot-basic.yml:kas/opt/package-lock.yml

# SDK
./kas-docker --isar build kas-iot2050-example.yml:kas/opt/sdk.yml:kas/opt/package-lock.yml
```

## Booting the Image from SD card

Under Linux, insert an unused SD card. Assuming the SD card takes device
/dev/mmcblk0, use dd to copy the image to it. For example:

```shell
$ sudo dd if=build/tmp/deploy/images/iot2050/iot2050-image-example-isar-iot2050.wic.img \
of=/dev/mmcblk0 bs=4M oflag=sync
```

Alternatively, install the bmap-tools package and run the following command which is generally faster and safer:

```shell
$ sudo bmaptool copy build/tmp/deploy/images/iot2050/iot2050-image-example-isar-iot2050.wic.img /dev/mmcblk0
```

The example image starts with the IP 192.168.200.1 preconfigured on the first
Ethernet interface, and use DHCP at another. You can use ssh to connect to the system.

The BSP image does not configure the network. If you want to ssh into the
system, you can use the root terminal via UART to ifconfig the IP address and
use that to ssh in.

NOTE: To login, the default username and password is `root`.
And you are required to change the default password when first login.

## Selecting a boot device

By default, the boot loader will pick the first bootable device. If that device
may no longer fully start, you can select an alternative boot device in the
U-Boot shell. Attach a USB-UART adapter to X14, connect it to a host PC and
open a terminal program on that port. Reset the device and interrupt the boot
when it counts down ("Hit any key to stop autoboot"). Then type

```shell
=> setenv boot_targets mmc0
=> run distro_bootcmd
```

to boot from the microSD card. Use `usb0` for the first USB mass storage
device.

NOTE: This selection is not persistent. The boot loader will fall back to its
default boot order after reset.
32 changes: 32 additions & 0 deletions classes/boot-flash-img.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) Siemens AG, 2019
#
# Authors:
# Le Jin <[email protected]>
#
# SPDX-License-Identifier: MIT

BOOT_IMG_SIZE_KB ?= "8192"
BOOT_IMG_FILE = "${DEPLOY_DIR_IMAGE}/${IMAGE_FULLNAME}.bin"

do_boot_img[stamp-extra-info] = "${DISTRO}-${MACHINE}"

do_boot_flash_img() {
rm -f ${BOOT_IMG_FILE}
dd if=/dev/zero ibs=1k count=${BOOT_IMG_SIZE_KB} | tr "\000" "\377" > ${BOOT_IMG_FILE}
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/tiboot3.bin of=${BOOT_IMG_FILE} seek=0 oflag=seek_bytes conv=notrunc
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/tispl.bin of=${BOOT_IMG_FILE} seek=512K oflag=seek_bytes conv=notrunc
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/u-boot.img of=${BOOT_IMG_FILE} seek=2560K oflag=seek_bytes conv=notrunc
# Env
dd if=/dev/zero ibs=1k count=128 of=${BOOT_IMG_FILE} seek=6656K oflag=seek_bytes conv=notrunc
# Env.bak
dd if=/dev/zero ibs=1k count=128 of=${BOOT_IMG_FILE} seek=6784K oflag=seek_bytes conv=notrunc
# SysFW
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/sysfw.itb of=${BOOT_IMG_FILE} seek=6912K oflag=seek_bytes conv=notrunc
# PRU ethernet FW
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/am65x-pru0-prueth-fw.elf of=${BOOT_IMG_FILE} seek=7936K oflag=seek_bytes conv=notrunc
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/am65x-pru1-prueth-fw.elf of=${BOOT_IMG_FILE} seek=8000K oflag=seek_bytes conv=notrunc
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/am65x-rtu0-prueth-fw.elf of=${BOOT_IMG_FILE} seek=8064K oflag=seek_bytes conv=notrunc
dd if=${BUILDCHROOT_DIR}/usr/lib/u-boot/${MACHINE}/am65x-rtu1-prueth-fw.elf of=${BOOT_IMG_FILE} seek=8128K oflag=seek_bytes conv=notrunc
}

addtask boot_flash_img before do_build after do_copy_boot_files
11 changes: 11 additions & 0 deletions classes/meta-version.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) Siemens AG, 2019
#
# Authors:
# Le Jin <[email protected]>
#
# SPDX-License-Identifier: MIT

get_meta_version() {
version=$(git describe --long --tag --dirty --always || echo unknown)
echo $version
}
Loading

0 comments on commit 6ba8769

Please sign in to comment.