mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Support older kernels
Support older kernels
This commit is contained in:
commit
fc1347e654
@ -112,8 +112,10 @@ configureNAT () {
|
||||
iptables -t nat -A PREROUTING -i "${VM_NET_DEV}" -p tcp -j DNAT --to $VM_NET_IP
|
||||
iptables -t nat -A PREROUTING -i "${VM_NET_DEV}" -p udp -j DNAT --to $VM_NET_IP
|
||||
|
||||
if (( KERNEL > 4 )); then
|
||||
# Hack for guest VMs complaining about "bad udp checksums in 5 packets"
|
||||
iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM --checksum-fill || true
|
||||
fi
|
||||
|
||||
#Enable port forwarding flag
|
||||
[[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]] && sysctl -w net.ipv4.ip_forward=1
|
||||
|
10
run/run.sh
10
run/run.sh
@ -3,8 +3,8 @@ set -eu
|
||||
|
||||
# Docker environment variabeles
|
||||
|
||||
: ${URL:=''}. # URL of the PAT file
|
||||
: ${DEBUG:=''}. # Enable debug mode
|
||||
: ${URL:=''} # URL of the PAT file
|
||||
: ${DEBUG:=''} # Enable debug mode
|
||||
: ${ALLOCATE:='Y'} # Preallocate diskspace
|
||||
: ${CPU_CORES:='1'} # Amount of CPU cores
|
||||
: ${DISK_SIZE:='16G'} # Initial data disk size
|
||||
@ -13,6 +13,8 @@ set -eu
|
||||
echo "Starting Virtual DSM for Docker v${VERSION}..."
|
||||
|
||||
STORAGE="/storage"
|
||||
KERNEL=$(uname -r | cut -b 1)
|
||||
|
||||
[ ! -d "$STORAGE" ] && echo "Storage folder (${STORAGE}) not found!" && exit 69
|
||||
[ ! -f "/run/run.sh" ] && echo "Script must run inside Docker container!" && exit 60
|
||||
|
||||
@ -67,4 +69,8 @@ set -m
|
||||
)
|
||||
set +m
|
||||
|
||||
if (( KERNEL > 4 )); then
|
||||
pidwait -F "${_QEMU_PID}" & wait $!
|
||||
else
|
||||
tail --pid "$(cat ${_QEMU_PID})" --follow /dev/null & wait $!
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user