diff --git a/recipes-core/images/includes/image-preprocessing.inc b/recipes-core/images/includes/image-preprocessing.inc new file mode 100644 index 0000000..7e88345 --- /dev/null +++ b/recipes-core/images/includes/image-preprocessing.inc @@ -0,0 +1,11 @@ +IMAGE_PREPROCESS_COMMAND_sota += " moveRPMDatabase;" + + +# Change the location of /var/lib/rpm to /usr/lib/rpm. +# This makes the rpm package index consistent with installed packages. +moveRPMDatabase() { + cd ${WORKDIR}/rootfs + mv var/lib/rpm/* usr/lib/rpm + rm -r var/lib/rpm + echo "L /var/lib/rpm - - - - /usr/lib/rpm" > etc/tmpfiles.d/ostree-rpm.conf +} diff --git a/recipes-core/images/netmodule-linux-image.bb b/recipes-core/images/netmodule-linux-image.bb index fc999b5..4463c5c 100644 --- a/recipes-core/images/netmodule-linux-image.bb +++ b/recipes-core/images/netmodule-linux-image.bb @@ -1,4 +1,5 @@ inherit core-image +require includes/image-preprocessing.inc SUMMARY = "NetModule Linux Distro Image" @@ -121,15 +122,4 @@ IMAGE_OVERHEAD_FACTOR = "1.0" OSTREE_BOOTLOADER = "u-boot" OSTREE_BRANCHNAME ?= "${MACHINE}" -IMAGE_PREPROCESS_COMMAND_sota += " moveRPMDatabase;" - BUILDNAME = "${EXTERNALSRC_GIT_SRCREV};${DATETIME};${PN}" - -# Change the location of /var/lib/rpm to /usr/lib/rpm. -# This makes the rpm package index consistent with installed packages. -moveRPMDatabase() { - cd ${WORKDIR}/rootfs - mv var/lib/rpm/* usr/lib/rpm - rm -r var/lib/rpm - echo "L /var/lib/rpm - - - - /usr/lib/rpm" > etc/tmpfiles.d/ostree-rpm.conf -}