[yocto] FW: stupid question about post-installation scripts

Paul Eggleton paul.eggleton at linux.intel.com
Mon Nov 25 09:01:10 PST 2013


On Monday 25 November 2013 15:21:41 Rifenbark, Scott M wrote:
> >From: Robert P. J. Day [mailto:rpjday at crashcourse.ca]
> >Sent: Sunday, November 24, 2013 2:37 AM
> >To: Rifenbark, Scott M
> >Subject: stupid question about post-installation scripts
> >
> >  when one defines pkg_postinst scripts, are those scripts invoked at
> >
> >*both* root filesystem creation time and first boot time? so that one needs
> >to manually check the value of ${D} to decide whether to run them, say, at
> >first boot time?

Not both - it's either-or; i.e. it will be run at rootfs creation time and if 
it fails then, it will be run on first boot. Yes you can use the value of $D 
(note: *not* ${D}!) to find out where the script is being called from, if 
necessary.

> >  i'm reading the section here:
> >http://www.yoctoproject.org/docs/latest/dev-manual/dev-> >manual.html#post-installation-scripts
> >
> >and i know i've seen elsewhere scripts explicitly checking the value of the
> >${D} prefix to determine when they're being invoked. it *seems* like
> >that's what's happening, but if that's the case, it can probably be said
> >much more clearly.

The answer is, you can do this if you have to, but ideally you shouldn't need 
to. In the ideal situation the script should be written such that it functions 
equally well no matter where it executes; that avoids the need to run anything 
on first boot, *and* (assuming you have package management enabled for the 
target) it will work if the package is installed on the target some time 
afterwards.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list