Skip to content

Commit 2cf3746

Browse files
jsuhaas22StaticRocket
authored andcommitted
feat(debian): Armbian-ize Debian docs for all platforms
Instead of building TI Debian images with ti-bdebstrap, we are now using Armbian. In e571245 ("feat(debian): AM62LX: Armbian-ize Debian docs for AM62L"), changes were made to migrate AM62L docs to Armbian from ti-bdebstrap. At the time of that commit, changes were specific to AM62L only since the other boards were still at Debian. With 11.01 release, all platforms will use Debian built from the Armbian build framework. Therefore, generalize that information. Specifically, do the following: * Remove references to ti-bdebstrap. * Explain the difference between Armbian and Debian briefly. * Move sources/devices/AM62LX/debian/Building_Debian_Image.rst to sources/debian/, and delete the file of the same name from the latter path. The new file was originally written for AM62L, and thus was placed in that directory, but is now (after a few changes also made in this commit) applicable to all platforms. * Do some formatting. Signed-off-by: Suhaas Joshi <[email protected]>
1 parent 60bfdc3 commit 2cf3746

File tree

9 files changed

+110
-319
lines changed

9 files changed

+110
-319
lines changed

.github/styles/config/vocabularies/PSDK/accept.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ balenaEtcher
2525
Armbian
2626
Debian
2727
Weston
28+
Trixie
29+
mmdebstrap
30+
bdebstrap

configs/AM62LX/AM62LX_debian_toc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ devices/AM62LX/debian/index
22

33
debian/Overview
44
devices/AM62LX/debian/Getting_Started_Guide
5-
devices/AM62LX/debian/Building_Debian_Image
5+
debian/Building_Debian_Image
66
debian/Building_Debian_Packages
77
debian/How_to_Guides/index_How_to_Guides
88
linux/How_to_Guides/Target/How_To_Enable_M2CC3301_in_linux
Lines changed: 62 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1,236 +1,106 @@
1-
======================
2-
Building Debian Images
3-
======================
1+
====================================
2+
Building Debian Images Using Armbian
3+
====================================
44

55
Introduction
66
============
77

8-
Building a Debian Image requires:
8+
Texas Instruments uses the **Armbian** build framework to generate Debian images for its platforms.
9+
*Armbian* describes itself to be a "base operating system"; that is, a build framework used to build
10+
Linux images optimized for Single-Board Computers.
911

10-
1. Generating a chroot environment for the target architecture (Arm), if the host environment is on x86.
11-
2. Installing all the necessary packages
12-
3. Customizing configuration scripts if needed
13-
4. Building Bootloader
14-
5. Flashing the generated RootFS and Boot binaries to SD Card
12+
|__SDK_DOWNLOAD_URL__| provides Debian images, but users can also build these, especially if users
13+
require something custom (such as different kernel configurations or default desktop environments).
1514

16-
There are several opensource tools available for generating the RootFS in a chroot environment. Such as debootstrap (now deprecated), mmdebstrap (complex), bdebstrap (simple wrapper on top of mmdebstrap).
15+
Armbian Usage
16+
=============
1717

18-
`ti-bdebstrap <https://github.com/TexasInstruments/ti-debpkgs>`__ is a set of scripts that builds upon the ``bdebstrap`` tool to create custom Debian images for TI platforms. This includes creating the ``bdebstrap`` chroot environment itself, installing essential and useful TI and non-TI packages, setting up the configuations, Building the U-Boot etc.
18+
This document provides high-level information about how to build Debian images for TI platforms,
19+
using Armbian. For a full list of options available for users to configure these images at build
20+
time, see `Armbian Documentation <https://docs.armbian.com/>`__.
1921

20-
In other words, ``ti-bdebstrap`` offers users an easy way to create a full-fledged Debian image for supported TI platforms, using a single command. Once the image is built, the user can directly flash it onto a SD card.
21-
22-
TI currently supports building Debian images for AM62Lx, AM62Px, AM62x and AM64x platforms.
23-
24-
Usage
25-
=====
26-
27-
Get Scripts
22+
Get Armbian
2823
-----------
2924

30-
The scripts are hosted at https://github.com/TexasInstruments/ti-bdebstrap
31-
32-
To clone the repository, run:
25+
For the time being, TI's fork of Armbian maintains support for TI platforms. Therefore, the first
26+
step is to fetch TI's fork:
3327

3428
.. code-block:: console
3529
36-
git clone https://github.com/TexasInstruments/ti-bdebstrap.git
37-
30+
git clone https://github.com/TexasInstruments/armbian-build.git
3831
3932
Repository Structure
4033
--------------------
4134

