TipsAndTricks/EnablingAPackageFeed: Difference between revisions
Henry Bruce (talk | contribs) No edit summary |
Henry Bruce (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
This article is based on work done a few years ago with fido (1.8) and only covers using smart with rpm. Needs some testing and extended to cover using dnf. | This article is based on work done a few years ago with fido (1.8) and only covers using smart with rpm. Needs some testing and extended to cover using dnf. | ||
Instructions assume you have had at least one successful build of your target image. | |||
== | == Select Your Package Format == | ||
package format is set via variable PACKAGE_CLASSES, typically in local.conf. Look for line like | package format is set via variable PACKAGE_CLASSES, typically in local.conf. Look for line like | ||
PACKAGE_CLASSES ?= "package_rpm" | PACKAGE_CLASSES ?= "package_rpm" | ||
Line 18: | Line 17: | ||
== Select Your Package Feed URL == | == Select Your Package Feed URL == | ||
Is this example we'll use <tt>http://my-server.com/repo</tt> | Is this example we'll use <tt>http://my-server.com/repo</tt> | ||
== Add Package Manager to Build == | |||
Smart package manager is in oe-core, so need to add any extra layers | |||
IMAGE_INSTALL += "python-smartpm" | |||
== Configure Package Feed in Build == | == Configure Package Feed in Build == | ||
Now you have the information to create a package feed, ideally you add details in your distro conf file. If you are not using your own distro, you can set the following in local.conf | Now you have the information to create a package feed, ideally you add details in your distro conf file. If you are not using your own distro, you can set the following in local.conf | ||
PACKAGE_FEED_URIS = "http://my-server.com/repo" | PACKAGE_FEED_URIS = "http://my-server.com/repo" | ||
PACKAGE_FEED_BASE_PATHS = "rpm" | PACKAGE_FEED_BASE_PATHS = "rpm" | ||
PACKAGE_FEED_ARCHS = "all edison core2_32" | PACKAGE_FEED_ARCHS = "all edison core2_32" | ||
* | == Create Package Feed == | ||
* | * Re-build image so it includes smart and the package feed info | ||
* | * Update repo package indices (this step can be excluded in later versions of Yocto) | ||
* | bitbake package-index | ||
* Copy packages to server. This sample script assumes files are served from /var/www/html/repo | |||
<pre> | |||
rsync -r -u --exclude 'x86_64*' tmp/deploy/rpm/* /var/www/html/repo | |||
for d in /var/www/html/iot/repo/rpm/* | |||
do | |||
if [ -d $d ]; then | |||
echo createrepo $d | |||
createrepo -q $d | |||
fi | |||
done | |||
</pre> |
Revision as of 22:05, 14 June 2017
Caveat
This article is based on work done a few years ago with fido (1.8) and only covers using smart with rpm. Needs some testing and extended to cover using dnf.
Instructions assume you have had at least one successful build of your target image.
Select Your Package Format
package format is set via variable PACKAGE_CLASSES, typically in local.conf. Look for line like
PACKAGE_CLASSES ?= "package_rpm"
This means you're using rpm.
Know Your Package Architectures
Your OS image will be comprised of a number of different package architectures. The package feed needs to know what they are so look in tmp/deploy/rpm
$ ls tmp/deploy/rpm/ all core2_32 edison x86_64_nativesdk
You can exclude anything starting with x86_64. This means you architectures are: all core2_32 edison
Select Your Package Feed URL
Is this example we'll use http://my-server.com/repo
Add Package Manager to Build
Smart package manager is in oe-core, so need to add any extra layers
IMAGE_INSTALL += "python-smartpm"
Configure Package Feed in Build
Now you have the information to create a package feed, ideally you add details in your distro conf file. If you are not using your own distro, you can set the following in local.conf
PACKAGE_FEED_URIS = "http://my-server.com/repo" PACKAGE_FEED_BASE_PATHS = "rpm" PACKAGE_FEED_ARCHS = "all edison core2_32"
Create Package Feed
- Re-build image so it includes smart and the package feed info
- Update repo package indices (this step can be excluded in later versions of Yocto)
bitbake package-index
- Copy packages to server. This sample script assumes files are served from /var/www/html/repo
rsync -r -u --exclude 'x86_64*' tmp/deploy/rpm/* /var/www/html/repo for d in /var/www/html/iot/repo/rpm/* do if [ -d $d ]; then echo createrepo $d createrepo -q $d fi done