From 55d9133b3a4182c6561002e43d01f7e84eb4f297 Mon Sep 17 00:00:00 2001 From: Jan De Landtsheer Date: Wed, 3 Sep 2025 18:52:32 +0200 Subject: [PATCH] Complete module dependency fixes and build improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement proper recursive dependency resolution using depmod -av + modinfo -k - Copy configs/init as /sbin/init instead of creating symlink to zinit - Fix validation to check /sbin/init as executable file (not symlink) - Remove automatic cleanup - always preserve build artifacts for incremental builds - Module resolution now finds missing core modules: virtio.ko, virtio_ring.ko, nvme-core - Recursive resolution verified: nvme→nvme-core, virtio_scsi→5 dependencies - Final chroot depmod creates proper module database for boot-time loading --- scripts/build.sh | 7 ------- scripts/lib/initramfs.sh | 14 +++++++------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 512dbac..cec2c02 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -358,11 +358,6 @@ function main_build_process() { fi } -# Keep all build artifacts by default for incremental builds and debugging -function cleanup_build_artifacts() { - log_info "Build artifacts preserved for incremental builds" - log_info "Use ./scripts/clean.sh to manually clean artifacts when needed" -} # Main function function main() { @@ -416,8 +411,6 @@ function main() { return 1 fi - # Always preserve artifacts for incremental builds - cleanup_build_artifacts section_header "Zero OS Build Complete" log_info "Ready to deploy Zero OS with Alpine Linux and zinit" diff --git a/scripts/lib/initramfs.sh b/scripts/lib/initramfs.sh index ab835aa..4b72d66 100644 --- a/scripts/lib/initramfs.sh +++ b/scripts/lib/initramfs.sh @@ -558,17 +558,17 @@ function initramfs_validate() { ((errors++)) fi - # Check that /sbin/init is properly linked to zinit - if [[ -L "${initramfs_dir}/sbin/init" ]]; then - local link_target=$(readlink "${initramfs_dir}/sbin/init") - if [[ "$link_target" == "zinit" ]]; then - log_info "✓ /sbin/init correctly linked to zinit" + # Check that /sbin/init is configs/init script (not symlink) + if [[ -f "${initramfs_dir}/sbin/init" && -x "${initramfs_dir}/sbin/init" ]]; then + # Verify it's the configs/init script by checking content + if grep -q "ZERO-OS ALPINE INITRAMFS" "${initramfs_dir}/sbin/init" 2>/dev/null; then + log_info "✓ /sbin/init is configs/init script" else - log_error "✗ /sbin/init linked to wrong target: ${link_target}" + log_error "✗ /sbin/init is not configs/init script" ((errors++)) fi else - log_error "✗ /sbin/init is not a symbolic link" + log_error "✗ /sbin/init is missing or not executable" ((errors++)) fi