Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/import-layers/yocto-poky/meta/classes/package.bbclass b/import-layers/yocto-poky/meta/classes/package.bbclass
index a6f0a7a..a03c05b 100644
--- a/import-layers/yocto-poky/meta/classes/package.bbclass
+++ b/import-layers/yocto-poky/meta/classes/package.bbclass
@@ -54,6 +54,14 @@
 # rpm is used for the per-file dependency identification
 PACKAGE_DEPENDS += "rpm-native"
 
+
+# If your postinstall can execute at rootfs creation time rather than on
+# target but depends on a native/cross tool in order to execute, you need to
+# list that tool in PACKAGE_WRITE_DEPENDS. Target package dependencies belong
+# in the package dependencies as normal, this is just for native/cross support
+# tools at rootfs build time.
+PACKAGE_WRITE_DEPS ??= ""
+
 def legitimize_package_name(s):
     """
     Make sure package names are legitimate strings
@@ -120,7 +128,7 @@
 
     """
 
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
     root = d.expand(root)
     output_pattern = d.expand(output_pattern)
     extra_depends = d.expand(extra_depends)
@@ -130,7 +138,7 @@
     if not os.path.exists(dvar + root):
         return []
 
-    ml = d.getVar("MLPREFIX", True)
+    ml = d.getVar("MLPREFIX")
     if ml:
         if not output_pattern.startswith(ml):
             output_pattern = ml + output_pattern
@@ -145,7 +153,7 @@
             extra_depends = " ".join(newdeps)
 
 
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     split_packages = set()
 
     if postinst:
@@ -163,7 +171,7 @@
                     objs.append(relpath)
 
     if extra_depends == None:
-        extra_depends = d.getVar("PN", True)
+        extra_depends = d.getVar("PN")
 
     if not summary:
         summary = description
@@ -189,7 +197,7 @@
                 packages = [pkg] + packages
             else:
                 packages.append(pkg)
-        oldfiles = d.getVar('FILES_' + pkg, True)
+        oldfiles = d.getVar('FILES_' + pkg)
         newfile = os.path.join(root, o)
         # These names will be passed through glob() so if the filename actually
         # contains * or ? (rare, but possible) we need to handle that specially
@@ -214,9 +222,9 @@
             d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
         if extra_depends != '':
             d.appendVar('RDEPENDS_' + pkg, ' ' + extra_depends)
-        if not d.getVar('DESCRIPTION_' + pkg, True):
+        if not d.getVar('DESCRIPTION_' + pkg):
             d.setVar('DESCRIPTION_' + pkg, description % on)
-        if not d.getVar('SUMMARY_' + pkg, True):
+        if not d.getVar('SUMMARY_' + pkg):
             d.setVar('SUMMARY_' + pkg, summary % on)
         if postinst:
             d.setVar('pkg_postinst_' + pkg, postinst)
