All of lore.kernel.org
 help / color / mirror / Atom feed
From: "JC" <jc@vtkloud.com>
To: "Paul Eggleton" <paul.eggleton@linux.intel.com>
Cc: yocto@yoctoproject.org
Subject: Re: adding specific config files
Date: Thu, 05 Sep 2013 03:05:04 -0700 (PDT)	[thread overview]
Message-ID: <1378375503526.8457b679@Nodemailer> (raw)
In-Reply-To: <1788175.gQRx6AnBKQ@helios>

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]

On jeu., sept. 5, 2013 at 12:00 PM, Paul Eggleton <paul.eggleton@linux.intel.com="mailto:paul.eggleton@linux.intel.com">> wrote:

    On Thursday 05 September 2013 11:45:26 JC wrote:

> On 05/09/2013 11:32, Paul Eggleton wrote:

> > Unfortunately we have to have a fixed configuration for smart during

> > do_rootfs, so it has to be written to. I think though that rather than

> > trying to install a configuration file for smart using a separate recipe,

> > I would suggest modifying the smart configuration at the end of do_rootfs

> > to add the configuration elements you need. The way to do this would be

> > to define a shell function that you can add a call to in

> > ROOTFS_POSTPROCESS_COMMAND that will run smart:

> > 

> > add_extra_smart_config() {

> > 

> > 	smart --data-dir=${IMAGE_ROOTFS}/var/lib/smart channel --add rpmsys

> > 	type=rpm-sys -y> 

> > }

> > ROOTFS_POSTPROCESS_COMMAND += "add_extra_smart_config; "

> > 

> > You can put the above in the image recipe itself or in a class that your

> > image recipe inherits.

> > 

> > Cheers,

> > Paul

> 

> Thanks, I'm going to try it !!

> 

> Assuming I don't want to create a new image (i still haven't exactly

> figured how to do this in a clean way), where should I append this code ?


To be honest I always recommend people create their own image recipes

whatever they are doing since image recipes are usually trivial and

almost always need to be customised. The easiest way to do this is to

copy an existing image recipe and name it and modify it as you prefer.


> How can I make it dependend on the "package-management" feature?


If "package-management" is not in IMAGE_FEATURES the smart config gets deleted

anyway so this will have no effect. However, if desired you can use an inline

python expression within the shell function to do things conditionally, e.g.


if ${@base_contains("IMAGE_FEATURES", "package-management", "true", "false", d)}; then

...

fi


It's important to realise though that the evaluation of the inline

python happens when the expression is parsed, not when the shell

function it is executed; by the time the shell function executes the

expression will have been converted to its result.


Cheers,

Paul




    ​

    
      


    Thanks ! I'm gonna try and let you know !

    
      


    Jay

[-- Attachment #2: Type: text/html, Size: 3344 bytes --]

  reply	other threads:[~2013-09-05 10:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 18:58 adding specific config files JC
2013-09-04 19:58 ` JC
2013-09-04 20:10   ` JC
2013-09-05  9:32     ` Paul Eggleton
2013-09-05  9:45       ` JC
2013-09-05 10:00         ` Paul Eggleton
2013-09-05 10:05           ` JC [this message]
2013-09-05 13:09           ` (solved) " JC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378375503526.8457b679@Nodemailer \
    --to=jc@vtkloud.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.