[bitbake-devel] [PatchV2] hob/bitbake: custom image is now using the base image

Richard Purdie richard.purdie at linuxfoundation.org
Tue Dec 11 15:48:52 UTC 2012


On Tue, 2012-12-11 at 15:44 +0200, Cristiana Voicu wrote:
> Till now, a custom image made in Hob was using only the packages from
> the base image. Now it is using everything declared in the base image.
> Also next to hob-image.bb, it creates another .bb file which is used
> in building process. Those images are ignored by git.
> 
> [YOCTO #2601]
> Signed-off-by: Cristiana Voicu <cristiana.voicu at intel.com>
> ---
>  .gitignore                                  |    1 +
>  bitbake/lib/bb/command.py                   |   10 ++++++++++
>  bitbake/lib/bb/cooker.py                    |   20 ++++++++++++++++++++
>  bitbake/lib/bb/ui/crumbs/builder.py         |    6 +++++-
>  bitbake/lib/bb/ui/crumbs/hobeventhandler.py |   10 +++++++++-
>  bitbake/lib/bb/ui/crumbs/hoblistmodel.py    |    6 ++++++
>  6 files changed, 51 insertions(+), 2 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index 88c91f6..003f09a 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -15,3 +15,4 @@ meta-*
>  *~
>  !meta-yocto
>  !meta-yocto-bsp
> +hob-image-*.bb
> diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
> index 3f28bca..28b4c5d 100644
> --- a/bitbake/lib/bb/command.py
> +++ b/bitbake/lib/bb/command.py
> @@ -197,6 +197,16 @@ class CommandsSync:
>          filterfunc = params[0]
>          bb.parse.parse_py.ConfHandler.confFilters.append(filterfunc)
>  
> +    def matchFile(self, command, params):
> +        fMatch = params[0]
> +        return command.cooker.matchFile(fMatch)
> +
> +    def generateNewImage(self, command, params):
> +        image = params[0]
> +        base_image = params[1]
> +        package_queue = params[2]
> +        return command.cooker.generateNewImage(image, base_image, package_queue)
> +
>  class CommandsAsync:
>      """
>      A class of asynchronous commands
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index 6b58f91..2338b31 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1188,6 +1188,26 @@ class BBCooker:
>  
>          self.server_registration_cb(buildTargetsIdle, rq)
>  
> +    def generateNewImage(self, image, base_image, package_queue):
> +        '''
> +        Create a new image with a "require" base_image statement
> +        '''
> +        image_name = os.path.splitext(image)[0]
> +        timestr = time.strftime("-%Y%m%d-%H%M%S")
> +        dest = image_name + str(timestr) + ".bb"
> +
> +        with open(dest, "w") as imagefile:
> +            imagefile.write("inherit image\n")

Do we need the above line? Doesn't the original image do this for us?


Looks good to me otherwise though, much better than the previous
version!

Cheers,

Richard





More information about the bitbake-devel mailing list