forked from tfgrid/zosbuilder
Fix init script setup and preserve build artifacts
- Copy configs/init as /sbin/init instead of creating symlink to zinit - Remove automatic cleanup of build artifacts - always preserve for incremental builds - Allows rebuilding initramfs with existing components - Use ./scripts/clean.sh to manually clean when needed
This commit is contained in:
@@ -358,18 +358,10 @@ function main_build_process() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Cleanup build artifacts
|
||||
# Keep all build artifacts by default for incremental builds and debugging
|
||||
function cleanup_build_artifacts() {
|
||||
if [[ "$KEEP_ARTIFACTS" != "true" ]]; then
|
||||
section_header "Cleaning Build Artifacts"
|
||||
|
||||
components_cleanup "$COMPONENTS_DIR" "false"
|
||||
kernel_cleanup "$KERNEL_DIR" "false"
|
||||
|
||||
log_info "Build artifacts cleaned"
|
||||
else
|
||||
log_info "Keeping build artifacts as requested"
|
||||
fi
|
||||
log_info "Build artifacts preserved for incremental builds"
|
||||
log_info "Use ./scripts/clean.sh to manually clean artifacts when needed"
|
||||
}
|
||||
|
||||
# Main function
|
||||
@@ -424,7 +416,7 @@ function main() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Cleanup if requested
|
||||
# Always preserve artifacts for incremental builds
|
||||
cleanup_build_artifacts
|
||||
|
||||
section_header "Zero OS Build Complete"
|
||||
|
||||
@@ -27,10 +27,18 @@ function initramfs_setup_zinit() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Remove existing init (if any) and replace with zinit
|
||||
log_info "Replacing system init with zinit"
|
||||
# Copy configs/init as /sbin/init (not a symlink to zinit)
|
||||
log_info "Installing configs/init as /sbin/init"
|
||||
safe_execute rm -f "${initramfs_dir}/sbin/init"
|
||||
safe_execute ln -sf zinit "${initramfs_dir}/sbin/init"
|
||||
local configs_init="${PROJECT_ROOT}/configs/init"
|
||||
if [[ -f "$configs_init" ]]; then
|
||||
safe_execute cp "$configs_init" "${initramfs_dir}/sbin/init"
|
||||
safe_execute chmod 755 "${initramfs_dir}/sbin/init"
|
||||
log_info "✓ Installed configs/init as /sbin/init"
|
||||
else
|
||||
log_error "configs/init not found: $configs_init"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Copy zinit configuration (all YAML and scripts)
|
||||
log_info "Installing zinit configuration"
|
||||
|
||||
Reference in New Issue
Block a user