Compare commits

..

45 Commits

Author SHA1 Message Date
1b97851c82 Use proper kernel name. 2024-02-02 17:13:27 -04:00
76bc0ba7ca Fix kernel module path 2024-02-02 16:12:33 -04:00
0227ec7804 Build faster, include modules 2024-02-02 16:03:30 -04:00
603c6ab8e4 More minor tweaks to github workflows 2024-02-02 13:30:00 -04:00
3b881f5340 Build on arm64 obviously 2024-02-02 13:18:03 -04:00
13e590d521 Update workflow to pull submodules 2024-02-02 12:58:40 -04:00
c77770989b Bumped readme to trigger a build, sorry 2024-02-02 12:42:09 -04:00
ab4ad0db03 Building in a docker container for easy linking to tx2-rootfs 2024-02-02 12:39:51 -04:00
244ecd1208 Update MT9M021 submodule to v0.2.6 2021-04-05 08:32:48 -06:00
7be20ea623 Update MT9M021 submodule to v0.2.5 2021-04-05 08:18:24 -06:00
1c89240c75 Update MT9M021 submodule to v0.2.4 2021-03-29 12:58:15 -06:00
1d448b4fc5 Update MT9M021 submodule to v0.2.3 2021-03-26 17:39:01 -06:00
9857d5bfa9 Update MT9M021 submodule to v0.2.1 2021-03-25 10:56:19 -06:00
bb0fad2b08 Update MT9M021 submodule to v0.2.1 2021-03-25 10:15:07 -06:00
eae52eff2b Update MT9M021 submodule to v0.2.0 2021-03-19 19:02:04 -06:00
db85d87701 Update submodules commits on Master branches to v0.1.0 releases 2021-03-17 17:55:44 -06:00
4acf8139e9 documentation: Update README 2021-03-17 17:43:06 -06:00
316c75c672 Update submodules to follow Master 2021-03-17 17:02:40 -06:00
77f18be63d Update CTI BSP submodule to v0.1.0 2021-03-17 10:24:09 -06:00
aa338c3b00 Merge pull request 'Update EG25-G Driver & Jetpack submodules to v0.1.0' (#9) from 4.4.1/tx2-cti/fix-ae-issue into master
Reviewed-on: #9
2021-03-16 04:54:57 +00:00
78da7de4f5 Update EG25-G Driver & Jetpack submodules to v0.1.0 2021-03-15 22:52:52 -06:00
84b4db7284 Merge pull request '4.4.1/tx2-cti/fix-ae-issue' (#8) from 4.4.1/tx2-cti/fix-ae-issue into master
Reviewed-on: #8
2021-03-04 12:36:20 +00:00
c628f09bf4 documentation: Update README on Kernel & DTBs installation 2021-03-04 06:27:47 -06:00
523b4559a3 Update MT9M021 Driver submodule 2021-03-04 06:27:47 -06:00
632f0c07b0 Update Jetpack submodule 2021-03-04 02:54:42 -06:00
42a8cd7013 Merge pull request '4.4.1/tx2-cti/cam-gsm-drivers-dev' (#6) from 4.4.1/tx2-cti/cam-gsm-drivers-dev into master
Reviewed-on: #6
2021-02-20 05:03:47 +00:00
daddb2f4f5 documentation: Add REAME 2021-02-19 23:00:33 -06:00
e51328e1ce documentation: Add architecture diagram 2021-02-19 23:00:33 -06:00
8b3e84226c Add EG25-G Driver submodule 2021-02-19 23:00:33 -06:00
f57121c1c8 Add CTI BSP submodule 2021-02-19 23:00:33 -06:00
69d0b29476 Add MT9M021 Driver submodule 2021-02-19 23:00:33 -06:00
66e493e847 Add Jetpack submodule
Update repository organization
2021-02-19 23:00:33 -06:00
e04df34623 Merge pull request '4.4.1/tx2-cti/camera-driver-dev' (#1) from 4.4.1/tx2-cti/camera-driver-dev into master
Reviewed-on: #1
2021-02-12 01:04:57 +00:00
a46df4d376 Add doc tree 2021-02-11 19:01:20 -06:00
b942aa3206 Update li-mt9m021 Driver branch to 4.4.1 2021-02-11 19:01:20 -06:00
0bd638b363 Update submodules commits 2021-02-11 19:01:20 -06:00
d2d03528e2 Remove mu_kernel_sources submodule 2021-02-11 19:01:20 -06:00
b4bec0f3ae Update CTI-L4T BSP sources to 4.4.1 2021-02-11 19:01:20 -06:00
6c2ea11dab Update Jetpack to 4.4.1 2021-02-11 19:01:20 -06:00
13c2658955 Add README file 2021-02-11 19:01:20 -06:00
c4ffee64ef Add eg25-g driver submodule 2021-01-25 15:15:51 -06:00
0276e9a551 Add Spiri sources submodule 2021-01-25 15:12:23 -06:00
b662e4703c Add li-mt9m021 driver submodule 2021-01-25 15:04:53 -06:00
9cddb7fe49 Add CTI-L4T BSP sources 2021-01-25 14:57:21 -06:00
df5450a264 Add Jetpack-CTI sources 2021-01-25 14:55:09 -06:00
11 changed files with 145 additions and 29 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
README.md
Dockerfile
.git

63
.github/workflows/build-docker.yaml vendored Normal file
View 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 }}

8
.gitmodules vendored
View File

@ -1,16 +1,16 @@
[submodule "source/Jetpack"]
path = source/Jetpack
url = https://git.spirirobotics.com/dchvs/Jetpack.git
branch = cti-jetpack-4.4.1
branch = master
[submodule "source/drivers/li-mt9m021"]
path = source/drivers/li-mt9m021
url = https://git.spirirobotics.com/dchvs/li-mt9m021.git
branch = jetpack-4.4.1
branch = master
[submodule "CTI-L4T"]
path = CTI-L4T
url = https://git.spirirobotics.com/dchvs/CTI-L4T.git
branch = 4.4.1/feature/install-script-on-level2-directory
branch = master
[submodule "source/drivers/eg25-g"]
path = source/drivers/eg25-g
url = https://git.spirirobotics.com/dchvs/eg25-g.git
branch = 4.4.1/tx2-cti/quectel-module
branch = master

36
Dockerfile Normal file
View 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

View File

@ -1,5 +1,4 @@
The installation consists on creating a build area locatated at:
```bash
Linux_for_Tegra/builds/build_<spiri>
```
@ -24,10 +23,14 @@ 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
```
@ -43,14 +46,14 @@ sudo ./install.sh
cd $LINUX_FOR_TEGRA/
mkdir -p builds/build_<this build name> && cd builds/build_<this build name>
mkdir build modules
mkdir build
# Create the Kernel configuration file
make -C ../../spiri-project/source/Jetpack/kernel/kernel-4.9/ ARCH=arm64 O=$PWD/build/ tegra_defconfig
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ tegra_defconfig
```
```bash
# Check for the Drivers with the "spiri" keyword
make -C ../../spiri-project/source/Jetpack/kernel/kernel-4.9/ ARCH=arm64 O=$PWD/build/ menuconfig
make -C $KERNEL_LOCATION ARCH=arm64 O=$PWD/build/ menuconfig
```
By default the Drivers are installed, the tegra_defconfig include them as:
@ -69,8 +72,7 @@ You can review it on the Kernel Menuconfig, and find it out in the following pat
```bash
# Build the Kernel, DTBs and modules
make -C ../../spiri-project/source/Jetpack/kernel/kernel-4.9/ ARCH=arm64 O=$PWD/build/ CROSS_COMPILE=${CROSS_COMPILE} -j8 --output-sync=target zImage dtbs modules
make -C ../../spiri-project/source/Jetpack/kernel/kernel-4.9/ ARCH=arm64 O=$PWD/build/ modules_install INSTALL_MOD_PATH=$PWD/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:
@ -84,29 +86,25 @@ Once the Kernel it's compiled, the output binaries should get installed on the J
```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/ |
+-----------------------------+ +-------------+
+------------------------------------+ +---------------------+
| build/arch/arm64/boot/Image | --> | kernel/Image |
+------------------------------------+ +---------------------+
+------------------------------------+ +---------------------+
| build/arch/arm64/boot/dts/* | --> | kernel/dtb/ |
+------------------------------------+ +---------------------+
+------------------------------------+ +---------------------+
| modules/lib/modules/4.9.140-tegra/ | --> | rootfs/lib/modules/ |
+------------------------------------+ +---------------------+
```
```
# Backup the default Kernel
cp -r ../../kernel/dtb/ ../../kernel/backup_dtb/
cp ../../kernel/Image ../../kernel/backup_Image
sudo mv ../../rootfs/lib/modules/4.9.140-tegra/ ../../rootfs/lib/modules/backup_4.9.140-tegra/
# Add the Kernel files for full image installation
cp build/arch/arm64/boot/dts/* ../../kernel/dtb/
cp build/arch/arm64/boot/Image ../../kernel/
sudo make -C ../../spiri-project/source/Jetpack/kernel/kernel-4.9/ ARCH=arm64 O=$PWD/build/ modules_install INSTALL_MOD_PATH=$PWD/../../rootfs/
# 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:

12
extlinux.conf Normal file
View 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
source/.gitattributes vendored Normal file
View 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 +1 @@
Subproject commit 95c069085f35530c71e4d216cbb298a917532e4b
Subproject commit 10faeae40c2ec8147da5dc141ba5f0d5ceafed37

@ -1 +1 @@
Subproject commit 8ef1521acd107421302ce1c39dbf3b15e9c69da4
Subproject commit 771948b95dcd4ffb14abf0eb3cbf5f103e89c364

@ -1 +1 @@
Subproject commit 14da17d421c75dcbb9731c7a5bf103fdddf7e154
Subproject commit a324c5b05e26adeab2d48bbcac04b7ba534415fc

Binary file not shown.