Difference between revisions of "Package repository for OpenSTLinux distribution"

[quality revision] [quality revision]
(Further readings)
m (Update for DV-3.1)
 

1 Disclaimers[edit]

STMicroelectronics packages repository service is provided for evaluation purpose only, and therefore not approved for use in production.
The package licenses hosted in these repositories can be found here: OpenSTLinux _ licenses.

2

Command outputs described in this document may slightly vary depending on tools version.

1.1 Description[edit]

OpenSTLinux provides a package repository service hosted at the non-browsable URL http://packages.openstlinux.st.com.

The package repository service is designed for STM32MP157C-DK2 boards and is enabled by default in the Starter Package.


1.2.1 Organization[edit]

Within each repository, packages are organized in two three groups (a.k.a "components" in the APT terminology):

2.2
  • the "main" group contains a wide selection of packages whose installation is automatically tested by STMicroelectronics
  • the "untested" group contains all the other packages that can be built using the bitbake world command. However their installation is not guaranteed.

A third group named "updates" is reserved for future use.

1.3 Limitations[edit]

Packages repository service doesn't include the packages that are shipped in the rootfs image, nor the BSP components (TF-A, U-Boot, Linux and OP-TEE). They can be installed only from the Starter Package using the STM32CubeProgrammer.

rootfs available space is about 60MB by default. For a better experience it is recommend recommended to flash the Starter Package using the "extensible" flashlayout (*-extensible.tsv).
Extensible flashlayout does not flash userfs partition to extend the rootfs partition to the size of the sdcard.


3 2 Usage[edit]

32.1 Prequisite[edit]

We assume your board has an internet connection either through the network cable or through a WiFi connection.


2.2 Apt[edit]

OpenSTLinux packages can be handled using apt-* utilities, which are the same utilities used on a Debian system. The first apt-* command that must be run before any other is:

 
root@board# apt-get update
 The software package is provided AS IS, and by downloading it, you agree to be
 bound to the terms of the software license agreement (SLA).
 The detailed content licenses can be found at
 https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
  
 Get:1 http://packages.openstlinux.st.com/3.1 dunfell InRelease [3455 B]
 Get:2 http://packages.openstlinux.st.com/3.1 dunfell/main armhf Packages [779 kB]
 Get:3 http://packages.openstlinux.st.com/3.1 dunfell/updates armhf Packages [32.1 kB]
 Get:4 http://packages.openstlinux.st.com/3.1 dunfell/untested armhf Packages [1450 kB]
 Fetched 2264 kB in 3s (635 kB/s)
 Reading package lists... Done

This command synchronizes the local packages index from the repositories enumerated in /etc/apt/sources.list{,.d}. Once it is updated, apt-cache can be used to get the list of all available packages:

 
root@board# apt-cache search .

Obviously it
 a52dec - ATSC A/52 surround sound stream decoder
 a52dec-doc - ATSC A/52 surround sound stream decoder
 acl - Utilities for managing POSIX Access Control Lists
 ...
 xserver-xorg - The X.Org X server
 xserver-xorg-xwayland - The X.Org X server
 xterm - xterm is the standard terminal emulator for the X Window System
 xvinfo - Print out X-Video extension adaptor information
 xz - Utilities for managing LZMA compressed files

It is possible to list only packages that match a given pattern, for example:

 
root@board# apt-cache search emacs
 [...]
 libreadline-doc - Library for editing typed command lines - Documentation files
 gpm - Console mouse driver
 gpm-doc - Console mouse driver - Documentation files
 zile - veryZile smallis lossy Emacs
 zile-subsetdoc editor
- Zile is lossy Emacs - Documentation files
 libreadline8 - Library for editing typed command lines

The desired package(s) can then be easily installed:

 
root@board# apt-get install zile
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following additional packages will be installed:
   bdwgc
 The following NEW packages will be installed:
   bdwgc zile
 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
 Need to get 148 kB of archives.
 After this operation, 0 B of additional disk space will be used.
 Do you want to continue? [Y/n]
 Get:1 http://packages.openstlinux.st.com/3.1 dunfell/untested armhf bdwgc armhf 8.0.4-r0 [69.2 kB]
 Get:2 http://packages.openstlinux.st.com/3.1 dunfell/untested armhf zile armhf 2.4.14-r0 [79.3 kB]
 Fetched 148 kB in 0s (465kB/s)
 
 The software package is provided AS IS, and by downloading it, you agree to be
 bound to the terms of the software license agreement (SLA).
 The detailed content licenses can be found at
 https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 
 Selecting previously unselected package bdwgc.
 (Reading database ... 14204 files and directories currently installed.)
 Preparing to unpack .../bdwgc_8.0.4-r0_armhf.deb ...
 Unpacking bdwgc (8.0.4-r0) ...
 Selecting previously unselected package zile.
 Preparing to unpack .../zile_2.4.14-r0_armhf.deb ...
 Unpacking zile (2.4.14-r0) ...
 Setting up bdwgc (8.0.4-r0) ...
 Setting up zile (2.4.14-r0) ...

