Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions configs/AM62LX/AM62LX_debian_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@

Replacement Variables
---------------------
'__PART_FAMILY_NAME__' : 'AM62LX'
'__PART_FAMILY_DEVICE_NAMES__' : 'AM62LX'
'__PART_FAMILY_NAME__' : 'AM62Lx'
'__PART_FAMILY_DEVICE_NAMES__' : 'AM62Lx'
'__PRODUCT_LINE_NAME__' : 'Sitara MPU'
'__SDK_BUILD_MACHINE__' : 'am62lxx-evm'
'__SDK_FULL_NAME__' : 'Debian for AM62L'
'__SDK_FULL_NAME__' : 'Debian for AM62Lx'
'__SDK_SHORT_NAME__' : 'Debian'
'__SDK_DOWNLOAD_URL__' : '`AM62L-SDK-Download-page <https://www.ti.com/tool/AM62L-PROCESSOR-SDK>`__'
'__SDK_DOWNLOAD_URL__' : '`AM62Lx-SDK-Download-page <https://www.ti.com/tool/AM62L-PROCESSOR-SDK>`__'
'__LINUX_UBUNTU_VERSION_LONG__' : '22.04 (64-bit)'
'__LINUX_UBUNTU_VERSION_SHORT__' : '22.04'
'__OPTEE_PLATFORM_FLAVOR__' : 'k3-am62lx'

Configuration Values
--------------------
Expand Down
4 changes: 2 additions & 2 deletions configs/AM62LX/AM62LX_debian_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
fam_name = 'AM62LX'

# Project name and HTML title
project = u'Debian for AM62LX'
html_title = 'Debian AM62LX Documentation'
project = u'Debian for AM62Lx'
html_title = 'Debian AM62Lx Documentation'

# The master toctree document.
master_doc = 'devices/AM62LX/debian/index'
2 changes: 2 additions & 0 deletions configs/AM62LX/AM62LX_debian_toc.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devices/AM62LX/debian/index

debian/Overview
devices/AM62LX/linux/Release_Specific
devices/AM62LX/linux/Release_Specific_Release_Notes
devices/AM62LX/debian/Getting_Started_Guide
debian/Building_Debian_Image
debian/Building_Debian_Packages
Expand Down
3 changes: 2 additions & 1 deletion configs/AM62PX/AM62PX_debian_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ Replacement Variables
'__PART_FAMILY_NAME__' : 'AM62Px'
'__PART_FAMILY_DEVICE_NAMES__' : 'AM62Px'
'__PRODUCT_LINE_NAME__' : 'Sitara MPU'
'__SDK_BUILD_MACHINE__' : 'am62xx-evm'
'__SDK_BUILD_MACHINE__' : 'am62pxx-evm'
'__SDK_FULL_NAME__' : 'Debian for AM62Px'
'__SDK_SHORT_NAME__' : 'Debian'
'__SDK_DOWNLOAD_URL__' : '`AM62Px-SDK-Download-page <https://www.ti.com/tool/PROCESSOR-SDK-AM62P>`__'
'__LINUX_UBUNTU_VERSION_LONG__' : '22.04 (64-bit)'
'__LINUX_UBUNTU_VERSION_SHORT__' : '22.04'
'__OPTEE_PLATFORM_FLAVOR__' : 'k3-am62px'

Configuration Values
--------------------
Expand Down
2 changes: 2 additions & 0 deletions configs/AM62PX/AM62PX_debian_toc.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devices/AM62PX/debian/index

debian/Overview
devices/AM62PX/linux/Release_Specific
devices/AM62PX/linux/Release_Specific_Release_Notes
devices/AM62PX/debian/Getting_Started_Guide
debian/Building_Debian_Image
debian/Building_Debian_Packages
Expand Down
2 changes: 2 additions & 0 deletions configs/AM62X/AM62X_debian_toc.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devices/AM62X/debian/index

debian/Overview
devices/AM62X/linux/Release_Specific
devices/AM62X/linux/Release_Specific_Release_Notes
devices/AM62X/debian/Getting_Started_Guide
debian/Building_Debian_Image
debian/Building_Debian_Packages
Expand Down
2 changes: 2 additions & 0 deletions configs/AM64X/AM64X_debian_toc.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
devices/AM64X/debian/index

