Files
zosbuilder/scripts/functionlist.md
Jan De Landtsheer b9f94105cf fix: major build system improvements and container output issues
- Fix container output visibility with proper TTY handling and debug mode
- Fix build order: kernel modules built before initramfs creation
- Implement two-stage kernel build to resolve chicken-and-egg dependency
- Fix sed command issues in kernel configuration with direct execution
- Add diffutils package to container for proper kernel build support
- Enhance NIC module/firmware correlation with intelligent selection
- Fix module staging logic: all NICs loaded in stage1 before network up
- Add smart firmware installation based on module requirements
- Create comprehensive function documentation (scripts/functionlist.md)
- Add debug container script for troubleshooting

Major fixes:
* Container builds now show real-time output
* Kernel builds work with proper GNU diff support
* Module/firmware selection optimized for common hardware
* Build process handles dependencies correctly
* Documentation provides complete function reference
2025-09-03 14:06:44 +02:00

8.9 KiB

Function List - scripts/lib Library

This document provides a comprehensive description of all functions available in the scripts/lib library that are to be sourced by build scripts.

alpine.sh - Alpine Linux Operations

Core Functions

common.sh - Core Utilities

Logging Functions

  • log_info() - Log informational messages with timestamp and color
  • log_warn() - Log warning messages with timestamp and color
  • log_error() - Log error messages with timestamp and color
  • log_debug() - Log debug messages (only when DEBUG=1)

Execution and System Functions

File System Operations

components.sh - ThreeFold Component Management

Component Processing

Build Environment

Component-Specific Build Functions

Verification and Cleanup

docker.sh - Container Runtime Management

Runtime Detection and Setup

Container Image Management

Container Execution

initramfs.sh - Initramfs Assembly

Core Assembly Functions

Module Management

Optimization and Packaging

Validation and Testing

kernel.sh - Kernel Building

Source Management

Build Functions

Cleanup

testing.sh - Virtualization Testing

QEMU Testing

Cloud Hypervisor Testing

Analysis and Orchestration

Usage Notes

Function Availability

All functions are exported for sourcing and can be called from any script that sources the respective library file. The common pattern is:

# Source the library
source "${SCRIPT_DIR}/lib/common.sh"
source "${SCRIPT_DIR}/lib/alpine.sh"
# ... other libraries as needed

# Use the functions
alpine_extract_miniroot "/path/to/target"
components_parse_sources_conf "/path/to/sources.conf" "/path/to/components"

Error Handling

All functions follow consistent error handling patterns:

  • Return non-zero exit codes on failure
  • Use safe_execute() for command execution
  • Provide detailed logging via log_*() functions
  • Clean up resources on failure

Dependencies

Functions have dependencies on:

  • External tools (checked via check_dependencies())
  • Other library functions (noted in function descriptions)
  • Configuration files and environment variables
  • Proper directory structures

Configuration

Most functions respect environment variables for configuration:

  • DEBUG=1 enables debug logging
  • ALPINE_VERSION, KERNEL_VERSION set versions
  • RUST_TARGET configures Rust builds
  • Various *_DIR variables set paths