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:
@@ -9,6 +9,7 @@ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
# Container configuration
|
||||
CONTAINER_NAME="zero-os-dev"
|
||||
BUILDER_IMAGE="zero-os-builder:latest"
|
||||
HOST_SSH_DIR="${SSH_MOUNT_DIR:-${HOME}/.ssh}"
|
||||
|
||||
# Default to verbose, streaming logs for dev flows unless explicitly disabled
|
||||
export DEBUG="${DEBUG:-1}"
|
||||
@@ -88,18 +89,32 @@ function dev_container_start() {
|
||||
log_info "Creating new development container: ${CONTAINER_NAME}"
|
||||
|
||||
# Create persistent container with all necessary mounts and environment
|
||||
safe_execute podman run -d \
|
||||
--name "$CONTAINER_NAME" \
|
||||
--privileged \
|
||||
-v "${PROJECT_ROOT}:/workspace" \
|
||||
-w /workspace \
|
||||
-e DEBUG=1 \
|
||||
-e ALPINE_VERSION=3.22 \
|
||||
-e KERNEL_VERSION=6.12.44 \
|
||||
-e RUST_TARGET=x86_64-unknown-linux-musl \
|
||||
-e OPTIMIZATION_LEVEL=max \
|
||||
"$BUILDER_IMAGE" \
|
||||
local podman_args=(
|
||||
run -d
|
||||
--name "$CONTAINER_NAME"
|
||||
--privileged
|
||||
-v "${PROJECT_ROOT}:/workspace"
|
||||
-w /workspace
|
||||
-e DEBUG=1
|
||||
-e ALPINE_VERSION=3.22
|
||||
-e KERNEL_VERSION=6.12.44
|
||||
-e RUST_TARGET=x86_64-unknown-linux-musl
|
||||
-e OPTIMIZATION_LEVEL=max
|
||||
)
|
||||
|
||||
if [[ -d "$HOST_SSH_DIR" ]]; then
|
||||
log_info "Mounting SSH directory: ${HOST_SSH_DIR} -> /root/.ssh (read-only)"
|
||||
podman_args+=(-v "${HOST_SSH_DIR}:/root/.ssh:ro")
|
||||
else
|
||||
log_warn "SSH directory not found at ${HOST_SSH_DIR}; skipping SSH mount"
|
||||
fi
|
||||
|
||||
podman_args+=(
|
||||
"$BUILDER_IMAGE"
|
||||
sleep infinity
|
||||
)
|
||||
|
||||
safe_execute podman "${podman_args[@]}"
|
||||
|
||||
log_info "Development container started successfully"
|
||||
log_info "Container name: ${CONTAINER_NAME}"
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ section "Packing directory to flist"
|
||||
log_info "Source path: ${SRC_PATH}"
|
||||
log_info "Manifest: ${MANIFEST_PATH}"
|
||||
log_info "Store: ${RFS_S3_STORE_URI}"
|
||||
safe_execute "${RFS_BIN}" pack --debug -m "${MANIFEST_PATH}" -s "${RFS_S3_STORE_URI}" "${SRC_PATH}"
|
||||
safe_execute "${RFS_BIN}" --debug pack -m "${MANIFEST_PATH}" -s "${RFS_S3_STORE_URI}" "${SRC_PATH}"
|
||||
|
||||
section "Patching route.url in manifest to S3 read-only endpoint"
|
||||
rfs_common_build_route_url
|
||||
|
||||
Reference in New Issue
Block a user