debian/Overview
devices/AM64X/linux/Release_Specific
devices/AM64X/linux/Release_Specific_Release_Notes
devices/AM64X/debian/Getting_Started_Guide
debian/Building_Debian_Image
debian/Building_Debian_Packages
Expand Down
113 changes: 65 additions & 48 deletions source/debian/Building_Debian_Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
============

Texas Instruments uses the **Armbian** build framework to generate Debian images for its platforms.
*Armbian* describes itself to be a "base operating system"; that is, a build framework used to build
Armbian describes itself to be a "base operating system"; that is, a build framework used to build
Linux images optimized for Single-Board Computers.

|__SDK_DOWNLOAD_URL__| provides Debian images, but users can also build these, especially if users
Expand All @@ -22,8 +22,9 @@
Get Armbian
-----------

For the time being, TI's fork of Armbian maintains support for TI platforms. Therefore, the first
step is to fetch TI's fork:
For the time being, `TI's fork <https://github.com/TexasInstruments/armbian-build.git>`__ of
`Armbian/build <https://github.com/armbian/build.git>`__ maintains support for TI platforms.
Therefore, the first step is to fetch TI's fork:

.. code-block:: console

Expand All @@ -32,75 +33,91 @@
Repository Structure
--------------------

There are 4 files and directories of relevance to this high-level overview:
The following files and directories are relevant to this high-level overview:

- :file:`configs/`: This directory has configurations for boards, families, kernel configurations,
desktop or CLI environments and so on. To find configuration files relevant to TI, see:
- :file:`config/`: This directory has configurations for boards, families, kernel configurations,
desktop or CLI environments and so on. To find configuration files relevant to TI, see:

- :file:`configs/sources/families/k3.conf`
- :file:`configs/kernel/linux-k3-current.conf`
- :file:`configs/kernel/linux-k3-rt-current.conf`
- :file:`config/boards/<TI EVM board>.conf`

Check warning on line 41 in source/debian/Building_Debian_Image.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'EVM') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message": "[RedHat.Definitions] Define acronyms and abbreviations (such as 'EVM') on first occurrence if they're likely to be unfamiliar.", "location": {"path": "source/debian/Building_Debian_Image.rst", "range": {"start": {"line": 41, "column": 31}}}, "severity": "INFO"}
- :file:`config/sources/families/k3.conf`
- :file:`config/kernel/linux-k3-current.conf`

Check warning on line 43 in source/debian/Building_Debian_Image.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'.", "location": {"path": "source/debian/Building_Debian_Image.rst", "range": {"start": {"line": 43, "column": 27}}}, "severity": "WARNING"}
- :file:`config/kernel/linux-k3-rt-current.conf`

Check warning on line 44 in source/debian/Building_Debian_Image.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'.", "location": {"path": "source/debian/Building_Debian_Image.rst", "range": {"start": {"line": 44, "column": 27}}}, "severity": "WARNING"}

- :file:`compile.sh`: This is the script that the user should run for building Armbian images.
- :file:`compile.sh`: This is the script that the user should run for building Armbian images.

- :file:`lib/`: This directory stores the scripts that do most of the work in building Armbian images.
- :file:`lib/`: This directory stores the scripts that do most of the work in building Armbian images.

- :file:`extensions/`: This directory has files that define **extension hooks**. In Armbian, *extension
hooks* are function signatures, which the build framework calls in the process of building an
image. However, the build framework does not define these in ``lib/``. Users can define these
functions and integrate custom steps in the build process. TI has ``extensions/ti-debpkgs.sh``
extension file. To customize the build process, create a new file in this directory, and define
your extension hooks there. Once the file is created, be sure to add the following line to
board/family config file:
- :file:`extensions/`: This directory has files that define **extension hooks**. In Armbian, extension
hooks are function signatures, which the build framework calls in the process of building an
image. However, the build framework does not define these in ``lib/``. Users can define these
functions and integrate custom steps in the build process. TI has ``extensions/ti-debpkgs.sh``
extension file. To customize the build process, create a new file in this directory, and define
your extension hooks there. Once the file is created, be sure to add the following line to
board/family config file:

