Integrate zosstorage build path and runtime orchestration
Summary: * add openssh-client to the builder image and mount host SSH keys into the dev container when available * switch RFS to git builds, register the zosstorage source, and document the extra Rust component * wire zosstorage into the build: add build_zosstorage(), ship the binary in the initramfs, and extend component validation * refresh kernel configuration to 6.12.49 while dropping Xen guest selections and enabling counted-by support * tighten runtime configs: use cached mycelium key path, add zosstorage zinit unit, bootstrap ovsdb-server, and enable openvswitch module * adjust the network health check ping invocation and fix the RFS pack-tree --debug flag order * update NOTES changelog, README component list, and introduce a runit helper for qemu/cloud-hypervisor testing * add ovsdb init script wiring under config/zinit/init and ensure zosstorage is available before mycelium
This commit is contained in:
@@ -421,6 +421,50 @@ function build_rfs() {
|
||||
log_info "Built rfs binary (${binary_size}) at: ${binary_path}"
|
||||
}
|
||||
|
||||
# Build function for zosstorage (standard Rust build)
|
||||
function build_zosstorage() {
|
||||
local name="$1"
|
||||
local component_dir="$2"
|
||||
|
||||
section_header "Building zosstorage with musl target"
|
||||
|
||||
components_setup_rust_env
|
||||
|
||||
log_info "Building zosstorage from: ${component_dir}"
|
||||
|
||||
if [[ ! -d "$component_dir" ]]; then
|
||||
log_error "Component directory not found: ${component_dir}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log_info "Executing: cd $component_dir"
|
||||
cd "$component_dir" || {
|
||||
log_error "Failed to change to directory: $component_dir"
|
||||
return 1
|
||||
}
|
||||
|
||||
local current_dir
|
||||
current_dir=$(pwd)
|
||||
log_info "Current directory: ${current_dir}"
|
||||
|
||||
if [[ ! -f "Cargo.toml" ]]; then
|
||||
log_error "Cargo.toml not found in: ${current_dir}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
safe_execute cargo build --release --target "$RUST_TARGET"
|
||||
|
||||
local binary_path="target/${RUST_TARGET}/release/zosstorage"
|
||||
if [[ ! -f "$binary_path" ]]; then
|
||||
log_error "zosstorage binary not found at: ${binary_path}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local binary_size
|
||||
binary_size=$(get_file_size "$binary_path")
|
||||
log_info "Built zosstorage binary (${binary_size}) at: ${binary_path}"
|
||||
}
|
||||
|
||||
# Build function for mycelium (special subdirectory build)
|
||||
function build_mycelium() {
|
||||
local name="$1"
|
||||
@@ -554,6 +598,16 @@ function components_verify_installation() {
|
||||
((missing_count++))
|
||||
fi
|
||||
|
||||
# zosstorage
|
||||
local zosstorage_bin="${components_dir}/zosstorage/target/x86_64-unknown-linux-musl/release/zosstorage"
|
||||
if [[ -x "$zosstorage_bin" ]]; then
|
||||
log_info "✓ zosstorage ($(get_file_size "$zosstorage_bin")) at: ${zosstorage_bin#${components_dir}/}"
|
||||
((ok_count++))
|
||||
else
|
||||
log_error "✗ zosstorage missing: ${zosstorage_bin#${components_dir}/}"
|
||||
((missing_count++))
|
||||
fi
|
||||
|
||||
# corex
|
||||
local corex_bin="${components_dir}/corex/corex"
|
||||
if [[ -x "$corex_bin" ]]; then
|
||||
@@ -599,7 +653,7 @@ function components_cleanup() {
|
||||
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 build_zinit build_rfs build_zosstorage build_mycelium install_corex
|
||||
export -f components_verify_installation components_cleanup
|
||||
# Export functions for install_rfs
|
||||
export -f install_rfs
|
||||
|
||||
@@ -186,6 +186,34 @@ function initramfs_copy_components() {
|
||||
log_error "✗ mycelium binary not found: ${mycelium_binary}"
|
||||
((missing_count++))
|
||||
fi
|
||||
|
||||
# Copy zosstorage to /usr/bin
|
||||
local zosstorage_binary="${components_dir}/zosstorage/target/x86_64-unknown-linux-musl/release/zosstorage"
|
||||
if [[ -f "$zosstorage_binary" ]]; then
|
||||
safe_mkdir "${initramfs_dir}/usr/bin"
|
||||
safe_execute cp "$zosstorage_binary" "${initramfs_dir}/usr/bin/zosstorage"
|
||||
safe_execute chmod +x "${initramfs_dir}/usr/bin/zosstorage"
|
||||
|
||||
local original_size=$(get_file_size "${initramfs_dir}/usr/bin/zosstorage")
|
||||
if strip "${initramfs_dir}/usr/bin/zosstorage" 2>/dev/null || true; then
|
||||
log_debug "Stripped zosstorage"
|
||||
else
|
||||
log_debug "zosstorage already stripped or strip failed"
|
||||
fi
|
||||
|
||||
if command_exists "upx" && upx --best --force "${initramfs_dir}/usr/bin/zosstorage" >/dev/null 2>&1 || true; then
|
||||
log_debug "UPX compressed zosstorage"
|
||||
else
|
||||
log_debug "UPX failed or already compressed"
|
||||
fi
|
||||
|
||||
local final_size=$(get_file_size "${initramfs_dir}/usr/bin/zosstorage")
|
||||
log_info "✓ Copied zosstorage ${original_size} → ${final_size} to /usr/bin/zosstorage"
|
||||
((copied_count++))
|
||||
else
|
||||
log_error "✗ zosstorage binary not found: ${zosstorage_binary}"
|
||||
((missing_count++))
|
||||
fi
|
||||
|
||||
# Copy corex to /usr/bin
|
||||
local corex_binary="${components_dir}/corex/corex"
|
||||
@@ -929,6 +957,7 @@ function initramfs_validate() {
|
||||
local component_binaries=(
|
||||
"usr/bin/rfs"
|
||||
"usr/bin/mycelium"
|
||||
"usr/bin/zosstorage"
|
||||
"usr/bin/corex"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user