Update build.func
This commit is contained in:
parent
ced1173282
commit
3a71045891
165
misc/build.func
165
misc/build.func
@ -2338,16 +2338,6 @@ build_container() {
|
||||
export DIAGNOSTICS="$DIAGNOSTICS"
|
||||
export RANDOM_UUID="$RANDOM_UUID"
|
||||
export SESSION_ID="$SESSION_ID"
|
||||
export BUILD_LOG="$BUILD_LOG"
|
||||
export INSTALL_LOG="/root/.install-${SESSION_ID}.log"
|
||||
export dev_mode="${dev_mode:-}"
|
||||
export DEV_MODE_MOTD="${DEV_MODE_MOTD:-false}"
|
||||
export DEV_MODE_KEEP="${DEV_MODE_KEEP:-false}"
|
||||
export DEV_MODE_TRACE="${DEV_MODE_TRACE:-false}"
|
||||
export DEV_MODE_PAUSE="${DEV_MODE_PAUSE:-false}"
|
||||
export DEV_MODE_BREAKPOINT="${DEV_MODE_BREAKPOINT:-false}"
|
||||
export DEV_MODE_LOGS="${DEV_MODE_LOGS:-false}"
|
||||
export DEV_MODE_DRYRUN="${DEV_MODE_DRYRUN:-false}"
|
||||
export CACHER="$APT_CACHER"
|
||||
export CACHER_IP="$APT_CACHER_IP"
|
||||
export tz="$timezone"
|
||||
@ -2361,65 +2351,120 @@ build_container() {
|
||||
export CTTYPE="$CT_TYPE"
|
||||
export ENABLE_FUSE="$ENABLE_FUSE"
|
||||
export ENABLE_TUN="$ENABLE_TUN"
|
||||
export ENABLE_NESTING="$ENABLE_NESTING"
|
||||
export ENABLE_KEYCTL="$ENABLE_KEYCTL"
|
||||
export ENABLE_MKNOD="$ENABLE_MKNOD"
|
||||
export ALLOW_MOUNT_FS="$ALLOW_MOUNT_FS"
|
||||
export PROTECT_CT="$PROTECT_CT"
|
||||
export CT_TIMEZONE="$CT_TIMEZONE"
|
||||
export PCT_OSTYPE="$var_os"
|
||||
export PCT_OSVERSION="$var_version"
|
||||
export PCT_DISK_SIZE="$DISK_SIZE"
|
||||
|
||||
# Build PCT_OPTIONS array (not string) for proper parameter handling
|
||||
PCT_OPTIONS=()
|
||||
|
||||
# Add features - each as separate -features parameter
|
||||
for feature in "${FEATURES_ARRAY[@]}"; do
|
||||
PCT_OPTIONS+=("-features" "$feature")
|
||||
done
|
||||
|
||||
PCT_OPTIONS+=("-hostname" "$HN")
|
||||
PCT_OPTIONS+=("-tags" "$TAGS")
|
||||
|
||||
if [ -n "$SD" ]; then
|
||||
PCT_OPTIONS+=($SD) # Storage device flags (already formatted)
|
||||
fi
|
||||
|
||||
if [ -n "$NS" ]; then
|
||||
PCT_OPTIONS+=($NS) # Nameserver flags (already formatted)
|
||||
fi
|
||||
|
||||
# Network configuration (single string with all network parameters)
|
||||
PCT_OPTIONS+=($NET_STRING)
|
||||
|
||||
PCT_OPTIONS+=("-onboot" "1")
|
||||
PCT_OPTIONS+=("-cores" "$CORE_COUNT")
|
||||
PCT_OPTIONS+=("-memory" "$RAM_SIZE")
|
||||
PCT_OPTIONS+=("-unprivileged" "$CT_TYPE")
|
||||
|
||||
# Protection flag
|
||||
if [ "$PROTECT_CT" == "1" ]; then
|
||||
PCT_OPTIONS+=("-protection" "1")
|
||||
fi
|
||||
|
||||
# Timezone flag
|
||||
if [ -n "$CT_TIMEZONE" ]; then
|
||||
PCT_OPTIONS+=("-timezone" "$CT_TIMEZONE")
|
||||
fi
|
||||
|
||||
# Password flag (already formatted as "-password xxx")
|
||||
if [ -n "$PW" ]; then
|
||||
PCT_OPTIONS+=($PW)
|
||||
fi
|
||||
|
||||
export PCT_OPTIONS
|
||||
export PCT_OPTIONS="
|
||||
-features $FEATURES
|
||||
-hostname $HN
|
||||
-tags $TAGS
|
||||
$SD
|
||||
$NS
|
||||
$NET_STRING
|
||||
-onboot 1
|
||||
-cores $CORE_COUNT
|
||||
-memory $RAM_SIZE
|
||||
-unprivileged $CT_TYPE
|
||||
$PW
|
||||
"
|
||||
export TEMPLATE_STORAGE="${var_template_storage:-}"
|
||||
export CONTAINER_STORAGE="${var_container_storage:-}"
|
||||
create_lxc_container || exit $?
|
||||
|
||||
LXC_CONFIG="/etc/pve/lxc/${CTID}.conf"
|
||||
|
||||
# TEMP_DIR=$(mktemp -d)
|
||||
# pushd "$TEMP_DIR" >/dev/null
|
||||
# if [ "$var_os" == "alpine" ]; then
|
||||
# export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/alpine-install.func)"
|
||||
# else
|
||||
# export FUNCTIONS_FILE_PATH="$(curl -fsSL https://git.community-scripts.org/community-scripts/ProxmoxVED/raw/branch/main/misc/install.func)"
|
||||
# fi
|
||||
# export DIAGNOSTICS="$DIAGNOSTICS"
|
||||
# export RANDOM_UUID="$RANDOM_UUID"
|
||||
# export SESSION_ID="$SESSION_ID"
|
||||
# export BUILD_LOG="$BUILD_LOG"
|
||||
# export INSTALL_LOG="/root/.install-${SESSION_ID}.log"
|
||||
# export dev_mode="${dev_mode:-}"
|
||||
# export DEV_MODE_MOTD="${DEV_MODE_MOTD:-false}"
|
||||
# export DEV_MODE_KEEP="${DEV_MODE_KEEP:-false}"
|
||||
# export DEV_MODE_TRACE="${DEV_MODE_TRACE:-false}"
|
||||
# export DEV_MODE_PAUSE="${DEV_MODE_PAUSE:-false}"
|
||||
# export DEV_MODE_BREAKPOINT="${DEV_MODE_BREAKPOINT:-false}"
|
||||
# export DEV_MODE_LOGS="${DEV_MODE_LOGS:-false}"
|
||||
# export DEV_MODE_DRYRUN="${DEV_MODE_DRYRUN:-false}"
|
||||
# export CACHER="$APT_CACHER"
|
||||
# export CACHER_IP="$APT_CACHER_IP"
|
||||
# export tz="$timezone"
|
||||
# export APPLICATION="$APP"
|
||||
# export app="$NSAPP"
|
||||
# export PASSWORD="$PW"
|
||||
# export VERBOSE="$VERBOSE"
|
||||
# export SSH_ROOT="${SSH}"
|
||||
# export SSH_AUTHORIZED_KEY
|
||||
# export CTID="$CT_ID"
|
||||
# export CTTYPE="$CT_TYPE"
|
||||
# export ENABLE_FUSE="$ENABLE_FUSE"
|
||||
# export ENABLE_TUN="$ENABLE_TUN"
|
||||
# export ENABLE_NESTING="$ENABLE_NESTING"
|
||||
# export ENABLE_KEYCTL="$ENABLE_KEYCTL"
|
||||
# export ENABLE_MKNOD="$ENABLE_MKNOD"
|
||||
# export ALLOW_MOUNT_FS="$ALLOW_MOUNT_FS"
|
||||
# export PROTECT_CT="$PROTECT_CT"
|
||||
# export CT_TIMEZONE="$CT_TIMEZONE"
|
||||
# export PCT_OSTYPE="$var_os"
|
||||
# export PCT_OSVERSION="$var_version"
|
||||
# export PCT_DISK_SIZE="$DISK_SIZE"
|
||||
|
||||
# # Build PCT_OPTIONS array (not string) for proper parameter handling
|
||||
# PCT_OPTIONS=()
|
||||
|
||||
# # Add features - each as separate -features parameter
|
||||
# for feature in "${FEATURES_ARRAY[@]}"; do
|
||||
# PCT_OPTIONS+=("-features" "$feature")
|
||||
# done
|
||||
|
||||
# PCT_OPTIONS+=("-hostname" "$HN")
|
||||
# PCT_OPTIONS+=("-tags" "$TAGS")
|
||||
|
||||
# if [ -n "$SD" ]; then
|
||||
# PCT_OPTIONS+=($SD) # Storage device flags (already formatted)
|
||||
# fi
|
||||
|
||||
# if [ -n "$NS" ]; then
|
||||
# PCT_OPTIONS+=($NS) # Nameserver flags (already formatted)
|
||||
# fi
|
||||
|
||||
# # Network configuration (single string with all network parameters)
|
||||
# PCT_OPTIONS+=($NET_STRING)
|
||||
|
||||
# PCT_OPTIONS+=("-onboot" "1")
|
||||
# PCT_OPTIONS+=("-cores" "$CORE_COUNT")
|
||||
# PCT_OPTIONS+=("-memory" "$RAM_SIZE")
|
||||
# PCT_OPTIONS+=("-unprivileged" "$CT_TYPE")
|
||||
|
||||
# # Protection flag
|
||||
# if [ "$PROTECT_CT" == "1" ]; then
|
||||
# PCT_OPTIONS+=("-protection" "1")
|
||||
# fi
|
||||
|
||||
# # Timezone flag
|
||||
# if [ -n "$CT_TIMEZONE" ]; then
|
||||
# PCT_OPTIONS+=("-timezone" "$CT_TIMEZONE")
|
||||
# fi
|
||||
|
||||
# # Password flag (already formatted as "-password xxx")
|
||||
# if [ -n "$PW" ]; then
|
||||
# PCT_OPTIONS+=($PW)
|
||||
# fi
|
||||
|
||||
# export PCT_OPTIONS
|
||||
# export TEMPLATE_STORAGE="${var_template_storage:-}"
|
||||
# export CONTAINER_STORAGE="${var_container_storage:-}"
|
||||
# create_lxc_container || exit $?
|
||||
|
||||
# LXC_CONFIG="/etc/pve/lxc/${CTID}.conf"
|
||||
|
||||
# ============================================================================
|
||||
# GPU/USB PASSTHROUGH CONFIGURATION
|
||||
# ============================================================================
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user