<commit_before>build-yocto
===========

Building Docker image
---------------------

    docker build -t gmacario/build-yocto .

Running Docker image
--------------------

    docker run -t -i gmacario/build-yocto

Once the container is running

    cd /opt/yocto/poky
    git checkout -b daisy origin/daisy

Create build environment

    cd /work
    source /opt/yocto/poky/oe-init-build-env build-test01

Start the build

    bitbake -k core-image-sato

Known issues and workarounds
----------------------------

### bitbake complains if run as root

```
root@eb4b9143265d:/work/build-test01# bitbake -k core-image-sato
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Do not use Bitbake as root.
ERROR: Execution of event handler 'check_sanity_eventhandler' failed
ERROR: Command execution failed: Exited with 1

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
root@eb4b9143265d:/work/build-test01#
```

Workaround:

    $ touch conf/sanity.conf

EOF<commit_msg>README.md: Add section "Using the wic tool"<commit_after>build-yocto
===========

Building Docker image
---------------------

    docker build -t gmacario/build-yocto .

Running Docker image
--------------------

    docker run -t -i gmacario/build-yocto

Once the container is running

    cd /opt/yocto/poky
    git checkout -b daisy origin/daisy

Create build environment

    cd /work
    source /opt/yocto/poky/oe-init-build-env build-test01

Start the build

    bitbake -k core-image-sato
    
### Using the "wic" tool

#### Show program version

Yocto 1.6 provides version 0.1.0
```
root@eb4b9143265d:/work/build-test01# wic --version
wic version 0.1.0
root@eb4b9143265d:/work/build-test01#
```

#### Show program help
```
root@eb4b9143265d:/work/build-test01# wic --help
Usage:

 Create a customized OpenEmbedded image

 usage: wic [--version] [--help] COMMAND [ARGS]

 Current 'wic' commands are:
    create            Create a new OpenEmbedded image
    list              List available values for options and image properties

 See 'wic help COMMAND' for more information on a specific command.


Options:
  --version   show program's version number and exit
  -h, --help  show this help message and exit
root@eb4b9143265d:/work/build-test01#
```

#### List available OpenEmbedded image properties
```
root@eb4b9143265d:/work/build-test01# wic list images
  directdisk            Create a 'pcbios' direct disk image
  mkefidisk             Create an EFI disk image
root@eb4b9143265d:/work/build-test01#
```

TODO

Known issues and workarounds
----------------------------

### bitbake complains if run as root

```
root@eb4b9143265d:/work/build-test01# bitbake -k core-image-sato
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Do not use Bitbake as root.
ERROR: Execution of event handler 'check_sanity_eventhandler' failed
ERROR: Command execution failed: Exited with 1

Summary: There were 3 ERROR messages shown, returning a non-zero exit code.
root@eb4b9143265d:/work/build-test01#
```

Workaround:

    $ touch conf/sanity.conf

EOF
{'fraction_non_alphanumeric': 0.1240174672489083, 'fraction_numerical': 0.033770014556040756, 'mean_word_length': 2.926857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '75475', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1047, 'n_words': 367}