initramfs+modules: robust copy aliasing, curated stage1 + PHYs, firmware policy via firmware.conf, runtime readiness, build ID; docs sync
Summary of changes (with references):\n\nModules + PHY coverage\n- Curated and normalized stage1 list in [config.modules.conf](config/modules.conf:1):\n - Boot-critical storage, core virtio, common NICs (Intel/Realtek/Broadcom), overlay/fuse, USB HCD/HID.\n - Added PHY drivers required by NIC MACs:\n * realtek (for r8169, etc.)\n * broadcom families: broadcom, bcm7xxx, bcm87xx, bcm_phy_lib, bcm_phy_ptp\n- Robust underscore↔hyphen aliasing during copy so e.g. xhci_pci → xhci-pci.ko, hid_generic → hid-generic.ko:\n - [bash.initramfs_copy_resolved_modules()](scripts/lib/initramfs.sh:990)\n\nFirmware policy and coverage\n- Firmware selection now authoritative via [config/firmware.conf](config/firmware.conf:1); ignore modules.conf firmware hints:\n - [bash.initramfs_setup_modules()](scripts/lib/initramfs.sh:229)\n - Count from firmware.conf for reporting; remove stale required-firmware.list.\n- Expanded NIC firmware set (bnx2, bnx2x, tigon, intel, realtek, rtl_nic, qlogic, e100) in [config.firmware.conf](config/firmware.conf:1).\n- Installer enforces firmware.conf source-of-truth in [bash.alpine_install_firmware()](scripts/lib/alpine.sh:392).\n\nEarly input & build freshness\n- Write a runtime build stamp to /etc/zero-os-build-id for embedded initramfs verification:\n - [bash.initramfs_finalize_customization()](scripts/lib/initramfs.sh:568)\n- Minor init refinements in [config.init](config/init:1) (ensures /home, consistent depmod path).\n\nRebuild helper improvements\n- [scripts/rebuild-after-zinit.sh](scripts/rebuild-after-zinit.sh:1):\n - Added --verify-only; container-aware execution; selective marker clears only.\n - Prints stage status before/after; avoids --rebuild-from; resolves full kernel version for diagnostics.\n\nRemote flist readiness + zinit\n- Init scripts now probe BASE_URL readiness and accept FLISTS_BASE_URL/FLIST_BASE_URL; firmware target is /lib/firmware:\n - [sh.firmware.sh](config/zinit/init/firmware.sh:1)\n - [sh.modules.sh](config/zinit/init/modules.sh:1)\n\nContainer, docs, and utilities\n- Stream container build logs by calling runtime build directly in [bash.docker_build_container()](scripts/lib/docker.sh:56).\n- Docs updated to reflect firmware policy, runtime readiness, rebuild helper, early input, and GRUB USB:\n - [docs.NOTES.md](docs/NOTES.md)\n - [docs.PROMPT.md](docs/PROMPT.md)\n - [docs.review-rfs-integration.md](docs/review-rfs-integration.md)\n- Added GRUB USB creator (referenced in docs): [scripts/make-grub-usb.sh](scripts/make-grub-usb.sh)\n\nCleanup\n- Removed legacy/duplicated config trees under configs/ and config/zinit.old/.\n- Minor newline and ignore fixes: [.gitignore](.gitignore:1)\n\nNet effect\n- Runtime now has correct USB HCDs/HID-generic and NIC+PHY coverage (Realtek/Broadcom), with matching firmware installed in initramfs.\n- Rebuild workflow is minimal and host/container-aware; docs are aligned with implemented behavior.\n
This commit is contained in:
@@ -395,43 +395,35 @@ function alpine_install_firmware() {
|
||||
|
||||
section_header "Installing Required Firmware Packages (Selective)"
|
||||
|
||||
# Use smart firmware selection from module analysis if available
|
||||
# Policy: firmware.conf is the authoritative source for initramfs firmware
|
||||
local firmware_packages=()
|
||||
|
||||
if [[ ! -f "$firmware_conf" ]]; then
|
||||
log_warn "Firmware configuration not found: ${firmware_conf}; skipping firmware installation to initramfs"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Ignore any REQUIRED_FIRMWARE_PACKAGES hints to avoid duplication/mismatch with modules.conf
|
||||
if [[ -n "${REQUIRED_FIRMWARE_PACKAGES:-}" ]]; then
|
||||
log_info "Using intelligent firmware selection based on COPIED modules only"
|
||||
read -ra firmware_packages <<< "$REQUIRED_FIRMWARE_PACKAGES"
|
||||
|
||||
log_info "Required firmware packages (${#firmware_packages[@]}):"
|
||||
for package in "${firmware_packages[@]}"; do
|
||||
log_info " ✓ ${package}"
|
||||
done
|
||||
else
|
||||
log_info "Falling back to firmware configuration file"
|
||||
|
||||
if [[ ! -f "$firmware_conf" ]]; then
|
||||
log_warn "No firmware configuration found and no module requirements"
|
||||
log_info "Skipping firmware installation"
|
||||
return 0
|
||||
log_info "Firmware selection: ignoring REQUIRED_FIRMWARE_PACKAGES; using ${firmware_conf} as authoritative source"
|
||||
fi
|
||||
|
||||
# Read firmware packages from config (excluding comments and empty lines)
|
||||
while IFS=: read -r package description; do
|
||||
# Skip comments and empty lines
|
||||
if [[ "$package" =~ ^[[:space:]]*# ]] || [[ -z "${package// }" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Read firmware packages from config (excluding comments and empty lines)
|
||||
while IFS=: read -r package description; do
|
||||
# Skip comments and empty lines
|
||||
if [[ "$package" =~ ^[[:space:]]*# ]] || [[ -z "${package// }" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# Trim whitespace
|
||||
package=$(echo "$package" | xargs)
|
||||
description=$(echo "$description" | xargs)
|
||||
|
||||
if [[ -n "$package" ]]; then
|
||||
firmware_packages+=("$package")
|
||||
log_info " - ${package}: ${description}"
|
||||
fi
|
||||
done < "$firmware_conf"
|
||||
fi
|
||||
# Trim whitespace
|
||||
package=$(echo "$package" | xargs)
|
||||
description=$(echo "$description" | xargs)
|
||||
|
||||
if [[ -n "$package" ]]; then
|
||||
firmware_packages+=("$package")
|
||||
log_info " - ${package}: ${description}"
|
||||
fi
|
||||
done < "$firmware_conf"
|
||||
|
||||
if [[ ${#firmware_packages[@]} -eq 0 ]]; then
|
||||
log_warn "No firmware packages to install"
|
||||
|
||||
Reference in New Issue
Block a user