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
This commit is contained in:
2025-09-03 14:06:44 +02:00
parent 6d44575860
commit b9f94105cf
23 changed files with 1072 additions and 4310 deletions

View File

@@ -49,11 +49,11 @@ function components_parse_sources_conf() {
components_download_git "mycelium" "https://github.com/threefoldtech/mycelium" "v0.6.1" "$components_dir"
components_build_component "mycelium" "build_mycelium" "$components_dir"
# Component 3: rfs
# Component 3: rfs (pre-built release)
component_count=$((component_count + 1))
log_info "Processing component ${component_count}: rfs (git)"
components_download_git "rfs" "https://github.com/threefoldtech/rfs" "development" "$components_dir"
components_build_component "rfs" "build_rfs" "$components_dir"
log_info "Processing component ${component_count}: rfs (release)"
components_download_release "rfs" "https://github.com/threefoldtech/rfs/releases/download/v2.0.6/rfs" "v2.0.6" "$components_dir" ""
components_build_component "rfs" "install_rfs" "$components_dir"
# Component 4: corex
component_count=$((component_count + 1))
@@ -397,6 +397,32 @@ function build_mycelium() {
log_info "Installed mycelium binary (${binary_size}) to: ${INSTALL_DIR}/usr/bin/mycelium"
}
# Install function for rfs (pre-built binary)
function install_rfs() {
local name="$1"
local component_dir="$2"
section_header "Installing rfs binary"
log_info "Installing rfs from: ${component_dir}"
# Find the rfs binary
local binary_path="${component_dir}/rfs"
if [[ ! -f "$binary_path" ]]; then
log_error "rfs binary not found at: ${binary_path}"
return 1
fi
# Make executable and install
safe_execute chmod +x "$binary_path"
safe_mkdir "${INSTALL_DIR}/usr/bin"
safe_execute cp "$binary_path" "${INSTALL_DIR}/usr/bin/rfs"
safe_execute chmod +x "${INSTALL_DIR}/usr/bin/rfs"
local binary_size=$(get_file_size "${INSTALL_DIR}/usr/bin/rfs")
log_info "Installed rfs binary (${binary_size}) to: ${INSTALL_DIR}/usr/bin/rfs"
}
# Install function for corex (pre-built binary)
function install_corex() {
local name="$1"
@@ -490,4 +516,6 @@ export -f components_parse_sources_conf
export -f components_download_git components_download_release components_process_extra_options
export -f components_build_component components_setup_rust_env
export -f build_zinit build_rfs build_mycelium install_corex
export -f components_verify_installation components_cleanup
export -f components_verify_installation components_cleanup
# Export functions for install_rfs
export -f install_rfs