Skip to content

Development Workflows Recipe Development Guide

Alex J Lennon edited this page Oct 6, 2025 · 1 revision

Recipe Development Guide

This guide covers the proper workflow for creating and modifying Yocto recipes in the meta-dynamicdevices project.

⚠️ CRITICAL: Always Use devtool

NEVER create recipes manually - always use devtool within the proper kas environment to avoid dependency errors and ensure proper cross-compilation.

Common Manual Recipe Mistakes

Manual recipe creation often leads to errors like:

  • Invalid package dependencies (e.g., coreutils-stty instead of coreutils)
  • Missing cross-compilation configuration
  • Incorrect license checksums
  • Build path issues

Proper Recipe Development Workflow

1. Enter Kas Environment

cd /path/to/meta-dynamicdevices
./scripts/kas-shell-base.sh

⚠️ WARNING: Never run Yocto environment setup directly (like setup-environment scripts). Always use the kas scripts to ensure proper TMPDIR paths and build configuration.

2. Create Recipe with devtool

# Inside kas shell
devtool add --srcrev main recipe-name https://github.com/user/repo.git

Benefits of devtool add:

  • Automatic dependency detection
  • Proper recipe structure generation
  • Validates package names against target system
  • Handles cross-compilation complexities

3. Build and Test

# Build the recipe
devtool build recipe-name

# Deploy to target for testing (if board available)
devtool deploy-target recipe-name [email protected]

4. Modify Recipe if Needed

# Edit the recipe in workspace
devtool modify recipe-name

# Make changes, then rebuild
devtool build recipe-name

5. Finalize Recipe to Layer

# Move recipe to proper layer
devtool finish recipe-name meta-dynamicdevices-bsp

Example: eink-power-cli Recipe

The eink-power-cli recipe was initially created manually and had dependency issues:

❌ Manual Creation Issues

# WRONG - caused build failure
RDEPENDS:${PN} += "coreutils-stty"  # Package doesn't exist

✅ Proper devtool Approach

# Enter kas environment
./scripts/kas-shell-base.sh

# Create recipe properly
devtool add --srcrev main eink-power-cli https://github.com/DynamicDevices/eink-power-cli.git

# Test build
devtool build eink-power-cli

# Deploy for testing
devtool deploy-target eink-power-cli [email protected]

# Finalize to BSP layer
devtool finish eink-power-cli meta-dynamicdevices-bsp

Recipe Validation Checklist

Before finalizing any recipe:

  • Recipe builds successfully with devtool build
  • Dependencies are validated against target system
  • Cross-compilation works correctly
  • License checksums are accurate
  • Runtime dependencies are correct
  • Recipe follows Yocto best practices

Common devtool Commands

Command Purpose
devtool add Create new recipe from source
devtool modify Modify existing recipe
devtool build Build recipe
devtool deploy-target Deploy to target device
devtool finish Move recipe to layer
devtool reset Remove from workspace
devtool status Show workspace status

Integration with Build System

After using devtool finish, remember to:

  1. Commit changes to the BSP layer
  2. Update submodule in main repository
  3. Trigger new build from meta-subscriber-overrides
  4. Monitor build using the fio-api.sh script

See Also

Clone this wiki locally