Patchwork [2/2] scripts/oe-setup-builddir: Keep track of TEMPLATECONF setting

login
register
mail settings
Submitter Gary Thomas
Date Feb. 24, 2014, 3:18 p.m.
Message ID <1393255080-12382-3-git-send-email-gary@mlbassoc.com>
Download mbox | patch
Permalink /patch/67251/
State New
Headers show

Comments

Gary Thomas - Feb. 24, 2014, 3:18 p.m.
Keeping track of the TEMPLATECONF variable in the build
tree will let this script produce the same output when
listing 'conf-notes.txt' every time the script is run,
regardless of whether or not TEMPLATECONF has been provided
by the user.

Signed-off-by: Gary Thomas <gary@mlbassoc.com>
---
 scripts/oe-setup-builddir |    8 ++++++++
 1 file changed, 8 insertions(+)
Richard Purdie - Feb. 24, 2014, 3:37 p.m.
On Mon, 2014-02-24 at 08:18 -0700, Gary Thomas wrote:
> Keeping track of the TEMPLATECONF variable in the build
> tree will let this script produce the same output when
> listing 'conf-notes.txt' every time the script is run,
> regardless of whether or not TEMPLATECONF has been provided
> by the user.
> 
> Signed-off-by: Gary Thomas <gary@mlbassoc.com>
> ---
>  scripts/oe-setup-builddir |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> index a869fdc..4322158 100755
> --- a/scripts/oe-setup-builddir
> +++ b/scripts/oe-setup-builddir
> @@ -37,8 +37,16 @@ fi
>  
>  cd "$BUILDDIR"
>  
> +if (test -f "$BUILDDIR/conf/template.conf") then
> +    TEMPLATECONF=$(cat $BUILDDIR/conf/template.conf)
> +fi
> +
>  TEMPLATECONF=${TEMPLATECONF:-meta/conf}
>  
> +if ! (test -f "$BUILDDIR/conf/template.conf") then
> +    echo "$TEMPLATECONF" >$BUILDDIR/conf/template.conf
> +fi
> +

Can you please call this something other than xxx.conf? I don't fancy
someone trying to load this ".conf" file with bitbake...

Since you're also looking in this area, there is one piece I've meant to
add for a long time but never quite got to. I think something like a
hidden top level ".templatepointer" style file might be a good idea for
repos like poky and for anyone else trying to customise the build. This
would allow us to point directly at poky's template configuration files
without having to hack the scripts which is currently what happens
there.

That hacking has long since bothered me, equally, I tend to have more
pressing issues to deal with so its never been done as yet.

Cheers,

Richard
Gary Thomas - Feb. 24, 2014, 3:42 p.m.
On 2014-02-24 08:37, Richard Purdie wrote:
> On Mon, 2014-02-24 at 08:18 -0700, Gary Thomas wrote:
>> Keeping track of the TEMPLATECONF variable in the build
>> tree will let this script produce the same output when
>> listing 'conf-notes.txt' every time the script is run,
>> regardless of whether or not TEMPLATECONF has been provided
>> by the user.
>>
>> Signed-off-by: Gary Thomas <gary@mlbassoc.com>
>> ---
>>  scripts/oe-setup-builddir |    8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
>> index a869fdc..4322158 100755
>> --- a/scripts/oe-setup-builddir
>> +++ b/scripts/oe-setup-builddir
>> @@ -37,8 +37,16 @@ fi
>>  
>>  cd "$BUILDDIR"
>>  
>> +if (test -f "$BUILDDIR/conf/template.conf") then
>> +    TEMPLATECONF=$(cat $BUILDDIR/conf/template.conf)
>> +fi
>> +
>>  TEMPLATECONF=${TEMPLATECONF:-meta/conf}
>>  
>> +if ! (test -f "$BUILDDIR/conf/template.conf") then
>> +    echo "$TEMPLATECONF" >$BUILDDIR/conf/template.conf
>> +fi
>> +
> 
> Can you please call this something other than xxx.conf? I don't fancy
> someone trying to load this ".conf" file with bitbake...
> 
> Since you're also looking in this area, there is one piece I've meant to
> add for a long time but never quite got to. I think something like a
> hidden top level ".templatepointer" style file might be a good idea for
> repos like poky and for anyone else trying to customise the build. This
> would allow us to point directly at poky's template configuration files
> without having to hack the scripts which is currently what happens
> there.

