0

I have some task to make linux's bootable image with my own package. This package (named starlet) is a set of .C modules + Makefile. I created the package/starlet directory and added Config.in and starlet.mk; selected in the Buildroot configuration to include my package to build target image.

So, it's works fine...

Now i'm need to build starlet's image with additional library from the zztop-dev package. zztop-dev package is an .RPM package with set of .H and .C files to build target zztop.a (.so) libraries.

What do I need to do to install zztop-dev.RPM before building STARLET image?

Luca Ceresoli
  • 1,591
  • 8
  • 19
  • 1
    What is zztop-dev? Is it publicly available on the Internet? Then please add the URL where it can be found. – Luca Ceresoli Jan 03 '20 at 08:22
  • 1
    So you have an .rpm file containing the sources to build this `zztop-dev` library? It's uncommon, do you have access to the original source on a .tar.gz file, a git/svn repository or anywhere else? – Luca Ceresoli Jan 03 '20 at 08:24

1 Answers1

2

Having the source code for a package stored in a .rpm file is quite uncommon. Buildroot has built-in rules to extract all the most common formats. Using an uncommon format requires you to write extraction rules on your own.

So the first question is whether you can use a more common format that Buildroot has rules for. You probably can access the source code from its original location in a source code repository (git, Subversion, whatever) or a tarball.

If you really need to extract the sources from am .rpm file, then you need to write your own custom extract commands. Look for LIBFOO_EXTRACT_CMDS in the Buildroot user manual.

But if your extract commands call the rpm command to do the extraction then you'll need the rpm tool either installed on your host machine, or packaged as a host package in Buildroot and listed as a dependency of zztop-dev. The former approach is way simpler, but it will force you to have rpm installed on every host machine where you run the build.

Luca Ceresoli
  • 1,591
  • 8
  • 19
  • Thanks for the answer! Common or uncommon is not mater of the situation. I have RPM package (zztop-dev is a example of non-existent package) and i'm need to use libraries from this package at time of building the target binaries (it's other package). – Ruslan R. Laishev Jan 04 '20 at 09:36
  • @RuslanR.Laishev: Well, being uncommon matters because Buildroot has built-in rules to extract all *common* formats. Using an uncommon format requires you to write extraction rules on your own. I edited the answer to clarify that. I hope it's clearer now. – Luca Ceresoli Jan 04 '20 at 13:42
  • RPM is not common ? – Ruslan R. Laishev Jan 09 '20 at 18:21
  • RPM is common as a package manager, a system used in distributions. It is not common at all as a format for open source developers to release their source code. Build systems such as Buildroot fetch the source code from the "upstream" locations, where it is distributed as a tarball, a git/svn/hg repo, sometimes a zip file and a few other formats. Distributions fetch the upstream code from the same locations and possibly re-release it as an rpm/dpkg file, but that is a by-product. Build systems have no reason to fetch a by-product when they can fetch the source at its, well, source. – Luca Ceresoli Jan 09 '20 at 21:06
  • As I wrote in the answer, you need to write your own custom extract commands. – Luca Ceresoli Jan 13 '20 at 16:24