Update build.func
This commit is contained in:
parent
b2abad19ba
commit
fac32e6840
@ -2269,45 +2269,17 @@ build_container() {
|
|||||||
none) ;;
|
none) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Build FEATURES_ARRAY with all requested features
|
# Build FEATURES string (simple working version)
|
||||||
# Note: Set safe defaults for all feature flags to prevent undefined variables
|
if [ "$CT_TYPE" == "1" ]; then
|
||||||
: "${ENABLE_NESTING:=1}"
|
FEATURES="keyctl=1,nesting=1"
|
||||||
: "${ENABLE_KEYCTL:=0}"
|
else
|
||||||
: "${ENABLE_MKNOD:=0}"
|
FEATURES="nesting=1"
|
||||||
: "${ENABLE_FUSE:=no}"
|
|
||||||
: "${ALLOW_MOUNT_FS:=}"
|
|
||||||
|
|
||||||
FEATURES_ARRAY=()
|
|
||||||
FEATURES_ARRAY+=("nesting=$ENABLE_NESTING")
|
|
||||||
|
|
||||||
# keyctl: needed for Docker inside containers (systemd-networkd workaround)
|
|
||||||
if [ "$CT_TYPE" == "1" ] || [ "$ENABLE_KEYCTL" == "1" ]; then
|
|
||||||
FEATURES_ARRAY+=("keyctl=1")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mknod: allow device node creation (requires kernel 5.3+)
|
|
||||||
if [ "$ENABLE_MKNOD" == "1" ]; then
|
|
||||||
FEATURES_ARRAY+=("mknod=1")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# FUSE: required for rclone, mergerfs, AppImage, etc.
|
|
||||||
if [ "$ENABLE_FUSE" == "yes" ]; then
|
if [ "$ENABLE_FUSE" == "yes" ]; then
|
||||||
FEATURES_ARRAY+=("fuse=1")
|
FEATURES="$FEATURES,fuse=1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mount: allow specific filesystems (e.g., nfs, ext4)
|
|
||||||
# Format: mount=fstype1;fstype2;fstype3 (semicolon-separated!)
|
|
||||||
if [ -n "$ALLOW_MOUNT_FS" ]; then
|
|
||||||
ALLOW_MOUNT_FS_FORMATTED="${ALLOW_MOUNT_FS//,/;}"
|
|
||||||
FEATURES_ARRAY+=("mount=$ALLOW_MOUNT_FS_FORMATTED")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# DEBUG: Show built FEATURES_ARRAY
|
|
||||||
echo "[DEBUG] FEATURES_ARRAY built with ${#FEATURES_ARRAY[@]} elements:"
|
|
||||||
for i in "${!FEATURES_ARRAY[@]}"; do
|
|
||||||
echo " [$i] = ${FEATURES_ARRAY[$i]}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# NEW IMPLEMENTATION (Fixed): Build PCT_OPTIONS properly
|
# NEW IMPLEMENTATION (Fixed): Build PCT_OPTIONS properly
|
||||||
# Key insight: Bash cannot export arrays, so we build the options as a string
|
# Key insight: Bash cannot export arrays, so we build the options as a string
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user