TipsAndTricks/OnTargetWorkFlowLeveragingRPMPackagefeeds: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
No edit summary
Line 27: Line 27:
* now we rerun configure and get:
* now we rerun configure and get:
  ./configure --enable-cyrus
  ./configure --enable-cyrus
   ZNC 1.6.5 configured
   ZNC 1.6.5 configured
  prefix:      /usr/local
  prefix:      /usr/local
  debug:        no
  debug:        no

Revision as of 00:54, 8 July 2017

Leveraging Pkg Feeds or How I got Tired of Burning Images

I was trying to build a sw repo on target and found that I lacked many of the tools and libraries in order to accomplish this. I found reflashing and rebooting the image on the target to be quite slow. Luckily YP supports a much better workflow for this process.
In this example, we will be building znc 1.6.5, an irc bouncer. This is just a good complex example. In order to use this guide, you should set up your bitbake environment and your target as outlined in PkgFeeds the EasiestWay

Steps

  • It's typically easies to make an image that has *most* of what you think you'll need. In this example, I added the following to my local.conf:
 EXTRA_IMAGE_FEATURES += " ssh-server-openssh package-management  dev-pkgs tools-sdk tools-debug tools-profile "
  • Now I'll grab the src code we will try to build
git clone https://github.com/znc/znc.git
cd znc
git checkout -b 1.6.5 znc-1.6.5
* follow the build instructions
./autogen.sh
./configure

This worked, but we decide we want to have cyrus support as well.

  • First we try
./configure --enable-cyrus

but we get

configure: error: could not find libsasl2. Try --disable-cyrus.
  • So we need the cyrus-sals-dev pkg. If we aren't sure where that is, we can use openembedded layer index and search for the recipe cyrus (this finds cyrus-sasl2 in meta-networking). So, we add meta-networking to bblayers (and meta-oe and meta-python, as its dependencies) then build cyrus-sasl.
 bitbake cyrus-sasl

and remake the package index

bitbake package-index
  • target side, pull in the new package. Since I am building stuff, I need the -dev pkg for configure to be happy.
$dnf install cyrus-sasl-dev (note this will also pull in the cyrus-sasl rpm as a dependency.)
  • now we rerun configure and get:
./configure --enable-cyrus
 ZNC 1.6.5 configured
prefix:       /usr/local
debug:        no
ipv6:         yes
openssl:      yes
dns:          threads
perl:         no
python:       no
swig:         not needed
cyrus:        yes
tcl:          no
charset:      yes
zlib:         yes
run from src: no

Pretty Easy, you can see how this cycle may be repeated a number of times for more complex projects.

  • I prefer emacs, so I tend to to this a lot as zile is a small emacs analogue:
bitbake zile
bitbake package-index

Target ->

$ dnf install zile