.. code-block:: console

enable_extension <extension_name>

- :file:`userpatches/`: This directory stores files that define build parameters, user patches and so on.
- :file:`userpatches/`: This directory stores files that define build parameters, user patches and so on.

Building Images
---------------

Armbian supports an interactive build process. To build interactively, go to TI's Armbian fork you
cloned, and use the following command:
Armbian supports both an interactive UI and a noninteractive build process.

.. code-block:: console
.. note::

./compile.sh
This build guide has been tested on an x86 host machine running Ubuntu 22.04. The Armbian :file:`compile.sh` script

Check warning on line 71 in source/debian/Building_Debian_Image.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.TermsSuggestions] Depending on the context, consider using '64-bit x86' or 'x86_64' rather than 'x86'. Raw Output: {"message": "[RedHat.TermsSuggestions] Depending on the context, consider using '64-bit x86' or 'x86_64' rather than 'x86'.", "location": {"path": "source/debian/Building_Debian_Image.rst", "range": {"start": {"line": 71, "column": 43}}}, "severity": "INFO"}
builds in an ARM64 docker container. Ensure the following packages are installed:

Check warning on line 72 in source/debian/Building_Debian_Image.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.PassiveVoice] 'are installed' is passive voice. In general, use active voice. Consult the style guide for acceptable use of passive voice. Raw Output: {"message": "[RedHat.PassiveVoice] 'are installed' is passive voice. In general, use active voice. Consult the style guide for acceptable use of passive voice.", "location": {"path": "source/debian/Building_Debian_Image.rst", "range": {"start": {"line": 72, "column": 71}}}, "severity": "INFO"}

The build framework will then display dialog boxes. The user can use this to select the board, CLI
or desktop environment, kernel configurations and so on.
.. code-block:: console

To build the image non-interactively, specify all required **Build Switches** in the command:
sudo apt update
sudo apt install docker.io qemu qemu-user-static binfmt-support

.. code-block:: console
- To build interactively:

./compile.sh [command] [switch...] [command...]
.. code-block:: console

A full list of build switches is available at `Build Switches <https://docs.armbian.com/Developer-Guide_Build-Switches/>`__.
./compile.sh

For example, the following command builds the minimal non-RT Trixie image:
The build framework will then display dialog boxes. The user can use this to select the board, CLI
or desktop environment, kernel configurations and so on.

.. code-block:: console
- To build non-interactively:

.. code-block:: console

./compile.sh [command] [switch...] [command...]

A full list of build switches is available at `Build Switches <https://docs.armbian.com/Developer-Guide_Build-Switches/>`__.

.. warning::

If build issues arise, try adding these build switches to the end of the build command:

.. code-block:: console

GIT_SKIP_SUBMODULES=yes SKIP_ARMBIAN_REPO=yes

For example, the following command builds the minimal non-RT Trixie image:

.. code-block:: console

./compile.sh build BOARD=<board> BRANCH=current BUILD_MINIMAL=yes KERNEL_CONFIGURE=no RELEASE=trixie GIT_SKIP_SUBMODULES=yes SKIP_ARMBIAN_REPO=yes

For a list of boards and branches supported by each SoC, refer:

.. csv-table::
:header: "SoC", "Board", "Board Config File", "Branch"

./compile.sh build BOARD=<target> BRANCH=current BUILD_MINIMAL=yes KERNEL_CONFIGURE=no RELEASE=trixie SKIP_ARMBIAN_REPO=yes

For a list of targets corresponding to each board, refer:

