Patchwork [v2] rpm: split out run-postinsts

login
register
mail settings
Submitter Zhenhua Luo
Date March 25, 2013, 10:38 a.m.
Message ID <CA452391058F6D4E9715FB2C29D9312A01487E80@039-SN2MPN1-022.039d.mgd.msft.net>
Download mbox | patch
Permalink /patch/46837/
State Superseded
Headers show

Comments

Zhenhua Luo - March 25, 2013, 10:38 a.m.
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Mark Hatle
> Sent: Saturday, March 23, 2013 1:05 AM
> 
> On 3/22/13 11:29 AM, Richard Purdie wrote:
> > On Thu, 2013-03-21 at 10:05 +0800, Zhenhua Luo wrote:
> >> Split out run-postinsts script into separated package, sometimes only
> the postinsts script is required to run all postinsts scripts in
> /etc/rpm-postinsts/ instead of the whole rpm package.
> >>
> >> @@ -223,9 +223,11 @@ FILES_${PN} =  "${bindir}/rpm \
> >>   		${libdir}/rpm/bin/wget \
> >>   		/var/lib/rpm \
> >>   		/var/cache/rpm \
> >> -		${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
> \
> >>   		"
> >>
> >> +FILES_${PN}-postinsts =
> "${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts \
> >> +                "
> >> +
> >>   FILES_${PN}-dbg += "${libdir}/rpm/.debug \
> >>   		${libdir}/rpm/bin/.debug \
> >>   		"
> >
> > Don't we need to depend on this package somewhere so that it gets
> > installed?
> 
> I think it should be required from the rootfs_rpm.bbclass in some way.
[Luo Zhenhua-B19537] Is following the right way to include the rpm-postinsts into rootfs or any better idea? Below patch is verified to be working. 



Best Regards,

Zhenhua
Richard Purdie - March 25, 2013, 10:44 a.m.
On Mon, 2013-03-25 at 10:38 +0000, Luo Zhenhua-B19537 wrote:
> > > Don't we need to depend on this package somewhere so that it gets
> > > installed?
> > 
> > I think it should be required from the rootfs_rpm.bbclass in some way.
> [Luo Zhenhua-B19537] Is following the right way to include the rpm-postinsts into rootfs or any better idea? Below patch is verified to be working. 
> 
> --- a/meta/classes/rootfs_rpm.bbclass
> +++ b/meta/classes/rootfs_rpm.bbclass
> @@ -35,6 +35,8 @@ opkglibdir = "${localstatedir}/lib/opkg"
>  RPMOPTS="--dbpath ${rpmlibdir}"
>  RPM="rpm ${RPMOPTS}"
>  
> +IMAGE_INSTALL += "rpm-postinsts"
> +
>  # RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files 
>  # in ${DEPLOY_DIR_RPM}. This can be removed if package_update_index_rpm can be called concurrently
>  do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"

Looking at rootfs_ipk:

ROOTFS_PKGMANAGE = "opkg opkg-collateral ${EXTRAOPKGCONFIG}"
ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"

seems to be a pretty good setup to copy, particularly given the rpm
counterpart:

# Postinstalls on device are handled within this class at present
ROOTFS_PKGMANAGE_BOOTSTRAP = ""

which is no longer true.

Cheers,

Richard

Patch

--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -35,6 +35,8 @@  opkglibdir = "${localstatedir}/lib/opkg"
 RPMOPTS="--dbpath ${rpmlibdir}"
 RPM="rpm ${RPMOPTS}"
 
+IMAGE_INSTALL += "rpm-postinsts"
+
 # RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files 
 # in ${DEPLOY_DIR_RPM}. This can be removed if package_update_index_rpm can be called concurrently
 do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"