@@ -231,9 +239,9 @@
 PACKAGE_DEPENDS += "file-native"
 
 python () {
-    if d.getVar('PACKAGES', True) != '':
+    if d.getVar('PACKAGES') != '':
         deps = ""
-        for dep in (d.getVar('PACKAGE_DEPENDS', True) or "").split():
+        for dep in (d.getVar('PACKAGE_DEPENDS') or "").split():
             deps += " %s:do_populate_sysroot" % dep
         d.appendVarFlag('do_package', 'depends', deps)
 
@@ -286,14 +294,14 @@
 
 # Called in package_<rpm,ipk,deb>.bbclass to get the correct list of configuration files
 def get_conffiles(pkg, d):
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     root = os.path.join(pkgdest, pkg)
     cwd = os.getcwd()
     os.chdir(root)
 
-    conffiles = d.getVar('CONFFILES_%s' % pkg, True);
+    conffiles = d.getVar('CONFFILES_%s' % pkg);
     if conffiles == None:
-        conffiles = d.getVar('CONFFILES', True)
+        conffiles = d.getVar('CONFFILES')
     if conffiles == None:
         conffiles = ""
     conffiles = conffiles.split()
@@ -318,7 +326,7 @@
     return conf_list
 
 def checkbuildpath(file, d):
-    tmpdir = d.getVar('TMPDIR', True)
+    tmpdir = d.getVar('TMPDIR')
     with open(file) as f:
         file_content = f.read()
         if tmpdir in file_content:
@@ -335,9 +343,9 @@
 
     import stat
 
-    dvar = d.getVar('PKGD', True)
-    objcopy = d.getVar("OBJCOPY", True)
-    debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+    dvar = d.getVar('PKGD')
+    objcopy = d.getVar("OBJCOPY")
+    debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/debugedit")
 
     # We ignore kernel modules, we don't generate debug info files.
     if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
@@ -382,11 +390,11 @@
 
     sourcefile = d.expand("${WORKDIR}/debugsources.list")
     if debugsrcdir and os.path.isfile(sourcefile):
-        dvar = d.getVar('PKGD', True)
-        strip = d.getVar("STRIP", True)
-        objcopy = d.getVar("OBJCOPY", True)
+        dvar = d.getVar('PKGD')
+        strip = d.getVar("STRIP")
+        objcopy = d.getVar("OBJCOPY")
         debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
-        workdir = d.getVar("WORKDIR", True)
+        workdir = d.getVar("WORKDIR")
         workparentdir = os.path.dirname(os.path.dirname(workdir))
         workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
 
@@ -406,7 +414,8 @@
         bb.utils.mkdirhier(basepath)
         cpath.updatecache(basepath)
 
-        processdebugsrc =  "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
+        # Ignore files from the recipe sysroots (target and native)
+        processdebugsrc =  "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '((<internal>|<built-in>)$|/.*recipe-sysroot.*/)' | "
         # We need to ignore files that are not actually ours
         # we do this by only paying attention to items from this package
         processdebugsrc += "fgrep -zw '%s' | "
@@ -462,26 +471,23 @@
         if d.getVar(key, False) is None:
             continue
         d.setVarFlag(key, "type", "list")
-        if d.getVarFlag(key, "separator", True) is None:
+        if d.getVarFlag(key, "separator") is None:
             d.setVarFlag(key, "separator", "\\n")
         metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
         return "\n".join(metadata_fields).strip()
 
 def runtime_mapping_rename (varname, pkg, d):
-    #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
-
-    if bb.data.inherits_class('packagegroup', d):
-        return
+    #bb.note("%s before: %s" % (varname, d.getVar(varname)))
 
     new_depends = {}
-    deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) or "")
+    deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
     for depend in deps:
         new_depend = get_package_mapping(depend, pkg, d)
         new_depends[new_depend] = deps[depend]
 
     d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
 
-    #bb.note("%s after: %s" % (varname, d.getVar(varname, True)))
+    #bb.note("%s after: %s" % (varname, d.getVar(varname)))
 
 #
 # Package functions suitable for inclusion in PACKAGEFUNCS
@@ -492,34 +498,34 @@
     import re
 
     # Support per recipe PRSERV_HOST
-    pn = d.getVar('PN', True)
-    host = d.getVar("PRSERV_HOST_" + pn, True)
+    pn = d.getVar('PN')
+    host = d.getVar("PRSERV_HOST_" + pn)
     if not (host is None):
         d.setVar("PRSERV_HOST", host)
 
-    pkgv = d.getVar("PKGV", True)
+    pkgv = d.getVar("PKGV")
 
     # PR Server not active, handle AUTOINC
-    if not d.getVar('PRSERV_HOST', True):
+    if not d.getVar('PRSERV_HOST'):
         if 'AUTOINC' in pkgv:
             d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
         return
 
     auto_pr = None
-    pv = d.getVar("PV", True)
-    version = d.getVar("PRAUTOINX", True)
-    pkgarch = d.getVar("PACKAGE_ARCH", True)
-    checksum = d.getVar("BB_TASKHASH", True)
+    pv = d.getVar("PV")
+    version = d.getVar("PRAUTOINX")
+    pkgarch = d.getVar("PACKAGE_ARCH")
+    checksum = d.getVar("BB_TASKHASH")
 
-    if d.getVar('PRSERV_LOCKDOWN', True):
-        auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch, True) or d.getVar('PRAUTO_' + version, True) or None
+    if d.getVar('PRSERV_LOCKDOWN'):
+        auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch) or d.getVar('PRAUTO_' + version) or None
         if auto_pr is None:
             bb.fatal("Can NOT get PRAUTO from lockdown exported file")
         d.setVar('PRAUTO',str(auto_pr))
         return
 
     try:
