Difference between revisions of "How to manage the debian packages in OpenSTLinux distribution"

[quality revision] [pending revision]
m (Replaced content with "<noinclude> {{ArticleMainWriter| YvesC}} {{ReviewersList | NathalieS, BernardP, ChristopheP}} {{ArticleApprovedVersion | Jean-ChristopheT | Nobody | No previous approved v...")
(Tag: Replaced)
m
 




Under construction.png Coming soon

The purpose of this article is to describe a simple and fast configuration for using the management system for software packages (APT : Advanced Packaging Tool)).

1 Introduction[edit]

With the OpenSTLinux distribution, all the debian packages defined in the distribution configuration are built and stored. In order to update your board with some software components included in these packages, you can use the APT. The APT allow you to upgrade/install/remove some packages on the target from a source like a HTTP server. Software dependencies are managed automatically by the tool. It's a good way to share all updates or new application/framework development for validation. For this simple and fast configuration we use a basic HTTP server python application SimpleHTTPServer. For multi-user and security aspects you can use a more reliable Web server application as Apache.

2 Prerequisites[edit]

  • one MPU board
  • the STM32MP1 Distribution Package
  • package index generated throw STM32MP1 Distribution Package (bitbake package-index)
  • an internet connection
  • a computer with Linux OS Ubuntu

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 computer. The <TOP-DIR> is the folder you installed the OpenSTLinux Distribution. An example for <DISTRO> "openstlinux-weston" and for <MACHINE> "stm32mp1".

PC $>cd <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy
PC $>python -m SimpleHTTPServer&


Info.png For Apache :
  • Apache HTTP server installation
PC $> sudo apt-get install apache2

  • Apache HTTP server basic configuration

site definition :

PC $> cd /etc/apache2/sites-available
PC $> vi openstlinux_packages.conf

fill the file openstlinux_packages.conf with :


 <VirtualHost <IP>:80>
	DocumentRoot	/var/www/openstlinux_packages.com
	ServerName	openstlinux_packages.com
	<Directory /var/www/openstlinux_packages.com>
		Allow from all
        </Directory>
 </VirtualHost>

PC $> cd /var/www
PC $> sudo ln -s  <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy openstlinux_packages.com

  • site&server activation
PC $> sudo a2ensite openstlinux_packages.conf
PC $> service apache2 reload

4 APT configuration on the target[edit]

You can configure the APT tool directly on the target via a Linux console. <IP> is the IP address of the HTTP server, we use the physical IP address of the HTTP server to configure APT, means that this address should be defined as static on computer.

Board $> echo 'deb http://<IP>:8000/deb/stm32mp1 /' >> /etc/apt/sources.list.d/stm32mp1.list
Board $> echo 'deb http://<IP>:8000/deb/all /' >>  /etc/apt/sources.list.d/stm32mp1.list
Board $> echo 'deb http://<IP>:8000/deb/cortexa7hf-neon-vfpv4 /' >>  /etc/apt/sources.list.d/stm32mp1.list

5 Package install example[edit]

Execute the command apt-get update on the target Linux console

Board $> apt-get update

This is an example of result expected :

root@stm32mp1:~# apt-get update
Ign:1 http://<IP>:8000/deb/stm32mp1  InRelease
Ign:2 http://<IP>:8000/deb/all  InRelease
Ign:3 http://<IP>:8000/deb/cortexa7hf-neon-vfpv4  InRelease
Get:4 http://<IP>:8000/deb/stm32mp1  Release [1218 B]
Get:5 http://<IP>:8000/deb/all  Release [1213 B]
Get:6 http://<IP>:8000/deb/cortexa7hf-neon-vfpv4  Release [1231 B]
Ign:7 http://<IP>:8000/deb/stm32mp1  Release.gpg
Ign:8 http://<IP>:8000/deb/all  Release.gpg
Ign:9 http://<IP>:8000/deb/cortexa7hf-neon-vfpv4  Release.gpg
Fetched 3662 B in 0s (31.2 kB/s)
Reading package lists... Done
W: The repository 'http://<IP>:8000/deb/stm32mp1  Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://<IP>:8000/deb/all  Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://<IP>:8000/deb/cortexa7hf-neon-vfpv4  Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@stm32mp1:~#

