Skip to content
This repository was archived by the owner on Jan 27, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions classes/binconfig-stage.oeclass
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,6 @@ def binconfig_stage_fixup(d):
binconfig_file)
with open(filename, "w") as output_file:
output_file.write(binconfig_file)
if pkg_type in ("machine", "sdk"):
if pkg_type == "sdk":
cross_type = "sdk-cross"
else:
cross_type = "cross"
srcfile = os.path.join(sysroot, filename)
dstlink = os.path.join(
stage_dir, cross_type, d.get("stage_bindir").lstrip("/"),
os.path.basename(filename))
dstdir = os.path.dirname(dstlink)
print("creating destination dir: {}".format(dstdir))
oelite.util.makedirs(dstdir)
print "symlinking %s to %s"%(dstlink, srcfile)
os.symlink(srcfile, dstlink)

# Local Variables:
# mode: python
Expand Down
30 changes: 30 additions & 0 deletions classes/binconfig.oeclass
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
## Class for packages having binconfig files.
##
## Rewrites the paths in the binconfig files so that it contains valid dirs.
##
## @var BINCONFIG_FILES Space separated list of glob patterns to match files
## for ${PN}-dev (defaults to "${bindir}/*-config")
## @var BINCONFIG_GLOB Glob pattern to match files that need fixup (defaults
## to "${BINCONFIG_FILES}")
## @var BINCONFIG_PACKAGE Name of cross package with symlink to binconfig files
## (defaults to "${PN}-binconfig")
## @var BINCONFIG_LIB Name of package that depends on binconfig package
## (default to "${PN}")
## @var BINCONFIG_FIXUP_STRIP_DIRS
## Space separated list of directories to fixup in binconfig
## files (default to "${HOST_SYSROOT} ${TARGET_SYSROOT} ${D}
## ${B} ${S}")

require conf/meta.conf

BINCONFIG_FILES ?= "${bindir}/*-config"
BINCONFIG_GLOB ?= "${BINCONFIG_FILES}"
FILES_${PN}-dev += "${BINCONFIG_FILES}"
BINCONFIG_FIXUP_STRIP_DIRS ?= "${HOST_SYSROOT} ${TARGET_SYSROOT} ${D} ${B} ${S}"
BINCONFIG_PACKAGE ?= "${PN}-binconfig"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe call it ${PN}-binconfig-cross to make it more clear that it is not actually the binconfig files, but just a cross thingy (ie. symlink) of it.

BINCONFIG_LIB ?= "${PN}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More naming. It seems weird to call it BINCONFIG_LIB when it is just the name of a package containing one (or more) binconfig scripts.

Maybe BINCONFIG_CROSS_PACKAGE and BINCONFIG_PACKAGE instead of BINCONFIG_PACKAGE and BINCONFIG_LIB.


# Add cross package for the binconfig files
PACKAGES =+ "${BINCONFIG_PACKAGE}"
PACKAGE_TYPE_${BINCONFIG_PACKAGE} = "${TARGET_CROSS}"
FILES_${BINCONFIG_PACKAGE} = "${stage_bindir}/*-config"
DEPENDS_${BINCONFIG_LIB} += "cross:${BINCONFIG_PACKAGE}"

do_install[postfuncs] += "do_install_binconfig_fixup"
do_install_binconfig_fixup[dirs] = "${D}"
Expand Down Expand Up @@ -45,6 +66,15 @@ def do_install_binconfig_fixup(d):
with open(filename, "w") as output_file:
output_file.write(binconfig_file)

# create symlink
srcdir = os.path.join("..", "..", "machine", d.get("machine_bindir").lstrip("/"))
srcfile = os.path.join(srcdir, os.path.basename(filename))
dstdir = os.path.join(d.get("D"), d.get("stage_bindir").lstrip("/"))
dstlink = os.path.join(dstdir, os.path.basename(filename))
oelite.util.makedirs(dstdir)
print "symlinking %s to %s"%(dstlink, srcfile)
os.symlink(srcfile, dstlink)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if ${machine_bindir} == ${stage_bindir} ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing good will come from that.. We might need a better way to separate the symlink from the real script. Does it make sense to rename the real script prior to creating the symlink?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same issue arises in line 30:
FILES_${BINCONFIG_CROSS_PACKAGE} = "${stage_bindir}/*-config"


do_split[postfuncs] += "do_split_binconfig_fixup"
def do_split_binconfig_fixup(d):
pkgd = d.get("PKGD")
Expand Down