Hey Jam,
I'm surely not a genius, considering the effort I have to put in order to make little advancements, but...
The script is now halting here, after running it with your default parameters:
root@proxmox:~# ./install-openwrt-all-arch.sh
Fetching latest stable OpenWrt version...
curl: (6) Could not resolve host: downloads.openwrt.org
Detected latest stable version: 24.10.0
Selected architecture: aarch64
Enter OpenWrt stable version (default: 24.10.0): 24.10.0
Enter Container ID (default: 100): 100
Enter Container Name (default: openwrt-100): openwrt-24.10.0
Enter root password (leave blank to skip):
Confirm root password:
Enter memory size in MB (default: 256): 256
Enter number of CPU cores (default: 2): 2
Enter storage limit in GB (default: 0.5): 0.5
Enter LAN subnet (default: 10.23.45.1/24): 10.23.45.1/24
Using existing OpenWrt image: openwrt-24.10.0-armsr-armv8.tar.gz
Creating LXC container 100...
Formatting '/var/lib/vz/images/100/vm-100-disk-0.raw', fmt=raw size=536870912 preallocation=off
Creating filesystem with 131072 4k blocks and 32768 inodes
Filesystem UUID: d92e1464-d3e9-4108-990e-682a692ab56d
Superblock backups stored on blocks:
32768, 98304
extracting archive '/var/lib/vz/template/cache/openwrt-24.10.0-armsr-armv8.tar.gz'
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
unable to create CT 100 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - -z --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/100/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2
Error: Failed to create container
Can you spot something wrong?
P.S: sometimes it defaults on 24.10.0, some other it catches 24.10.1, but this is not the problem.
It seems to me a problem related to the extraction of the archive.
Can I run it in verbose mode, so to give you a wider scope?
In this section:
# Build pct create command with corrected network options
echo -e "${GREEN}Creating LXC container $CTID...${NC}"
NET_OPTS=()
[ -n "$WAN_BRIDGE" ] && NET_OPTS+=("--net0" "name=eth0,bridge=$WAN_BRIDGE")
[ -n "$WAN_DEVICE" ] && NET_OPTS+=("--net0" "name=eth0,hwaddr=$(ip link show "$WAN_DEVICE" | grep -o 'ether [0-9a-f:]\+' | cut -d' ' -f2)")
[ -n "$LAN_BRIDGE" ] && NET_OPTS+=("--net1" "name=eth1,bridge=$LAN_BRIDGE")
[ -n "$LAN_DEVICE" ] && NET_OPTS+=("--net1" "name=eth1,hwaddr=$(ip link show "$LAN_DEVICE" | grep -o 'ether [0-9a-f:]\+' | cut -d' ' -f2)")
pct create "$CTID" "$TEMPLATE_DIR/$TEMPLATE_FILE" \
--arch "$PCT_ARCH" \
--hostname "$CTNAME" \
--rootfs "$STORAGE:$STORAGE_SIZE" \
--memory "$MEMORY" \
--cores "$CORES" \
--unprivileged 1 \
--features nesting=1 \
--ostype unmanaged \
"${NET_OPTS[@]}" || exit_script 1 "Error: Failed to create container"
what I can say is that my two VNETs are called "enlan" and "enwan", differing from the default naming scheme. Don't know if this is the culprit.
UPDATE: I'm trying to manually follow the logic of the script, because i can't bother someone if I don't know that my environment is perfectly functioning.
So, for example, this section here
extracting archive '/var/lib/vz/template/cache/openwrt-24.10.0-armsr-armv8.tar.gz'
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
is caused by my PVE instance. It was not downloading correctly the rootfs archive. And I don't know why, unfortunately.