Hi Quentin,

On Tue, May 28, 2024 at 01:23:20PM +0200, Quentin Schulz wrote:
> Hi Marcus,
> 

[...]

> > +#
> > +#
> > +# Usage: add inherit += "image-bootfiles" to your image
> > +#
> 
> Simply
> 
> inherit image-bootfiles

Noted

> 
> c.f. 
> https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#inherit-directive
> 
> since you put this class into meta/classes/ and not meta/classes-recipes/,
> it could be included both with
> 
> INHERIT += "image-bootfiles"
> 
> and
> 
> inherit image-bootfiles
> 
> The former is to be included from configuration files (e.g. a distro,
> local.conf, machine conf file, etc.). The latter inside the image recipe
> directly.
> 
> I am wondering if we shouldn't make this a recipes-only bbclass? so moving
> it to meta/classes-recipes/? This means that we won't be able to use the
> INHERIT += "image-bootfiles" anymore but.... should we? On one side, we have
> something that only applies to images, on the other hand, it's probably
> something close to a policy, so rather part of a distro. So just wondering,
> not asking for a change :)

I don't have a strong opinion, I let this be to what people think is
the best.
If I must choose, I think it is more of a distro thing.

> 
> Cheers,
> Quentin
> 
> > +
> > +IMAGE_BOOT_FILES_DIR ?= "boot"
> > +
> > +python bootfiles_populate() {
> > +    import shutil
> > +    from oe.bootfiles import get_boot_files
> > +
> > +    deploy_image_dir = d.getVar("DEPLOY_DIR_IMAGE")
> > +    boot_dir = os.path.join(d.getVar("IMAGE_ROOTFS"), 
> > d.getVar("IMAGE_BOOT_FILES_DIR"))
> > +
> > +    boot_files = d.getVar("IMAGE_BOOT_FILES")
> > +    if boot_files is None:
> > +        return
> > +
> > +    install_files = get_boot_files(deploy_image_dir, boot_files)
> > +    if install_files is None:
> > +        bb.warn("Could not find any boot files to install even though 
> > IMAGE_BOOT_FILES is not empty")
> > +        return
> > +
> > +    os.makedirs(boot_dir, exist_ok=True)
> > +    for src, dst  in install_files:
> > +        image_src = os.path.join(deploy_image_dir, src)
> > +        image_dst = os.path.join(boot_dir, dst)
> > +        shutil.copyfile(image_src, image_dst)
> 
> This won't work if the parent directory of image_dst doesn't exist yet.

Good catch, I will do as you suggest.

[...]
> 
> Cheers,
> Quentin


Best regards,
Marcus Folkesson

Attachment: signature.asc
Description: PGP signature

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#199970): 
https://lists.openembedded.org/g/openembedded-core/message/199970
Mute This Topic: https://lists.openembedded.org/mt/106345350/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to