-        conn = d.getVar("__PRSERV_CONN", True)
+        conn = d.getVar("__PRSERV_CONN")
         if conn is None:
             conn = oe.prservice.prserv_make_conn(d)
         if conn is not None:
@@ -540,19 +546,19 @@
 LOCALEBASEPN ??= "${PN}"
 
 python package_do_split_locales() {
-    if (d.getVar('PACKAGE_NO_LOCALE', True) == '1'):
+    if (d.getVar('PACKAGE_NO_LOCALE') == '1'):
         bb.debug(1, "package requested not splitting locales")
         return
 
-    packages = (d.getVar('PACKAGES', True) or "").split()
+    packages = (d.getVar('PACKAGES') or "").split()
 
-    datadir = d.getVar('datadir', True)
+    datadir = d.getVar('datadir')
     if not datadir:
         bb.note("datadir not defined")
         return
 
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('LOCALEBASEPN', True)
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('LOCALEBASEPN')
 
     if pn + '-locale' in packages:
         packages.remove(pn + '-locale')
@@ -565,10 +571,10 @@
 
     locales = os.listdir(localedir)
 
-    summary = d.getVar('SUMMARY', True) or pn
-    description = d.getVar('DESCRIPTION', True) or ""
-    locale_section = d.getVar('LOCALE_SECTION', True)
-    mlprefix = d.getVar('MLPREFIX', True) or ""
+    summary = d.getVar('SUMMARY') or pn
+    description = d.getVar('DESCRIPTION') or ""
+    locale_section = d.getVar('LOCALE_SECTION')
+    mlprefix = d.getVar('MLPREFIX') or ""
     for l in sorted(locales):
         ln = legitimize_package_name(l)
         pkg = pn + '-locale-' + ln
@@ -589,14 +595,14 @@
     # glibc-localedata-translit* won't install as a dependency
     # for some other package which breaks meta-toolchain
     # Probably breaks since virtual-locale- isn't provided anywhere
-    #rdep = (d.getVar('RDEPENDS_%s' % pn, True) or "").split()
+    #rdep = (d.getVar('RDEPENDS_%s' % pn) or "").split()
     #rdep.append('%s-locale*' % pn)
     #d.setVar('RDEPENDS_%s' % pn, ' '.join(rdep))
 }
 
 python perform_packagecopy () {
-    dest = d.getVar('D', True)
-    dvar = d.getVar('PKGD', True)
+    dest = d.getVar('D')
+    dvar = d.getVar('PKGD')
 
     # Start by package population by taking a copy of the installed
     # files to operate on
@@ -730,8 +736,8 @@
     # paths are resolved via BBPATH
     def get_fs_perms_list(d):
         str = ""
-        bbpath = d.getVar('BBPATH', True)
-        fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
+        bbpath = d.getVar('BBPATH')
+        fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES')
         if not fs_perms_tables:
             fs_perms_tables = 'files/fs-perms.txt'
         for conf_file in fs_perms_tables.split():
@@ -740,7 +746,7 @@
 
 
 
-    dvar = d.getVar('PKGD', True)
+    dvar = d.getVar('PKGD')
 
     fs_perms_table = {}
     fs_link_table = {}
@@ -769,10 +775,10 @@
                 'oldincludedir' ]
 
     for path in target_path_vars:
-        dir = d.getVar(path, True) or ""
+        dir = d.getVar(path) or ""
         if dir == "":
             continue
-        fs_perms_table[dir] = fs_perms_entry(bb.data.expand("%s 0755 root root false - - -" % (dir), d))
+        fs_perms_table[dir] = fs_perms_entry(d.expand("%s 0755 root root false - - -" % (dir)))
 
     # Now we actually load from the configuration files
     for conf in get_fs_perms_list(d).split():
@@ -854,20 +860,20 @@
 python split_and_strip_files () {
     import stat, errno
 
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('PN', True)
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('PN')
 
     oldcwd = os.getcwd()
     os.chdir(dvar)
 
     # We default to '.debug' style
-    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory':
+    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
         # Single debug-file-directory style debug info
         debugappend = ".debug"
         debugdir = ""
         debuglibdir = "/usr/lib/debug"
         debugsrcdir = "/usr/src/debug"
-    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-without-src':
+    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src':
         # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
         debugappend = ""
         debugdir = "/.debug"
@@ -918,10 +924,10 @@
     symlinks = {}
     kernmods = []
     inodes = {}
-    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
-    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
-    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1' or \
-            d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1'):
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir"))
+    if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1' or \
+            d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
         for root, dirs, files in cpath.walk(dvar):
             for f in files:
                 file = os.path.join(root, f)
