cpb- / yocto-cooker

Meta buildtool for Yocto Project based Linux embedded systems
GNU General Public License v2.0
42 stars 22 forks source link

Add a menu template command #136

Open adri1mart1 opened 1 year ago

adri1mart1 commented 1 year ago

Hello there :)

I am starting a brand new project using cooker. Initial repo README suggest to start with cooker cook MENU or cooker init MENU. I didn't found an easy way to get a menu template. I think at the moment, we need to pick up a random recipe in the sample dir and remove / add what we need ?

2 suggestions to ease starting:

The template I'm expected to get would be:

{
    "sources" : [
        { "url": "git://git.yoctoproject.org/poky", "branch": "xxx", "rev": "xxx" },
                { "url": "git://git.openembedded.org/meta-openembedded", "branch": "xxx", "rev": "xxx" }
    ],

    "layers" : [
        "poky/meta",
        "poky/meta-poky",
        "poky/meta-yocto-bsp",
        "meta-openembedded/meta-oe"
    ],

    "builds" : {
        "xxx": {
            "target" : "xxxx",

            "layers" : [],

            "local.conf": [
                "MACHINE = 'xxx' "
            ]
        }
    }
}

This template should have basically the minimum required for 90% of menus like the 3 json main nodes (sources / layers / builds), Some common basic layers (poky and openembedded), and a single build target named xxx.

What is your point of view ?

cpb- commented 1 year ago

Fun fact, I suggested quite the same feature last week during a meeting with Patrick :-)

pboettch commented 1 year ago

Good idea create empty template, maybe based on supported variants (and branches ?) Maybe using jinja2 for templates? Overkill?

cooker create-menu -b kirkstone -r openembedded/poky <path/to/newly-created-menu-file.json>
adri1mart1 commented 1 year ago

I would say maybe overkill because to me, the point of this command is only to save time from creating the correct json template. Add the -b branch_name just to put the correct branch name in the menu doesn't same much time. I believe once you have a full empty template, it's really easy to find where to fill up things,

pboettch commented 1 year ago

I was referring to your prefilled source poky and openembedded. There are other bitbake-based distributions we are supporting which are using other based repositories. We should support them and then user should be able to select them. That's why my complex example.

adri1mart1 commented 1 year ago

Yes I think I understood well what you suggest. I think the functionality "create-menu" is needed but the key is to have an idea of what it does in details. Few questions I'm asking to myself but maybe you can share your point of view ?

pboettch commented 1 year ago

No, -r stands for release; maybe it would be better to name it -d for distribution. -b can be any arbitrary.

adri1mart1 commented 1 year ago

Alright, well that was ambiguous this -r. My last 2 interogations above remains unanswered :x

pboettch commented 1 year ago
adri1mart1 commented 1 year ago

Makes sense then ! If you give me some days I can try to add this feature ? or do you want to do it yourself ?