Execute the command apt-get install on the target Linux console, the package to install in this example is python-json

Board $> apt-get install python-json

This is an example of result expected :

root@stm32mp1:~# apt-get install python-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
 python-json
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/48.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
 python-json
Install these packages without verification? [y/N] y
Selecting previously unselected package python-json.
(Reading database ... 13484 files and directories currently installed.)
Preparing to unpack .../python-json_2.7.13-r1_armhf.deb ...
Unpacking python-json (2.7.13-r1) ...
Setting up python-json (2.7.13-r1) ...
root@stm32mp1:~#

6 Reference list[edit]

<noinclude>

{{ArticleMainWriter| YvesC}}
{{ReviewersList | NathalieS, BernardP, ChristopheP}}
{{ArticleApprovedVersion | Jean-ChristopheT | Nobody ArticleProposedVersion | YvesC | NathalieS (Not Done), BernardP (Not Done), ChristopheP (Done Dec03 2018) | No previous approved version | Automatic approval (article under construction) | 19Feb’19}}Nobody | 15May'18}}
[[Category:How to customize software]]</noinclude>
{{UnderConstruction}}

The purpose of this article is to describe a simple and fast configuration for using the management system for software packages (APT : Advanced Packaging Tool)).

= Introduction =
With the OpenSTLinux distribution, all the debian packages defined in the distribution configuration are built and stored. In order to update your board with some software components included in these packages, you can use the APT. The APT allow you to upgrade/install/remove some packages on the target from a source like a HTTP server. Software dependencies are managed automatically by the tool. It's a good way to share all updates or new application/framework development for validation. For this simple and fast configuration we use a basic HTTP server python application '''SimpleHTTPServer'''. For multi-user and security aspects you can use a more reliable Web server application as '''Apache'''.

= Prerequisites =
*one MPU board 
*the [[STM32MP1 Distribution Package]]
*package index generated throw STM32MP1 Distribution Package (bitbake package-index)
*an internet connection
*a computer with Linux OS Ubuntu

= 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 computer. The <TOP-DIR> is the folder you installed the OpenSTLinux Distribution. An example for <DISTRO> "openstlinux-weston" and for <MACHINE> "stm32mp1".

 {{PC$}}cd <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy
 {{PC$}}python -m SimpleHTTPServer&

{{Info|For '''Apache :''' 
*Apache HTTP server installation
 {{PC$}} sudo apt-get install apache2
*Apache HTTP server basic configuration
site definition :
 {{PC$}} cd /etc/apache2/sites-available
 {{PC$}} vi openstlinux_packages.conf
fill the file openstlinux_packages.conf with :<pre>
<VirtualHost <IP>:80>
	DocumentRoot	/var/www/openstlinux_packages.com
	ServerName	openstlinux_packages.com<Directory /var/www/openstlinux_packages.com>

		Allow from all</Directory>
</VirtualHost>
</pre>

 {{PC$}} cd /var/www
 {{PC$}} sudo ln -s  <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy openstlinux_packages.com
*site&server activation
 {{PC$}} sudo a2ensite openstlinux_packages.conf
 {{PC$}} service apache2 reload
}}

= APT configuration on the target =
You can configure the APT tool directly on the target via a Linux console.<IP> is the IP address of the HTTP server, we use the physical IP address of the HTTP server to configure APT, means that this address should be defined as static on computer.
 {{Board$}} echo 'deb http://<IP>:8000/deb/stm32mp1 /' >> /etc/apt/sources.list.d/stm32mp1.list
 {{Board$}} echo 'deb http://<IP>:8000/deb/all /' >>  /etc/apt/sources.list.d/stm32mp1.list
 {{Board$}} echo 'deb http://<IP>:8000/deb/cortexa7hf-neon-vfpv4 /' >>  /etc/apt/sources.list.d/stm32mp1.list

= Package install example =
Execute the command '''apt-get update''' on the target Linux console
 {{Board$}} apt-get update

This is an example of result expected :
 root@stm32mp1:~# apt-get update
 Ign:1 http://''<IP>'':8000/deb/stm32mp1  InRelease
 Ign:2 http://''<IP>'':8000/deb/all  InRelease
 Ign:3 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  InRelease
 Get:4 http://''<IP>'':8000/deb/stm32mp1  Release [1218 B]
 Get:5 http://''<IP>'':8000/deb/all  Release [1213 B]
 Get:6 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release [1231 B]
 Ign:7 http://''<IP>'':8000/deb/stm32mp1  Release.gpg
 Ign:8 http://''<IP>'':8000/deb/all  Release.gpg
 Ign:9 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release.gpg
 Fetched 3662 B in 0s (31.2 kB/s)
 Reading package lists... Done
 W: The repository 'http://''<IP>'':8000/deb/stm32mp1  Release' is not signed.
 N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
 N: See apt-secure(8) manpage for repository creation and user configuration details.
 W: The repository 'http://''<IP>'':8000/deb/all  Release' is not signed.
 N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
 N: See apt-secure(8) manpage for repository creation and user configuration details.
 W: The repository 'http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release' is not signed.
 N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
 N: See apt-secure(8) manpage for repository creation and user configuration details.
 root@stm32mp1:~#

Execute the command '''apt-get install''' on the target Linux console, the package to install in this example is '''python-json'''
 {{Board$}} apt-get install python-json

This is an example of result expected :
 root@stm32mp1:~# apt-get install python-json
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 The following NEW packages will be installed:
  python-json
 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
 Need to get 0 B/48.3 kB of archives.
 After this operation, 0 B of additional disk space will be used.
 WARNING: The following packages cannot be authenticated!
  python-json
 Install these packages without verification? [y/N] y
 Selecting previously unselected package python-json.
 (Reading database ... 13484 files and directories currently installed.)
 Preparing to unpack .../python-json_2.7.13-r1_armhf.deb ...
 Unpacking python-json (2.7.13-r1) ...
 Setting up python-json (2.7.13-r1) ...
 root@stm32mp1:~#

= Reference list =<references />
Line 2: Line 2:
 
{{ArticleMainWriter| YvesC}}
 
{{ArticleMainWriter| YvesC}}
 
{{ReviewersList | NathalieS, BernardP, ChristopheP}}
 
{{ReviewersList | NathalieS, BernardP, ChristopheP}}
{{ArticleApprovedVersion | Jean-ChristopheT | Nobody | No previous approved version | Automatic approval (article under construction) | 19Feb’19}}
+
{{ArticleProposedVersion | YvesC | NathalieS (Not Done), BernardP (Not Done), ChristopheP (Done Dec03 2018) | No previous approved version | Nobody | 15May'18}}
  +
 
 
[[Category:How to customize software]]
 
[[Category:How to customize software]]
 
</noinclude>
 
</noinclude>
{{UnderConstruction}}
+
 
  +
The purpose of this article is to describe a simple and fast configuration for using the management system for software packages (APT : Advanced Packaging Tool)).
  +
 
  +
= Introduction =
  +
With the OpenSTLinux distribution, all the debian packages defined in the distribution configuration are built and stored. In order to update your board with some software components included in these packages, you can use the APT. The APT allow you to upgrade/install/remove some packages on the target from a source like a HTTP server. Software dependencies are managed automatically by the tool. It's a good way to share all updates or new application/framework development for validation. For this simple and fast configuration we use a basic HTTP server python application '''SimpleHTTPServer'''. For multi-user and security aspects you can use a more reliable Web server application as '''Apache'''.
  +
 
  +
= Prerequisites =
  +
*one MPU board
  +
*the [[STM32MP1 Distribution Package]]
  +
*package index generated throw STM32MP1 Distribution Package (bitbake package-index)
  +
*an internet connection
  +
*a computer with Linux OS Ubuntu
  +
 
  +
= 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 computer. The <TOP-DIR> is the folder you installed the OpenSTLinux Distribution. An example for <DISTRO> "openstlinux-weston" and for <MACHINE> "stm32mp1".
  +
 
  +
{{PC$}}cd <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy
  +
{{PC$}}python -m SimpleHTTPServer&
  +
 
  +
 
  +
{{Info|For '''Apache :'''
  +
*Apache HTTP server installation
  +
{{PC$}} sudo apt-get install apache2
  +
*Apache HTTP server basic configuration
  +
site definition :
  +
{{PC$}} cd /etc/apache2/sites-available
  +
{{PC$}} vi openstlinux_packages.conf
  +
fill the file openstlinux_packages.conf with :
  +
<pre>
  +
<VirtualHost <IP>:80>
  +
DocumentRoot /var/www/openstlinux_packages.com
  +
ServerName openstlinux_packages.com
  +
<Directory /var/www/openstlinux_packages.com>
  +
Allow from all
  +
        </Directory>
  +
</VirtualHost>
  +
</pre>
  +
{{PC$}} cd /var/www
  +
{{PC$}} sudo ln -s  <TOP-DIR>/build-<DISTRO>-<MACHINE>/tmp-glibc/deploy openstlinux_packages.com
  +
*site&server activation
  +
{{PC$}} sudo a2ensite openstlinux_packages.conf
  +
{{PC$}} service apache2 reload
  +
}}
  +
 
  +
= APT configuration on the target =
  +
You can configure the APT tool directly on the target via a Linux console.
  +
<IP> is the IP address of the HTTP server, we use the physical IP address of the HTTP server to configure APT, means that this address should be defined as static on computer.
  +
{{Board$}} echo 'deb http://<IP>:8000/deb/stm32mp1 /' >> /etc/apt/sources.list.d/stm32mp1.list
  +
{{Board$}} echo 'deb http://<IP>:8000/deb/all /' >>  /etc/apt/sources.list.d/stm32mp1.list
  +
{{Board$}} echo 'deb http://<IP>:8000/deb/cortexa7hf-neon-vfpv4 /' >>  /etc/apt/sources.list.d/stm32mp1.list
  +
 
  +
= Package install example =
  +
Execute the command '''apt-get update''' on the target Linux console
  +
{{Board$}} apt-get update
  +
 
  +
This is an example of result expected :
  +
root@stm32mp1:~# apt-get update
  +
Ign:1 http://''<IP>'':8000/deb/stm32mp1  InRelease
  +
Ign:2 http://''<IP>'':8000/deb/all  InRelease
  +
Ign:3 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  InRelease
  +
Get:4 http://''<IP>'':8000/deb/stm32mp1  Release [1218 B]
  +
Get:5 http://''<IP>'':8000/deb/all  Release [1213 B]
  +
Get:6 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release [1231 B]
  +
Ign:7 http://''<IP>'':8000/deb/stm32mp1  Release.gpg
  +
Ign:8 http://''<IP>'':8000/deb/all  Release.gpg
  +
Ign:9 http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release.gpg
  +
Fetched 3662 B in 0s (31.2 kB/s)
  +
Reading package lists... Done
  +
W: The repository 'http://''<IP>'':8000/deb/stm32mp1  Release' is not signed.
  +
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
  +
N: See apt-secure(8) manpage for repository creation and user configuration details.
  +
W: The repository 'http://''<IP>'':8000/deb/all  Release' is not signed.
  +
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
  +
N: See apt-secure(8) manpage for repository creation and user configuration details.
  +
W: The repository 'http://''<IP>'':8000/deb/cortexa7hf-neon-vfpv4  Release' is not signed.
  +
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
  +
N: See apt-secure(8) manpage for repository creation and user configuration details.
  +
root@stm32mp1:~#
  +
 
  +
Execute the command '''apt-get install''' on the target Linux console, the package to install in this example is '''python-json'''
  +
{{Board$}} apt-get install python-json
  +
 
  +
This is an example of result expected :
  +
root@stm32mp1:~# apt-get install python-json
  +
Reading package lists... Done
  +
Building dependency tree
  +
Reading state information... Done
  +
The following NEW packages will be installed:
  +
  python-json
  +
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  +
Need to get 0 B/48.3 kB of archives.
  +
After this operation, 0 B of additional disk space will be used.
  +
WARNING: The following packages cannot be authenticated!
  +
  python-json
  +
Install these packages without verification? [y/N] y
  +
Selecting previously unselected package python-json.
  +
(Reading database ... 13484 files and directories currently installed.)
  +
Preparing to unpack .../python-json_2.7.13-r1_armhf.deb ...
  +
Unpacking python-json (2.7.13-r1) ...
  +
Setting up python-json (2.7.13-r1) ...
  +
root@stm32mp1:~#
  +
 
  +
= Reference list =
  +
<references />

Attachments

Discussions