@@ -962,7 +968,7 @@
                     elf_file = isELF(file)
                     if elf_file & 1:
                         if elf_file & 2:
-                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split():
                                 bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
                             else:
                                 msg = "File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn)
@@ -991,7 +997,7 @@
     #
     # First lets process debug splitting
     #
-    if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1'):
+    if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
         for file in elffiles:
             src = file[len(dvar):]
             dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
@@ -1054,8 +1060,8 @@
     #
     # Now lets go back over things and strip them
     #
-    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1'):
-        strip = d.getVar("STRIP", True)
+    if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1'):
+        strip = d.getVar("STRIP")
         sfiles = []
         for file in elffiles:
             elf_file = int(elffiles[file])
@@ -1075,16 +1081,16 @@
 python populate_packages () {
     import glob, re
 
-    workdir = d.getVar('WORKDIR', True)
-    outdir = d.getVar('DEPLOY_DIR', True)
-    dvar = d.getVar('PKGD', True)
-    packages = d.getVar('PACKAGES', True)
-    pn = d.getVar('PN', True)
+    workdir = d.getVar('WORKDIR')
+    outdir = d.getVar('DEPLOY_DIR')
+    dvar = d.getVar('PKGD')
+    packages = d.getVar('PACKAGES')
+    pn = d.getVar('PN')
 
     bb.utils.mkdirhier(outdir)
     os.chdir(dvar)
     
-    autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG", True) or False)
+    autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False)
 
     # Sanity check PACKAGES for duplicates
     # Sanity should be moved to sanity.bbclass once we have the infrastucture
@@ -1099,7 +1105,7 @@
         else:
             package_list.append(pkg)
     d.setVar('PACKAGES', ' '.join(package_list))
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
     seen = []
 
@@ -1120,7 +1126,7 @@
         root = os.path.join(pkgdest, pkg)
         bb.utils.mkdirhier(root)
 
-        filesvar = d.getVar('FILES_%s' % pkg, True) or ""
+        filesvar = d.getVar('FILES_%s' % pkg) or ""
         if "//" in filesvar:
             msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg
             package_qa_handle_error("files-invalid", msg, d)
@@ -1188,7 +1194,7 @@
     # Handle LICENSE_EXCLUSION
     package_list = []
     for pkg in packages.split():
-        if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
+        if d.getVar('LICENSE_EXCLUSION-' + pkg):
             msg = "%s has an incompatible license. Excluding from packaging." % pkg
             package_qa_handle_error("incompatible-license", msg, d)
         else:
@@ -1207,7 +1213,7 @@
 
     if unshipped != []:
         msg = pn + ": Files/directories were installed but not shipped in any package:"
-        if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+        if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn) or "").split():
             bb.note("Package %s skipping QA tests: installed-vs-shipped" % pn)
         else:
             for f in unshipped:
