[bitbake-devel] [PATCH 3/7] Hob: Make layers define in bblayers.conf as default

Richard Purdie richard.purdie at linuxfoundation.org
Sat Mar 31 15:51:01 UTC 2012


On Sat, 2012-03-31 at 13:29 +0800, Xu, Dongxiao wrote:
> On Sat, 2012-03-31 at 08:32 +0800, Xu, Dongxiao wrote:
> > On Fri, 2012-03-30 at 09:10 -0700, Joshua Lock wrote:
> > > 
> > > On 30/03/12 05:01, Dongxiao Xu wrote:
> > > > For layers defined in bblayers.conf, we treat them as default layers
> > > > and users are not allowed to remove them.
> > > 
> > > Can you explain the rationale behind this change? I see what you're 
> > > doing but it's not entirely clear why.
> > > 
> > > I think this is a bad idea. Early on in the design of Hob we decided we 
> > > didn't want configuration made for non-Hob builds to affect builds made 
> > > with Hob, and vice versa.
> > 
> > The issue I am going to solve is that, with current local.conf
> > (DISTRO="poky") and bblayers.conf (bblayers="meta meta-yocto"), we are
> > not able to delete the meta-yocto layer in Hob since it will meet
> > local.conf parsing error since it could not find where "poky" is
> > defined.
> > 
> > This patch is to set those layers define in bblayers.conf as default
> > layers and they could not be removed. For example, in Yocto Project,
> > "meta", "meta-yocto", and "meta-hob" are not removable. For pure OE-Core
> > environment, "meta" and "meta-hob" are not removable.
> > 
> 
> Just discussed with Josh on this problem.
> 
> He suggested that meta-yocto should be still removable. If user met the
> error after deleting the meta-yocto layer, he/she should change the
> DISTRO setting in "Setting" dialog to "defaultsetup".
> 
> Current code to handle the distro setting is:
> 
>     def set_distro(self, distro):  
>         if distro != "defaultsetup":   
>             self.server.runCommand(["setVariable", "DISTRO", distro])
> 
> Therefore even if user has selected defaultsetup, it will not set any
> value to bitbake server, and then DISTRO ?= "poky" will take effect
> while parsing local.conf.
> 
> To make DISTRO ?= "poky" doesn't take effect, we need to change the code
> to be:
> 
>     def set_distro(self, distro):  
>         if distro == "defaultsetup":   
>             distro = ""
>         self.server.runCommand(["setVariable", "DISTRO", distro])
> 
> However Richard ever worried about this approach.
> See:
> http://lists.linuxtogo.org/pipermail/bitbake-devel/2012-March/002438.html
> 
> In summary, there are two solutions now:
> 
> 1) Set those layers defined in bblayers.conf as default, and don't allow
> users to delete them, like this [PATCH 3/7] does.
> 2) Use the empty string "" as the value of DISTRO variable for
> "defaultsetup", and set this value before parsing configuration files,
> making the DISTRO ?= "poky" in local.conf doesn't take effect.
> 
> Welcome for comments on this issue.

I'd be happy if you change the above code to do:

        self.server.runCommand(["deleteVariable", "DISTRO"])

which is subtly different but consistent with what we really want. I
have no idea if we have a deleteVariable command but if we don't, we
should add one.

Cheers,

Richard





More information about the bitbake-devel mailing list