+------------------------------+--------------+
| Board | Target |
+==============================+==============+
| AM62P | sk-am62p |
+------------------------------+--------------+
| AM62x | sk-am62b |
+------------------------------+--------------+
| AM62-LP | sk-am62-lp |
+------------------------------+--------------+
| AM62SIP | sk-am62-sip |
+------------------------------+--------------+
| AM64x | sk-am64b |
+------------------------------+--------------+
AM62Lx,am62lxx-evm,``config/boards/am62lxx-evm.conf``,"current, current-rt, edge"
AM62Px,am62pxx-evm,``config/boards/am62pxx-evm.conf``,"current, current-rt, edge"
AM62x,sk-am62b,``config/boards/sk-am62b.conf``,"current, edge"
AM62-LP,sk-am62-lp,``config/boards/sk-am62-lp.conf``,"current, current-rt, edge"
AM62SIP,sk-am62-sip,``config/boards/sk-am62-sip.conf``,"current, current-rt, edge"
AM64x,sk-am64b,``config/boards/sk-am64b.conf``,"current, edge"


``output/images/`` stores the built images. These images have a ``.img`` extension.
78 changes: 40 additions & 38 deletions source/debian/Building_Debian_Packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,94 @@
Building Debian Packages
========================

`Debian-Repos <https://github.com/TexasInstruments/debian-repos>`__ is a set of scripts to build TI's Debian packages with a single command.
`debian-repos <https://github.com/TexasInstruments/debian-repos>`__ is a set of scripts to build TI's Debian packages with a single command.

The generation of a Debian package from a binary or source involves many steps such as, obtaining the source code in tar (compressed) format, generating template files, modifying template file. The host build system and host build environment variables should also be configured.

The `run.sh` script handles these steps, thus the building of a deb package for TI's packages is as simple as running `run.sh` with the desired package's name.
The :file:`run.sh` script handles these steps. Therefore, the building of a deb package for TI's packages is as simple as running :file:`run.sh` with the package's name as a command line argument.

This repository is useful to the following audience:

1. Potential package contributors who want to fix bugs or add enhancements to TI packages.
2. Users who want to create a new package with the latest changes or customizations.
3. Anyone who wants to study Debian packaging.
- Potential package contributors who want to fix bugs or add enhancements to TI packages.
- Users who want to create a new package with the latest changes or customizations.
- Anyone who wants to study Debian packaging.

Structure
=========

The `run.sh` file is the "main" script that should be run. It takes as argument the name of the package to be built.
The :file:`run.sh` file is the "main" script. It takes as argument the name of the package to build.

Each TI package has a corresponding directory, named after its source package. Within this directory exists the `suite/<distro-variant>/debian/` path. All Debian related files (`control`, `rules`, man pages etc) for the package are located here.
Each TI package has a corresponding directory, named after its source package. Within this directory exists the :file:`suite/<distro-variant>/debian/` path. All Debian related files (:file:`control`, :file:`rules`, man pages etc) for the package are located here.

Check warning on line 22 in source/debian/Building_Debian_Packages.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.PassiveVoice] 'are located' is passive voice. In general, use active voice. Consult the style guide for acceptable use of passive voice. Raw Output: {"message": "[RedHat.PassiveVoice] 'are located' is passive voice. In general, use active voice. Consult the style guide for acceptable use of passive voice.", "location": {"path": "source/debian/Building_Debian_Packages.rst", "range": {"start": {"line": 22, "column": 247}}}, "severity": "INFO"}

Check warning on line 22 in source/debian/Building_Debian_Packages.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.TermsWarnings] Consider using 'and so on' rather than 'etc' unless updating existing content that uses the term. Raw Output: {"message": "[RedHat.TermsWarnings] Consider using 'and so on' rather than 'etc' unless updating existing content that uses the term.", "location": {"path": "source/debian/Building_Debian_Packages.rst", "range": {"start": {"line": 22, "column": 226}}}, "severity": "WARNING"}

Check warning on line 22 in source/debian/Building_Debian_Packages.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.TermsSuggestions] Depending on the context, consider using 'distribution' rather than 'distro'. Raw Output: {"message": "[RedHat.TermsSuggestions] Depending on the context, consider using 'distribution' rather than 'distro'.", "location": {"path": "source/debian/Building_Debian_Packages.rst", "range": {"start": {"line": 22, "column": 127}}}, "severity": "INFO"}