@@ -1220,7 +1226,7 @@
 
 python package_fixsymlinks () {
     import errno
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
     packages = d.getVar("PACKAGES", False).split()
 
     dangling_links = {}
@@ -1255,7 +1261,7 @@
                 bb.note("%s contains dangling symlink to %s" % (pkg, l))
 
     for pkg in newrdepends:
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
         for p in newrdepends[pkg]:
             if p not in rdepends:
                 rdepends[p] = []
@@ -1286,11 +1292,11 @@
             c = codecs.getencoder("unicode_escape")
             return c(str)[0].decode("latin1")
 
-        val = d.getVar('%s_%s' % (var, pkg), True)
+        val = d.getVar('%s_%s' % (var, pkg))
         if val:
             f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
             return val
-        val = d.getVar('%s' % (var), True)
+        val = d.getVar('%s' % (var))
         if val:
             f.write('%s: %s\n' % (var, encode(val)))
         return val
@@ -1309,9 +1315,9 @@
                 with open(subdata_file, 'w') as fd:
                     fd.write("PKG_%s: %s" % (ml_pkg, pkg))
 
-    packages = d.getVar('PACKAGES', True)
-    pkgdest = d.getVar('PKGDEST', True)
-    pkgdatadir = d.getVar('PKGDESTWORK', True)
+    packages = d.getVar('PACKAGES')
+    pkgdest = d.getVar('PKGDEST')
+    pkgdatadir = d.getVar('PKGDESTWORK')
 
     # Take shared lock since we're only reading, not writing
     lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
@@ -1321,9 +1327,9 @@
     f.write("PACKAGES: %s\n" % packages)
     f.close()
 
-    pn = d.getVar('PN', True)
-    global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split()
-    variants = (d.getVar('MULTILIB_VARIANTS', True) or "").split()
+    pn = d.getVar('PN')
+    global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split()
+    variants = (d.getVar('MULTILIB_VARIANTS') or "").split()
 
     if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
         write_extra_pkgs(variants, pn, packages, pkgdatadir)
@@ -1331,10 +1337,10 @@
     if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
         write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
 
     for pkg in packages.split():
-        pkgval = d.getVar('PKG_%s' % pkg, True)
+        pkgval = d.getVar('PKG_%s' % pkg)
         if pkgval is None:
             pkgval = pkg
             d.setVar('PKG_%s' % pkg, pkg)
@@ -1342,11 +1348,14 @@
         pkgdestpkg = os.path.join(pkgdest, pkg)
         files = {}
         total_size = 0
+        seen = set()
         for f in pkgfiles[pkg]:
             relpth = os.path.relpath(f, pkgdestpkg)
             fstat = os.lstat(f)
-            total_size += fstat.st_size
             files[os.sep + relpth] = fstat.st_size
+            if fstat.st_ino not in seen:
+                seen.add(fstat.st_ino)
+                total_size += fstat.st_size
         d.setVar('FILES_INFO', json.dumps(files))
 
         subdata_file = pkgdatadir + "/runtime/%s" % pkg
@@ -1371,17 +1380,18 @@
         write_if_exists(sf, pkg, 'PKG')
         write_if_exists(sf, pkg, 'ALLOW_EMPTY')
         write_if_exists(sf, pkg, 'FILES')
+        write_if_exists(sf, pkg, 'CONFFILES')
         write_if_exists(sf, pkg, 'pkg_postinst')
         write_if_exists(sf, pkg, 'pkg_postrm')
         write_if_exists(sf, pkg, 'pkg_preinst')
         write_if_exists(sf, pkg, 'pkg_prerm')
         write_if_exists(sf, pkg, 'FILERPROVIDESFLIST')
         write_if_exists(sf, pkg, 'FILES_INFO')
-        for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg, True) or "").split():
+        for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split():
             write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
 
         write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
-        for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split():
+        for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split():
             write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
 
         sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
@@ -1394,9 +1404,9 @@
                 bb.utils.mkdirhier(os.path.dirname(subdata_sym))
                 oe.path.symlink("../../runtime/%s" % pkg, subdata_sym, True)
 
-        allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg, True)
+        allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg)
         if not allow_empty:
-            allow_empty = d.getVar('ALLOW_EMPTY', True)
+            allow_empty = d.getVar('ALLOW_EMPTY')
         root = "%s/%s" % (pkgdest, pkg)
         os.chdir(root)
         g = glob('*')
@@ -1424,7 +1434,13 @@
 fi
 }
 
-RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps-oecore --macros ${STAGING_LIBDIR_NATIVE}/rpm/macros --define '_rpmfc_magic_path ${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc' --rpmpopt ${STAGING_LIBDIR_NATIVE}/rpm/rpmpopt"
+# In Morty and earlier releases, and on master (Rocko), the RPM file
+# dependencies are always enabled. However, since they were broken with the
+# release of Pyro and enabling them may cause build problems for some packages,
+# they are not enabled by default in Pyro. Setting ENABLE_RPM_FILEDEPS_FOR_PYRO
+# to "1" will enable them again.
+ENABLE_RPM_FILEDEPS_FOR_PYRO ??= "0"
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps${@' --alldeps' if d.getVar('ENABLE_RPM_FILEDEPS_FOR_PYRO') == '1' else ''}"
 
 # Collect perfile run-time dependency metadata
 # Output:
