Package Server - FrankBau/meta-marsboard-bsp GitHub Wiki

Setting up your own package server

When the MarSBoard has network connection to build host, it might be helpful to configure the build host as a package server. Read more about packages and recipes in the bitbake article.

On the Build Host

It's assumed that the packages of the currently installed image are available in ${BSPDIR}/build/tmp/deploy/rpm.

In the simple setup presented here, the build host is also the package server, but it could be a separate machine which is exposed in the internet and always online. A web server must be installed on the package server, in this example lighttpd is used.

Configure lighttpd by editing /etc/lighttpd/lighttpd.conf. Make sure that server.module "mod_access" is enabled and let point server.document-root to the above rpm folder. restart ligttpd to make your changes effective:

sudo /etc/init.d/lighttpd restart

Check with your favorite web browser that you see the rmp folder tree when entering http://127.0.0.1/. Note: you may configure a web subfolder like http://127.0.0.1/ for the package folder root and/or use a different port for the package server like http://127.0.0.1/:8080 in case you want to provide more web stuff.

On the Target Board

For simplicity it's assumed that the package management smart (used by Yocto) is installed on the target which supports different package formats including rpm. smart greatly simplifies configuration. In the example 192.168.2.106 is the local IP address of the build host in a LAN:

smart channel --yes --add all type=rpm-md baseurl=http://192.168.2.106/all 
smart channel --yes --add cortexa9hf_neon type=rpm-md baseurl=http://192.168.2.106/cortexa9hf_neon 
smart channel --yes --add cortexa9hf_neon_mx6qdl type=rpm-md baseurl=http://192.168.2.106/cortexa9hf_neon_mx6qdl 
smart channel --yes --add marsboard type=rpm-md baseurl=http://192.168.2.106/marsboard
smart update

In case of duplicate channels, smart will complain. Be careful deleting channels. Do not delete rpm-sys, i.e. do not "delete all". Otherwise smart forgets about already installed packages (can be fixed).

Now you should be able to install/update/... packages as you need.

Testing

Bitbake something new (baseline image: image-multimedia-full-with-opencv). On the build host:

bitbake opencv-app
bitbake package-index

Now, on the target:

root@marsboard:~# smart update
root@marsboard:~# smart install opencv-app

Providing more packages

To generate a plenty of packages for the package server use:

bitbake -k world

world stands for "all buildable" packages and the -k flag says "continue on error". This allows for an unattended, long running bitbake process where you can (hopefully) fix individual errors after most packages have been built. Note that the set of packages built depends on the layers you have integrated into your bblayer.conf.