rootfs_rpm.bbclass: migrate image creation to dnf
To properly look at this patch, you probably need a side-by-side diff viewing tool. (From OE-Core rev: 65581c68d130fa74d703f6c3c92560e053857ac7) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d4efcded26
commit
67615e0175
|
@ -2,20 +2,23 @@
|
|||
# Creates a root filesystem out of rpm packages
|
||||
#
|
||||
|
||||
ROOTFS_PKGMANAGE = "rpm smartpm"
|
||||
ROOTFS_PKGMANAGE = "rpm dnf"
|
||||
ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
|
||||
|
||||
# Add 100Meg of extra space for Smart
|
||||
IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "smartpm", " + 102400", "" ,d)}"
|
||||
# dnf is using our custom distutils, and so will fail without these
|
||||
export STAGING_INCDIR
|
||||
export STAGING_LIBDIR
|
||||
|
||||
# Smart is python based, so be sure python-native is available to us.
|
||||
# Add 100Meg of extra space for dnf
|
||||
IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "dnf", " + 102400", "" ,d)}"
|
||||
|
||||
# Dnf is python based, so be sure python-native is available to us.
|
||||
EXTRANATIVEPATH += "python-native"
|
||||
|
||||
# opkg is needed for update-alternatives
|
||||
RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
|
||||
rpmresolve-native:do_populate_sysroot \
|
||||
python-smartpm-native:do_populate_sysroot \
|
||||
createrepo-native:do_populate_sysroot \
|
||||
dnf-native:do_populate_sysroot \
|
||||
createrepo-c-native:do_populate_sysroot \
|
||||
opkg-native:do_populate_sysroot"
|
||||
|
||||
do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
|
||||
|
@ -35,7 +38,3 @@ python () {
|
|||
d.setVar('RPM_POSTPROCESS_COMMANDS', '')
|
||||
|
||||
}
|
||||
# Smart is python based, so be sure python-native is available to us.
|
||||
EXTRANATIVEPATH += "python-native"
|
||||
|
||||
rpmlibdir = "/var/lib/rpm"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -431,6 +431,8 @@ class RpmRootfs(Rootfs):
|
|||
bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
|
||||
self.pm.remove(pkg_to_remove)
|
||||
|
||||
self.pm.autoremove()
|
||||
|
||||
def _create(self):
|
||||
pkgs_to_install = self.manifest.parse_initial_manifest()
|
||||
rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
|
||||
|
@ -444,8 +446,6 @@ class RpmRootfs(Rootfs):
|
|||
if self.progress_reporter:
|
||||
self.progress_reporter.next_stage()
|
||||
|
||||
self.pm.dump_all_available_pkgs()
|
||||
|
||||
if self.inc_rpm_image_gen == "1":
|
||||
self._create_incremental(pkgs_to_install)
|
||||
|
||||
|
@ -480,15 +480,13 @@ class RpmRootfs(Rootfs):
|
|||
if self.progress_reporter:
|
||||
self.progress_reporter.next_stage()
|
||||
|
||||
self._setup_dbg_rootfs(['/etc/rpm', '/var/lib/rpm', '/var/lib/smart'])
|
||||
self._setup_dbg_rootfs(['/etc', '/var/lib/rpm', '/var/cache/dnf', '/var/lib/dnf'])
|
||||
|
||||
execute_pre_post_process(self.d, rpm_post_process_cmds)
|
||||
|
||||
if self.inc_rpm_image_gen == "1":
|
||||
self.pm.backup_packaging_data()
|
||||
|
||||
self.pm.rpm_setup_smart_target_config()
|
||||
|
||||
if self.progress_reporter:
|
||||
self.progress_reporter.next_stage()
|
||||
|
||||
|
@ -526,15 +524,7 @@ class RpmRootfs(Rootfs):
|
|||
self.pm.save_rpmpostinst(pkg)
|
||||
|
||||
def _cleanup(self):
|
||||
# during the execution of postprocess commands, rpm is called several
|
||||
# times to get the files installed, dependencies, etc. This creates the
|
||||
# __db.00* (Berkeley DB files that hold locks, rpm specific environment
|
||||
# settings, etc.), that should not get into the final rootfs
|
||||
self.pm.unlock_rpm_db()
|
||||
if os.path.isdir(self.pm.install_dir_path + "/tmp") and not os.listdir(self.pm.install_dir_path + "/tmp"):
|
||||
bb.utils.remove(self.pm.install_dir_path + "/tmp", True)
|
||||
if os.path.isdir(self.pm.install_dir_path) and not os.listdir(self.pm.install_dir_path):
|
||||
bb.utils.remove(self.pm.install_dir_path, True)
|
||||
pass
|
||||
|
||||
class DpkgOpkgRootfs(Rootfs):
|
||||
def __init__(self, d, progress_reporter=None, logcatcher=None):
|
||||
|
|
|
@ -130,7 +130,6 @@ class RpmSdk(Sdk):
|
|||
|
||||
pm.create_configs()
|
||||
pm.write_index()
|
||||
pm.dump_all_available_pkgs()
|
||||
pm.update()
|
||||
|
||||
pkgs = []
|
||||
|
@ -188,7 +187,9 @@ class RpmSdk(Sdk):
|
|||
True).strip('/'),
|
||||
)
|
||||
self.mkdirhier(native_sysconf_dir)
|
||||
for f in glob.glob(os.path.join(self.sdk_output, "etc", "*")):
|
||||
for f in glob.glob(os.path.join(self.sdk_output, "etc", "rpm*")):
|
||||
self.movefile(f, native_sysconf_dir)
|
||||
for f in glob.glob(os.path.join(self.sdk_output, "etc", "dnf", "*")):
|
||||
self.movefile(f, native_sysconf_dir)
|
||||
self.remove(os.path.join(self.sdk_output, "etc"), True)
|
||||
|
||||
|
@ -350,7 +351,7 @@ def sdk_list_installed_packages(d, target, rootfs_dir=None):
|
|||
if img_type == "rpm":
|
||||
arch_var = ["SDK_PACKAGE_ARCHS", None][target is True]
|
||||
os_var = ["SDK_OS", None][target is True]
|
||||
return RpmPkgsList(d, rootfs_dir, arch_var, os_var).list_pkgs()
|
||||
return RpmPkgsList(d, rootfs_dir).list_pkgs()
|
||||
elif img_type == "ipk":
|
||||
conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_TARGET"][target is True]
|
||||
return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var)).list_pkgs()
|
||||
|
|
Loading…
Reference in New Issue