@@ -1435,19 +1451,19 @@
 #  FILERDEPENDS_filepath_pkg - per file dep
 
 python package_do_filedeps() {
-    if d.getVar('SKIP_FILEDEPS', True) == '1':
+    if d.getVar('SKIP_FILEDEPS') == '1':
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
-    packages = d.getVar('PACKAGES', True)
-    rpmdeps = d.getVar('RPMDEPS', True)
+    pkgdest = d.getVar('PKGDEST')
+    packages = d.getVar('PACKAGES')
+    rpmdeps = d.getVar('RPMDEPS')
 
     def chunks(files, n):
         return [files[i:i+n] for i in range(0, len(files), n)]
 
     pkglist = []
     for pkg in packages.split():
-        if d.getVar('SKIP_FILEDEPS_' + pkg, True) == '1':
+        if d.getVar('SKIP_FILEDEPS_' + pkg) == '1':
             continue
         if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-'):
             continue
@@ -1496,22 +1512,22 @@
         return
 
     lib_re = re.compile("^.*\.so")
-    libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
+    libdir_re = re.compile(".*/%s$" % d.getVar('baselib'))
 
-    packages = d.getVar('PACKAGES', True)
-    targetos = d.getVar('TARGET_OS', True)
+    packages = d.getVar('PACKAGES')
+    targetos = d.getVar('TARGET_OS')
 
-    workdir = d.getVar('WORKDIR', True)
+    workdir = d.getVar('WORKDIR')
 
-    ver = d.getVar('PKGV', True)
+    ver = d.getVar('PKGV')
     if not ver:
         msg = "PKGV not defined"
         package_qa_handle_error("pkgv-undefined", msg, d)
         return
 
-    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = d.getVar('PKGDEST')
 
-    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR')
 
     # Take shared lock since we're only reading, not writing
     lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
@@ -1519,7 +1535,7 @@
     def linux_so(file, needed, sonames, renames, pkgver):
         needs_ldconfig = False
         ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
-        cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
+        cmd = d.getVar('OBJDUMP') + " -p " + pipes.quote(file) + " 2>/dev/null"
         fd = os.popen(cmd)
         lines = fd.readlines()
         fd.close()
@@ -1601,28 +1617,44 @@
                 if name and name not in needed[pkg]:
                      needed[pkg].append((name, file, []))
 
-    if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS', True) == "1":
+    def mingw_dll(file, needed, sonames, renames, pkgver):
+        if not os.path.exists(file):
+            return
+
+        if file.endswith(".dll"):
+            # assume all dlls are shared objects provided by the package
+            sonames.append((os.path.basename(file), os.path.dirname(file).replace(pkgdest + "/" + pkg, ''), pkgver))
+
+        if (file.endswith(".dll") or file.endswith(".exe")):
+            # use objdump to search for "DLL Name: .*\.dll"
+            p = sub.Popen([d.expand("${HOST_PREFIX}objdump"), "-p", file], stdout = sub.PIPE, stderr= sub.PIPE)
+            out, err = p.communicate()
+            # process the output, grabbing all .dll names
+            if p.returncode == 0:
+                for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
+                    dllname = m.group(1)
+                    if dllname:
+                        needed[pkg].append((dllname, file, []))
+
+    if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
         snap_symlinks = True
     else:
         snap_symlinks = False
 
-    if (d.getVar('USE_LDCONFIG', True) or "1") == "1":
-        use_ldconfig = True
-    else:
-        use_ldconfig = False
+    use_ldconfig = bb.utils.contains('DISTRO_FEATURES', 'ldconfig', True, False, d)
 
     needed = {}
     shlib_provider = oe.package.read_shlib_providers(d)
 
     for pkg in packages.split():
-        private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True) or ""
+        private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or ""
         private_libs = private_libs.split()
         needs_ldconfig = False
         bb.debug(2, "calculating shlib provides for %s" % pkg)
 
-        pkgver = d.getVar('PKGV_' + pkg, True)
+        pkgver = d.getVar('PKGV_' + pkg)
         if not pkgver:
-            pkgver = d.getVar('PV_' + pkg, True)
+            pkgver = d.getVar('PV_' + pkg)
         if not pkgver:
             pkgver = ver
 
@@ -1635,6 +1667,8 @@
                     continue
                 if targetos == "darwin" or targetos == "darwin8":
                     darwin_so(file, needed, sonames, renames, pkgver)
+                elif targetos.startswith("mingw"):
+                    mingw_dll(file, needed, sonames, renames, pkgver)
                 elif os.access(file, os.X_OK) or lib_re.match(file):
                     ldconfig = linux_so(file, needed, sonames, renames, pkgver)
                     needs_ldconfig = needs_ldconfig or ldconfig
