On Thu, 2022-11-10 at 10:24 +0100, Alexander Kanavin wrote:
> This is the last (I believe) piece of the puzzle in setting up builds from
> nothing
> without having to write custom scripts or use external tools.
>
> After layers have been fetched and placed into their respective locations,
> one would
> surely want to proceed to the actual build, and here's how:
>
> 1. Without arguments or with 'list-config-templates', the tool simply walks
> the ../..
> of its location (which is the parent dir of poky/oe-core), and prints what
> templates it
> has found, as seen below. If the following is not enough information,
> adding '-v' will also print conf-notes.txt for each of the templates:
>
> $ oe-setup-build
> Available build configuration templates (re-run with -v to see their
> descriptions):
>
> /srv/work/alex/poky/scripts/oe-setup-build setup-build-env -c
> /srv/work/alex/poky/meta-poky/conf/templates/default
> will create a build configuration in /srv/work/alex/build-meta-poky-default
>
> /srv/work/alex/poky/scripts/oe-setup-build setup-build-env -c
> /srv/work/alex/meta-alex/conf/templates/configuration-gizmo
> will create a build configuration in
> /srv/work/alex/build-meta-alex-configuration-gizmo
>
> /srv/work/alex/poky/scripts/oe-setup-build setup-build-env -c
> /srv/work/alex/meta-alex/conf/templates/configuration-gadget
> will create a build configuration in
> /srv/work/alex/build-meta-alex-configuration-gadget
>
> 2. Then the user picks one command of the above and runs it. This will land
> them in a shell ready to run bitbake:
>
> $ oe-setup-build setup-build-env -c
> /srv/work/alex/meta-alex/conf/templates/configuration-gizmo
> Running:
> TEMPLATECONF=/srv/work/alex/meta-alex/conf/templates/configuration-gizmo .
> /srv/work/alex/poky/oe-init-build-env
> /srv/work/alex/build-meta-alex-configuration-gizmo && /bin/bash
> You had no conf/local.conf file. This configuration file has therefore been
> created for you from
> /srv/work/alex/meta-alex/conf/templates/configuration-gizmo/local.conf.sample
> You may wish to edit it to, for example, select a different MACHINE (target
> hardware). See conf/local.conf for more information as common configuration
> options are commented.
>
> You had no conf/bblayers.conf file. This configuration file has therefore been
> created for you from
> /srv/work/alex/meta-alex/conf/templates/configuration-gizmo/bblayers.conf.sample
> To add additional metadata layers into your configuration please add entries
> to conf/bblayers.conf.
>
> The Yocto Project has extensive documentation about OE including a reference
> manual which can be found at:
> https://docs.yoctoproject.org
>
> For more information about OpenEmbedded see the website:
> https://www.openembedded.org/
>
> This configuration template will set up a build for the purposes of
> supporting gizmo.
> Please refer to meta-alex/README for additional details and available bitbake
> targets.
>
> 3. The full set of command line options is:
>
> $ oe-setup-build -h
> usage: oe-setup-build [-h] {list-config-templates,setup-build-env} ...
>
> A script that discovers available build configuration templates and sets up a
> build environment based on one of them
>
> positional arguments:
> {list-config-templates,setup-build-env}
> list-config-templates
> List available configuration templates
> setup-build-env Set up a build environment and open a shell session
> with it, ready to run builds.
>
> optional arguments:
> -h, --helpshow this help message and exit
>
> $ oe-setup-build list-config-templates -h
> usage: oe-setup-build list-config-templates [-h] [--topdir TOPDIR] [-v]
>
> optional arguments:
> -h, --help show this help message and exit
> --topdir TOPDIR Where to look for available build configuration templates
> (default is /srv/work/alex).
> -v Print a description for each available build configuration
> template.
>
> $ oe-setup-build setup-build-env -h
> usage: oe-setup-build setup-build-env [-h] -c template_path [-b build_path]
> [--no-shell]
>
> optional arguments:
> -h, --helpshow this help message and exit
> -c template_path Use a build configuration template in template_path to
> set up a build environment (run this script with 'list-config-templates' to
> see what is available)
> -b build_path Set up a build directory in build_path (run this script
> with 'list-config-templates' to see where it would be by default)
> --no-shellCreate a build directory but do not start a shell session
> with the build environment from it.
>
> 4. There's also a selftest that runs a basic check for template discovery and
> build setup,
> and an added hint in oe-setup-layers about how to proceed (as it is really
> not user-friendly
> to fetch the layer repos successfully and then exit without a word).
>
> Signed-off-by: Alexander Kanavin
I appreciate I've taken