# bitbake task
* Writer : Harvey Wu (harveywu95@gmail.com)
* Begin write : 2022/08/09
## Check task list
example 1: bitbake -c listtasks smbios-mdr
```
do_build Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
do_checkuri Validates the SRC_URI value
do_clean Removes all output files for a target
do_cleanall Removes all output files, shared state cache, and downloaded source files for a target
do_cleansstate Removes all output files and shared state cache for a target
do_compile Compiles the source in the compilation directory
do_configure Configures the source by enabling and disabling any build-time and configuration options for the software being built
do_deploy_source_date_epoch
do_deploy_source_date_epoch_setscene (setscene version)
do_devshell Starts a shell with the environment set up for development/debugging
do_fetch Fetches the source code
do_generate_toolchain_file
do_install Copies files from the compilation directory to a holding area
do_listtasks Lists all defined tasks for a target
do_package Analyzes the content of the holding area and splits it into subsets based on available packages and files
do_package_qa Runs QA checks on packaged files
do_package_qa_setscene Runs QA checks on packaged files (setscene version)
do_package_setscene Analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version)
do_package_write_rpm Creates the actual RPM packages and places them in the Package Feed area
do_package_write_rpm_setscene Creates the actual RPM packages and places them in the Package Feed area (setscene version)
do_packagedata Creates package metadata used by the build system to generate the final packages
do_packagedata_setscene Creates package metadata used by the build system to generate the final packages (setscene version)
do_patch Locates patch files and applies them to the source code
do_populate_lic Writes license information for the recipe that is collected later when the image is constructed
do_populate_lic_setscene Writes license information for the recipe that is collected later when the image is constructed (setscene version)
do_populate_sysroot Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes
do_populate_sysroot_setscene Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes (setscene version)
do_prepare_recipe_sysroot
do_pydevshell Starts an interactive Python shell for development/debugging
do_unpack Unpacks the source code into a working directory
```
example 2: bitbake -c listtasks obmc-phosphor-image
```
do_build Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
do_checkuri Validates the SRC_URI value
do_clean Removes all output files for a target
do_cleanall Removes all output files, shared state cache, and downloaded source files for a target
do_cleansstate Removes all output files and shared state cache for a target
do_compile Compiles the source in the compilation directory
do_configure Configures the source by enabling and disabling any build-time and configuration options for the software being built
do_copy_signing_pubkey
do_deploy_source_date_epoch
do_deploy_source_date_epoch_setscene (setscene version)
do_devshell Starts a shell with the environment set up for development/debugging
do_fetch Fetches the source code
do_flush_pseudodb
do_generate_phosphor_manifest
do_generate_rwfs_ext4
do_generate_rwfs_static
do_generate_rwfs_ubi
do_generate_static
do_generate_static_alltar
do_generate_static_tar
do_generate_ubi_tar
do_image
do_image_complete
do_image_complete_setscene (setscene version)
do_image_cpio
do_image_qa
do_image_qa_setscene (setscene version)
do_image_squashfs_xz
do_install Copies files from the compilation directory to a holding area
do_listtasks Lists all defined tasks for a target
do_package Analyzes the content of the holding area and splits it into subsets based on available packages and files
do_package_qa_setscene Runs QA checks on packaged files (setscene version)
do_package_setscene Analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version)
do_package_write_rpm_setscene Creates the actual RPM packages and places them in the Package Feed area (setscene version)
do_packagedata_setscene Creates package metadata used by the build system to generate the final packages (setscene version)
do_patch Locates patch files and applies them to the source code
do_populate_lic_deploy
do_populate_lic_setscene Writes license information for the recipe that is collected later when the image is constructed (setscene version)
do_populate_sdk Creates the file and directory structure for an installable SDK
do_populate_sdk_ext
do_populate_sdk_setscene Creates the file and directory structure for an installable SDK (setscene version)
do_populate_sysroot_setscene Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes (setscene version)
do_prepare_bootloaders
do_prepare_recipe_sysroot
do_pydevshell Starts an interactive Python shell for development/debugging
do_rootfs Creates the root filesystem (file and directory structure) for an image
do_rootfs_wicenv
do_sdk_depends
do_unpack Unpacks the source code into a working directory
```
* PS. Another useful cmd to check repices list : ```bitbake -s```
## Procedure
* The ```base.bbclass``` file is always included. Other classes that are specified in the configuration using the :term:`INHERIT` variable are also included.[(link)](https://github.com/openbmc/openbmc/blob/master/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst#parsing-the-base-configuration-metadata)
* About setscene task => https://docs.yoctoproject.org/2.2/ref-manual/ref-manual.html#shared-state
### obmc-phosphor-image.bbclass
inherit:
```graphviz
digraph obmc_phosphor_image {
nodesep=1.0
node [color=Black,fontname=Arial,shape=box]
edge [color=Blue, style=dashed]
"obmc-phosphor-image" -> {"core-image", "obmc-phosphor-utils"}
"core-image" -> {"image"}
"image" -> {"rootfs_deb/ipk/rpm", "image-types", "image_types_wic", "node"}
"node" -> {"rootfs-postcommands", "image-postinst-intercepts", "overlayfs-etc"}
"node" [shape=circle]
"image-types" -> {"siteinfo", "kernel-arch", "image-artifact-names"}
"rootfs-postcommands" -> "image-artifact-names"
}
```
### base.bbclass
inherit:
```graphviz
digraph base_inherit {
nodesep=1.0
node [color=Black,fontname=Arial,shape=box]
edge [color=Blue, style=dashed]
base -> {patch, staging, mirrors, utils, "utility-tasks", logging, metadata_scm}
}
```
task:
```graphviz
digraph base_task {
nodesep=1.0
node [color=Black,fontname=Arial,shape=box]
edge [color=Blue, style=dashed]
do_fetch -> do_unpack
do_patch -> do_deploy_source_date_epoch -> do_configure
do_configure -> do_compile -> do_install
do_populate_sysroot -> do_build
do_clean -> do_cleansstate -> do_cleanall
do_unpack -> do_patch [label="patch.bbclass"]
do_fetch -> do_prepare_recipe_sysroot -> do_configure [label="staging.bbclass"]
do_install -> do_populate_sysroot [label="staging.bbclass"]
}
```
### image.bbclass
task:
```graphviz
digraph task {
nodesep=1.0
node [color=Black,fontname=Arial,shape=box]
edge [color=Blue, style=dashed]
do_prepare_recipe_sysroot -> do_rootfs
do_image -> do_image_complete -> do_build
do_rootfs -> do_image_qa -> do_image
do_populate_sysroot -> do_rootfs
}
```