Do you mean for things like this line which is different in Poky?
  TEMPLATECONF=${TEMPLATECONF:-meta/conf}
vs.
  TEMPLATECONF=${TEMPLATECONF:-meta-yocto/conf}

Do you have a list of where such differences are so I can address them?

> 
> That hacking has long since bothered me, equally, I tend to have more
> pressing issues to deal with so its never been done as yet.

I'll see what I can do to improve on this and send a new [set of] patches.
Richard Purdie - Feb. 24, 2014, 4:13 p.m.
On Mon, 2014-02-24 at 08:42 -0700, Gary Thomas wrote:
> On 2014-02-24 08:37, Richard Purdie wrote:
> > On Mon, 2014-02-24 at 08:18 -0700, Gary Thomas wrote:
> >> Keeping track of the TEMPLATECONF variable in the build
> >> tree will let this script produce the same output when
> >> listing 'conf-notes.txt' every time the script is run,
> >> regardless of whether or not TEMPLATECONF has been provided
> >> by the user.
> >>
> >> Signed-off-by: Gary Thomas <gary@mlbassoc.com>
> >> ---
> >>  scripts/oe-setup-builddir |    8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
> >> index a869fdc..4322158 100755
> >> --- a/scripts/oe-setup-builddir
> >> +++ b/scripts/oe-setup-builddir
> >> @@ -37,8 +37,16 @@ fi
> >>  
> >>  cd "$BUILDDIR"
> >>  
> >> +if (test -f "$BUILDDIR/conf/template.conf") then
> >> +    TEMPLATECONF=$(cat $BUILDDIR/conf/template.conf)
> >> +fi
> >> +
> >>  TEMPLATECONF=${TEMPLATECONF:-meta/conf}
> >>  
> >> +if ! (test -f "$BUILDDIR/conf/template.conf") then
> >> +    echo "$TEMPLATECONF" >$BUILDDIR/conf/template.conf
> >> +fi
> >> +
> > 
> > Can you please call this something other than xxx.conf? I don't fancy
> > someone trying to load this ".conf" file with bitbake...
> > 
> > Since you're also looking in this area, there is one piece I've meant to
> > add for a long time but never quite got to. I think something like a
> > hidden top level ".templatepointer" style file might be a good idea for
> > repos like poky and for anyone else trying to customise the build. This
> > would allow us to point directly at poky's template configuration files
> > without having to hack the scripts which is currently what happens
> > there.
> 
> Do you mean for things like this line which is different in Poky?
>   TEMPLATECONF=${TEMPLATECONF:-meta/conf}
> vs.
>   TEMPLATECONF=${TEMPLATECONF:-meta-yocto/conf}
> 
> Do you have a list of where such differences are so I can address them?

That is literally the remaining thing I'd like to resolved, making that
configurable. I'm not sure there is anything else.

Cheers,

Richard

> > 
> > That hacking has long since bothered me, equally, I tend to have more
> > pressing issues to deal with so its never been done as yet.
> 
> I'll see what I can do to improve on this and send a new [set of] patches.
>

Patch

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index a869fdc..4322158 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -37,8 +37,16 @@  fi
 
 cd "$BUILDDIR"
 
+if (test -f "$BUILDDIR/conf/template.conf") then
+    TEMPLATECONF=$(cat $BUILDDIR/conf/template.conf)
+fi
+
 TEMPLATECONF=${TEMPLATECONF:-meta/conf}
 
+if ! (test -f "$BUILDDIR/conf/template.conf") then
+    echo "$TEMPLATECONF" >$BUILDDIR/conf/template.conf
+fi
+
 # 
 # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
 #