A comprehensive Yocto/OpenEmbedded layer for automated testing of Chromium browser builds across multiple architectures, Yocto versions, and C library implementations.
- Overview
- Purpose
- Features
- Layer Structure
- Prerequisites
- Quick Start
- Configuration Matrix
- Scripts Usage
- KAS Configuration
- Adding New Combinations
- Testing
- Recipes
- Docker Infrastructure
- Troubleshooting
- Contributing
The meta-chromium-test layer provides automated testing infrastructure for the Chromium browser on embedded Linux systems. It supports building and testing Chromium across multiple combinations of:
- Yocto Versions: kirkstone, scarthgap, walnascar, master
- Architectures: ARM, AArch64, RISC-V, x86-64
- Chromium Variants: Ozone Wayland, X11
- C Libraries: glibc, musl
This layer is designed to work with the meta-browser layer and uses KAS for reproducible builds.
This testing layer serves several key purposes:
- Automated CI/CD Testing: Provides consistent testing across multiple configurations
- Regression Detection: Catches issues early across different platforms and versions
- Quality Assurance: Ensures Chromium builds work reliably on embedded systems
- Development Support: Facilitates testing new features and configurations
- Performance Benchmarking: Enables systematic performance testing
- Matrix Testing: Automated generation of test configurations for all supported combinations
- KAS Integration: Uses KAS for reproducible and isolated builds
- QEMU Testing: Automated testing using QEMU emulation
- Smoke Tests: Built-in smoke tests for basic Chromium functionality
- Script Automation: Comprehensive build, test, and validation scripts
- Flexible Architecture: Easy to extend with new configurations
meta-chromium-test/
├── conf/
│ └── layer.conf # Layer configuration
├── kas/ # KAS configuration files
│ ├── chromium/ # Chromium variant configs
│ │ ├── ozone-wayland.yml # Wayland/Ozone configuration
│ │ └── x11.yml # X11 configuration
│ ├── repos/ # Repository configurations
│ │ ├── common-repos.yml # Common repository definitions
│ │ ├── kirkstone.yml # Kirkstone-specific repos
│ │ ├── scarthgap.yml # Scarthgap-specific repos
│ │ ├── walnascar.yml # Walnascar-specific repos
│ │ ├── master.yml # Master branch repos
│ │ └── lts-mixins.yml # LTS-specific configurations
│ ├── common.yml # Common build settings
│ ├── musl.yml # musl C library configuration
│ └── *.yml # Generated test configurations
├── recipes-core/
│ └── images/
│ └── chromium-test-image.bb # Test image recipe
├── recipes-test/
│ └── chromium-tests/
│ ├── chromium-tests.bb # Test package recipe
│ └── files/
│ └── chromium-smoke-test.sh # Smoke test script
├── scripts/
│ ├── generate_kas_files.sh # Generate KAS configurations
│ ├── build.sh # Build automation script
│ ├── test.sh # Test automation script
│ └── validate.sh # Layer validation script
└── README.md # This file
- Yocto/OpenEmbedded: Compatible with kirkstone, scarthgap, walnascar, and master
- KAS: Version 3.0 or later
- Python: 3.8+
- Git: For repository management
- Docker: Required for the recommended testing infrastructure
The testing infrastructure expects the following base directory structure:
/yocto/- Base directory for all builds and test images/yocto/{yocto_version}/- Version-specific build directories (created by GitHub Actions/CI)
The following subdirectories are created automatically by the build.sh script:
/yocto/yocto_dl/- Download directory for source packages/yocto/yocto_sstate_chromium/- Shared state cache directory/yocto/yocto_ccache/- ccache directory for faster rebuilds/yocto/test-images/- Directory for storing built test images
Note: The recommended approach is to use the provided Docker infrastructure which handles these requirements automatically. Only the root /yocto directory needs manual setup.
meta-browser/meta-chromium- Chromium recipesmeta-openembedded/meta-oe- Additional recipesmeta-clang- Clang compiler support (for some configurations)
The recommended approach is to use the Docker-based testing infrastructure which provides a consistent environment:
# Example: Build and test master branch with aarch64 ozone-wayland glibc
docker run --rm -it \
-v /yocto:/yocto \
-v /path/to/meta-browser:/src/meta-browser:ro \
-v /path/to/meta-chromium-test:/src/meta-chromium-test:ro \
skandigraun/yocto:latest \
bash -c '
set -e
mkdir -p /yocto/master && cd /yocto/master
rm -rf meta-browser meta-chromium-test
cp -r /src/meta-browser ./meta-browser
cp -r /src/meta-chromium-test ./meta-chromium-test
./meta-chromium-test/scripts/build.sh master aarch64 ozone-wayland glibc
./meta-chromium-test/scripts/test.sh master aarch64 ozone-wayland glibc
'Docker Command Breakdown:
-v /yocto:/yocto- Mounts host/yoctodirectory for persistent builds-v /path/to/meta-browser:/src/meta-browser:ro- Mounts meta-browser layer (read-only)-v /path/to/meta-chromium-test:/src/meta-chromium-test:ro- Mounts this test layer (read-only)skandigraun/yocto:latest- Pre-configured Yocto build environment
For native builds without Docker:
-
Clone the required layers:
git clone https://github.com/OSSystems/meta-browser.git git clone https://github.com/openembedded/meta-openembedded.git git clone https://github.com/kraj/meta-clang.git
-
Generate KAS files (if not already present):
cd meta-chromium-test ./scripts/generate_kas_files.sh -
Build a test image:
kas build kas/glibc-kirkstone-ozone-wayland-x86-64-test.yml
-
Run automated build and test:
./scripts/build.sh kirkstone x86-64 ozone-wayland ./scripts/test.sh kirkstone x86-64 ozone-wayland
Note: Native setup requires manual creation of the /yocto/ directory structure and proper environment configuration.
The layer supports the following configuration matrix:
| Yocto Version | Architectures | Chromium Variants | C Libraries |
|---|---|---|---|
| kirkstone | arm, aarch64, x86-64 | ozone-wayland, x11 | glibc, musl |
| scarthgap | arm, aarch64, riscv, x86-64 | ozone-wayland, x11 | glibc, musl |
| walnascar | arm, aarch64, riscv, x86-64 | ozone-wayland, x11 | glibc, musl |
| master | arm, aarch64, riscv, x86-64 | ozone-wayland, x11 | glibc, musl |
Note: RISC-V support is not available for kirkstone.
This generates 120 unique configurations for comprehensive testing.
Important: All scripts are designed to run within the Docker infrastructure. For native execution, ensure the /yocto/ directory structure exists and is properly configured.
# Build and test kirkstone x86-64 ozone-wayland with glibc
docker run --rm -it \
-v /yocto:/yocto \
-v /path/to/meta-browser:/src/meta-browser:ro \
-v /path/to/meta-chromium-test:/src/meta-chromium-test:ro \
skandigraun/yocto:latest \
bash -c '
set -e
mkdir -p /yocto/kirkstone && cd /yocto/kirkstone
rm -rf meta-browser meta-chromium-test
cp -r /src/meta-browser ./meta-browser
cp -r /src/meta-chromium-test ./meta-chromium-test
./meta-chromium-test/scripts/build.sh kirkstone x86-64 ozone-wayland
./meta-chromium-test/scripts/test.sh kirkstone x86-64 ozone-wayland
'
# Test musl with scarthgap aarch64 x11
docker run --rm -it \
-v /yocto:/yocto \
-v /path/to/meta-browser:/src/meta-browser:ro \
-v /path/to/meta-chromium-test:/src/meta-chromium-test:ro \
skandigraun/yocto:latest \
bash -c '
set -e
mkdir -p /yocto/scarthgap && cd /yocto/scarthgap
rm -rf meta-browser meta-chromium-test
cp -r /src/meta-browser ./meta-browser
cp -r /src/meta-chromium-test ./meta-chromium-test
./meta-chromium-test/scripts/build.sh scarthgap aarch64 x11 musl
./meta-chromium-test/scripts/test.sh scarthgap aarch64 x11 musl
'Generates all KAS configuration files for the supported matrix:
# Generate all KAS files
./scripts/generate_kas_files.shCustomizing the script:
- Modify
YOCTO_VERSIONSarray to add/remove Yocto versions - Update
CHROMIUM_VERSIONSfor new Chromium variants - Add new architectures to
ARCHSand updatearch_machine_dict - Extend
LIBC_FLAVOURSfor additional C library support
Automated build script for specific configurations:
# Usage: build.sh yocto_version arch chromium_version [libc_flavour]
# Examples (within Docker container):
./scripts/build.sh kirkstone x86-64 ozone-wayland
./scripts/build.sh scarthgap aarch64 x11 musl
./scripts/build.sh master riscv ozone-wayland glibcScript behavior:
- Creates build directory structure in
/yocto/{yocto_version}/ - Checks for existing builds to avoid rebuilding
- Uses KAS for reproducible builds
- Copies final images to
/yocto/test-images/for testing
Automated testing using QEMU:
# Usage: test.sh yocto_version arch chromium_version [libc_flavour]
# Examples (within Docker container):
./scripts/test.sh kirkstone x86-64 ozone-wayland
./scripts/test.sh scarthgap aarch64 x11 muslScript behavior:
- Looks for built images in
/yocto/test-images/ - Launches QEMU with appropriate configuration
- Runs automated smoke tests
- Creates
.donefiles to track completed tests
Validates the layer structure and configuration:
./scripts/validate.shThe layer uses a modular KAS configuration approach:
common.yml: Shared settings for all buildsmusl.yml: musl C library specific settingschromium/ozone-wayland.yml: Wayland/Ozone variant settingschromium/x11.yml: X11 variant settings
repos/common-repos.yml: Common repository definitionsrepos/{version}.yml: Version-specific repository commits and settings
Each test configuration follows the naming pattern:
{libc}-{yocto_version}-{chromium_version}-{arch}-test.yml
Examples:
glibc-kirkstone-ozone-wayland-x86-64-test.ymlmusl-scarthgap-x11-aarch64-test.yml
-
Create repository configuration:
cp kas/repos/master.yml kas/repos/newfversion.yml # Edit newfversion.yml with appropriate repository commits -
Update generate_kas_files.sh:
YOCTO_VERSIONS=("kirkstone" "scarthgap" "walnascar" "master" "newfversion")
-
Regenerate KAS files:
./scripts/generate_kas_files.sh
-
Update generate_kas_files.sh:
ARCHS=("arm" "aarch64" "riscv" "x86-64" "newarch") # Add machine mapping arch_machine_dict["newarch"]="qemunewarch"
-
Update build.sh and test.sh if needed for architecture-specific settings
-
Regenerate configurations:
./scripts/generate_kas_files.sh
-
Create variant configuration:
# kas/chromium/newvariant.yml header: version: 11 local_conf_header: chromium-newvariant: | PREFERRED_PROVIDER_chromium = "chromium-newvariant" PACKAGECONFIG:append:pn-chromium-newvariant = " proprietary-codecs"
-
Update generate_kas_files.sh:
CHROMIUM_VERSIONS=("ozone-wayland" "x11" "newvariant")
-
Regenerate configurations:
./scripts/generate_kas_files.sh
The layer includes basic smoke tests for Chromium functionality:
# Run smoke test on target
chromium-smoke-test-
Build and boot image:
kas build kas/glibc-kirkstone-ozone-wayland-x86-64-test.yml runqemu qemux86-64
-
Test Chromium manually:
# On target system chromium --no-sandbox
For CI/CD integration using Docker with ccache:
#!/bin/bash
# Example CI script for Docker-based testing with ccache
DOCKER_IMAGE="skandigraun/yocto:latest"
META_BROWSER_PATH="/path/to/meta-browser"
META_CHROMIUM_TEST_PATH="/path/to/meta-chromium-test"
# Test configurations
CONFIGS=(
"kirkstone x86-64 ozone-wayland glibc"
"scarthgap aarch64 x11 musl"
"master riscv ozone-wayland glibc"
)
# Show initial ccache stats
echo "Initial ccache statistics:"
docker run --rm -v yocto:/yocto "$DOCKER_IMAGE" bash -c "
export CCACHE_DIR=/yocto/yocto_ccache
ccache -s 2>/dev/null || echo 'ccache not yet initialized'
"
for config in "${CONFIGS[@]}"; do
read -r yocto_version arch chromium_version libc <<< "$config"
echo "Testing: $config"
docker run --rm -it \
-v yocto:/yocto \
-v "$META_BROWSER_PATH":/src/meta-browser:ro \
-v "$META_CHROMIUM_TEST_PATH":/src/meta-chromium-test:ro \
"$DOCKER_IMAGE" \
bash -c "
set -e
# Only create Yocto version directory - build.sh handles the rest
mkdir -p /yocto/$yocto_version && cd /yocto/$yocto_version
rm -rf meta-browser meta-chromium-test
cp -r /src/meta-browser ./meta-browser
cp -r /src/meta-chromium-test ./meta-chromium-test
./meta-chromium-test/scripts/build.sh $yocto_version $arch $chromium_version $libc
./meta-chromium-test/scripts/test.sh $yocto_version $arch $chromium_version $libc
" || exit 1
done
# Show final ccache stats
echo "Final ccache statistics:"
docker run --rm -v yocto:/yocto "$DOCKER_IMAGE" bash -c "
export CCACHE_DIR=/yocto/yocto_ccache
ccache -s
"
echo "All tests completed successfully with ccache acceleration!"A comprehensive test image including:
- Both Chromium variants (Ozone Wayland and X11)
- Development and debugging tools
- Network utilities
- Font packages
- X11 server components
Provides smoke tests and utility scripts for Chromium testing.
The testing infrastructure uses the skandigraun/yocto:latest Docker image which provides:
- Pre-configured Yocto build environment
- All required tools and dependencies
- Optimized build cache and download directories
- ccache support for faster rebuilds
- Consistent environment across different host systems
The Docker container uses the following directory structure (created automatically by build.sh):
/yocto/ # Host directory mounted to container
├── yocto_dl/ # Download cache (created by build.sh)
├── yocto_sstate_chromium/ # Shared state cache (created by build.sh)
├── yocto_ccache/ # ccache directory (created by build.sh)
├── test-images/ # Built test images (created by build.sh)
├── kirkstone/ # Kirkstone builds (created as needed)
├── scarthgap/ # Scarthgap builds (created as needed)
├── walnascar/ # Walnascar builds (created as needed)
└── master/ # Master builds (created as needed)
Note: Only the root /yocto directory needs to be set up manually. All subdirectories are created automatically by the build script with proper permissions.
/yocto:/yocto- Persistent build artifacts and caches/path/to/meta-browser:/src/meta-browser:ro- Meta-browser layer (read-only)/path/to/meta-chromium-test:/src/meta-chromium-test:ro- This test layer (read-only)
The Docker environment includes optimized settings for:
- Download directory:
/yocto/yocto_dl - Shared state directory:
/yocto/yocto_sstate_chromium - ccache directory:
/yocto/yocto_ccache(up to 50GB cache) - Source mirror URL for faster downloads
- Build optimizations for containerized environments
The layer is configured with ccache to significantly speed up rebuilds:
- Cache Location:
/yocto/yocto_ccache - Maximum Size: 50GB (configurable in
kas/common.yml) - Compression: Enabled with level 6 for space efficiency
- Shared Across: All architectures and Yocto versions
ccache Benefits:
- First Build: Same speed as without ccache
- Subsequent Builds: 2-10x faster depending on changes
- Cross-Architecture: Shared cache across ARM, AArch64, x86-64, RISC-V
- Cross-Version: Shared cache across different Yocto versions
Before running any builds, you need to create the Docker volume with the required directory structure and proper permissions. This ensures that the yoctouser in the container can write to all necessary directories.
# Create the named Docker volume
docker volume create yocto# Run a temporary container as root to set up basic structure and permissions
docker run --rm -v yocto:/yocto --user root skandigraun/yocto:latest bash -c "
# Create the root /yocto directory with proper ownership
mkdir -p /yocto
# Set proper ownership for yoctouser (UID 1000, GID 1000 typically)
chown -R 1000:1000 /yocto
# Set proper permissions
chmod -R 755 /yocto
echo 'Docker volume setup completed successfully!'
echo 'Note: Build-specific directories will be created automatically by build.sh'
"Note: The build script (build.sh) automatically creates all required subdirectories (yocto_dl, yocto_sstate_chromium, yocto_ccache, test-images) with proper permissions when you run your first build. This eliminates the need to manually create these directories during setup.
# Verify that yoctouser can write to the volume
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c "
echo 'Testing write permissions...'
touch /yocto/test-file
ls -la /yocto/test-file
rm /yocto/test-file
echo 'Volume setup verified successfully!'
echo 'Ready for builds - subdirectories will be created automatically'
"For convenience, you can set up everything in a single command:
# Create volume and set up basic structure in one go
docker volume create yocto && \
docker run --rm -v yocto:/yocto --user root skandigraun/yocto:latest bash -c "
mkdir -p /yocto
chown -R 1000:1000 /yocto
chmod -R 755 /yocto
echo 'Yocto Docker volume ready for use!'
echo 'Build-specific directories will be created automatically by build.sh'
" && \
echo "Volume setup complete. You can now run builds with automatic ccache setup."
#### ccache Management
Monitor and manage ccache performance:
```bash
# Check ccache statistics
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c "
export CCACHE_DIR=/yocto/yocto_ccache
ccache -s
"
# Clear ccache if needed
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c "
export CCACHE_DIR=/yocto/yocto_ccache
ccache -C
"
# Set different cache size limit (e.g., 100GB)
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c "
export CCACHE_DIR=/yocto/yocto_ccache
ccache -M 100G
"If you encounter permission issues:
-
Check the yoctouser UID/GID in your container:
docker run --rm skandigraun/yocto:latest id yoctouser
-
Adjust ownership if needed (replace 1000:1000 with actual UID:GID):
docker run --rm -v yocto:/yocto --user root skandigraun/yocto:latest bash -c " chown -R 1000:1000 /yocto "
-
Remove and recreate volume if corrupted:
docker volume rm yocto # Then repeat the setup steps above
-
View volume information:
docker volume inspect yocto
-
Clean up old builds (preserves download, sstate, and ccache):
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c " rm -rf /yocto/*/build 2>/dev/null || true rm -rf /yocto/test-images/* 2>/dev/null || true echo 'Build artifacts cleaned, caches preserved' echo 'Note: Shared directories will be recreated automatically on next build' "
-
Complete volume cleanup (removes everything including ccache):
docker volume rm yocto
For optimal ccache performance:
-
Monitor cache hit rate:
docker run --rm -v yocto:/yocto skandigraun/yocto:latest bash -c " export CCACHE_DIR=/yocto/yocto_ccache ccache -s | grep 'cache hit rate' "
-
Adjust cache size based on available disk space:
- Minimum recommended: 20GB for basic usage
- Optimal: 50GB for full matrix testing
- Maximum useful: 100GB+ for extensive development
-
Keep cache across container restarts by using the persistent volume mount
Once the volume is set up, you can proceed with the Docker usage examples in the Quick Start section. Your builds will automatically benefit from ccache acceleration on subsequent runs.
-
Build Failures:
# Clean previous builds (within Docker container) kas shell kas/your-config.yml -c "bitbake -c clean chromium-ozone-wayland"
-
Missing Dependencies:
- Ensure all required layers are present in the Docker container
- Check layer compatibility with
bitbake-layers show-layers
-
QEMU Issues:
- Verify QEMU machine configuration
- Check available system resources
- Ensure
/yocto/test-images/contains the required images
-
Docker Volume Issues:
- Verify
/yoctodirectory exists on host system - Check volume mount permissions
- Ensure sufficient disk space in
/yoctodirectory
- Verify
-
KAS Problems:
# Validate KAS file (within Docker container) kas dump kas/your-config.yml
Enable debug output within Docker container:
kas --log-level debug build kas/your-config.yml- Check the meta-browser documentation
- Review KAS documentation
- Examine build logs in
build/tmp/log/within the container - For Docker-specific issues, check container logs and volume mounts
- Fork the repository
- Create a feature branch
- Add your changes:
- Update configurations as needed
- Add new test cases
- Update documentation
- Test your changes:
./scripts/validate.sh ./scripts/generate_kas_files.sh
- Submit a pull request
- Follow existing naming conventions
- Update documentation for new features
- Test changes across multiple configurations
- Maintain backward compatibility
- Add appropriate error handling
This layer is distributed under the MIT License. See the COPYING.MIT file for details.
- See
MAINTAINERSfile for current maintainer information
For questions, issues, or contributions, please use the project's issue tracker or contact the maintainers directly.