Skip to content

Commit 126724f

Browse files
committed
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 4fe1623 commit 126724f

File tree

6 files changed

+72
-301
lines changed

6 files changed

+72
-301
lines changed

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: 48 additions & 195 deletions
Original file line numberDiff line numberDiff line change
@@ -1,236 +1,89 @@
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-
------------------------------
35+
There are 4 files and directories of relevance to this high-level overview:
10836

109-
First, ensure that your repositories are up-to-date:
37+
- ``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:
11039

111-
.. code-block:: console
112-
113-
sudo apt update
40+
- ``configs/sources/families/k3.conf``
41+
- ``configs/kernel/linux-k3-current.conf``
42+
- ``configs/kernel/linux-k3-rt-current.conf``
11443

115-
Then, install packages as follows:
44+
- ``compile.sh``: This is the script that the user should run for building Armbian images.
11645

117-
.. code-block:: console
46+
- ``lib/``: This directory stores the scripts that do most of the work in building Armbian images.
11847

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
48+
- ``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:
12755

56+
.. code-block:: console
12857
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
58+
enable_extension <extension_name>
13859
139-
pip3 install toml-cli
140-
pip3 install yamllint
60+
- ``userpatches/``: This directory stores files that define build parameters, user patches and so on.
14161

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>
167-
168-
For example, to checkout to the `10.01.10.04-release` tag, use the following command:
169-
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-
-------------------
178-
179-
.. note::
180-
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`).
182-
183-
To build an image, you need to run the :file:`build.sh` script:
184-
185-
.. code-block:: console
186-
187-
sudo ./build.sh <build-name>
188-
189-
The ``<build-name>`` must be one present inside :file:`builds.toml` file.
190-
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`.
200-
201-
Generate an SD Card Image
202-
-------------------------
203-
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:
70+
./compile.sh
20771
208-
.. code-block:: console
209-
210-
./create-wic.sh <build-name>
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.
21174

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.
219-
220-
Flash Image to SD Card using Script
221-
-----------------------------------
79+
./compile.sh [command] [switch...] [command...]
22280
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.
81+
A full list of build switches is available at `Build Switches <https://docs.armbian.com/Developer-Guide_Build-Switches/>`__.
22482

225-
.. code-block:: console
226-
227-
sudo ./create-sdcard.sh <build-name>
228-
229-
For example, if the image is ``trixie-am62pxx-evm``, type:
83+
For example, the following command builds the minimal non-RT Trixie image:
23084

23185
.. code-block:: console
23286
233-
sudo ./create-sdcard.sh trixie-am62pxx-evm
234-
235-
This script will partition the SD Card and copy the contents of RootFS and Boot partitions that are generated to the SD Card.
87+
./compile.sh build BOARD=<board-name> BRANCH=current BUILD_MINIMAL=yes KERNEL_CONFIGURE=no RELEASE=trixie SKIP_ARMBIAN_REPO=yes
23688
89+
``output/images/`` stores the built images. These images have a ``.img`` extension.

source/debian/Overview.rst

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,35 @@
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. It is developed and maintained by the community-supported Debian Project. It comes with a
7+
vast repository of software packages, which can be installed using the `apt` package manager.
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 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 (SBCs). Unlike other tools, such as mmdebstrap and bdebstrap, which are often
12+
used for creating Debian images, Armbian focuses on creating images for SBCs.
813

14+
The Linux Debian distribution is enabled for TI's AM62LX, AM62Px, AM62x and AM64x platforms. Few key
15+
highlights of 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. The deb packages for the components owned by TI are built using the public sources
19+
hosted on respective git repositories and the deb packages are hosted on TI's official PPA
20+
repository maintained on `Github/TexasInstruments
21+
<https://github.com/TexasInstruments/ti-debpkgs>`__.
1122

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.
23+
- This document also provides the required steps and instructions to customize the TI's components
24+
for AM62Lx, AM62Px, AM62x and AM64x SOCs and create the corresponding deb packages.
3325

26+
- The entire project is made public and we accept community contributions as pull requests to github
27+
repositories.
3428

3529
Debian vs Yocto
3630
===============
3731

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.
32+
TI provides both Debian and OpenEmbedded/Yocto based images as their Linux offering. Here's a quick
33+
comparision between both to let you choose which one to get started with.
3934

4035
Comparision
4136
-----------
@@ -65,7 +60,7 @@ Comparision
6560
Acknowledgements
6661
================
6762

68-
- `beagleboard/image-builder <https://github.com/beagleboard/image-builder.git>`__
63+
- `armbian/build <https://github.com/armbian/build/>`__
6964
- `beagleboard/repos-arm64 <https://git.beagleboard.org/beagleboard/repos-arm64>`__
7065

7166

0 commit comments

Comments
 (0)