Setting up a package management service in Yocto for your image

Document created by Rodrigue Simonneau Employee on Nov 29, 2016Last modified by Rodrigue Simonneau Employee on Nov 30, 2016
Version 2Show Document
  • View in full screen mode

Wondering how to manage and install the various rpms generated under tmp/deploy/rpm?

smart is the application you need on the target to replace apt-get

 

Please set your local.conf with the following:

# It is also recommended you use build history, which adds some sanity checks to package versions, in conjunction with the server that

# is running the PR Service. To enable build history, add the following to each building system's
# It is recommended to activate "buildhistory" for testing the PR service

INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"

PRSERV_HOST = "localhost:0"  # This will set up your host computer as Package Revision Server
// PACKAGE_FEED_URIS = "http://10.170.96.7/imx7rpm" #please place any server ip addr, this one is mine.

add also the following to enable the package management (smart):

EXTRA_IMAGE_FEATURES += "package-management"

 

Setup your own http server, and link the server repository with your tmp/deploy/rpm repo (your are free to use your preferred http server).

 

Once this done, tell the system to index the packages:

bitbake package-index

do that after every build

 

once this is done, you only have to check on your target and add the update server channels:

smart channel --add all type=rpm-md baseurl=http://10.170.96.7/imx7rpm/rpm/all

smart channel --add cortexa7hf_neon type=rpm-md baseurl=http://10.170.96.7/imx7rpm/rpm/cortexa7hf_neon

 

smart query gcc*

root@imx7dsabresd:/# smart query gcc*
Loading cache...
Updating cache...                                         ################################################################################ [100%]

gcc-5.3.0-r0@cortexa7hf_neon
gcc-dev-5.3.0-r0@cortexa7hf_neon
gcc-sanitizers-5.3.0-r0@cortexa7hf_neon
gcc-symlinks-5.3.0-r0@cortexa7hf_neon

 

=> you may get that way all the rpms you placed in the http server repo!

 

smart update checks for new packages. After a new build you should see them.

Image compiled: core-image-base

Example of newly compiled package: sqlite

bitabke sqlite

bitbake package-index

 

root@imx7dsabresd:/# smart update
Loading cache...
Updating cache...                                         ################################################################################ [100%]

Fetching information for 'all'...                                                                                                               
-> http://10.170.96.7/imx7rpm/rpm/all/repodata/repomd.xml                                                                                       
repomd.xml                                                ################################################################################ [ 25%]
-> http://10.170.96.7/imx7rpm/rpm/all/repodata/primary.xml.gz                                                                                   
primary.xml.gz                                            ################################################################################ [ 37%]
-> http://10.170.96.7/imx7rpm/rpm/all/repodata/filelists.xml.gz                                                                                 
filelists.xml.gz                                          ################################################################################ [ 50%]
                                                                                                                                                
Fetching information for 'cortexa7hf_neon'...
-> http://10.170.96.7/imx7rpm/rpm/cortexa7hf_neon/repodata/repomd.xml                                                                           
repomd.xml                                                ################################################################################ [ 75%]
-> http://10.170.96.7/imx7rpm/rpm/cortexa7hf_neon/repodata/primary.xml.gz                                                                       
-> http://10.170.96.7/imx7rpm/rpm/cortexa7hf_neon/repodata/filelists.xml.gz                                                                     
filelists.xml.gz                                          ################################################################################ [ 87%]
primary.xml.gz                                            ################################################################################ [100%]

Updating cache...                                         ################################################################################ [100%]

Channels have 4 new packages:
    libsqlite-bin-2.8.17-r7.0@cortexa7hf_neon
    libsqlite-dbg-2.8.17-r7.0@cortexa7hf_neon
    libsqlite-dev-2.8.17-r7.0@cortexa7hf_neon
    libsqlite0-2.8.17-r7.0@cortexa7hf_neon

Saving cache...

 

smart install   libsqlite-bin-2.8.17-r7.0@cortexa7hf_neon

 

And your are done!

2 people found this helpful

Attachments

    Outcomes