... or removed:

 
root@board# apt-get remove zile
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following package was automatically installed and is no longer required:
   bdwgc
 Use 'apt autoremove' to remove it.
 The following packages will be REMOVED:
   zile
 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
 After this operation, 0 B of additional disk space will be used.
 Do you want to continue? [Y/n]
 
 The software package is provided AS IS, and by downloading it, you agree to be
 bound to the terms of the software license agreement (SLA).
 The detailed content licenses can be found at
 https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
   
 (Reading database ... 14209 files and directories currently installed.)
 Removing zile (2.4.14-r0) ...


This command only removes the files that were installed from this package. It does not remove the package from the apt download cache. If there is not enough space available on the system, it is recommended to clean the cache:

 
root@board# apt-get clean

Likewise, some packages may have been automatically installed to respect dependencies with other packages. If they are no longer required, they can be removed to free space:

 
root@board# apt-get autoremove

In addition, it is recommended to regularly install the latest versions of the packages currently installed on the system:

 root@board# apt-get upgrade

3.2 How to create a repository[edit]

A lot of different tools can be used to generate an Apt repository; the most recommended one is reprepro, and the easiest one is probably apt-ftparchive. For instance, to quickly create an Apt repository from a build of OpenSTLinux:

 user@pc$ cd build-openstlinuxweston-stm32mp1
 user@pc$ cd  Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following packages will be REMOVED:
   bdwgc
 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
 After this operation, 0 B of additional disk space will be used.
 Do you want to continue? [Y/n]
 
 The software package is provided AS IS, and by downloading it, you agree to be
 bound to the terms of the software license agreement (SLA).
 The detailed content licenses can be found at
 https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 
 (Reading database ... 14208 files and directories currently installed.)
 Removing bdwgc (8.0.4-r0) ...

3 How to activate a local package repository[edit]

3.1 Prerequisite[edit]

Even if Package repository for OpenSTLinux offers lots of and various packages, you may need to use a local and personnal package repository. To use a local and personnal package repository is a 'smart' and 'quick' way to update the STM32MP15_Discovery_kits_-_Starter_Package with your developments.

A local package repository is a collection of *.deb organized such apt needs it. The local repository should provide Packages metafiles.

Natively OpenEmbedded/Yocto build system is able to generate a valid package repository (by using bitbake package-index command listed below). So first Install the STM32MP1 OpenSTLinux distribution.

3.2 Update the repo package indexes[edit]

Execute the bitbake package-index command:

  cd [your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>
  bitbake package-index

3.3 HTTP server execution on the computer[edit]

SimpleHTTPserver python application is already installed on the board with the OpenSTLinux distribution. You just need to launch this application on your host computer, in the "[your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb

/

" folder:

 cd user@pc$[your lsSTM32MP1 Distribution all/  cortexa7t2hf-neon-vfpv4/  stm32mp1/
 user@pc$ apt-ftparchive --arch armhf packages . > Packages
 user@pc$ apt-ftparchive release . > Release

The whole content of this directory (deb in the previous example) must then be copied to a location that can be accessed by the OpenSTLinux OS. It could be a file server or a local disk. Just declare this location ($location in the example below) to the Apt system:

 root@board#path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb
 python -m SimpleHTTPServer&

3.4 How to use the local OpenSTLinux Distribution[edit]

We use the physical IP address of the HTTP server we launched above to configure APT. That means this {{<IP>}} address should be defined as static on the host computer.
You can now configure the APT tool directly on the target via a Linux console:

 echo "deb [trusted=yes] http://<IP>:8000/stm32mp1 /" > /etc/apt/sources.list.d/my_custom.list
 echo "deb [trusted=yes] http://<IP>:8000/all /" >> /etc/apt/sources.list.d/my_custom.list
 echo "deb [trusted=yes] $locationhttp://<IP>:8000/cortexa7t2hf-neon-vfpv4 /" >>> /etc/apt/sources.list.d/my_custom.list

In the above example, [trusted=yes] has been specified because the package manifest Release is not signed. Eventually, apt-* commands can be used as described in the apt section

Then you can run the command to synchronize the local packages index:

  apt-get update
 The software package is provided AS IS, and by downloading it, you agree to be
 bound to the terms of the software license agreement (SLA).
 The detailed content licenses can be found at
 https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses.
 Ign:1 http://<IP>:8000/all  InRelease                                                                                                                           
 Ign:2 http://<IP>:8000/stm32mp1  InRelease                                                                                                                      
 Ign:3 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  InRelease                                                                                                       
 Get:4 http://<IP>:8000/all  Release [1213 B]                                                                                                                    
 Get:5 http://<IP>:8000/stm32mp1  Release [1218 B]                                                                                                               
 Get:6 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Release [1233 B]                                                                                                
 Ign:7 http://<IP>:8000/all  Release.gpg                                                                                                                         
 Ign:8 http://<IP>:8000/stm32mp1  Release.gpg                                                                                                                    
 Ign:9 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Release.gpg                                                                                                     
 Get:10 http://<IP>:8000/all  Packages [82.8 kB]                                                                                                                 
 Get:11 http://<IP>:8000/stm32mp1  Packages [173 kB]                                                                                                             
 Get:12 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Packages [1734 kB]                                                                                             
 Fetched 1994 kB in 3s (662 kB/s)                                                                                                                                        
 Reading package lists... Done

The other apt-* commands are now available as described above.

4 Support[edit]

Bug reports, request for new packages, or any other kind of support requests can be submitted through https://community.st.com.


5 Further readings[edit]


==Disclaimers==
STMicroelectronics packages repository service is provided for evaluation purpose only, and therefore not approved for use in production.<br/>

The package licenses hosted in these repositories can be found here: [[OpenSTLinux_licenses]].

==Description==|OpenSTLinux licenses]].<br/>