Check warning on line 22 in source/debian/Building_Debian_Packages.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.UserReplacedValues] Separate words by underscores in user-replaced values. Raw Output: {"message": "[RedHat.UserReplacedValues] Separate words by underscores in user-replaced values.", "location": {"path": "source/debian/Building_Debian_Packages.rst", "range": {"start": {"line": 22, "column": 126}}}, "severity": "INFO"}

There also exists a `<package-name>/version.sh` file. This file is sourced by `run.sh`.
There also exists a :file:`<package-name>/version.sh` file. This file is sourced by :file:`run.sh`.

Check warning on line 24 in source/debian/Building_Debian_Packages.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.UserReplacedValues] Separate words by underscores in user-replaced values. Raw Output: {"message": "[RedHat.UserReplacedValues] Separate words by underscores in user-replaced values.", "location": {"path": "source/debian/Building_Debian_Packages.rst", "range": {"start": {"line": 24, "column": 28}}}, "severity": "INFO"}

Setting Up Host for the build
=============================

The `debian-repos` only support native compilation of packages. Hence, the build has to be done either on the ARM64 Target or ARM64 Docker Container or ARM64 Chroot Environment.
`debian-repos <https://github.com/TexasInstruments/debian-repos>`__ only supports native compilation of packages. Therefore, the build has to be done either on the ARM64 target or an ARM64 Docker Container.

When running on native ARM64 target, no additional setup is required. Proceed with Building the Package.

To setup and run an ARM64 Docker, run the following commands:
To setup and run an ARM64 Docker Container, run the following commands:

.. code-block::

# Setup Qemu multiarch support
sudo apt-get install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# Setup Qemu multiarch support
sudo apt install qemu binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

# Run ARM64 Container
docker pull ghcr.io/texasinstruments/debian-arm64:latest
docker run --rm -it ghcr.io/texasinstruments/debian-arm64:latest
# Run ARM64 Container
docker pull ghcr.io/texasinstruments/debian-arm64:latest
docker run --rm -it ghcr.io/texasinstruments/debian-arm64:latest bash

Building the Package
====================

Clone `debian-repos <https://github.com/TexasInstruments/debian-repos>`__
#. Clone `debian-repos <https://github.com/TexasInstruments/debian-repos>`__:

.. code-block::
.. code-block::

git clone https://github.com/TexasInstruments/debian-repos.git
cd debian-repos
git clone https://github.com/TexasInstruments/debian-repos.git
cd debian-repos

To build a package, the syntax is:
#. Build package:

.. code-block::
.. code-block::

./run.sh <package-name>
./run.sh <package-name>

This command carries out all the necessary steps to build the package including installation of package-specific dependencies. The package and all related files are then stored in `build/<package-name>`.
.. note::

For example: to build `ti-linux-kernel`, the command is:
This command carries out all the necessary steps to build the package including installation of package-specific dependencies.
The package and all related files are then stored in :file:`build/<package-name>`.

.. code-block::
For example: to build :file:`ti-linux-kernel`, the command is:

.. code-block::

./run.sh ti-linux-kernel
./run.sh ti-linux-kernel

The output is then found in `build/ti-linux-kernel/`.
The output is then found in :file:`build/ti-linux-kernel/`.

Adding Packages
===============

To add a package, follow the following steps:

1. Create nested directories as follows:
#. Create directory structure:

.. code-block::

mkdir -p <proj-name>/suite/<distro-variant>/debian/
.. code-block::

2. Copy all ``debian/`` specific files that are relevant to building the package:
mkdir -p <proj-name>/suite/<distro-variant>/debian/

.. code-block::
#. Copy all :file:`debian/` specific files that are relevant to building the package:

cp /path/to/debian/* -r <proj-name>/suite/<distro-variant>/debian/
.. code-block::

3. In ``<proj-name>/``, create the ``version.sh`` file. The file must export the following variables:
cp /path/to/debian/* -r <proj-name>/suite/<distro-variant>/debian/

.. code-block::
#. In :file:`<proj-name>/`, create the :file:`version.sh` file. The file must export the following variables:

git_repo # link from which to clone
.. code-block::

git_repo # link from which to clone
Loading
Loading