Compare commits
40 Commits
4.2.2/tx2-
...
master
Author | SHA1 | Date | |
---|---|---|---|
1b97851c82 | |||
76bc0ba7ca | |||
0227ec7804 | |||
603c6ab8e4 | |||
3b881f5340 | |||
13e590d521 | |||
c77770989b | |||
ab4ad0db03 | |||
244ecd1208 | |||
7be20ea623 | |||
1c89240c75 | |||
1d448b4fc5 | |||
9857d5bfa9 | |||
bb0fad2b08 | |||
eae52eff2b | |||
db85d87701 | |||
4acf8139e9 | |||
316c75c672 | |||
77f18be63d | |||
aa338c3b00 | |||
78da7de4f5 | |||
84b4db7284 | |||
c628f09bf4 | |||
523b4559a3 | |||
632f0c07b0 | |||
42a8cd7013 | |||
daddb2f4f5 | |||
e51328e1ce | |||
8b3e84226c | |||
f57121c1c8 | |||
69d0b29476 | |||
66e493e847 | |||
e04df34623 | |||
a46df4d376 | |||
b942aa3206 | |||
0bd638b363 | |||
d2d03528e2 | |||
b4bec0f3ae | |||
6c2ea11dab | |||
13c2658955 |
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
README.md
|
||||
Dockerfile
|
||||
.git
|
63
.github/workflows/build-docker.yaml
vendored
Normal file
63
.github/workflows/build-docker.yaml
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
name: Create and publish a Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
|
||||
env:
|
||||
REGISTRY: git.spirirobotics.com
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
|
||||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
#
|
||||
steps:
|
||||
#- name: install docker
|
||||
# run: apt install moby-cli -y
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
submodules: true
|
||||
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.WORKFLOW_REGISTRY_TOKEN }}
|
||||
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
# - name: Set up QEMU
|
||||
# uses: docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
|
||||
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
|
||||
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
|
||||
- name: Build Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
env:
|
||||
#Hack for gitea/github weirdness.
|
||||
ACTIONS_RUNTIME_TOKEN: ''
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
22
.gitmodules
vendored
22
.gitmodules
vendored
@ -1,20 +1,16 @@
|
||||
[submodule "Jetpack"]
|
||||
path = Jetpack
|
||||
[submodule "source/Jetpack"]
|
||||
path = source/Jetpack
|
||||
url = https://git.spirirobotics.com/dchvs/Jetpack.git
|
||||
branch = cti-jetpack-4.2.2
|
||||
branch = master
|
||||
[submodule "source/drivers/li-mt9m021"]
|
||||
path = source/drivers/li-mt9m021
|
||||
url = https://git.spirirobotics.com/dchvs/li-mt9m021.git
|
||||
branch = master
|
||||
[submodule "CTI-L4T"]
|
||||
path = CTI-L4T
|
||||
url = https://git.spirirobotics.com/dchvs/CTI-L4T.git
|
||||
branch = 4.2.2/feature/install-script-on-level2-directory
|
||||
[submodule "li-mt9m021"]
|
||||
path = li-mt9m021
|
||||
url = https://git.spirirobotics.com/dchvs/li-mt9m021.git
|
||||
branch = master
|
||||
[submodule "mu_kernel_sources"]
|
||||
path = mu_kernel_sources
|
||||
url = https://git.spirirobotics.com/Spiri/mu_kernel_sources.git
|
||||
branch = jetpack-4.2.2-dev
|
||||
[submodule "eg25-g"]
|
||||
path = eg25-g
|
||||
[submodule "source/drivers/eg25-g"]
|
||||
path = source/drivers/eg25-g
|
||||
url = https://git.spirirobotics.com/dchvs/eg25-g.git
|
||||
branch = master
|
||||
|
2
CTI-L4T
2
CTI-L4T
@ -1 +1 @@
|
||||
Subproject commit 554c6d4c02eb1da17d73f2379407fcd67f1f8d21
|
||||
Subproject commit af2e8ef832d4e4b7efa2a8ce4aa710c8d87beff5
|
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
from --platform=linux/amd64 git.spirirobotics.com/spiri/tx2-flashing-tool:main as kernel-build
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y ripgrep
|
||||
|
||||
ADD ./source/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz /opt/gcc-linaro-7.3.1/
|
||||
ENV CROSS_COMPILE /opt/gcc-linaro-7.3.1/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
|
||||
|
||||
ENV LINUX_FOR_TEGRA /jetson/Linux_for_Tegra
|
||||
ENV KERNEL_LOCATION_FROM_BUILD_DIR ../../spiri-project/source/Jetpack/kernel/kernel-4.9/
|
||||
ENV KERNEL_LOCATION $KERNEL_LOCATION_FROM_BUILD_DIR
|
||||
|
||||
COPY ./ /jetson/Linux_for_Tegra/spiri-project
|
||||
|
||||
WORKDIR /jetson/Linux_for_Tegra/spiri-project/CTI-L4T/
|
||||
RUN ./install.sh
|
||||
|
||||
RUN mkdir -p /jetson/Linux_for_Tegra/builds/build_tx2/build
|
||||
|
||||
WORKDIR /jetson/Linux_for_Tegra/builds/build_tx2/
|
||||
RUN make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig
|
||||
RUN nice make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ CROSS_COMPILE=${CROSS_COMPILE} -j$(nproc --ignore 2) --output-sync=target zImage dtbs modules
|
||||
|
||||
#Fail if we're missing either of these kenel module
|
||||
RUN rg mt9m021 build/arch/arm64/boot/Image
|
||||
RUN rg eg25-g build/arch/arm64/boot/Image
|
||||
|
||||
RUN mkdir -p /build/boot/
|
||||
RUN mkdir -p /build/lib/modules/
|
||||
|
||||
FROM --platform=linux/arm64 scratch
|
||||
# FROM kernel-build
|
||||
|
||||
COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/Image /build/boot/spiriImage
|
||||
COPY --from=kernel-build /jetson/Linux_for_Tegra/builds/build_tx2/build/arch/arm64/boot/dts/tegra186-tx2-spiri-revF+.dtb /build/boot/
|
||||
COPY ./extlinux.conf /build/boot/extlinux/extlinux.conf
|
1
Jetpack
1
Jetpack
@ -1 +0,0 @@
|
||||
Subproject commit 1ea8207cd3f19b39dc436ec3e8c60c88eb8adb69
|
124
README.md
Normal file
124
README.md
Normal file
@ -0,0 +1,124 @@
|
||||
The installation consists on creating a build area locatated at:
|
||||
```bash
|
||||
Linux_for_Tegra/builds/build_<spiri>
|
||||
```
|
||||
From this directory you might call the targets ```tegra_defconfig, dtbs, Image, modules``` to compile the Kernel. Please, add your projects under builds/.
|
||||
|
||||
The Make targets gets sourced from the ```source/``` directory on the Jetpack workspace root, which is where this project Kernel sources are installed.
|
||||
* The ```-C``` flag for the make allows to change the directory where the Kernel source is.
|
||||
* The ```-O``` stands for the output of the build process files.
|
||||
* CROSS_COMPILE=${CROSS_COMPILE}, passes the C cross compiler. The recomended for this CTI release it's ```/opt/gcc-linaro-7.3.1/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-```.
|
||||
* The ```-jN```is the flag for the parallel jobs to build with. You can find it out at your host with the command `nproc`.
|
||||
|
||||
### 1. Download the Toolchain for crosscompiling
|
||||
```bash
|
||||
wget http://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
|
||||
sudo tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz -C /opt/gcc-linaro-7.3.1/
|
||||
|
||||
echo "export CROSS_COMPILE=/opt/gcc-linaro-7.3.1/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-" >> ~/.bashrc
|
||||
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### 2. Clone recursively the repository to the workspace's root to add the Jetpack+CTI 4.4.1 and Drivers MT9M021 and EG25-G
|
||||
```bash
|
||||
LINUX_FOR_TEGRA=<Linux_for_Tegra/ path>
|
||||
KERNEL_LOCATION_FROM_BUILD_DIR=../../spiri-project/source/Jetpack/kernel/kernel-4.9/
|
||||
KERNEL_LOCATION=$KERNEL_LOCATION_FROM_BUILD_DIR
|
||||
|
||||
cd $LINUX_FOR_TEGRA
|
||||
|
||||
git clone --recurse-submodules https://git.spirirobotics.com/dchvs/spiri-project.git
|
||||
cd spiri-project
|
||||
|
||||
git checkout master
|
||||
git submodule update --init --recursive --remote
|
||||
```
|
||||
|
||||
### 3. Install the CTI BSP
|
||||
```bash
|
||||
cd CTI-L4T/
|
||||
sudo ./install.sh
|
||||
```
|
||||
|
||||
### 4. Build the Spiri cameras project Kernel
|
||||
```bash
|
||||
cd $LINUX_FOR_TEGRA/
|
||||
|
||||
mkdir -p builds/build_<this build name> && cd builds/build_<this build name>
|
||||
mkdir build
|
||||
|
||||
# Create the Kernel configuration file
|
||||
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig
|
||||
```
|
||||
```bash
|
||||
# Check for the Drivers with the "spiri" keyword
|
||||
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ menuconfig
|
||||
```
|
||||
|
||||
By default the Drivers are installed, the tegra_defconfig include them as:
|
||||
```CONFIG_VIDEO_I2C_SPIRI_CAM=y```
|
||||
```CONFIG_VIDEO_I2C_SPIRI_GSM=y```
|
||||
You can review it on the Kernel Menuconfig, and find it out in the following paths:
|
||||
```bash
|
||||
+----------------+ +--------------------+ +-------------------------------------------------------------------+ +-------------------------------------+
|
||||
| Device Drivers | --> | Multimedia support | --> | NVIDIA overlay Encoders, decoders, sensors and other helper chips | --> | Spiri MT9M021 camera sensor support |
|
||||
+----------------+ +--------------------+ +-------------------------------------------------------------------+ +-------------------------------------+
|
||||
|
||||
+----------------+ +------------------------+ +----------------------+ +----------------------+
|
||||
| Device Drivers | --> | Network device support | --> | USB Network Adapters | --> | USB Network Adapters |
|
||||
+----------------+ +------------------------+ +----------------------+ +----------------------+
|
||||
```
|
||||
|
||||
```bash
|
||||
# Build the Kernel, DTBs and modules
|
||||
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ CROSS_COMPILE=${CROSS_COMPILE} -j8 --output-sync=target zImage dtbs modules
|
||||
```
|
||||
|
||||
The deployed Kernel binaries after compilation could check if it has the Drivers in it, inspecting on it with rgrep:
|
||||
```bash
|
||||
rgrep mt9m021 build/arch/arm64/boot/Image
|
||||
rgrep eg25-g build/arch/arm64/boot/Image
|
||||
```
|
||||
|
||||
### 5. Flash the Spiri Mu
|
||||
Once the Kernel it's compiled, the output binaries should get installed on the Jetpack workspace, letting the flash scripts deploy them into the target device. The update for the flash scripts deployment it's ilustrated as follows:
|
||||
|
||||
```bash
|
||||
# Location for the Kernel files to be found by Tegra flash.sh script in full image installation
|
||||
+------------------------------------+ +---------------------+
|
||||
| build/arch/arm64/boot/Image | --> | kernel/Image |
|
||||
+------------------------------------+ +---------------------+
|
||||
+------------------------------------+ +---------------------+
|
||||
| build/arch/arm64/boot/dts/* | --> | kernel/dtb/ |
|
||||
+------------------------------------+ +---------------------+
|
||||
+------------------------------------+ +---------------------+
|
||||
| modules/lib/modules/4.9.140-tegra/ | --> | rootfs/lib/modules/ |
|
||||
+------------------------------------+ +---------------------+
|
||||
```
|
||||
|
||||
```
|
||||
# Add the Kernel files for full image installation
|
||||
|
||||
# Install the Kernel Image and DTBs
|
||||
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ kernel_install INSTALL_PATH=$PWD/../../kernel/
|
||||
|
||||
# Install the Drivers modules
|
||||
sudo make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ modules_install INSTALL_MOD_PATH=$PWD/../../rootfs/
|
||||
```
|
||||
|
||||
In order to flash the target device, do the following commands from the workspace's root:
|
||||
|
||||
```bash
|
||||
cd $LINUX_FOR_TEGRA/
|
||||
|
||||
# Full OS installation
|
||||
sudo ./flash.sh jetson-tx2 mmcblk0p1
|
||||
|
||||
# Device tree installation
|
||||
sudo ./flash.sh -r -k kernel-dtb -d kernel/dtb/tegra186-tx2-spiri-revF+.dtb jetson-tx2 mmcblk0p1
|
||||
|
||||
# Kernel image installation
|
||||
sudo ./flash.sh -r -k kernel -K kernel/Image jetson-tx2 mmcblk0p1
|
||||
|
||||
```
|
BIN
doc/spiri_cameras_architecture_diagram_v0.2.0.jpeg
Normal file
BIN
doc/spiri_cameras_architecture_diagram_v0.2.0.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 108 KiB |
1
eg25-g
1
eg25-g
@ -1 +0,0 @@
|
||||
Subproject commit 480df7a9f40a98df7355970373aed26792c74e1c
|
12
extlinux.conf
Normal file
12
extlinux.conf
Normal file
@ -0,0 +1,12 @@
|
||||
TIMEOUT 2
|
||||
DEFAULT primary
|
||||
|
||||
MENU TITLE L4T boot options
|
||||
|
||||
LABEL primary
|
||||
MENU LABEL primary kernel
|
||||
LINUX /boot/spiriImage
|
||||
FDT /boot/tegra186-tx2-spiri-revF+.dtb
|
||||
INITRD /boot/initrd
|
||||
APPEND ${cbootargs} quiet
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 0a2227bfb57d57057607b1c063c0e74d4728fa15
|
@ -1 +0,0 @@
|
||||
Subproject commit 7fa28fcfc45b5eaf96a60e9baf193bc47637ede6
|
1
source/.gitattributes
vendored
Normal file
1
source/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz filter=lfs diff=lfs merge=lfs -text
|
1
source/Jetpack
Submodule
1
source/Jetpack
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 10faeae40c2ec8147da5dc141ba5f0d5ceafed37
|
1
source/drivers/eg25-g
Submodule
1
source/drivers/eg25-g
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 771948b95dcd4ffb14abf0eb3cbf5f103e89c364
|
1
source/drivers/li-mt9m021
Submodule
1
source/drivers/li-mt9m021
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a324c5b05e26adeab2d48bbcac04b7ba534415fc
|
BIN
source/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
(Stored with Git LFS)
Normal file
BIN
source/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user