Command outputs described in this document may slightly vary depending on tools version.

===Description===

OpenSTLinux provides a package repository service hosted at [the non-browsable URL <nowiki>http://packages.openstlinux.st.com packages.openstlinux.st.com].</nowiki>.


The package repository service is designed for ''STM32MP157C-DK2'' boards and is enabled by default in the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]].

===Organization===
Within each repository, packages are organized in twothree groups (a.k.a "''components"'' in the APT terminology):

* the "'''main"''' group contains a wide selection of packages whose installation is automatically tested by STMicroelectronics
* the "'''untested"''' group contains all the other packages that can be built using the <code>bitbake world</code> command. However their installation is not guaranteed.

A third group named "updates" is reserved for future use.
* the '''updates''' group contains additional packages not included in the [[OpenSTLinux_distribution|OpenSTLinux distribution releases]] and updated packages. This group is managed by a dedicated layer available through github®. Further details are available by following the github® link: https://github.com/STMicroelectronics/meta-st-pkgrepo-updates.
===Limitations===
Packages repository service doesn't include the packages that are shipped in the rootfs image, nor the BSP components (TF-A, U-Boot, Linux and OP-TEE).  They  can be installed only from the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the [[STM32CubeProgrammer]].

''rootfs'' available space is about 60MB by default. For a better experience it is recommendrecommended to [[STM32CubeProgrammer#How_to_flash_with_STM32CubeProgrammer|flash]] the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the "extensible" flashlayout (''*-extensible.tsv'').<br/>

{{Grey|'''''Extensible flashlayout''''' does not flash userfs partition to extend the rootfs partition to the size of the sdcard.}}

==Usage==
===Prequisite===
We assume your board has an internet connection either through the network cable or through a WiFi connection.

{{InternalInfo|
If your internet access depends on a proxy server, you should define the http_proxy environment variable with the following command before any <code>apt-*</code> commands:
 {{Board$}} export http_proxy&#x003D;'http://<proxy url>:<proxy port>/'
}}
===Apt ===

OpenSTLinux packages can be handled using <code>apt-*</code> utilities, which are the same utilities used on a [https://manpages.debian.org/stable/apt/apt-get.8.en.html Debian system].  The first <code>apt-*</code> command that must be run before any other is:
root@board#{{Board$}} apt-get update The software package is provided AS IS, and by downloading it, you agree to be
  bound to the terms of the software license agreement (SLA).
  The detailed content licenses can be found at<nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.

  Get:1 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell InRelease [3455 B]
  Get:2 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/main armhf Packages [779 kB]
  Get:3 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/updates armhf Packages [32.1 kB]
  Get:4 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf Packages [1450 kB]
  Fetched 2264 kB in 3s (635 kB/s)
  Reading package lists... Done
This command synchronizes the local packages index from the repositories enumerated in [https://manpages.debian.org/stable/apt/sources.list.5.en.html <code>/etc/apt/sources.list{,.d}</code>].  Once it is updated, [https://manpages.debian.org/stable/apt/apt-cache.8.en.html <code>apt-cache</code>] can be used to get the list of all available packages:
root@board#{{Board$}} apt-cache search .Obviously it is  a52dec - ATSC A/52 surround sound stream decoder
  a52dec-doc - ATSC A/52 surround sound stream decoder
  acl - Utilities for managing POSIX Access Control Lists
  ...
  xserver-xorg - The X.Org X server
  xserver-xorg-xwayland - The X.Org X server
  xterm - xterm is the standard terminal emulator for the X Window System
  xvinfo - Print out X-Video extension adaptor information
  xz - Utilities for managing LZMA compressed files

It is possible to list only packages that match a given pattern, for example:
root@board#{{Board$}} apt-cache search emacs[...]
  zile - very small Emacs-subset editor
libreadline-doc - Library for editing typed command lines - Documentation files
  gpm - Console mouse driver
  gpm-doc - Console mouse driver - Documentation files
  zile - Zile is lossy Emacs
  zile-doc - Zile is lossy Emacs - Documentation files
  libreadline8 - Library for editing typed command lines
The desired package(s) can then be easily installed:
root@board#{{Board$}} apt-get install zile... or removed:

  root@board# Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following additional packages will be installed:
    bdwgc
  The following NEW packages will be installed:
    bdwgc zile
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  Need to get 148 kB of archives.
  After this operation, 0 B of additional disk space will be used.
  Do you want to continue? [Y/n]
  Get:1 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf bdwgc armhf 8.0.4-r0 [69.2 kB]
  Get:2 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf zile armhf 2.4.14-r0 [79.3 kB]
  Fetched 148 kB in 0s (465kB/s)

  The software package is provided AS IS, and by downloading it, you agree to be
  bound to the terms of the software license agreement (SLA).
  The detailed content licenses can be found at<nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.

  Selecting previously unselected package bdwgc.
  (Reading database ... 14204 files and directories currently installed.)
  Preparing to unpack .../bdwgc_8.0.4-r0_armhf.deb ...
  Unpacking bdwgc (8.0.4-r0) ...
  Selecting previously unselected package zile.
  Preparing to unpack .../zile_2.4.14-r0_armhf.deb ...
  Unpacking zile (2.4.14-r0) ...
  Setting up bdwgc (8.0.4-r0) ...
  Setting up zile (2.4.14-r0) ...

... or removed:

  {{Board$}} apt-get remove zile Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following package was automatically installed and is no longer required:
    bdwgc
  Use 'apt autoremove' to remove it.
  The following packages will be REMOVED:
    zile
  0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  After this operation, 0 B of additional disk space will be used.
  Do you want to continue? [Y/n]

  The software package is provided AS IS, and by downloading it, you agree to be
  bound to the terms of the software license agreement (SLA).
  The detailed content licenses can be found at<nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.

  (Reading database ... 14209 files and directories currently installed.)
  Removing zile (2.4.14-r0) ...
This command only removes the files that were installed from this package. It does not remove the package from the <code>apt</code> download cache.  If there is not enough space available on the system, it is recommended to clean the cache:
root@board#{{Board$}} apt-get clean

Likewise, some packages may have been automatically installed to respect dependencies with other packages. If they are no longer required, they can be removed to free space:
root@board#{{Board$}} apt-get autoremoveIn addition, it is recommended to regularly install the latest versions of the packages currently installed on the system:

  root@board# apt-get upgrade

===How to create a repository===

A lot of different tools can be used to [https://wiki.debian.org/DebianRepository/Setup generate an Apt repository]; the most recommended one is [https://wiki.debian.org/DebianRepository/SetupWithReprepro <code>reprepro</code>], and
the easiest one is probably <code>apt-ftparchive</code>.  For instance, to
quickly create an Apt repository from a build of OpenSTLinux:

  user@pc$ cd build-openstlinuxweston-stm32mp1
  user@pc$ cd  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following packages will be REMOVED:
    bdwgc
  0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  After this operation, 0 B of additional disk space will be used.
  Do you want to continue? [Y/n]

  The software package is provided AS IS, and by downloading it, you agree to be
  bound to the terms of the software license agreement (SLA).
  The detailed content licenses can be found at<nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.

  (Reading database ... 14208 files and directories currently installed.)
  Removing bdwgc (8.0.4-r0) ...

== How to activate a local package repository ==
===Prerequisite===
Even if ''Package repository for OpenSTLinux'' offers lots of and various packages, you may need to use a local and personnal package repository. To use a local and personnal package repository is a 'smart' and 'quick' way to update the [[STM32MP15_Discovery_kits_-_Starter_Package]] with your developments.

A local package repository is a collection of *.deb organized such <code>apt</code> needs it. The local repository should provide ''Packages'' metafiles.

Natively OpenEmbedded/Yocto build system is able to generate a valid package repository (by using <code>bitbake package-index</code> command listed below). 
So first [[STM32MP1 Distribution Package - OpenSTLinux distribution#Download|Install the STM32MP1 OpenSTLinux distribution]].

===Update the repo package indexes===
Execute the <code>bitbake package-index</code> command:

  {{PC$}} cd [your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>

  {{PC$}} bitbake package-index

===HTTP server execution on the computer===
'''SimpleHTTPserver''' python application is already installed on the board with the OpenSTLinux distribution. You just need to launch this application on your host computer, in the "[your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb/
  user@pc$ ls
  all/  cortexa7t2hf-neon-vfpv4/  stm32mp1/
  user@pc$ apt-ftparchive --arch armhf packages . > Packages
  user@pc$ apt-ftparchive release . > Release

The whole content of this directory (<code>deb</code> in the previous
example) must then be copied to a location that can be accessed by the
OpenSTLinux OS. It could be a file server or a local disk. Just declare this
location (<code>$location</code> in the example below) to the Apt system:

  root@board# " folder:

 {{PC$}} cd [your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb
 {{PC$}} python -m SimpleHTTPServer&

===How to use the local OpenSTLinux Distribution===
We use the physical IP address of the HTTP server we launched above to configure APT. That means this {{<IP>}} address should be defined as static on the host computer.<br/>

You can now configure the APT tool directly on the target via a Linux console:

 {{Board$}} echo "deb [trusted=yes] http://<IP>:8000/stm32mp1 /" > /etc/apt/sources.list.d/my_custom.list
 {{Board$}} echo "deb [trusted=yes] http://<IP>:8000/all /" >> /etc/apt/sources.list.d/my_custom.list
 {{Board$}} echo "deb [trusted=yes] $location /" >http://<IP>:8000/cortexa7t2hf-neon-vfpv4 /" >> /etc/apt/sources.list.d/my_custom.list

In the above example, <code>'''[trusted=yes]</code>''' has been specified because the package manifest is
not [https://wiki.debian.org/SecureApt signed].  Eventually, <code>apt-*</code> commands can be used as described
in the [[#Apt|apt]] section.
'''Release''' is not signed.<br/>


Then you can run the command to synchronize the local packages index:

  {{Board$}} apt-get update
  The software package is provided AS IS, and by downloading it, you agree to be
  bound to the terms of the software license agreement (SLA).
  The detailed content licenses can be found at<nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  Ign:1 http://<IP>:8000/all  InRelease                                                                                                                           
  Ign:2 http://<IP>:8000/stm32mp1  InRelease                                                                                                                      
  Ign:3 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  InRelease                                                                                                       
  Get:4 http://<IP>:8000/all  Release [1213 B]                                                                                                                    
  Get:5 http://<IP>:8000/stm32mp1  Release [1218 B]                                                                                                               
  Get:6 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Release [1233 B]                                                                                                
  Ign:7 http://<IP>:8000/all  Release.gpg                                                                                                                         
  Ign:8 http://<IP>:8000/stm32mp1  Release.gpg                                                                                                                    
  Ign:9 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Release.gpg                                                                                                     
  Get:10 http://<IP>:8000/all  Packages [82.8 kB]                                                                                                                 
  Get:11 http://<IP>:8000/stm32mp1  Packages [173 kB]                                                                                                             
  Get:12 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Packages [1734 kB]                                                                                             
  Fetched 1994 kB in 3s (662 kB/s)                                                                                                                                        
  Reading package lists... Done

The other <code>apt-*</code> commands are now available as described above.
==Support==

Bug reports, request for new packages, or any other kind of support
requests can be submitted through https://community.st.com.

==Further readings==

* [[Dpkg]]
* https://manpages.debian.org/stable/apt/apt-get.8.en.html
* https://manpages.debian.org/stable/apt/sources.list.5.en.html
* https://manpages.debian.org/stable/apt/apt-cache.8.en.html
* https://wiki.debian.org/DebianRepository/Setup
* https://wiki.debian.org/DebianRepository/SetupWithReprepro
* https://wiki.debian.org/SecureApt
* https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package
* https://wiki.st.com/stm32mpu/wiki/STM32MP15_Evaluation_boards_-_Starter_Package
* https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package[[STM32MP15 Discovery kits - Starter Package]]
* [[STM32MP15_Evaluation boards - Starter Package]]
* [[STM32MP1 Developer Package]]

<noinclude>

[[Category:Services]]
{{PublicationRequestId | 14914 | 2020-02-12 |AnneJ}}</noinclude>
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
==Disclaimers==
 
==Disclaimers==
 
 
STMicroelectronics packages repository service is provided for evaluation purpose only, and therefore not approved for use in production.<br/>
 
STMicroelectronics packages repository service is provided for evaluation purpose only, and therefore not approved for use in production.<br/>
The package licenses hosted in these repositories can be found here: [[OpenSTLinux_licenses]].
+
The package licenses hosted in these repositories can be found here: [[OpenSTLinux_licenses|OpenSTLinux licenses]].<br/>
  +
Command outputs described in this document may slightly vary depending on tools version.
   
==Description==
+
===Description===
OpenSTLinux provides a package repository service hosted at [http://packages.openstlinux.st.com packages.openstlinux.st.com].
+
OpenSTLinux provides a package repository service hosted at the non-browsable URL <nowiki>http://packages.openstlinux.st.com</nowiki>.
   
 
The package repository service is designed for ''STM32MP157C-DK2'' boards and is enabled by default in the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]].
 
The package repository service is designed for ''STM32MP157C-DK2'' boards and is enabled by default in the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]].
  +
   
 
===Organization===
 
===Organization===
  +
Within each repository, packages are organized in three groups (a.k.a ''components'' in the APT terminology):
   
Within each repository, packages are organized in two groups (a.k.a "components" in the APT terminology):
+
* the '''main''' group contains a wide selection of packages whose installation is automatically tested by STMicroelectronics
 
+
* the '''untested''' group contains all the other packages that can be built using the <code>bitbake world</code> command. However their installation is not guaranteed.
* the "main" group contains a wide selection of packages whose installation is automatically tested by STMicroelectronics
+
* the '''updates''' group contains additional packages not included in the [[OpenSTLinux_distribution|OpenSTLinux distribution releases]] and updated packages. This group is managed by a dedicated layer available through github®. Further details are available by following the github® link: https://github.com/STMicroelectronics/meta-st-pkgrepo-updates.
* the "untested" group contains all the other packages that can be built using the <code>bitbake world</code> command. However their installation is not guaranteed.
 
 
 
A third group named "updates" is reserved for future use.
 
 
 
   
 
===Limitations===
 
===Limitations===
 
Packages repository service doesn't include the packages that are shipped in the rootfs image, nor the BSP components (TF-A, U-Boot, Linux and OP-TEE).  They  can be installed only from the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the [[STM32CubeProgrammer]].
 
Packages repository service doesn't include the packages that are shipped in the rootfs image, nor the BSP components (TF-A, U-Boot, Linux and OP-TEE).  They  can be installed only from the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the [[STM32CubeProgrammer]].
   
''rootfs'' available space is about 60MB by default. For a better experience it is recommend to [[STM32CubeProgrammer#How_to_flash_with_STM32CubeProgrammer|flash]] the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the "extensible" flashlayout (''*-extensible.tsv'').<br/>
+
''rootfs'' available space is about 60MB by default. For a better experience it is recommended to [[STM32CubeProgrammer#How_to_flash_with_STM32CubeProgrammer|flash]] the [[STM32MP15_Discovery_kits_-_Starter_Package|Starter Package]] using the "extensible" flashlayout (''*-extensible.tsv'').<br/>
 
{{Grey|'''''Extensible flashlayout''''' does not flash userfs partition to extend the rootfs partition to the size of the sdcard.}}
 
{{Grey|'''''Extensible flashlayout''''' does not flash userfs partition to extend the rootfs partition to the size of the sdcard.}}
  +
   
 
==Usage==
 
==Usage==
  +
===Prequisite===
  +
We assume your board has an internet connection either through the network cable or through a WiFi connection.
  +
  +
{{InternalInfo|
  +
If your internet access depends on a proxy server, you should define the http_proxy environment variable with the following command before any <code>apt-*</code> commands:
  +
{{Board$}} export http_proxy&#x003D;'http://<proxy url>:<proxy port>/'
  +
}}
   
 
===Apt ===
 
===Apt ===
Line 31: Line 37:
 
OpenSTLinux packages can be handled using <code>apt-*</code> utilities, which are the same utilities used on a [https://manpages.debian.org/stable/apt/apt-get.8.en.html Debian system].  The first <code>apt-*</code> command that must be run before any other is:
 
OpenSTLinux packages can be handled using <code>apt-*</code> utilities, which are the same utilities used on a [https://manpages.debian.org/stable/apt/apt-get.8.en.html Debian system].  The first <code>apt-*</code> command that must be run before any other is:
   
   root@board# apt-get update
+
   {{Board$}} apt-get update
  +
  The software package is provided AS IS, and by downloading it, you agree to be
  +
  bound to the terms of the software license agreement (SLA).
  +
  The detailed content licenses can be found at
  +
  <nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  +
 
  +
  Get:1 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell InRelease [3455 B]
  +
  Get:2 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/main armhf Packages [779 kB]
  +
  Get:3 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/updates armhf Packages [32.1 kB]
  +
  Get:4 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf Packages [1450 kB]
  +
  Fetched 2264 kB in 3s (635 kB/s)
  +
  Reading package lists... Done
   
 
This command synchronizes the local packages index from the repositories enumerated in [https://manpages.debian.org/stable/apt/sources.list.5.en.html <code>/etc/apt/sources.list{,.d}</code>].  Once it is updated, [https://manpages.debian.org/stable/apt/apt-cache.8.en.html <code>apt-cache</code>] can be used to get the list of all available packages:
 
This command synchronizes the local packages index from the repositories enumerated in [https://manpages.debian.org/stable/apt/sources.list.5.en.html <code>/etc/apt/sources.list{,.d}</code>].  Once it is updated, [https://manpages.debian.org/stable/apt/apt-cache.8.en.html <code>apt-cache</code>] can be used to get the list of all available packages:
   
   root@board# apt-cache search .
+
   {{Board$}} apt-cache search .
  +
  a52dec - ATSC A/52 surround sound stream decoder
  +
  a52dec-doc - ATSC A/52 surround sound stream decoder
  +
  acl - Utilities for managing POSIX Access Control Lists
  +
  ...
  +
  xserver-xorg - The X.Org X server
  +
  xserver-xorg-xwayland - The X.Org X server
  +
  xterm - xterm is the standard terminal emulator for the X Window System
  +
  xvinfo - Print out X-Video extension adaptor information
  +
  xz - Utilities for managing LZMA compressed files
   
Obviously it is possible to list only packages that match a given pattern, for example:
+
It is possible to list only packages that match a given pattern, for example:
   
   root@board# apt-cache search emacs
+
   {{Board$}} apt-cache search emacs
   [...]
+
   libreadline-doc - Library for editing typed command lines - Documentation files
   zile - very small Emacs-subset editor
+
  gpm - Console mouse driver
  +
  gpm-doc - Console mouse driver - Documentation files
  +
  zile - Zile is lossy Emacs
  +
   zile-doc - Zile is lossy Emacs - Documentation files
  +
  libreadline8 - Library for editing typed command lines
   
 
The desired package(s) can then be easily installed:
 
The desired package(s) can then be easily installed:
   
   root@board# apt-get install zile
+
   {{Board$}} apt-get install zile
  +
  Reading package lists... Done
  +
  Building dependency tree
  +
  Reading state information... Done
  +
  The following additional packages will be installed:
  +
    bdwgc
  +
  The following NEW packages will be installed:
  +
    bdwgc zile
  +
  0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  +
  Need to get 148 kB of archives.
  +
  After this operation, 0 B of additional disk space will be used.
  +
  Do you want to continue? [Y/n]
  +
  Get:1 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf bdwgc armhf 8.0.4-r0 [69.2 kB]
  +
  Get:2 <nowiki>http://packages.openstlinux.st.com/3.1</nowiki> dunfell/untested armhf zile armhf 2.4.14-r0 [79.3 kB]
  +
  Fetched 148 kB in 0s (465kB/s)
  +
 
  +
  The software package is provided AS IS, and by downloading it, you agree to be
  +
  bound to the terms of the software license agreement (SLA).
  +
  The detailed content licenses can be found at
  +
  <nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  +
 
  +
  Selecting previously unselected package bdwgc.
  +
  (Reading database ... 14204 files and directories currently installed.)
  +
  Preparing to unpack .../bdwgc_8.0.4-r0_armhf.deb ...
  +
  Unpacking bdwgc (8.0.4-r0) ...
  +
  Selecting previously unselected package zile.
  +
  Preparing to unpack .../zile_2.4.14-r0_armhf.deb ...
  +
  Unpacking zile (2.4.14-r0) ...
  +
  Setting up bdwgc (8.0.4-r0) ...
  +
  Setting up zile (2.4.14-r0) ...
   
 
... or removed:
 
... or removed:
   
   root@board# apt-get remove zile
+
   {{Board$}} apt-get remove zile
  +
  Reading package lists... Done
  +
  Building dependency tree
  +
  Reading state information... Done
  +
  The following package was automatically installed and is no longer required:
  +
    bdwgc
  +
  Use 'apt autoremove' to remove it.
  +
  The following packages will be REMOVED:
  +
    zile
  +
  0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  +
  After this operation, 0 B of additional disk space will be used.
  +
  Do you want to continue? [Y/n]
  +
 
  +
  The software package is provided AS IS, and by downloading it, you agree to be
  +
  bound to the terms of the software license agreement (SLA).
  +
  The detailed content licenses can be found at
  +
  <nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  +
   
  +
  (Reading database ... 14209 files and directories currently installed.)
  +
  Removing zile (2.4.14-r0) ...
  +
 
   
 
This command only removes the files that were installed from this package. It does not remove the package from the <code>apt</code> download cache.  If there is not enough space available on the system, it is recommended to clean the cache:
 
This command only removes the files that were installed from this package. It does not remove the package from the <code>apt</code> download cache.  If there is not enough space available on the system, it is recommended to clean the cache:
   
   root@board# apt-get clean
+
   {{Board$}} apt-get clean
   
 
Likewise, some packages may have been automatically installed to respect dependencies with other packages. If they are no longer required, they can be removed to free space:
 
Likewise, some packages may have been automatically installed to respect dependencies with other packages. If they are no longer required, they can be removed to free space:
   
   root@board# apt-get autoremove
+
   {{Board$}} apt-get autoremove
  +
  Reading package lists... Done
  +
  Building dependency tree
  +
  Reading state information... Done
  +
  The following packages will be REMOVED:
  +
    bdwgc
  +
  0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  +
  After this operation, 0 B of additional disk space will be used.
  +
  Do you want to continue? [Y/n]
  +
 
  +
  The software package is provided AS IS, and by downloading it, you agree to be
  +
  bound to the terms of the software license agreement (SLA).
  +
  The detailed content licenses can be found at
  +
  <nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  +
 
  +
  (Reading database ... 14208 files and directories currently installed.)
  +
  Removing bdwgc (8.0.4-r0) ...
  +
 
  +
== How to activate a local package repository ==
  +
===Prerequisite===
  +
Even if ''Package repository for OpenSTLinux'' offers lots of and various packages, you may need to use a local and personnal package repository. To use a local and personnal package repository is a 'smart' and 'quick' way to update the [[STM32MP15_Discovery_kits_-_Starter_Package]] with your developments.
  +
 
  +
A local package repository is a collection of *.deb organized such <code>apt</code> needs it. The local repository should provide ''Packages'' metafiles.
   
In addition, it is recommended to regularly install the latest versions of the packages currently installed on the system:
+
Natively OpenEmbedded/Yocto build system is able to generate a valid package repository (by using <code>bitbake package-index</code> command listed below).
  +
So first [[STM32MP1 Distribution Package - OpenSTLinux distribution#Download|Install the STM32MP1 OpenSTLinux distribution]].
   
  root@board# apt-get upgrade
+
===Update the repo package indexes===
  +
Execute the <code>bitbake package-index</code> command:
   
===How to create a repository===
+
  {{PC$}} cd [your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>
  +
  {{PC$}} bitbake package-index
   
A lot of different tools can be used to [https://wiki.debian.org/DebianRepository/Setup generate an Apt repository]; the most recommended one is [https://wiki.debian.org/DebianRepository/SetupWithReprepro <code>reprepro</code>], and
+
===HTTP server execution on the computer===
the easiest one is probably <code>apt-ftparchive</code>.  For instance, to
+
'''SimpleHTTPserver''' python application is already installed on the board with the OpenSTLinux distribution. You just need to launch this application on your host computer, in the "[your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb" folder:
quickly create an Apt repository from a build of OpenSTLinux:
 
   
  user@pc$ cd build-openstlinuxweston-stm32mp1
+
{{PC$}} cd [your STM32MP1 Distribution path]/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy/deb
  user@pc$ cd tmp-glibc/deploy/deb/
+
  {{PC$}} python -m SimpleHTTPServer&
  user@pc$ ls
 
  all/ cortexa7t2hf-neon-vfpv4/  stm32mp1/
 
  user@pc$ apt-ftparchive --arch armhf packages . > Packages
 
  user@pc$ apt-ftparchive release . > Release
 
   
The whole content of this directory (<code>deb</code> in the previous
+
===How to use the local OpenSTLinux Distribution===
example) must then be copied to a location that can be accessed by the
+
We use the physical IP address of the HTTP server we launched above to configure APT. That means this {{<IP>}} address should be defined as static on the host computer.<br/>
OpenSTLinux OS. It could be a file server or a local disk. Just declare this
+
You can now configure the APT tool directly on the target via a Linux console:
location (<code>$location</code> in the example below) to the Apt system:
 
   
  root@board# echo "deb [trusted=yes] $location /" > /etc/apt/sources.list.d/custom.list
+
{{Board$}} echo "deb [trusted=yes] http://<IP>:8000/stm32mp1 /" > /etc/apt/sources.list.d/my_custom.list
  +
{{Board$}} echo "deb [trusted=yes] http://<IP>:8000/all /" >> /etc/apt/sources.list.d/my_custom.list
  +
{{Board$}} echo "deb [trusted=yes] http://<IP>:8000/cortexa7t2hf-neon-vfpv4 /" >> /etc/apt/sources.list.d/my_custom.list
   
In the above example, <code>[trusted=yes]</code> has been specified because the package manifest is
+
In the above example, '''[trusted=yes]''' has been specified because the package manifest '''Release''' is not signed.<br/>
not [https://wiki.debian.org/SecureApt signed].  Eventually, <code>apt-*</code> commands can be used as described
+
 
in the [[#Apt|apt]] section.
+
Then you can run the command to synchronize the local packages index:
  +
 
  +
  {{Board$}} apt-get update
  +
  The software package is provided AS IS, and by downloading it, you agree to be
  +
  bound to the terms of the software license agreement (SLA).
  +
  The detailed content licenses can be found at
  +
  <nowiki>https://wiki.st.com/stm32mpu/wiki/OpenSTLinux_licenses</nowiki>.
  +
  Ign:1 http://<IP>:8000/all  InRelease                                                                                                                         
  +
  Ign:2 http://<IP>:8000/stm32mp1  InRelease                                                                                                                     
  +
  Ign:3 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  InRelease                                                                                                     
  +
  Get:4 http://<IP>:8000/all  Release [1213 B]                                                                                                                   
  +
  Get:5 http://<IP>:8000/stm32mp1  Release [1218 B]                                                                                                             
  +
  Get:6 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Release [1233 B]                                                                                              
  +
  Ign:7 http://<IP>:8000/all  Release.gpg                                                                                                                       
  +
  Ign:8 http://<IP>:8000/stm32mp1  Release.gpg                                                                                                                   
  +
  Ign:9 http://<IP>:8000/cortexa7t2hf-neon-vfpv4 Release.gpg                                                                                                   
  +
  Get:10 http://<IP>:8000/all  Packages [82.8 kB]                                                                                                               
  +
  Get:11 http://<IP>:8000/stm32mp1  Packages [173 kB]                                                                                                           
  +
  Get:12 http://<IP>:8000/cortexa7t2hf-neon-vfpv4  Packages [1734 kB]                                                                                           
  +
  Fetched 1994 kB in 3s (662 kB/s)                                                                                                                                       
  +
  Reading package lists... Done
  +
 
  +
The other <code>apt-*</code> commands are now available as described above.
   
 
==Support==
 
==Support==
Line 91: Line 213:
 
Bug reports, request for new packages, or any other kind of support
 
Bug reports, request for new packages, or any other kind of support
 
requests can be submitted through https://community.st.com.
 
requests can be submitted through https://community.st.com.
  +
   
 
==Further readings==
 
==Further readings==
Line 101: Line 224:
 
* https://wiki.debian.org/DebianRepository/SetupWithReprepro
 
* https://wiki.debian.org/DebianRepository/SetupWithReprepro
 
* https://wiki.debian.org/SecureApt
 
* https://wiki.debian.org/SecureApt
* https://wiki.st.com/stm32mpu/wiki/STM32MP15_Discovery_kits_-_Starter_Package
+
* [[STM32MP15 Discovery kits - Starter Package]]
* https://wiki.st.com/stm32mpu/wiki/STM32MP15_Evaluation_boards_-_Starter_Package
+
* [[STM32MP15_Evaluation boards - Starter Package]]
* https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package
+
* [[STM32MP1 Developer Package]]
   
 
<noinclude>
 
<noinclude>