42-
.. code-block:: text
43-
44-
tibdebstrap/
45-
├── build.sh
46-
├── builds.toml
47-
├── configs
48-
│   ├── bdebstrap_configs
49-
│   │   ├── bookworm
50-
│   │   │   ├── bookworm-<machine>.yaml
51-
│   │   │   └── bookworm-rt-<machine>.yaml
52-
│   │   └── trixie
53-
│   │   ├── trixie-<machine>.yaml
54-
│   │   └── trixie-rt-<machine>.yaml
55-
│   ├── bsp_sources.toml
56-
│   └── machines
57-
│   ├── 09.02.00.010.toml
58-
│   └── 11.00.05.02.toml
59-
├── create-sdcard.sh
60-
├── create-wic.sh
61-
├── LICENSE
62-
├── README.md
63-
├── scripts
64-
│   ├── build_bsp.sh
65-
│   ├── build_distro.sh
66-
│   ├── common.sh
67-
│   └── setup.sh
68-
└── target --> Custom files to deploy in target.
69-
70-
``build.sh``: the "main" script that the user should run to generate Debian images.
71-
72-
``configs/``: contains details, configuration options and values for machines, bsp_sources and distro-variants (see below for details).
73-
74-
``scripts/``: contains helper scripts for ``build.sh``.
75-
76-
``target/``: contains files for target configs, like ``weston.service`` for the **weston** target.
77-
78-
``builds.toml``: contains list of all valid builds along with their definitions (see below for details).
79-
80-
Build Configurations
81-
--------------------
82-
83-
A ``build config`` represents an image with certain values for the ``machine``, ``rt_linux`` and ``distro_codename`` parameters.
84-
85-
The ``builds.toml`` file contains a list of all valid builds in the ``builds[]`` list. Each ``build`` is then defined underneath.
86-
87-
Values of ``machine`` and ``distro_codename`` must be defined in :file:`configs/machines.toml`, :file:`configs/bdebstrap_configs/<distro>/<distro>-<machine>.yaml` and :file:`configs/bsp_sources.toml` files. If any of these is missing, the build will fail.
88-
89-
So long as you conform to the rule above, you may also define your own builds.
90-
91-
Building Images
92-
---------------
93-
94-
All valid builds are listed in the :file:`builds.toml` file. To build an image, one of these must be chosen and supplied to the :file:`build.sh` command. :file:`build.sh` commences the build process.
95-
The images are finally stored in the :file:`build/` directory. Each build also produces a log file inside :file:`log/`.
96-
97-
Building images using ``ti-bdebstrap`` involves the following steps:
98-
99-
1. install the pre-requisite packages
100-
2. get the scripts using ``git clone``
101-
3. checkout to the SDK release version tag that you want to build
102-
4. run the :file:`build.sh` script and with required build config as argument.
103-
5. creating a wic image using :file:`create-wic.sh`.
104-
6. flashing the image into a SD card
105-
106-
Install Pre-requisite Packages
107-
------------------------------
108-
109-
First, ensure that your repositories are up-to-date:
110-
111-
.. code-block:: console
112-
113-
sudo apt update
114-
115-
Then, install packages as follows:
116-
117-
.. code-block:: console
118-
119-
sudo apt install -y \
120-
pigz expect pv \
121-
binfmtc binfmt-support \
122-
qemu-user qemu-user-static qemu-system-arm \
123-
debian-archive-keyring bdebstrap \
124-
build-essential autoconf automake \
125-
bison flex libssl-dev \
126-
bc u-boot-tools swig python3-pyelftools
127-
128-
129-
Ensure that all packages were correctly installed using:
130-
131-
.. code-block:: console
132-
133-
sudo apt install --fix-broken
134-
135-
Finally, install ``toml-cli`` and ``yamllint``:
136-
137-
.. code-block:: console
138-
139-
pip3 install toml-cli
140-
pip3 install yamllint
141-
142-
.. note::
143-
144-
Since the build script is run as ``root`` user, ``toml-cli`` and ``yamllint`` should also be installed with ``sudo`` for ``root`` user to be able to access it.
145-
146-
.. note::
147-
148-
The scripts internally handle toolchain downloads based on Host architecture. So the same steps can be followed on both ``arm`` and ``x86_64`` hosts.
149-
150-
Checkout to the Correct Release Tag
151-
-----------------------------------
152-
153-
ti-bdebstrap repository has tags corresponding to each release.
154-
155-
Before building the image, it is important to ensure that you are on the correct release tag. First, view all the tags
156-
using:
157-
158-
.. code-block:: console
159-
160-
git tag
161-
162-
Then, select a release tag and checkout to it:
163-
164-
.. code-block:: console
165-
166-
git checkout <tag-name>
35+
There are 4 files and directories of relevance to this high-level overview:
16736

