blob: bec4d63ed6c39f1356fd9659ef1b18f72a7d8c4b [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# Creates a root filesystem out of rpm packages
3#
4
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005ROOTFS_PKGMANAGE = "rpm dnf"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
Andrew Geissler595f6302022-01-24 19:11:47 +00007# dnf is using our custom sysconfig module, and so will fail without these
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008export STAGING_INCDIR
9export STAGING_LIBDIR
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011# Add 100Meg of extra space for dnf
Patrick Williams213cb262021-08-07 19:21:33 -050012IMAGE_ROOTFS_EXTRA_SPACE:append = "${@bb.utils.contains("PACKAGE_INSTALL", "dnf", " + 102400", "", d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013
14# Dnf is python based, so be sure python3-native is available to us.
15EXTRANATIVEPATH += "python3-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016
17# opkg is needed for update-alternatives
18RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 dnf-native:do_populate_sysroot \
20 createrepo-c-native:do_populate_sysroot \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 opkg-native:do_populate_sysroot"
22
23do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
24do_populate_sdk[depends] += "${RPMROOTFSDEPENDS}"
25
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080026do_rootfs[recrdeptask] += "do_package_write_rpm do_package_qa"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060027do_rootfs[vardeps] += "PACKAGE_FEED_URIS PACKAGE_FEED_BASE_PATHS PACKAGE_FEED_ARCHS"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029python () {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030 if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
31 flags = d.getVarFlag('do_rootfs', 'recrdeptask')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032 flags = flags.replace("do_package_write_rpm", "")
33 flags = flags.replace("do_deploy", "")
34 flags = flags.replace("do_populate_sysroot", "")
35 d.setVarFlag('do_rootfs', 'recrdeptask', flags)
36 d.setVar('RPM_PREPROCESS_COMMANDS', '')
37 d.setVar('RPM_POSTPROCESS_COMMANDS', '')
38
39}