@@ -1659,18 +1693,18 @@
             fd.close()
         if needs_ldconfig and use_ldconfig:
             bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
-            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
                 postinst = '#!/bin/sh\n'
-            postinst += d.getVar('ldconfig_postinst_fragment', True)
+            postinst += d.getVar('ldconfig_postinst_fragment')
             d.setVar('pkg_postinst_%s' % pkg, postinst)
         bb.debug(1, 'LIBNAMES: pkg %s sonames %s' % (pkg, sonames))
 
     bb.utils.unlockfile(lf)
 
-    assumed_libs = d.getVar('ASSUME_SHLIBS', True)
+    assumed_libs = d.getVar('ASSUME_SHLIBS')
     if assumed_libs:
-        libdir = d.getVar("libdir", True)
+        libdir = d.getVar("libdir")
         for e in assumed_libs.split():
             l, dep_pkg = e.split(":")
             lib_ver = None
@@ -1682,7 +1716,7 @@
                 shlib_provider[l] = {}
             shlib_provider[l][libdir] = (dep_pkg, lib_ver)
 
-    libsearchpath = [d.getVar('libdir', True), d.getVar('base_libdir', True)]
+    libsearchpath = [d.getVar('libdir'), d.getVar('base_libdir')]
 
     for pkg in packages.split():
         bb.debug(2, "calculating shlib requirements for %s" % pkg)
