mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-29 12:17:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8ef357ed2 | ||
|
|
a16c27ecce | ||
|
|
1917eae0ae | ||
|
|
d5bb90f012 | ||
|
|
d854ae811c | ||
|
|
03993aa773 | ||
|
|
b39ff267f2 | ||
|
|
f7870d1693 | ||
|
|
c648338a18 | ||
|
|
9fe52c874e | ||
|
|
c5eae88dfc | ||
|
|
1d0ac30ae1 | ||
|
|
c355cbe5dc | ||
|
|
6f69eb5c68 | ||
|
|
07595976b2 |
+1
-23
@@ -35,6 +35,7 @@ if ! enabled "$GPU" || isAmdCpu || [[ "$ARCH" != "amd64" ]]; then
|
||||
fi
|
||||
|
||||
msg="Configuring display drivers..."
|
||||
|
||||
html "$msg"
|
||||
enabled "$DEBUG" && echo "$msg"
|
||||
|
||||
@@ -65,27 +66,4 @@ if [ ! -c "$RENDERNODE" ] || [ ! -r "$RENDERNODE" ] || [ ! -w "$RENDERNODE" ]; t
|
||||
warn "render device '${RENDERNODE}' is unavailable or inaccessible."
|
||||
fi
|
||||
|
||||
addDsmPackage() {
|
||||
|
||||
local pkg=$1
|
||||
local desc=$2
|
||||
|
||||
if ! apt-mark showinstall | grep -qx "$pkg"; then
|
||||
[ -z "$COUNTRY" ] && setCountry
|
||||
|
||||
# Use a mainland mirror only for on-demand package installation, avoiding
|
||||
# slow or inaccessible Debian endpoints in that region.
|
||||
if [[ "${COUNTRY^^}" == "CN" ]]; then
|
||||
sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
|
||||
fi
|
||||
fi
|
||||
|
||||
addPackage "$pkg" "$desc"
|
||||
}
|
||||
|
||||
# Install acceleration packages lazily so non-GPU deployments keep the base
|
||||
# image small and do not require OpenGL modules.
|
||||
addDsmPackage "xserver-xorg-video-intel" "Intel GPU drivers"
|
||||
addDsmPackage "qemu-system-modules-opengl" "OpenGL module"
|
||||
|
||||
return 0
|
||||
|
||||
@@ -23,6 +23,7 @@ cd /run
|
||||
. init.sh # Initialize system
|
||||
. memory.sh # Check memory
|
||||
. server.sh # Start webserver
|
||||
. download.sh # Load functions
|
||||
. install.sh # Run installation
|
||||
. disk.sh # Initialize disks
|
||||
. display.sh # Initialize graphics
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
fKill "progress.sh"
|
||||
|
||||
if [ -s "$QEMU_DIR/qemu.host" ] && [[ "$(<"$QEMU_DIR/qemu.host")" == "172.17."* ]]; then
|
||||
warn "your container IP starts with 172.17.* which will cause conflicts when you install the Container Manager package inside DSM!"
|
||||
fi
|
||||
|
||||
+29
-2
@@ -178,8 +178,35 @@ createSystemImage() {
|
||||
return 67
|
||||
fi
|
||||
|
||||
7z x -y -o"$tmp" "$DSM_BOOT" >/dev/null || return $?
|
||||
DSM_BOOT="${DSM_BOOT%.zip}"
|
||||
local bootTmp="$tmp/boot" bootBase
|
||||
bootBase="$(basename "${DSM_BOOT%.zip}")"
|
||||
|
||||
rm -rf "$bootTmp" || return $?
|
||||
|
||||
if ! makeDir "$bootTmp"; then
|
||||
error "Failed to create directory \"$bootTmp\" !"
|
||||
return 93
|
||||
fi
|
||||
|
||||
if [[ "${fs,,}" == "btrfs" ]]; then
|
||||
{ chattr +C "$bootTmp"; } || :
|
||||
fi
|
||||
|
||||
7z x -y -o"$bootTmp" "$DSM_BOOT" >/dev/null || return $?
|
||||
DSM_BOOT="$bootTmp/$bootBase"
|
||||
|
||||
if [ ! -s "$DSM_BOOT" ]; then
|
||||
error "The PAT boot image could not be extracted."
|
||||
return 67
|
||||
fi
|
||||
|
||||
if [[ "${fs,,}" == "btrfs" ]]; then
|
||||
local attrs
|
||||
attrs=$(lsattr "$DSM_BOOT") || return $?
|
||||
if [[ "$attrs" != *"C"* ]]; then
|
||||
error "Failed to disable COW for boot image $DSM_BOOT on ${fs^^} filesystem."
|
||||
fi
|
||||
fi
|
||||
|
||||
SYSTEM="$STORAGE/$BASE.system.img"
|
||||
rm -f "$SYSTEM" || return $?
|
||||
|
||||
+3
-1
@@ -21,6 +21,7 @@ finish() {
|
||||
|
||||
local reason=$1 failed=0
|
||||
|
||||
# A nonzero exit is unexpected only when QEMU_END is missing.
|
||||
if [ ! -f "$QEMU_END" ] && (( reason != 0 )); then
|
||||
failed=1
|
||||
fi
|
||||
@@ -29,14 +30,15 @@ finish() {
|
||||
|
||||
forceKillQemu "$reason"
|
||||
cleanupHelpers "$HOST_PID"
|
||||
|
||||
fKill "print.sh"
|
||||
|
||||
rm -f -- "$HOST_API_SOCKET" "$HOST_AGENT_SOCKET"
|
||||
|
||||
if ! waitQemuExit 10; then
|
||||
warn "Timed out while waiting for $(app) to exit!"
|
||||
fi
|
||||
|
||||
stopConsole
|
||||
echo
|
||||
|
||||
if (( failed == 0 )); then
|
||||
|
||||
+2
-3
@@ -30,10 +30,9 @@ closeWebserver() {
|
||||
fi
|
||||
|
||||
writeAtomic "$WSD_COMMAND" "portal" || return $?
|
||||
sleep 1.2
|
||||
|
||||
local pids=( "${WEB_PID:-}" "${WSD_PID:-}" )
|
||||
mKill "${pids[@]}"
|
||||
sleep 1.2
|
||||
stopAllServers
|
||||
|
||||
WEB="N"
|
||||
|
||||
|
||||
+7
-1
@@ -23,7 +23,13 @@ server {
|
||||
gzip_disable "msie6";
|
||||
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;
|
||||
|
||||
add_header Cache-Control "no-cache";
|
||||
set $cache_control "no-cache";
|
||||
|
||||
if ($uri = /msg.html) {
|
||||
set $cache_control "no-store";
|
||||
}
|
||||
|
||||
add_header Cache-Control $cache_control always;
|
||||
|
||||
location / {
|
||||
|
||||
|
||||
+13
-6
@@ -7,7 +7,6 @@ var portal = false;
|
||||
var portalUrl = "";
|
||||
var interval = 1000;
|
||||
var lastStatus = "";
|
||||
var stopped = "The container has stopped. Check the container logs for details.";
|
||||
|
||||
function abortRequest() {
|
||||
|
||||
@@ -160,6 +159,12 @@ function processMsg(msg) {
|
||||
rememberStatus(msg);
|
||||
setInfo(msg);
|
||||
|
||||
if (msg.toLowerCase().indexOf("href=") !== -1) {
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = msg;
|
||||
return beginPortal(div.querySelector("a").href);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -297,14 +302,14 @@ function estimateProgress(bytes) {
|
||||
}
|
||||
|
||||
if (previousBoundary === 0) {
|
||||
return Math.min(bytes / boundary * 100, 100);
|
||||
return Math.min(bytes / boundary * 100, 99.9);
|
||||
}
|
||||
|
||||
var rangeProgress =
|
||||
(bytes - previousBoundary) /
|
||||
(boundary - previousBoundary);
|
||||
|
||||
return 30 + Math.pow(rangeProgress, 2) * 70;
|
||||
return Math.min(30 + Math.pow(rangeProgress, 2) * 70, 99.9);
|
||||
}
|
||||
|
||||
function parseProgress(msg) {
|
||||
@@ -512,9 +517,11 @@ function setError(text) {
|
||||
|
||||
function setStopped() {
|
||||
|
||||
var msg = stopped;
|
||||
var msg = "<span style=\"display:block\">The container has stopped.</span>";
|
||||
msg += "<span style=\"display:block; margin-top:1em; font-size:0.85em; font-weight:normal\">Check the container log for more details.</span>";
|
||||
|
||||
if (lastStatus.length > 0) {
|
||||
msg += "<br>(Last status: " + escapeContent(lastStatus) + ")";
|
||||
msg += "<span style=\"display:block; margin-top:1em; font-size:0.75em; font-weight:normal; color:rgba(255,255,255,0.65)\">[ Last status: " + escapeContent(lastStatus) + " ]</span>";
|
||||
}
|
||||
|
||||
return setError(msg);
|
||||
@@ -536,7 +543,7 @@ function reload() {
|
||||
|
||||
navigationTimer = setTimeout(function() {
|
||||
navigationTimer = null;
|
||||
window.location.reload();
|
||||
window.location.replace(window.location.href);
|
||||
}, 3000);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user