forked from tfgrid/zosbuilder
branding: enforce passwordless root via passwd -d -R; remove direct passwd/shadow edits
initramfs: switch to passwd -d -R in scripts/lib/initramfs.sh:initramfs_finalize_customization() for shadow-aware passwordless root (aligned with 9423b708 intent), drop sed and chpasswd paths, and add validation diagnostics. common: normalize INSTALL_DIR/COMPONENTS_DIR/KERNEL_DIR/DIST_DIR to absolute paths after sourcing config to prevent validation resolving under kernel/current. Dockerfile: include shadow (for passwd/chpasswd), ensure openssl and openssl-dev present; remove perl. config: introduce ZEROOS_PASSWORDLESS_ROOT default true and comment password vars. docs: NOTES.md updated with diagnostics and flow.
This commit is contained in:
@@ -226,14 +226,42 @@ trap cleanup_on_exit EXIT INT TERM
|
||||
BUILD_CONF="${PROJECT_ROOT}/config/build.conf"
|
||||
if [[ -f "$BUILD_CONF" ]]; then
|
||||
log_debug "Loading build configuration from: ${BUILD_CONF}"
|
||||
# shellcheck source=/dev/null
|
||||
source "$BUILD_CONF"
|
||||
else
|
||||
log_warn "Build configuration not found: ${BUILD_CONF}"
|
||||
log_warn "Using default values"
|
||||
fi
|
||||
|
||||
# Normalize key directory variables to absolute paths anchored at PROJECT_ROOT.
|
||||
# This prevents later re-sourcing from accidentally re-introducing relative paths.
|
||||
if [[ -z "${INSTALL_DIR:-}" ]]; then
|
||||
INSTALL_DIR="${PROJECT_ROOT}/initramfs"
|
||||
elif [[ "${INSTALL_DIR}" != /* ]]; then
|
||||
INSTALL_DIR="${PROJECT_ROOT}/${INSTALL_DIR#./}"
|
||||
fi
|
||||
|
||||
if [[ -z "${COMPONENTS_DIR:-}" ]]; then
|
||||
COMPONENTS_DIR="${PROJECT_ROOT}/components"
|
||||
elif [[ "${COMPONENTS_DIR}" != /* ]]; then
|
||||
COMPONENTS_DIR="${PROJECT_ROOT}/${COMPONENTS_DIR#./}"
|
||||
fi
|
||||
|
||||
if [[ -z "${KERNEL_DIR:-}" ]]; then
|
||||
KERNEL_DIR="${PROJECT_ROOT}/kernel"
|
||||
elif [[ "${KERNEL_DIR}" != /* ]]; then
|
||||
KERNEL_DIR="${PROJECT_ROOT}/${KERNEL_DIR#./}"
|
||||
fi
|
||||
|
||||
if [[ -z "${DIST_DIR:-}" ]]; then
|
||||
DIST_DIR="${PROJECT_ROOT}/dist"
|
||||
elif [[ "${DIST_DIR}" != /* ]]; then
|
||||
DIST_DIR="${PROJECT_ROOT}/${DIST_DIR#./}"
|
||||
fi
|
||||
|
||||
# Export common variables
|
||||
export SCRIPT_DIR PROJECT_ROOT
|
||||
export INSTALL_DIR COMPONENTS_DIR KERNEL_DIR DIST_DIR
|
||||
export -f log_info log_warn log_error log_debug
|
||||
export -f safe_execute section_header
|
||||
export -f command_exists in_container check_dependencies
|
||||
|
||||
Reference in New Issue
Block a user