2005-08-31 10:45:47 +00:00
|
|
|
inherit package
|
2007-04-03 11:31:02 +00:00
|
|
|
|
2006-09-19 09:04:09 +00:00
|
|
|
IMAGE_PKGTYPE ?= "ipk"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2009-08-12 10:26:07 +00:00
|
|
|
IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
|
|
|
|
IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf"
|
2007-09-01 22:17:06 +00:00
|
|
|
|
2010-08-05 10:12:27 +00:00
|
|
|
PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
|
|
|
|
|
2011-11-01 14:18:06 +00:00
|
|
|
# Program to be used to build opkg packages
|
|
|
|
OPKGBUILDCMD ??= "opkg-build"
|
|
|
|
|
2015-12-02 04:48:38 +00:00
|
|
|
OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
|
2016-12-14 21:13:04 +00:00
|
|
|
OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
|
|
|
|
OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "") != ""]}"
|
2012-12-06 11:38:59 +00:00
|
|
|
|
2013-02-04 22:06:52 +00:00
|
|
|
OPKGLIBDIR = "${localstatedir}/lib"
|
|
|
|
|
2005-08-31 10:45:47 +00:00
|
|
|
python do_package_ipk () {
|
2012-07-19 11:23:23 +00:00
|
|
|
import re, copy
|
|
|
|
import textwrap
|
|
|
|
import subprocess
|
2016-07-18 03:32:46 +00:00
|
|
|
import collections
|
2012-07-19 11:23:23 +00:00
|
|
|
|
2016-06-13 19:05:54 +00:00
|
|
|
oldcwd = os.getcwd()
|
|
|
|
|
2016-12-14 21:13:04 +00:00
|
|
|
workdir = d.getVar('WORKDIR')
|
|
|
|
outdir = d.getVar('PKGWRITEDIRIPK')
|
|
|
|
tmpdir = d.getVar('TMPDIR')
|
|
|
|
pkgdest = d.getVar('PKGDEST')
|
2012-07-19 11:23:23 +00:00
|
|
|
if not workdir or not outdir or not tmpdir:
|
|
|
|
bb.error("Variables incorrectly set, unable to package")
|
|
|
|
return
|
|
|
|
|
2016-12-14 21:13:04 +00:00
|
|
|
packages = d.getVar('PACKAGES')
|
2012-07-19 11:23:23 +00:00
|
|
|
if not packages or packages == '':
|
|
|
|
bb.debug(1, "No packages; nothing to do")
|
|
|
|
return
|
|
|
|
|
|
|
|
# We're about to add new packages so the index needs to be checked
|
|
|
|
# so remove the appropriate stamp file.
|
|
|
|
if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
|
|
|
|
os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
|
|
|
|
|
2013-11-05 22:08:56 +00:00
|
|
|
def cleanupcontrol(root):
|
|
|
|
for p in ['CONTROL', 'DEBIAN']:
|
|
|
|
p = os.path.join(root, p)
|
|
|
|
if os.path.exists(p):
|
|
|
|
bb.utils.prunedir(p)
|
|
|
|
|
2017-06-16 08:42:30 +00:00
|
|
|
recipesource = os.path.basename(d.getVar('FILE'))
|
|
|
|
|
2012-07-19 11:23:23 +00:00
|
|
|
for pkg in packages.split():
|
|
|
|
localdata = bb.data.createCopy(d)
|
|
|
|
root = "%s/%s" % (pkgdest, pkg)
|
|
|
|
|
|
|
|
lf = bb.utils.lockfile(root + ".lock")
|
|
|
|
|
|
|
|
localdata.setVar('ROOT', '')
|
|
|
|
localdata.setVar('ROOT_%s' % pkg, root)
|
2016-12-14 21:13:04 +00:00
|
|
|
pkgname = localdata.getVar('PKG_%s' % pkg)
|
2012-07-19 11:23:23 +00:00
|
|
|
if not pkgname:
|
|
|
|
pkgname = pkg
|
|
|
|
localdata.setVar('PKG', pkgname)
|
|
|
|
|
2015-06-02 14:06:13 +00:00
|
|
|
localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
|
2012-07-19 11:23:23 +00:00
|
|
|
|
|
|
|
basedir = os.path.join(os.path.dirname(root))
|
2016-12-14 21:13:04 +00:00
|
|
|
arch = localdata.getVar('PACKAGE_ARCH')
|
package_ipk.bbclass: Support hierarchical feed
This patch allows for an optional new layout for ipk feed directories which I've
called a 'hierarchical feed' and is based on how Debian pools package files. It
is disabled by default and is enabled by setting IPK_HIERARCHICAL_FEED to "1".
In the traditional feed layout, package files are placed in <outdir>/<arch>/.
This can lead to several thousand files existing in a single directory which is
often a problem if developers want to upload a package feed to a shared web
hosting provider. For example, in my case, listing files via FTP only shows the
first 2000 files, breaking my scripts which attempt to upload only new and
changed files via FTP.
In the hierarchical feed, package files are written to
<outdir>/<arch>/<pkg_prefix>/<pkg_subdir>, where pkg_prefix is the first letter
of the package file name for non-lib packages or "lib" plus the 4th letter of
the package file name for lib packages (eg, 'l' for less, 'libc' for libc6).
pkg_subdir is the root of the package file name, discarding the version and
architecture parts and the common suffixes '-dbg', '-dev', '-doc', '-staticdev',
'-locale' and '-locale-*' which are listed in meta/conf/bitbake.conf.
This change relies on recent patches to opkg-utils which support hierarchical
package feeds.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 15:19:50 +00:00
|
|
|
|
2015-06-18 14:14:16 +00:00
|
|
|
if localdata.getVar('IPK_HIERARCHICAL_FEED', False) == "1":
|
package_ipk.bbclass: Support hierarchical feed
This patch allows for an optional new layout for ipk feed directories which I've
called a 'hierarchical feed' and is based on how Debian pools package files. It
is disabled by default and is enabled by setting IPK_HIERARCHICAL_FEED to "1".
In the traditional feed layout, package files are placed in <outdir>/<arch>/.
This can lead to several thousand files existing in a single directory which is
often a problem if developers want to upload a package feed to a shared web
hosting provider. For example, in my case, listing files via FTP only shows the
first 2000 files, breaking my scripts which attempt to upload only new and
changed files via FTP.
In the hierarchical feed, package files are written to
<outdir>/<arch>/<pkg_prefix>/<pkg_subdir>, where pkg_prefix is the first letter
of the package file name for non-lib packages or "lib" plus the 4th letter of
the package file name for lib packages (eg, 'l' for less, 'libc' for libc6).
pkg_subdir is the root of the package file name, discarding the version and
architecture parts and the common suffixes '-dbg', '-dev', '-doc', '-staticdev',
'-locale' and '-locale-*' which are listed in meta/conf/bitbake.conf.
This change relies on recent patches to opkg-utils which support hierarchical
package feeds.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-28 15:19:50 +00:00
|
|
|
# Spread packages across subdirectories so each isn't too crowded
|
|
|
|
if pkgname.startswith('lib'):
|
|
|
|
pkg_prefix = 'lib' + pkgname[3]
|
|
|
|
else:
|
|
|
|
pkg_prefix = pkgname[0]
|
|
|
|
|
|
|
|
# Keep -dbg, -dev, -doc, -staticdev, -locale and -locale-* packages
|
|
|
|
# together. These package suffixes are taken from the definitions of
|
|
|
|
# PACKAGES and PACKAGES_DYNAMIC in meta/conf/bitbake.conf
|
|
|
|
if pkgname[-4:] in ('-dbg', '-dev', '-doc'):
|
|
|
|
pkg_subdir = pkgname[:-4]
|
|
|
|
elif pkgname.endswith('-staticdev'):
|
|
|
|
pkg_subdir = pkgname[:-10]
|
|
|
|
elif pkgname.endswith('-locale'):
|
|
|
|
pkg_subdir = pkgname[:-7]
|
|
|
|
elif '-locale-' in pkgname:
|
|
|
|
pkg_subdir = pkgname[:pkgname.find('-locale-')]
|
|
|
|
else:
|
|
|
|
pkg_subdir = pkgname
|
|
|
|
|
|
|
|
pkgoutdir = "%s/%s/%s/%s" % (outdir, arch, pkg_prefix, pkg_subdir)
|
|
|
|
else:
|
|
|
|
pkgoutdir = "%s/%s" % (outdir, arch)
|
|
|
|
|
2013-09-01 07:52:40 +00:00
|
|
|
bb.utils.mkdirhier(pkgoutdir)
|
2012-07-19 11:23:23 +00:00
|
|
|
os.chdir(root)
|
2013-11-05 22:08:56 +00:00
|
|
|
cleanupcontrol(root)
|
2012-07-19 11:23:23 +00:00
|
|
|
from glob import glob
|
|
|
|
g = glob('*')
|
2015-06-18 14:14:16 +00:00
|
|
|
if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
|
2016-12-14 21:13:04 +00:00
|
|
|
bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
|
2012-07-19 11:23:23 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
|
|
|
continue
|
|
|
|
|
|
|
|
controldir = os.path.join(root, 'CONTROL')
|
2013-09-01 07:52:40 +00:00
|
|
|
bb.utils.mkdirhier(controldir)
|
2017-01-21 14:14:24 +00:00
|
|
|
ctrlfile = open(os.path.join(controldir, 'control'), 'w')
|
2012-07-19 11:23:23 +00:00
|
|
|
|
|
|
|
fields = []
|
2016-12-14 21:13:04 +00:00
|
|
|
pe = d.getVar('PKGE')
|
2012-07-19 11:23:23 +00:00
|
|
|
if pe and int(pe) > 0:
|
|
|
|
fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
|
|
|
|
else:
|
|
|
|
fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
|
|
|
|
fields.append(["Description: %s\n", ['DESCRIPTION']])
|
|
|
|
fields.append(["Section: %s\n", ['SECTION']])
|
|
|
|
fields.append(["Priority: %s\n", ['PRIORITY']])
|
|
|
|
fields.append(["Maintainer: %s\n", ['MAINTAINER']])
|
|
|
|
fields.append(["License: %s\n", ['LICENSE']])
|
|
|
|
fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
|
|
|
|
fields.append(["OE: %s\n", ['PN']])
|
2016-12-14 21:13:04 +00:00
|
|
|
if d.getVar('HOMEPAGE'):
|
2014-02-06 13:33:45 +00:00
|
|
|
fields.append(["Homepage: %s\n", ['HOMEPAGE']])
|
2012-07-19 11:23:23 +00:00
|
|
|
|
|
|
|
def pullData(l, d):
|
|
|
|
l2 = []
|
|
|
|
for i in l:
|
2016-12-14 21:13:04 +00:00
|
|
|
l2.append(d.getVar(i))
|
2012-07-19 11:23:23 +00:00
|
|
|
return l2
|
|
|
|
|
|
|
|
ctrlfile.write("Package: %s\n" % pkgname)
|
|
|
|
# check for required fields
|
2017-01-21 14:14:24 +00:00
|
|
|
for (c, fs) in fields:
|
|
|
|
for f in fs:
|
|
|
|
if localdata.getVar(f, False) is None:
|
|
|
|
raise KeyError(f)
|
|
|
|
# Special behavior for description...
|
|
|
|
if 'DESCRIPTION' in fs:
|
|
|
|
summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "."
|
|
|
|
ctrlfile.write('Description: %s\n' % summary)
|
|
|
|
description = localdata.getVar('DESCRIPTION') or "."
|
|
|
|
description = textwrap.dedent(description).strip()
|
|
|
|
if '\\n' in description:
|
|
|
|
# Manually indent
|
|
|
|
for t in description.split('\\n'):
|
|
|
|
# We don't limit the width when manually indent, but we do
|
|
|
|
# need the textwrap.fill() to set the initial_indent and
|
|
|
|
# subsequent_indent, so set a large width
|
2017-04-05 18:46:35 +00:00
|
|
|
line = textwrap.fill(t.strip(),
|
|
|
|
width=100000,
|
|
|
|
initial_indent=' ',
|
|
|
|
subsequent_indent=' ') or '.'
|
|
|
|
ctrlfile.write('%s\n' % line)
|
2012-07-19 11:23:23 +00:00
|
|
|
else:
|
2017-01-21 14:14:24 +00:00
|
|
|
# Auto indent
|
|
|
|
ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
|
|
|
|
else:
|
|
|
|
ctrlfile.write(c % tuple(pullData(fs, localdata)))
|
2012-07-19 11:23:23 +00:00
|
|
|
# more fields
|
|
|
|
|
2012-11-16 18:29:26 +00:00
|
|
|
custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
|
|
|
|
if custom_fields_chunk is not None:
|
|
|
|
ctrlfile.write(custom_fields_chunk)
|
|
|
|
ctrlfile.write("\n")
|
|
|
|
|
2012-07-19 11:23:23 +00:00
|
|
|
mapping_rename_hook(localdata)
|
|
|
|
|
2012-09-30 00:19:11 +00:00
|
|
|
def debian_cmp_remap(var):
|
|
|
|
# In debian '>' and '<' do not mean what it appears they mean
|
|
|
|
# '<' = less or equal
|
|
|
|
# '>' = greater or equal
|
|
|
|
# adjust these to the '<<' and '>>' equivalents
|
|
|
|
#
|
|
|
|
for dep in var:
|
2012-10-02 10:37:07 +00:00
|
|
|
for i, v in enumerate(var[dep]):
|
|
|
|
if (v or "").startswith("< "):
|
|
|
|
var[dep][i] = var[dep][i].replace("< ", "<< ")
|
|
|
|
elif (v or "").startswith("> "):
|
|
|
|
var[dep][i] = var[dep][i].replace("> ", ">> ")
|
2012-09-30 00:19:11 +00:00
|
|
|
|
2016-12-14 21:13:04 +00:00
|
|
|
rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rdepends)
|
2016-12-14 21:13:04 +00:00
|
|
|
rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rrecommends)
|
2016-12-14 21:13:04 +00:00
|
|
|
rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rsuggests)
|
2015-07-16 22:47:30 +00:00
|
|
|
# Deliberately drop version information here, not wanted/supported by ipk
|
2016-12-14 21:13:04 +00:00
|
|
|
rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
|
2016-07-18 03:32:46 +00:00
|
|
|
rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rprovides)
|
2016-12-14 21:13:04 +00:00
|
|
|
rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rreplaces)
|
2016-12-14 21:13:04 +00:00
|
|
|
rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "")
|
2012-09-30 00:19:11 +00:00
|
|
|
debian_cmp_remap(rconflicts)
|
2012-07-19 11:23:23 +00:00
|
|
|
|
|
|
|
if rdepends:
|
|
|
|
ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
|
|
|
|
if rsuggests:
|
|
|
|
ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
|
|
|
|
if rrecommends:
|
|
|
|
ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
|
|
|
|
if rprovides:
|
|
|
|
ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
|
|
|
|
if rreplaces:
|
|
|
|
ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
|
|
|
|
if rconflicts:
|
|
|
|
ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
|
2017-06-16 08:42:30 +00:00
|
|
|
ctrlfile.write("Source: %s\n" % recipesource)
|
2012-07-19 11:23:23 +00:00
|
|
|
ctrlfile.close()
|
|
|
|
|
|
|
|
for script in ["preinst", "postinst", "prerm", "postrm"]:
|
2016-12-14 21:13:04 +00:00
|
|
|
scriptvar = localdata.getVar('pkg_%s' % script)
|
2012-07-19 11:23:23 +00:00
|
|
|
if not scriptvar:
|
|
|
|
continue
|
2017-01-21 14:14:24 +00:00
|
|
|
scriptfile = open(os.path.join(controldir, script), 'w')
|
2012-07-19 11:23:23 +00:00
|
|
|
scriptfile.write(scriptvar)
|
|
|
|
scriptfile.close()
|
2013-05-07 10:23:40 +00:00
|
|
|
os.chmod(os.path.join(controldir, script), 0o755)
|
2012-07-19 11:23:23 +00:00
|
|
|
|
2015-02-17 02:08:12 +00:00
|
|
|
conffiles_str = ' '.join(get_conffiles(pkg, d))
|
2012-07-19 11:23:23 +00:00
|
|
|
if conffiles_str:
|
2017-01-21 14:14:24 +00:00
|
|
|
conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
|
2012-07-19 11:23:23 +00:00
|
|
|
for f in conffiles_str.split():
|
2013-02-05 21:12:50 +00:00
|
|
|
if os.path.exists(oe.path.join(root, f)):
|
|
|
|
conffiles.write('%s\n' % f)
|
2012-07-19 11:23:23 +00:00
|
|
|
conffiles.close()
|
|
|
|
|
|
|
|
os.chdir(basedir)
|
2017-01-21 14:11:52 +00:00
|
|
|
subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
|
2016-12-14 21:13:04 +00:00
|
|
|
d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir), shell=True)
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2016-12-14 21:13:04 +00:00
|
|
|
if d.getVar('IPK_SIGN_PACKAGES') == '1':
|
|
|
|
ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
|
|
|
|
ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
|
2016-03-10 10:02:55 +00:00
|
|
|
sign_ipk(d, ipk_to_sign)
|
|
|
|
|
2013-11-05 22:08:56 +00:00
|
|
|
cleanupcontrol(root)
|
2012-07-19 11:23:23 +00:00
|
|
|
bb.utils.unlockfile(lf)
|
2010-08-05 10:12:27 +00:00
|
|
|
|
2016-06-13 19:05:54 +00:00
|
|
|
os.chdir(oldcwd)
|
2010-08-05 10:12:27 +00:00
|
|
|
}
|
2015-08-25 16:57:37 +00:00
|
|
|
# Otherwise allarch packages may change depending on override configuration
|
|
|
|
do_package_ipk[vardepsexclude] = "OVERRIDES"
|
2010-08-05 10:12:27 +00:00
|
|
|
|
|
|
|
SSTATETASKS += "do_package_write_ipk"
|
|
|
|
do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}"
|
|
|
|
do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}"
|
|
|
|
|
|
|
|
python do_package_write_ipk_setscene () {
|
2016-12-14 21:13:04 +00:00
|
|
|
tmpdir = d.getVar('TMPDIR')
|
2014-01-10 16:33:01 +00:00
|
|
|
|
|
|
|
if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
|
|
|
|
os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
|
|
|
|
|
2012-07-19 11:23:23 +00:00
|
|
|
sstate_setscene(d)
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
2010-09-16 05:55:21 +00:00
|
|
|
addtask do_package_write_ipk_setscene
|
2007-08-21 09:37:30 +00:00
|
|
|
|
|
|
|
python () {
|
2016-12-14 21:13:04 +00:00
|
|
|
if d.getVar('PACKAGES') != '':
|
2012-03-03 10:41:41 +00:00
|
|
|
deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
|
|
|
|
d.appendVarFlag('do_package_write_ipk', 'depends', deps)
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVarFlag('do_package_write_ipk', 'fakeroot', "1")
|
2007-08-21 09:37:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python do_package_write_ipk () {
|
2012-07-19 11:23:23 +00:00
|
|
|
bb.build.exec_func("read_subpackage_metadata", d)
|
|
|
|
bb.build.exec_func("do_package_ipk", d)
|
2007-08-21 09:37:30 +00:00
|
|
|
}
|
2010-08-05 10:12:27 +00:00
|
|
|
do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
|
2013-01-29 22:04:35 +00:00
|
|
|
do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
|
2012-03-10 02:11:57 +00:00
|
|
|
do_package_write_ipk[umask] = "022"
|
2017-01-19 16:49:00 +00:00
|
|
|
do_package_write_ipk[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
|
2014-03-28 11:04:30 +00:00
|
|
|
addtask package_write_ipk after do_packagedata do_package
|
package-index.bb: add support for deb and rpm.
[YOCTO #1024]
Currently package-index.bb only supports ipk. This commit adds the support
for rpm and deb, too.
------------------------------
How to generate and use repos:
1) run "bitbake package-index" after building some target,
e.g., core-image-sato-sdk;
2) export ${DEPLOY_DIR_RPM}, ${DEPLOY_DIR_IPK} and ${DEPLOY_DIR_DEB} by a
webserver on the host, assuming the host IP is 192.168.7.1, at
http://192.168.7.1/rpm
http://192.168.7.1/ipk
http://192.168.7.1/deb
3) inside the target, according to the packaging system (rpm, ipk or deb) used
when we generate the target image, we can use different ways to manage
packages:
3.1) RPM
run "zypper addrepo http://192.168.7.1/rpm main; zypper refresh"
to retrieve info about the repo; next, we can use "zypper install/remove"
to manage packages.
3.2) IPK
add the repo info into opkg config file, i.e., in
/etc/opkg/arch.conf, we can add something like
"src i586 http://192.168.7.1/ipk/i586", and next, we run "opkg update" to
make opkg update the list of available packages. And later, we can use
"opkg install/remove" to manage packages.
3.3) DEB
Currently in target, some important config files, like
/var/lib/dpkg/status and /etc/apt/sources.list, for deb/apt are missing. So
we can't install/remove package in target at present.
(From OE-Core rev: 01e34bdb43e0cc27c1cfffd6730c384f40c404c1)
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-18 04:09:01 +00:00
|
|
|
|
|
|
|
PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
|
|
|
|
PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot"
|
2014-02-24 16:12:07 +00:00
|
|
|
|
|
|
|
do_build[recrdeptask] += "do_package_write_ipk"
|