168-
For example, to checkout to the `10.01.10.04-release` tag, use the following command:
37+
- :file:`configs/`: This directory has configurations for boards, families, kernel configurations,
38+
desktop or CLI environments and so on. To find configuration files relevant to TI, see:
16939

170-
.. code-block:: console
171-
172-
git checkout 10.01.10.04-release
173-
174-
The :file:`builds.toml` and other config files will now support building images corresponding to the `10.01.10.04` release.
175-
176-
Building the Image
177-
-------------------
40+
- :file:`configs/sources/families/k3.conf`
41+
- :file:`configs/kernel/linux-k3-current.conf`
42+
- :file:`configs/kernel/linux-k3-rt-current.conf`
17843

179-
.. note::
44+
- :file:`compile.sh`: This is the script that the user should run for building Armbian images.
18045

181-
If you are behind a proxy, since the build is run with sudo, make sure to set the proxy for root user (preferably in :file:`/etc/environment`).
46+
- :file:`lib/`: This directory stores the scripts that do most of the work in building Armbian images.
18247

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

185-
.. code-block:: console
56+
.. code-block:: console
18657
187-
sudo ./build.sh <build-name>
58+
enable_extension <extension_name>
18859
189-
The ``<build-name>`` must be one present inside :file:`builds.toml` file.
60+
- :file:`userpatches/`: This directory stores files that define build parameters, user patches and so on.
19061

191-
After the build, the RootFS, Boot partition and bsp_sources are stored in :file:`build/<build-name>`. The logs will be stored in :file:`logs/<build-name>.log`.
62+
Building Images
63+
---------------
19264

193-
Example: to build for ``trixie-am62pxx-evm``, run:
65+
Armbian supports an interactive build process. To build interactively, go to TI's Armbian fork you
66+
cloned, and use the following command:
19467

19568
.. code-block:: console
19669
197-
sudo ./build.sh trixie-am62pxx-evm
198-
199-
The RootFS, Boot partition and bsp_sources are then stored in :file:`build/trixie-am62pxx-evm`. The build log is saved as :file:`logs/trixie-am62pxx-evm.log`.
70+
./compile.sh
20071
201-
Generate an SD Card Image
202-
-------------------------
72+
The build framework will then display dialog boxes. The user can use this to select the board, CLI
73+
or desktop environment, kernel configurations and so on.
20374

204-
This step can be skipped if you do not want to share the generated Image with anyone and want to proceed with testing with an SD card.
205-
206-
To generate an SD Card Image with the generated RootFS and Boot partition files, run:
207-
208-
.. code-block:: console
209-
210-
./create-wic.sh <build-name>
211-
212-
Example: to build for ``trixie-am62pxx-evm``, run:
75+
To build the image non-interactively, specify all required **Build Switches** in the command:
21376

21477
.. code-block:: console
21578
216-
./create-wic.sh trixie-am62pxx-evm
217-
218-
The wic image is generated under :file:`build/trixie-am62pxx-evm`. This can be used to flash an SD card using standard tools like balena-etcher.
79+
./compile.sh [command] [switch...] [command...]
21980
220-
Flash Image to SD Card using Script
221-
-----------------------------------
81+
A full list of build switches is available at `Build Switches <https://docs.armbian.com/Developer-Guide_Build-Switches/>`__.
22282

223-
To flash the SD card without generating a wic image, use the :file:`create-sdcard.sh` script. Run it using the below command and follow with the prompts.
83+
For example, the following command builds the minimal non-RT Trixie image:
22484

22585
.. code-block:: console
22686
227-
sudo ./create-sdcard.sh <build-name>
87+
./compile.sh build BOARD=<target> BRANCH=current BUILD_MINIMAL=yes KERNEL_CONFIGURE=no RELEASE=trixie SKIP_ARMBIAN_REPO=yes
22888
229-
For example, if the image is ``trixie-am62pxx-evm``, type:
230-
231-
.. code-block:: console
89+
For a list of targets corresponding to each board, refer:
23290

233-
sudo ./create-sdcard.sh trixie-am62pxx-evm
91+
+------------------------------+--------------+
92+
| Board | Target |
93+
+==============================+==============+
94+
| AM62P | sk-am62p |
95+
+------------------------------+--------------+
96+
| AM62x | sk-am62b |
97+
+------------------------------+--------------+
98+
| AM62-LP | sk-am62-lp |
99+
+------------------------------+--------------+
100+
| AM62SIP | sk-am62-sip |
101+
+------------------------------+--------------+
102+
| AM64x | sk-am64b |
103+
+------------------------------+--------------+
234104

