From 45392cc67a89afe468b179789c7fbeeb3aa67769 Mon Sep 17 00:00:00 2001 From: Valentin Popa Date: Fri, 27 Sep 2013 17:10:41 +0300 Subject: bitbake: HOB: MACHINE should be saved in conf files using ?= MACHINE var is saved using early assignment operator. Calling MACHINE=x bitbake core-image-... works properly. Comment "#added by bitbake" is replaced with "#added by hob". [YOCTO #5070] (Bitbake rev: 2d0ec8ff083b636a6cf98de3278900eb95c3def6) Signed-off-by: Valentin Popa Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 2 +- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs') diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 829281357d..46023cc585 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -198,7 +198,7 @@ class Configuration: handler.set_var_in_file("BBLAYERS", self.layers, "bblayers.conf") # local.conf if not defaults: - handler.set_var_in_file("MACHINE", self.curr_mach, "local.conf") + handler.early_assign_var_in_file("MACHINE", self.curr_mach, "local.conf") handler.set_var_in_file("DISTRO", self.curr_distro, "local.conf") handler.set_var_in_file("DL_DIR", self.dldir, "local.conf") handler.set_var_in_file("SSTATE_DIR", self.sstatedir, "local.conf") diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index ef74e563f9..3f5bebaca3 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py @@ -315,7 +315,7 @@ class HobHandler(gobject.GObject): def set_machine(self, machine): if machine: - self.set_var_in_file("MACHINE", machine, "local.conf") + self.early_assign_var_in_file("MACHINE", machine, "local.conf") def set_sdk_machine(self, sdk_machine): self.set_var_in_file("SDKMACHINE", sdk_machine, "local.conf") @@ -472,6 +472,11 @@ class HobHandler(gobject.GObject): self.server.runCommand(["setVarFile", var, val, default_file, "set"]) self.runCommand(["disableDataTracking"]) + def early_assign_var_in_file(self, var, val, default_file=None): + self.runCommand(["enableDataTracking"]) + self.server.runCommand(["setVarFile", var, val, default_file, "earlyAssign"]) + self.runCommand(["disableDataTracking"]) + def append_var_in_file(self, var, val, default_file=None): self.server.runCommand(["setVarFile", var, val, default_file, "append"]) -- cgit v1.2.3-54-g00ecf