mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-11 20:43:42 +08:00
Compare commits
8 Commits
e8ec5fb8ed
...
v7.35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
394131a0d7 | ||
|
|
4d0d16023f | ||
|
|
60dd794b29 | ||
|
|
f13d104968 | ||
|
|
914099fd12 | ||
|
|
639725957d | ||
|
|
64bbe82c4a | ||
|
|
73a13e5697 |
@@ -44,7 +44,7 @@ RUN set -eu && \
|
|||||||
netcat-openbsd \
|
netcat-openbsd \
|
||||||
qemu-system-x86 && \
|
qemu-system-x86 && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
pip3 install --no-cache-dir --break-system-packages dissect.cstruct && \
|
pip3 install --no-cache-dir --break-system-packages --root-user-action=ignore dissect.cstruct && \
|
||||||
mkdir -p /etc/qemu && \
|
mkdir -p /etc/qemu && \
|
||||||
echo "allow br0" > /etc/qemu/bridge.conf && \
|
echo "allow br0" > /etc/qemu/bridge.conf && \
|
||||||
unlink /etc/nginx/sites-enabled/default && \
|
unlink /etc/nginx/sites-enabled/default && \
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
FN="boot.pat"
|
FN="boot.pat"
|
||||||
DIR=$(find / -maxdepth 1 -type d -iname "$FN" | head -n 1)
|
DIR=$(find / -maxdepth 1 -type d -iname "$FN" -print -quit)
|
||||||
[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" | head -n 1)
|
[ ! -d "$DIR" ] && DIR=$(find "$STORAGE" -maxdepth 1 -type d -iname "$FN" -print -quit)
|
||||||
|
|
||||||
if [ -d "$DIR" ]; then
|
if [ -d "$DIR" ]; then
|
||||||
BASE="DSM_VirtualDSM" && URL="file://$DIR"
|
BASE="DSM_VirtualDSM" && URL="file://$DIR"
|
||||||
@@ -23,8 +23,8 @@ if [ -d "$DIR" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILE=$(find / -maxdepth 1 -type f -iname "$FN" | head -n 1)
|
FILE=$(find / -maxdepth 1 -type f -iname "$FN" -print -quit)
|
||||||
[ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" | head -n 1)
|
[ ! -s "$FILE" ] && FILE=$(find "$STORAGE" -maxdepth 1 -type f -iname "$FN" -print -quit)
|
||||||
[ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE"
|
[ -s "$FILE" ] && BASE="DSM_VirtualDSM" && URL="file://$FILE"
|
||||||
|
|
||||||
if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then
|
if [ -n "$URL" ] && [ ! -s "$FILE" ] && [ ! -d "$DIR" ]; then
|
||||||
@@ -270,12 +270,9 @@ mv "$HDA.tgz" "$HDA.txz"
|
|||||||
[ -d "$PKG" ] && mv "$PKG/" "$MOUNT/.SynoUpgradePackages/"
|
[ -d "$PKG" ] && mv "$PKG/" "$MOUNT/.SynoUpgradePackages/"
|
||||||
rm -f "$MOUNT/.SynoUpgradePackages/ActiveInsight-"*
|
rm -f "$MOUNT/.SynoUpgradePackages/ActiveInsight-"*
|
||||||
|
|
||||||
[ -s "$HDP.txz" ] && tar xpfJ "$HDP.txz" --absolute-names -C "$MOUNT/"
|
|
||||||
|
|
||||||
if [ -s "$IDB.txz" ]; then
|
if [ -s "$IDB.txz" ]; then
|
||||||
INDEX_DB="$MOUNT/usr/syno/synoman/indexdb/"
|
INDEX_DB="$MOUNT/usr/syno/synoman/indexdb"
|
||||||
mkdir -p "$INDEX_DB"
|
mkdir -p "$INDEX_DB"
|
||||||
tar xpfJ "$IDB.txz" --absolute-names -C "$INDEX_DB"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LABEL="1.44.1-42218"
|
LABEL="1.44.1-42218"
|
||||||
@@ -284,6 +281,8 @@ NUMBLOCKS="2097152" # (16777216 * 512) / 4096
|
|||||||
MSG="Installing system partition..."
|
MSG="Installing system partition..."
|
||||||
|
|
||||||
fakeroot -- bash -c "set -Eeu;\
|
fakeroot -- bash -c "set -Eeu;\
|
||||||
|
[ -s $HDP.txz ] && tar xpfJ $HDP.txz --absolute-names -C $MOUNT/;\
|
||||||
|
[ -s $IDB.txz ] && tar xpfJ $IDB.txz --absolute-names -C $INDEX_DB/;\
|
||||||
tar xpfJ $HDA.txz --absolute-names --skip-old-files -C $MOUNT/;\
|
tar xpfJ $HDA.txz --absolute-names --skip-old-files -C $MOUNT/;\
|
||||||
printf '%b%s%b' '\E[1;34m❯ \E[1;36m' 'Install: $MSG' '\E[0m\n';\
|
printf '%b%s%b' '\E[1;34m❯ \E[1;36m' 'Install: $MSG' '\E[0m\n';\
|
||||||
mke2fs -q -t ext4 -b 4096 -d $MOUNT/ -L $LABEL -F -E offset=$OFFSET $SYSTEM $NUMBLOCKS"
|
mke2fs -q -t ext4 -b 4096 -d $MOUNT/ -L $LABEL -F -E offset=$OFFSET $SYSTEM $NUMBLOCKS"
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ configureNAT() {
|
|||||||
|
|
||||||
# Create the necessary file structure for /dev/net/tun
|
# Create the necessary file structure for /dev/net/tun
|
||||||
if [ ! -c /dev/net/tun ]; then
|
if [ ! -c /dev/net/tun ]; then
|
||||||
|
[[ "$PODMAN" == [Yy1]* ]] && return 1
|
||||||
[ ! -d /dev/net ] && mkdir -m 755 /dev/net
|
[ ! -d /dev/net ] && mkdir -m 755 /dev/net
|
||||||
if mknod /dev/net/tun c 10 200; then
|
if mknod /dev/net/tun c 10 200; then
|
||||||
chmod 666 /dev/net/tun
|
chmod 666 /dev/net/tun
|
||||||
@@ -199,15 +200,14 @@ configureNAT() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -c /dev/net/tun ]; then
|
if [ ! -c /dev/net/tun ]; then
|
||||||
[[ "$PODMAN" != [Yy1]* ]] && error "$tuntap"
|
error "$tuntap" && return 1
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check port forwarding flag
|
# Check port forwarding flag
|
||||||
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
if [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||||
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
|
{ sysctl -w net.ipv4.ip_forward=1 > /dev/null; rc=$?; } || :
|
||||||
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
if (( rc != 0 )) || [[ $(< /proc/sys/net/ipv4/ip_forward) -eq 0 ]]; then
|
||||||
[[ "$PODMAN" != [Yy1]* ]] && error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
|
error "IP forwarding is disabled. $ADD_ERR --sysctl net.ipv4.ip_forward=1"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -338,17 +338,17 @@ closeNetwork() {
|
|||||||
|
|
||||||
checkOS() {
|
checkOS() {
|
||||||
|
|
||||||
local name
|
local kernel
|
||||||
local os=""
|
local os=""
|
||||||
local if="macvlan"
|
local if="macvlan"
|
||||||
name=$(uname -a)
|
kernel=$(uname -a)
|
||||||
|
|
||||||
[[ "${name,,}" == *"darwin"* ]] && os="Docker Desktop for macOS"
|
[[ "${kernel,,}" == *"darwin"* ]] && os="Docker Desktop for macOS"
|
||||||
[[ "${name,,}" == *"microsoft"* ]] && os="Docker Desktop for Windows"
|
[[ "${kernel,,}" == *"microsoft"* ]] && os="Docker Desktop for Windows"
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
if="macvtap"
|
if="macvtap"
|
||||||
[[ "${name,,}" == *"synology"* ]] && os="Synology Container Manager"
|
[[ "${kernel,,}" == *"synology"* ]] && os="Synology Container Manager"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$os" ]; then
|
if [ -n "$os" ]; then
|
||||||
|
|||||||
20
src/proc.sh
20
src/proc.sh
@@ -37,14 +37,14 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||||||
KVM_ERR=""
|
KVM_ERR=""
|
||||||
|
|
||||||
if [ ! -e /dev/kvm ]; then
|
if [ ! -e /dev/kvm ]; then
|
||||||
KVM_ERR="(device file missing)"
|
KVM_ERR="(/dev/kvm is missing)"
|
||||||
else
|
else
|
||||||
if ! sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
if ! sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||||
KVM_ERR="(no write access)"
|
KVM_ERR="(/dev/kvm is unwriteable)"
|
||||||
else
|
else
|
||||||
flags=$(sed -ne '/^flags/s/^.*: //p' /proc/cpuinfo)
|
flags=$(sed -ne '/^flags/s/^.*: //p' /proc/cpuinfo)
|
||||||
if ! grep -qw "vmx\|svm" <<< "$flags"; then
|
if ! grep -qw "vmx\|svm" <<< "$flags"; then
|
||||||
KVM_ERR="(vmx/svm disabled)"
|
KVM_ERR="(not enabled in BIOS)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -53,9 +53,17 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||||||
KVM="N"
|
KVM="N"
|
||||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
warn "you are using macOS which has no KVM support, this will cause a major loss of performance."
|
warn "you are using macOS which has no KVM support, this will cause a major loss of performance."
|
||||||
else
|
else
|
||||||
error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance."
|
kernel=$(uname -a)
|
||||||
error "See the FAQ on how to diagnose the cause, or continue without KVM by setting KVM=N (not recommended)."
|
case "${kernel,,}" in
|
||||||
|
*"microsoft"* )
|
||||||
|
error "Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop." ;;
|
||||||
|
*"synology"* )
|
||||||
|
error "Please make sure that Synology VMM (Virtual Machine Manager) is installed and that '/dev/kvm' is binded to this container." ;;
|
||||||
|
*)
|
||||||
|
error "KVM acceleration is not available $KVM_ERR, this will cause a major loss of performance."
|
||||||
|
error "See the FAQ for possible causes, or continue without it by adding KVM: \"N\" (not recommended)." ;;
|
||||||
|
esac
|
||||||
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user