Open main menu

DAVE Developer's Wiki β

Changes

no edit summary
{{ImportantMessage|text=This application note has been validated using the '''kit version''' in the History table.}}
<section begin=History/>{| style="border-collapse:collapse; "! colspan="4" style="width:100%; text-align:left" ; border-bottom:solid 2px #ededed" |History|- ! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Issue Date! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white" |Notes|-{| classstyle="wikitableborder-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" border|{{oldid|16498|2022/05/03}}| style="1border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|[[DESK-MX8M-L/General/Release_Notes#DESK-MX8M-L_2.0.0-rc2|DESK-MX8M-L 2.0.0-rc2]]!Version|-!Date| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |{{oldid|18383|2023/08/22}}!Development Kit version| style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000" |[[DESK-MX8M-L/General/Release_Notes#DESK-MX8M-L_4.0.0|DESK-MX8M-L 4.0.0]]
|-
| 1.0.0| Apr 2022|[[DESK! style="border-MX8Mleft:solid 2px #73B2C7; border-L/General/Release_Notesright:solid 2px #DESK73B2C7;border-MX8Mtop:solid 2px #73B2C7; border-L_2.0.0bottom:solid 2px #73B2C7; background-rc2color:#ededed; padding:5px; color:#000000" |DESK2023/11/08! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-MX8Mtop:solid 2px #73B2C7; border-L 2.0.0bottom:solid 2px #73B2C7; background-rc2]]color:#ededed; padding:5px; color:#000000" |Minor changes
|-
|}
<section end=History/>
==Introduction==
<section begin=body/>Since NXP BSP [https://www.nxp.com/webapp/Download?colCode=L5.4.24_2.1.0_LINUX_DOCS 5.4.24 ] Yocto release], [https://debian-handbook.info/browse/stable/sect.apt-get.html apt-get] has been added as a package manager for installing packages in the DUT (target machine).
As reported by NXP official documentation:
The default package management with Yocto Project is <code>rpm</code>. The i.MX distro now enables '''debian''' as the package management. This can be easily turned off by add PACKAGE_CLASSES <code>PACKAGE_CLASSES_*</code> set to <code>package_rpm </code> to the <code>local.conf </code> (or creating a custom distro without the debian package feed <code>PACKAGE_CLASSES = "package_rpm"</code>.
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.
'''apt-get''' performs runtime package management of <code>.deb</code> packages. In order to use '''apt-get''' for runtime package management, you must perform an initial setup on the target machine for cases where the <code>PACKAGE_FEED_* </code> variables were not set as part of the image that is running on the target.
In principle, the adoption of the Debian package management should allow to use prebuilt package archives available for [http://ftp.debian.org/debian/README.html 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 Application Note (AN) describes a way to apply the approach illustrated here to a Yocto distribution that makes use of Debian packetization. In other words, a local archive of Yocto-generated, prebuilt <code>.deb</code> packages is used in combination with the well known <code>apt-get</code> utility.
=== apt-get ===
The following instructions detail how to use apt-get for installing packages with Yocto repositories created by DAVE's build system for DESK-MX8M-L.
====Configuring <code>apt</code>for SBC-ORCA====
Edit the file <code>/etc/apt/apt.conf</code> like this:
<pre class="board>root@desk-terminal">mx8mp:~# cat /etc/apt/apt.conf
APT::Architecture "arm64";
APT::Get::AllowUnauthenticated "true";
<pre class="board-terminal">
root@desk-mx8mp:~# cat /etc/apt/sources.list.d/debian-10.list
deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0/ all/deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-54.0.40/ armv8a/deb [trusted=yes] http://yocto.dave.70eu/desk-mx8m-l-24.30.0/ aarch64armv8a-mx8mp/deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0/ aarch64desk_mx8mp/</pre> Execute the following commands in order to re-create the ''apt'' cache based on the new server's list: <pre>rm -mx8mprf /var/lib/apt/lists/*apt-get cleanapt-get update
</pre>
Execute the following commands:
<pre class="board-terminal">
root@desk-mx8mp:~# rm -rf /var/lib/apt/lists/*
root@desk-mx8mp:~# apt-get clean
root@orcadesk-mx8mp:~# apt-get updateIgn:1 http://yocto.dave.eu/desk-mx8m-l-4.0.0 all/ InReleaseIgn:2 http://yocto.dave.eu/desk-mx8m-l-4.0.0 armv8a-mx8mp/ InReleaseIgn:3 http://yocto.dave.eu/desk-mx8m-l-4.0.0 desk_mx8mp/ InReleaseGet:4 http://yocto.dave.eu/desk-mx8m-l-4.0% .0 all/ Release [1215 B]Get:5 http://yocto.dave.eu/desk-mx8m-l-4.0.0 armv8a-mx8mp/ Release [1224 B]Get:6 http://yocto.dave.eu/desk-mx8m-l-4.0.0 desk_mx8mp/ Release [Working1222 B]Ign:1 7 http://yocto.dave.eu/desk-mx8m-l-4.0.0 all/ Release.gpgIgn:8 http://yocto.dave.eu/imxdesk-5mx8m-l-4.0.0 armv8a-mx8mp/ Release.gpgIgn:9 http://yocto.dave.eu/desk-mx8m-l-4.700.0 desk_mx8mp/ Release.gpgGet:10 http://yocto.dave.eu/desk-mx8m-l-24.30.0 all/ InReleasePackages [174 kB]IgnGet:2 11 http://yocto.dave.eu/imxdesk-5mx8m-l-4.0.0 armv8a-mx8mp/ Packages [308 kB]Get:12 http://yocto.dave.eu/desk-mx8m-l-4.700.0 desk_mx8mp/ Packages [263 kB]Fetched 749 kB in 1s (866 kB/s)Reading package lists... DoneW: Conflicting distribution: http://yocto.dave.eu/desk-2mx8m-l-4.0.0 all/ Release (expected all/ but got )W: Conflicting distribution: http://yocto.dave.eu/desk-mx8m-l-4.30.0 aarch64armv8a-mx8mp/ InReleaseRelease (expected armv8a-mx8mp/ but got )IgnW: Conflicting distribution:3 http://yocto.dave.eu/imxdesk-5mx8m-l-4.0.0 desk_mx8mp/ Release (expected desk_mx8mp/ but got )</pre> Then, modify the cached package list due to the proper DAVE's server configuration: <pre>sed -i 's/\.\//all\//g' /var/lib/apt/lists/yocto.dave.eu_desk-mx8m-l-4.700.0_all_Packagessed -2i 's/\.\//armv8a\//g' /var/lib/apt/lists/yocto.dave.3eu_desk-mx8m-l-4.0 aarch64.0_armv8a_Packagessed -i 's/\.\//armv8a-mx8mp\//g' /var/lib/apt/lists/yocto.dave.eu_desk-mx8m-l-4.0.0_armv8a-mx8mp_Packagessed -i 's/\.\//desk%5fmx8mp\//g' /var/lib/apt/lists/yocto.dave.eu_desk-mx8m-l-4.0.0_desk%5fmx8mp_Packages</pre> ====Configuring <code>apt</code> for SBCX-Mito8MMini====Edit the file <code>/etc/apt/apt.conf</ InReleasecode> like this:<pre>root@desk-mx8mm:~# cat /etc/apt/apt.confAPT::Architecture "arm64";APT::Get::AllowUnauthenticated "true";Acquire::Languages "none";</pre> Edit the file <code>/etc/apt/sources.list.d/debian-10.list</code> like this:<pre class="board-terminal">root@desk-mx8mm:~# cat /etc/apt/sources.list.d/debian-10.listdeb [trusted=yes] http://yocto.dave.eu/desk-mx8m-l-4 .0.0/ all/deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-5l-4.0.0/ armv8a/deb [trusted=yes] http://yocto.dave.eu/desk-mx8m-l-4.700.0/ armv8a-mx8mm/deb [trusted=yes] http://yocto.dave.eu/desk-mx8m-l-4.0.0/ desk_mx8mm/</pre> Execute the following commands in order to re-create the ''apt'' cache based on the new server's list: <pre>rm -rf /var/lib/apt/lists/*apt-get cleanapt-get update</pre> <pre class="board-terminal">root@desk-mx8mm:~# rm -rf /var/lib/apt/lists/*root@desk-mx8mm:~# apt-get cleanroot@desk-mx8mm:~# apt-get updateIgn:1 http://yocto.dave.eu/desk-mx8m-l-4.0.0 all/ InReleaseIgn:2http://yocto.dave.eu/desk-mx8m-l-4.0.0 armv8a-mx8mm/ InReleaseIgn:3http://yocto.dave.eu/desk-mx8m-l-4.0.0 desk_mx8mm/ InReleaseGet:4 http://yocto.dave.eu/desk-mx8m-l-4.0.0 all/ Release [1213 1215 B]Get:5 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64armv8a-mx8mm/ Release [1217 1224 B]Get:6 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64-mx8mpdesk_mx8mm/ Release [1223 1222 B]Ign:7 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 all/ Release.gpgIgn:8 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64armv8a-mx8mm/ Release.gpgIgn:9 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64-mx8mpdesk_mx8mm/ Release.gpgGet:10 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 all/ Packages [146 174 kB]Get:11 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64armv8a-mx8mm/ Packages [2848 304 kB]Get:12 http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0 aarch64-mx8mpdesk_mx8mm/ Packages [283 259 kB]Fetched 3280 740 kB in 6s 1s (545 714 kB/s)
Reading package lists... Done
root@orcaW:~# Conflicting distribution: http://yocto.dave.eu/desk-mx8m-l-4.0.0 all/ Release (expected all/ but got )W: Conflicting distribution: http://yocto.dave.eu/desk-mx8m-l-4.0.0 armv8a/ Release (expected armv8a/ but got )W: Conflicting distribution: http://yocto.dave.eu/desk-mx8m-l-4.0.0 armv8a-mx8mm/ Release (expected armv8a-mx8mm/ but got )W: Conflicting distribution: http://yocto.dave.eu/desk-mx8m-l-4.0.0 desk_mx8mm/ Release (expected desk_mx8mm/ but got )</pre> Then, modify the cached package list due to the proper DAVE's server configuration: <pre>sed -i 's/\.\//aarch64all\//g' /var/lib/apt/lists/yocto.dave.eu_imxeu_desk-mx8m-l-5.4.70-20.3.0_aarch64_Packages0_all_Packagesroot@orca:~# sed -i 's/\.\//allarmv8a\//g' /var/lib/apt/lists/yocto.dave.eu_imxeu_desk-mx8m-l-5.4.70-2.30.0_all_Packages0_armv8a_Packagesroot@orca:~# sed -i 's/\.\//aarch64armv8a-mx8mpmx8mm\//g' /var/lib/apt/lists/yocto.dave.eu_imxeu_desk-mx8m-l-54.40.700_armv8a-2mx8mm_Packagessed -i 's/\.3\//desk%5fmx8mm\//g' /var/lib/apt/lists/yocto.dave.0_aarch64eu_desk-mx8m-l-mx8mp_Packages4.0.0_desk%5fmx8mm_Packages
</pre>
=== Installing packages on target ===
We assume that network interface has been already configured for Internet access. In any case, a simple network configuration can be done according to the [[DESK-MX8M-L/Deployment/How_to_configure_the_network_interfaces#Static_IP_address | How to configure the network interfaces]] wiki page.
 The target is finally ready to install new packages. The following example shows for instance the installation of <code>vimgraphviz</code>: 
<pre class="board-terminal">
root@orcadesk-mx8mp:~# apt-get install vimgraphviz
Reading package lists... Done
Building dependency treeReading state information... DoneThe following additional packages will be installed: vim-common vim-help vim-syntax vim-tutor vim-vimrc
The following NEW packages will be installed:
vim vim-common vim-help vim-syntax vim-tutor vim-vimrcgraphviz0 upgraded, 6 1 newly installed, 0 to remove and 20 0 not upgraded.Need to get 6584 2094 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] YGet:1 http://yocto.dave.eu/imxdesk-5.4.70mx8m-2.3.0 aarch64/ vim 8.1.1518l-r0 [1051 kB]Get:2 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-common 8.1.1518-r0 [2314 kB]Get:3 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-help 8.1.1518armv8a-r0 [1757 kB]Get:4 http:mx8mp//yocto.dave.eu/imx-5.4.70-graphviz 2.350.0 aarch64/ vim-syntax 8.1.1518-r0 [1049 2094 kB]Get:5 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-tutor 8.1.1518-r0 [411 kB]Get:6 http://yocto.dave.eu/imx-5.4.70-2.3.0 aarch64/ vim-vimrc 8.1.1518-r0 [1596 B]Fetched 6584 2094 kB in 9s 1s (660 1913 kB/s)Selecting previously unselected package vimgraphviz.(Reading database ... 71726 81414 files and directories currently installed.)Preparing to unpack .../vim_8graphviz_2.150.15180-r0_arm64.deb ...Unpacking vim graphviz (82.150.1518-r0) ...Selecting previously unselected package vim-common.Preparing to unpack .../vim-common_8.1.1518-r0_arm64.deb ...Unpacking vim-common (8.1.1518-r0) ...Selecting previously unselected package vim-help.Preparing to unpack .../vim-help_8.1.1518-r0_arm64.deb ...Unpacking vim-help (8.1.1518-r0) ...Selecting previously unselected package vim-syntax.Preparing to unpack .../vim-syntax_8.1.1518-r0_arm64.deb ...Unpacking vim-syntax (8.1.1518-r0) ...Selecting previously unselected package vim-tutor.Preparing to unpack .../vim-tutor_8.1.1518-r0_arm64.deb ...Unpacking vim-tutor (8.1.1518-r0) ...Selecting previously unselected package vim-vimrc.Preparing to unpack .../vim-vimrc_8.1.1518-r0_arm64.deb ...Unpacking vim-vimrc (8.1.15180-r0) ...Setting up vim graphviz (82.150.1518-r0) ...update-alternatives: Linking /bin/vi to /usr/bin/vim.vimupdate-alternatives: Linking /usr/bin/vim to /usr/bin/vim.vimupdate-alternatives: Linking /usr/bin/xxd to /usr/bin/xxd.vimSetting up vim-common (8.1.1518-r0) ...Setting up vim-help (8.1.1518-r0) ...Setting up vim-syntax (8.1.1518-r0) ...Setting up vim-tutor (8.1.1518-r0) ...Setting up vim-vimrc (8.1.15180-r0) ...
</pre>
=== Other useful apt commands ===
==== List of configured software repositories ====
As shown before, the target is configured for accessing the Yocto repositories as listed in the <code>/etc/apt/sources.list.d</code> apt configuration directory:
<pre class="board-terminal">
root@desk-mx8mp:~# cat /etc/apt/sources.list.d/debian-10.list
deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0/ all/deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0/ aarch64armv8a-mx8mp/deb [trusted=yes] http://yocto.dave.eu/imxdesk-mx8m-l-5.4.70-2.30.0/ aarch64-mx8mpdesk_mx8mp/
</pre>
==== Search for packages ====
To search for an available package into the current configured channels use <code>apt-cache search</code>
<pre class="board-terminal">
root@desk-mx8mp:~# apt-cache search vim
vim - Vi IMproved - enhanced vi editor
vim-common - Vi IMproved - enhanced vi editor
vim-help - Vi IMproved - enhanced vi editor
vim-syntax - Vi IMproved - enhanced vi editor
vim-tutor - Vi IMproved - enhanced vi editor
vim-vimrc - Vi IMproved - enhanced vi editor
</pre>
==== List of installed packages ====
User can see the list of installed packages with <code>apt list dpkg --get-installedselections | sed 's:install$::'</code>(sed removes the ''install'' string from the output list)
<pre class="board>aclacl-terminal">devadwaita-icon-theme-symbolicalsa-confalsa-statealsa-statesalsa-toolsalsa-utilsalsa-utils-aconnectalsa-utils-alsactlalsa-utils-alsaloopalsa-utils-alsamixeralsa-utils-alsatplg...[snip]...volatile-binds-devwaylandwayland-devwhichwhich-devwireless-regdb-staticwireless-toolswpa-supplicantwpa-supplicant-cliwpa-supplicant-passphrasexinetdxzxz-dev
</pre>
<section end=body/>
8,241
edits