Difference between revisions of "MISC-TN-014: Yocto and Debian packetization"

From DAVE Developer's Wiki
Jump to: navigation, search
(Testbed)
(Configuring and testing)
Line 45: Line 45:
  
 
==Configuring and testing==
 
==Configuring and testing==
 +
First of all, all the packages were built with Yocto. Then, they were copied to a server supporting the HTTPS protocol. The resulting archive is available here: https://yocto.dave.eu/imx-5.4/.
 +
 +
On the target, the file <code>imx-5.4.list</code> was created:
 +
<pre class="board-terminal">
 +
root@imx8mpevk:/etc/apt/sources.list.d# cat imx-5.4.list
 +
deb https://yocto.dave.eu/imx-5.4/aarch64-mx8mp ./
 +
deb https://yocto.dave.eu/imx-5.4/aarch64 ./
 +
deb https://yocto.dave.eu/imx-5.4/all ./
 +
deb https://yocto.dave.eu/imx-5.4/imx8mpevk ./
 +
</pre>
 +
 +
Please note that two files in <code>/etc/apt/sources.list.d</code> are automatically generated by Yocto: <code>debian-10.list</code> and <code>sources.list</code>. They were renamed to <code>debian-10.list.ignore</code> and <code>sources.list.ignore</code> respectively.
 +
 +
 +
The following example shows the installation of the <code>git</code> package, which is retrived from the local archive:
 +
<pre class="board-terminal">
 +
root@imx8mpevk:~# apt-get install git
 +
Reading package lists... Done
 +
Building dependency tree     
 +
Reading state information... Done
 +
The following NEW packages will be installed:
 +
  git
 +
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
 +
Need to get 0 B/3043 kB of archives.
 +
After this operation, 0 B of additional disk space will be used.
 +
WARNING: The following packages cannot be authenticated!
 +
  git
 +
Install these packages without verification? [y/N] y
 +
Selecting previously unselected package git.
 +
(Reading database ... 99542 files and directories currently installed.)
 +
Preparing to unpack .../git_2.23.1-r0_arm64.deb ...
 +
Unpacking git (2.23.1-r0) ...
 +
Setting up git (2.23.1-r0) ...
 +
N: Ignoring file 'debian-10.list.ignore' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
 +
</pre>
  
 
==TBD==
 
==TBD==

Revision as of 14:44, 3 August 2020

Info Box
Axel-04.png Applies to Axel Ultra
Axel-02.png Applies to AXEL ESATTA
Axel-lite 02.png Applies to Axel Lite
Yocto-logo.png Applies to Yocto


History[edit | edit source]

Version Date Notes
1.0.0 August 2020 First public release

Introduction[edit | edit source]

In recent years, the Yocto build system has gained popularity in the embedded world. Many silicon vendors such as NXP e Xilinx base their Board Support Packages (BSP) on this tool. Despite the fact that Yocto is very powerful and rich, it may be fairly tricky to use, however, especially during the development stage when developers generally need a lot of flexibility. In particular, the unavailability of an archive of prebuilt common packages—as opposed to most of server/desktop Linux distributions—can be really annoying. As described here, Yocto is basically devised to build an entire distribution from scratch indeed.

To mitigate this drawback, the technique described in [article] can be used. In essence, one can build all the packages supported by Yocto (bitbake -k world) and make them available through a smart channel on a local server. Developers working on the target can easily install required packages without having to build them.

Interestingly, in its recent BSP's, NXP indicates a little different approach, which goes even further as it is also open to interfacing to the Debian world. The following excerpt is taken from NXP i.MX Yocto Project User's Guide, Document Number: IMXLXYOCTOUG, Rev. L5.4.24_2.1.0, 06/2020:


Package Management

The default package management with Yocto Project is rpm. The i.MX distro now enables Debian as the package management. This can be easily turned off by add PACKAGE_CLASSES set to package_rpm to the local.conf (or creating a custom distro without the Debian package feed PACKAGE_CLASSES = "package_rpm"). With the addition of the Debian package feed, a sources.list can be added /etc/apt that links in Debian's package feed. This allows users to install packages not provided in the image without having to add them to a Yocto image. Because this package feed is not generated by the i.MX Yocto build process, there is no guarantee each package will work with the right dependencies but it allows simpler tools to be provided. Software that is complex and has more dependencies on specific versions might have issues with an external package feed.


In principle, the adoption of the Debian package management should allow to use prebuilt package archives available for Debian distributions. However, close attention should be paid when mixing packages of different distributions. For instance, Debian packages installed on a Yocto file system could not work. Even worse, they could interfere with existing packages and make these unusable.

This Technical Note (TN) describes a way to apply the smart-based approach illustrated here to a Yocto distribution that makes use of Debian packetization. In other words, a local archive of Yocto-generated prebuilt .deb packages is used in combination with the well known apt-get utility.

Testbed[edit | edit source]

The testbed used to verify this procedure consists of the NXP i.MX8M Plus EVK (*) combined with the Linux BSP tagged as L5.4.24_2.1.0.


(*) At the time of this writing, the i.MX8M Plus SoC is not released yet. DAVE Embedded Systems, however, has access to the EVK because it is part of the Beta program.

Configuring and testing[edit | edit source]

First of all, all the packages were built with Yocto. Then, they were copied to a server supporting the HTTPS protocol. The resulting archive is available here: https://yocto.dave.eu/imx-5.4/.

On the target, the file imx-5.4.list was created:

root@imx8mpevk:/etc/apt/sources.list.d# cat imx-5.4.list 
deb https://yocto.dave.eu/imx-5.4/aarch64-mx8mp ./
deb https://yocto.dave.eu/imx-5.4/aarch64 ./
deb https://yocto.dave.eu/imx-5.4/all ./
deb https://yocto.dave.eu/imx-5.4/imx8mpevk ./

Please note that two files in /etc/apt/sources.list.d are automatically generated by Yocto: debian-10.list and sources.list. They were renamed to debian-10.list.ignore and sources.list.ignore respectively.


The following example shows the installation of the git package, which is retrived from the local archive:

root@imx8mpevk:~# apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  git
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3043 kB of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  git
Install these packages without verification? [y/N] y
Selecting previously unselected package git.
(Reading database ... 99542 files and directories currently installed.)
Preparing to unpack .../git_2.23.1-r0_arm64.deb ...
Unpacking git (2.23.1-r0) ...
Setting up git (2.23.1-r0) ...
N: Ignoring file 'debian-10.list.ignore' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

TBD[edit | edit source]