On Saturday, January 7, 2017 10:23:50 AM PST Mike Looijmans wrote:
> On 06-01-17 18:17, Rudolf J Streif wrote:
> > Hi Colin,
> > 
> > The correct way of doing this is a package postinstallation script that is
> > run by the package manager after the package containing your application
> > is installed on the target system.
> > 
> > You add to your recipe:
> > 
> > pkg_postinst_${PN}() {
> > #!/bin/sh
> > echo "whateveryouneed" >> ${D}/etc/inittab
> > }
> 
> Problems are that if you upgrade the application on target, it'll be
> included twice, and that when you remove the application, the inittab
> entry remains. If inittab itsef gets upgraded, the entry will be gone.
> 

For the former, you use your imagination and scripting skills to see if the 
entry is already there and remove it or you use pkg_preinst_${PN} to remove 
the entry before installing.

For the latter pkg_prerm_${PN} and pkg_postrm_${PN} are at your disposition.

The problem you stated is actually independent of the build system. It is part 
of the package management. For RPM, for example, the scripts get copied into 
the respective sections of the package manifest:

pgk_preinst -> %pre
pkg_post_inst -> %post
pkg_prerm -> %preun
pkg_postrm -> %postun

Accordingly for the other package management systems.


-- 
Rudolf J Streif

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to