Compare commits

...

19 Commits
v4.02 ... v4.05

Author SHA1 Message Date
Kroese
b78342328f Add host model environment variable
Add host model environment variable
2023-05-29 02:57:42 +02:00
Kroese
36c89f0556 feat: Add host model 2023-05-29 02:56:47 +02:00
Kroese
1c62acd1a1 Add host MAC address as environment variable
Add host MAC address as environment variable
2023-05-29 02:22:55 +02:00
Kroese
0795fd1277 feat: Add host MAC address 2023-05-29 02:18:33 +02:00
Kroese
c509ef5ac4 feat: Add host MAC address 2023-05-29 02:10:10 +02:00
Kroese
46be2d583d fix: Decrease delay 2023-05-27 13:26:39 +02:00
Kroese
3441350087 fix: Don't redirect stdout 2023-05-27 07:13:43 +02:00
Kroese
d132b6afa9 Add device cgroup rules
Add device cgroup rules
2023-05-25 23:21:07 +02:00
Kroese
8d0efe7379 feat: Add device cgroup rules 2023-05-25 23:17:10 +02:00
Kroese
2ad9dcc24c Readme
Readme
2023-05-25 23:12:53 +02:00
Kroese
24ab417e9e docs: DHCP mode 2023-05-25 23:10:15 +02:00
Kroese
bc9d3ffc9b docs: DHCP mode 2023-05-25 23:08:20 +02:00
Kroese
4904109b9e Readme
Readme
2023-05-25 22:14:48 +02:00
Kroese
436eca45cc docs: DSM version 2023-05-25 22:09:21 +02:00
Kroese
daa91af2d5 docs: cgroup wildcard 2023-05-25 22:05:33 +02:00
Kroese
3416507ec5 Display QEMU version
Display QEMU version
2023-05-25 20:42:48 +02:00
Kroese
e9a5b50893 feat: Display QEMU version 2023-05-25 20:41:30 +02:00
Kroese
848dd9172d Default to DSM 7.0.1 on ARM systems
Default to DSM 7.0.1 on ARM systems
2023-05-25 14:48:31 +02:00
Kroese
585adabaee fix: Default to DSM 7.0.1 on ARM systems 2023-05-25 14:47:47 +02:00
6 changed files with 24 additions and 13 deletions

View File

@@ -124,7 +124,7 @@ else
fi
delay=5000
delay=500
elapsed=$((($(date +%s%N) - ts)/1000000))
if [[ delay -gt elapsed ]]; then

View File

@@ -10,6 +10,8 @@ services:
devices:
- /dev/kvm
- /dev/vhost-net
device_cgroup_rules:
- 'c *:* rwm'
cap_add:
- NET_ADMIN
ports:

View File

@@ -152,10 +152,10 @@ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-ti
devices:
- /dev/vhost-net
device_cgroup_rules:
- 'c 511:* rwm'
- 'c *:* rwm'
```
Please note that the exact `cgroup` rule number may vary depending on your system, but the log output will indicate the correct number in the event of an error.
Please note that even if you don't need DHCP, it's still recommended to enable this feature as it prevents NAT issues and increases performance by using a `macvtap` interface.
* ### How do I install a specific version of vDSM?
@@ -163,7 +163,7 @@ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-ti
```yaml
environment:
URL: "https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
URL: "https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
```
With this method, you are able to switch between different versions while keeping your file data.

View File

@@ -9,9 +9,11 @@ DL="https://global.synologydownload.com/download/DSM"
if [ -z "$URL" ]; then
URL="$DL/release/7.2/64561/DSM_VirtualDSM_64561.pat"
#URL="$DL/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
#URL="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
if [ "$ARCH" == "amd64" ]; then
URL="$DL/release/7.2/64561/DSM_VirtualDSM_64561.pat"
else
URL="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
fi
fi
@@ -98,10 +100,10 @@ if [ -f "${RDC}" ]; then
mv /run/extract/scemd /run/extract/syno_extract_system_patch
chmod +x /run/extract/syno_extract_system_patch
rm -rf "$TMP" && mkdir -p "$TMP"
fi
rm -rf "$TMP" && mkdir -p "$TMP"
info "Install: Downloading $(basename "$URL")..."
PAT="/$BASE.pat"
@@ -136,6 +138,7 @@ else
apt-get -qq --no-install-recommends -y install qemu-user > /dev/null
export DEBIAN_FRONTEND=""
export DEBCONF_NOWARNINGS=""
fi
@@ -147,9 +150,10 @@ else
{ qemu-x86_64 /run/extract/syno_extract_system_patch "$PAT" "$TMP/."; rc=$?; } || :
fi
(( rc != 0 )) && error "Failed to extract PAT file, reason $rc" && exit 63
export LD_LIBRARY_PATH=""
(( rc != 0 )) && error "Failed to extract PAT file, reason $rc" && exit 63
fi
HDA="$TMP/hda1"

View File

@@ -22,6 +22,7 @@ trap 'error "Status $? while: ${BASH_COMMAND} (line $LINENO/$BASH_LINENO)"' ERR
STORAGE="/storage"
KERNEL=$(uname -r | cut -b 1)
ARCH=$(dpkg --print-architecture)
VERS=$(qemu-system-x86_64 --version | head -n 1 | cut -d '(' -f 1)
[ ! -d "$STORAGE" ] && error "Storage folder (${STORAGE}) not found!" && exit 13
@@ -85,7 +86,7 @@ trap - ERR
set -m
(
[[ "${DEBUG}" == [Yy1]* ]] && set -x
[[ "${DEBUG}" == [Yy1]* ]] && info "$VERS" && set -x
qemu-system-x86_64 ${ARGS:+ $ARGS} & echo $! > "${_QEMU_PID}"
{ set +x; } 2>/dev/null
)

View File

@@ -4,10 +4,12 @@ set -Eeuo pipefail
# Docker environment variables
: ${HOST_CPU:=''}
: ${HOST_MAC:=''}
: ${HOST_BUILD:=''}
: ${HOST_DEBUG:=''}
: ${HOST_SERIAL:=''}
: ${GUEST_SERIAL:=''}
: ${HOST_MODEL:=''}
: ${HOST_VERSION:=''}
: ${HOST_TIMESTAMP:=''}
@@ -26,10 +28,12 @@ else
fi
HOST_ARGS=()
HOST_ARGS+=("-cpu=${CPU_CORES}")
HOST_ARGS+=("-cpu_arch=${HOST_CPU}")
[ -n "$CPU_CORES" ] && HOST_ARGS+=("-cpu=${CPU_CORES}")
[ -n "$HOST_MAC" ] && HOST_ARGS+=("-mac=${HOST_MAC//:/-}")
[ -n "$HOST_BUILD" ] && HOST_ARGS+=("-build=${HOST_BUILD}")
[ -n "$HOST_MODEL" ] && HOST_ARGS+=("-model=${HOST_MODEL}")
[ -n "$HOST_SERIAL" ] && HOST_ARGS+=("-hostsn=${HOST_SERIAL}")
[ -n "$GUEST_SERIAL" ] && HOST_ARGS+=("-guestsn=${GUEST_SERIAL}")
[ -n "$HOST_VERSION" ] && HOST_ARGS+=("-version=${HOST_VERSION}")
@@ -41,7 +45,7 @@ if [[ "${HOST_DEBUG}" == [Yy1]* ]]; then
{ set +x; } 2>/dev/null
echo
else
./run/host.bin "${HOST_ARGS[@]}" > /dev/null 2>&1 &
./run/host.bin "${HOST_ARGS[@]}" 2> /dev/null &
fi
# Configure serial ports