@@ -1736,12 +1770,12 @@
 python package_do_pkgconfig () {
     import re
 
-    packages = d.getVar('PACKAGES', True)
-    workdir = d.getVar('WORKDIR', True)
-    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES')
+    workdir = d.getVar('WORKDIR')
+    pkgdest = d.getVar('PKGDEST')
 
-    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
-    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+    shlibs_dirs = d.getVar('SHLIBSDIRS').split()
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR')
 
     pc_re = re.compile('(.*)\.pc$')
     var_re = re.compile('(.*)=(.*)')
@@ -1773,7 +1807,7 @@
                         m = field_re.match(l)
                         if m:
                             hdr = m.group(1)
-                            exp = bb.data.expand(m.group(2), pd)
+                            exp = pd.expand(m.group(2))
                             if hdr == 'Requires':
                                 pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
 
@@ -1826,7 +1860,7 @@
 
 def read_libdep_files(d):
     pkglibdeps = {}
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages:
         pkglibdeps[pkg] = {}
         for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
@@ -1846,9 +1880,9 @@
 python read_shlibdeps () {
     pkglibdeps = read_libdep_files(d)
 
-    packages = d.getVar('PACKAGES', True).split()
+    packages = d.getVar('PACKAGES').split()
     for pkg in packages:
-        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
         for dep in pkglibdeps[pkg]:
             # Add the dep if it's not already there, or if no comparison is set
             if dep not in rdepends:
@@ -1873,14 +1907,14 @@
     package.
     """
 
-    packages  = d.getVar('PACKAGES', True)
-    postfixes = (d.getVar('DEPCHAIN_POST', True) or '').split()
-    prefixes  = (d.getVar('DEPCHAIN_PRE', True) or '').split()
+    packages  = d.getVar('PACKAGES')
+    postfixes = (d.getVar('DEPCHAIN_POST') or '').split()
+    prefixes  = (d.getVar('DEPCHAIN_PRE') or '').split()
 
     def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
 
         #bb.note('depends for %s is %s' % (base, depends))
-        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
 
         for depend in depends:
             if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
@@ -1901,7 +1935,7 @@
     def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
 
         #bb.note('rdepends for %s is %s' % (base, rdepends))
-        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
 
         for depend in rdepends:
             if depend.find('virtual-locale-') != -1:
@@ -1924,12 +1958,12 @@
             list.append(dep)
 
     depends = []
-    for dep in bb.utils.explode_deps(d.getVar('DEPENDS', True) or ""):
+    for dep in bb.utils.explode_deps(d.getVar('DEPENDS') or ""):
         add_dep(depends, dep)
 
     rdepends = []
     for pkg in packages.split():
-        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) or ""):
+        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg) or ""):
             add_dep(rdepends, dep)
 
     #bb.note('rdepends is %s' % rdepends)
@@ -1959,11 +1993,11 @@
         for pkg in pkglibdeps:
             for k in pkglibdeps[pkg]:
                 add_dep(pkglibdeplist, k)
-        dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (bb.data.inherits_class('packagegroup', d)))
+        dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS') == '1') or (bb.data.inherits_class('packagegroup', d)))
 
     for suffix in pkgs:
         for pkg in pkgs[suffix]:
-            if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', True):
+            if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'):
                 continue
             (base, func) = pkgs[suffix][pkg]
             if suffix == "-dev":
@@ -1976,19 +2010,19 @@
                 pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
             else:
                 rdeps = []
-                for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base, True) or ""):
+                for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base) or ""):
                     add_dep(rdeps, dep)
                 pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
 }
 
 # Since bitbake can't determine which variables are accessed during package
 # iteration, we need to list them here:
-PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE"
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS"
 
 def gen_packagevar(d):
     ret = []
-    pkgs = (d.getVar("PACKAGES", True) or "").split()
-    vars = (d.getVar("PACKAGEVARS", True) or "").split()
+    pkgs = (d.getVar("PACKAGES") or "").split()
+    vars = (d.getVar("PACKAGEVARS") or "").split()
     for p in pkgs:
         for v in vars:
             ret.append(v + "_" + p)
@@ -2036,16 +2070,16 @@
     # Sanity test the setup
     ###########################################################################
 
-    packages = (d.getVar('PACKAGES', True) or "").split()
+    packages = (d.getVar('PACKAGES') or "").split()
     if len(packages) < 1:
         bb.debug(1, "No packages to build, skipping do_package")
         return
 
-    workdir = d.getVar('WORKDIR', True)
-    outdir = d.getVar('DEPLOY_DIR', True)
-    dest = d.getVar('D', True)
-    dvar = d.getVar('PKGD', True)
-    pn = d.getVar('PN', True)
+    workdir = d.getVar('WORKDIR')
+    outdir = d.getVar('DEPLOY_DIR')
+    dest = d.getVar('D')
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('PN')
 
     if not workdir or not outdir or not dest or not dvar or not pn:
         msg = "WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package"
@@ -2063,7 +2097,7 @@
     # code pre-expands some frequently used variables
 
     def expandVar(x, d):
-        d.setVar(x, d.getVar(x, True))
+        d.setVar(x, d.getVar(x))
 
     for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
         expandVar(x, d)
@@ -2072,7 +2106,7 @@
     # Setup PKGD (from D)
     ###########################################################################
 
-    for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split():
+    for f in (d.getVar('PACKAGEBUILDPKGD') or '').split():
         bb.build.exec_func(f, d)
 
     ###########################################################################
@@ -2081,7 +2115,7 @@
 
     cpath = oe.cachedpath.CachedPath()
 
-    for f in (d.getVar('PACKAGESPLITFUNCS', True) or '').split():
+    for f in (d.getVar('PACKAGESPLITFUNCS') or '').split():
         bb.build.exec_func(f, d)
 
     ###########################################################################
@@ -2091,18 +2125,18 @@
     # Build global list of files in each split package
     global pkgfiles
     pkgfiles = {}
-    packages = d.getVar('PACKAGES', True).split()
-    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES').split()
+    pkgdest = d.getVar('PKGDEST')
     for pkg in packages:
         pkgfiles[pkg] = []
         for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
             for file in files:
                 pkgfiles[pkg].append(walkroot + os.sep + file)
 
-    for f in (d.getVar('PACKAGEFUNCS', True) or '').split():
+    for f in (d.getVar('PACKAGEFUNCS') or '').split():
         bb.build.exec_func(f, d)
 
-    qa_sane = d.getVar("QA_SANE", True)
+    qa_sane = d.getVar("QA_SANE")
     if not qa_sane:
         bb.fatal("Fatal QA errors found, failing task.")
 }
@@ -2149,7 +2183,7 @@
     Rewrite variables to account for package renaming in things
     like debian.bbclass or manual PKG variable name changes
     """
-    pkg = d.getVar("PKG", True)
+    pkg = d.getVar("PKG")
     runtime_mapping_rename("RDEPENDS", pkg, d)
     runtime_mapping_rename("RRECOMMENDS", pkg, d)
     runtime_mapping_rename("RSUGGESTS", pkg, d)