235-
This script will partition the SD Card and copy the contents of RootFS and Boot partitions that are generated to the SD Card.
236105

106+
``output/images/`` stores the built images. These images have a ``.img`` extension.

source/debian/Overview.rst

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,37 @@
22
Overview
33
########
44

5-
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
5+
Debian, also known as Debian GNU/Linux, is a Linux distribution composed of free and open source
6+
software. Community-supported Debian Project develops and maintains it. It offers a vast repository
7+
of software packages, which the ``apt`` package manager can install.
68

7-
Armbian is a highly-optimized **base operating system** (i.e. an extensive build framework) for building Debian-based images for Single-Board Computers (SBCs).
9+
TI creates Debian images by using the popular project called **Armbian**. Armbian is a highly-optimized
10+
**base operating system** (i.e. an extensive build framework) for building Debian-based images for
11+
Single-Board Computers. Unlike other tools, such as mmdebstrap and bdebstrap, which are often
12+
used for creating Debian images, Armbian focuses on creating images for Single-Board Computers.
813

14+
TI's AM62LX, AM62Px, AM62x and AM64x platforms offer the Debian distribution. Few key highlights of
15+
this project are:
916

10-
Debian, also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project.
17+
- The Debian filesystem image requires standard packages from debian.org and TI's customizations as
18+
``.deb`` packages. TI's package build infrastructure uses public sources of git repositories to build
19+
deb packages. TI's official repository maintained on `Github/TexasInstruments/ti-debpkgs
20+
<https://github.com/TexasInstruments/ti-debpkgs>`__ hosts these packages.
1121

12-
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
13-
14-
The Linux Debian distribution, built using Armbian, is enabled for TI's AM62Lx platform. Few key highlights of this project are:
15-
16-
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
17-
18-
The Linux Debian distribution is enabled for TI's AM62Px, AM62x and AM64x platforms. Few key highlights of this project are:
19-
20-
- The Debian filesystem image requires standard packages from debian.org and TI's customizations as .deb packages. The deb packages for the components owned by TI are built using the public sources hosted on respective git repositories and the deb packages are hosted on TI's official PPA repository maintained on `Github/TexasInstruments <https://github.com/TexasInstruments/ti-debpkgs>`__.
21-
22-
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
23-
24-
- The entire Debian build process is made easy with a build script, the script "ti-bdebstrap" is hosted on `TI Debian Github <https://github.com/TexasInstruments/ti-bdebstrap>`__.
25-
26-
- This document also provides the required steps and instructions to customize the TI's components for AM62Lx, AM62Px, AM62x and AM64x SOCs and create the corresponding deb packages.
27-
28-
- The entire project is made public and we accept community contributions as pull requests to github repositories.
29-
30-
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
31-
32-
- Github actions are enabled for the buildscripts workflow. So, any change in the config files, package additions or modifications in build scripts will result in auto generation of a new debian filesystem that reflects these changes. The new builds will store the filesystem image as an artifact hosted on the same repo, allowing other users to test the change without making a new build. These images are available via github for 90 days after which they may be purged to save disk space.
22+
- This document also provides the required steps and instructions to customize the TI's components
23+
for AM62Lx, AM62Px, AM62x and AM64x Systems-on-Chip and create the corresponding deb packages.
3324

25+
- The entire project is public and we accept community contributions as pull requests to GitHub
26+
repositories.
3427

3528
Debian vs Yocto
3629
===============
3730

38-
TI provides both Debian and OpenEmbedded/Yocto based images as their Linux offering. Here's a quick comparision between both to let you choose which one to get started with.
31+
TI provides both Debian and OpenEmbedded/Yocto based images as their Linux offering. Here's a quick
32+
comparison between both to decide the one to start with:
3933

40-
Comparision
41-
-----------
34+
Comparison
35+
----------
4236

4337
+-------------------+--------------------------------------+---------------------------------------+
4438
| **File System** | **Debian** | **OpenEmbedded/Yocto (Arago)** |
@@ -65,7 +59,7 @@ Comparision
6559
Acknowledgements
6660
================
6761

68-
- `beagleboard/image-builder <https://github.com/beagleboard/image-builder.git>`__
62+
- `armbian/build <https://github.com/armbian/build/>`__
6963
- `beagleboard/repos-arm64 <https://git.beagleboard.org/beagleboard/repos-arm64>`__
7064

7165

0 commit comments

Comments
 (0)