mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-07 02:23:42 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7e229aaae | ||
|
|
10466d7851 | ||
|
|
238ebd273b | ||
|
|
0b08f4212e | ||
|
|
9aec5d20e3 | ||
|
|
a19bf2f066 | ||
|
|
bee68ee548 | ||
|
|
520c70ab22 | ||
|
|
67a7fbc94b | ||
|
|
1b8054e847 |
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -2,20 +2,6 @@ name: Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths-ignore:
|
|
||||||
- '**/*.md'
|
|
||||||
- '**/*.yml'
|
|
||||||
- '**/*.js'
|
|
||||||
- '**/*.css'
|
|
||||||
- '**/*.html'
|
|
||||||
- 'web/**'
|
|
||||||
- '.gitignore'
|
|
||||||
- '.dockerignore'
|
|
||||||
- '.github/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build
|
group: build
|
||||||
@@ -36,7 +22,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
-
|
-
|
||||||
|
|||||||
4
.github/workflows/check.yml
vendored
4
.github/workflows/check.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Run ShellCheck
|
name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@master
|
uses: ludeeus/action-shellcheck@master
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
SHELLCHECK_OPTS: -x --source-path=src -e SC2001 -e SC2034 -e SC2064 -e SC2317 -e SC2153 -e SC2028
|
SHELLCHECK_OPTS: -x --source-path=src -e SC2001 -e SC2034 -e SC2064 -e SC2317 -e SC2153 -e SC2028
|
||||||
-
|
-
|
||||||
name: Lint Dockerfile
|
name: Lint Dockerfile
|
||||||
uses: hadolint/hadolint-action@v3.1.0
|
uses: hadolint/hadolint-action@v3.2.0
|
||||||
with:
|
with:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ignore: DL3008,DL3003,DL3006,DL3013
|
ignore: DL3008,DL3003,DL3006,DL3013
|
||||||
|
|||||||
2
.github/workflows/hub.yml
vendored
2
.github/workflows/hub.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
dockerHubDescription:
|
dockerHubDescription:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Docker Hub Description
|
name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4
|
uses: peter-evans/dockerhub-description@v4
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM qemux/qemu-host:2.05 AS builder
|
FROM qemux/qemu-host:2.05 AS builder
|
||||||
|
|
||||||
# FROM golang as builder
|
# FROM golang as builder
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ convertDisk() {
|
|||||||
|
|
||||||
msg="Conversion of $DISK_DESC"
|
msg="Conversion of $DISK_DESC"
|
||||||
html "$msg completed..."
|
html "$msg completed..."
|
||||||
info "$msg to $DST_FMT completed succesfully!"
|
info "$msg to $DST_FMT completed successfully!"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,8 +209,9 @@ configureNAT() {
|
|||||||
|
|
||||||
# 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 2>&1; 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]* ]] && return 1
|
||||||
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
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ set -Eeuo pipefail
|
|||||||
# Configure QEMU for graceful shutdown
|
# Configure QEMU for graceful shutdown
|
||||||
|
|
||||||
API_CMD=6
|
API_CMD=6
|
||||||
API_TIMEOUT=50
|
|
||||||
API_HOST="127.0.0.1:2210"
|
API_HOST="127.0.0.1:2210"
|
||||||
|
: "${API_TIMEOUT:="50"}" # API Call timeout
|
||||||
|
|
||||||
QEMU_TERM=""
|
QEMU_TERM=""
|
||||||
QEMU_PORT=7100
|
QEMU_PORT=7100
|
||||||
QEMU_TIMEOUT=50
|
: "${QEMU_TIMEOUT:="50"}" # QEMU Termination timeout
|
||||||
QEMU_DIR="/run/shm"
|
QEMU_DIR="/run/shm"
|
||||||
QEMU_PID="$QEMU_DIR/qemu.pid"
|
QEMU_PID="$QEMU_DIR/qemu.pid"
|
||||||
QEMU_LOG="$QEMU_DIR/qemu.log"
|
QEMU_LOG="$QEMU_DIR/qemu.log"
|
||||||
|
|||||||
24
src/proc.sh
24
src/proc.sh
@@ -128,6 +128,30 @@ else
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$ARGUMENTS" == *"-cpu host,"* ]]; then
|
||||||
|
|
||||||
|
args="${ARGUMENTS} "
|
||||||
|
prefix="${args/-cpu host,*/}"
|
||||||
|
suffix="${args/*-cpu host,/}"
|
||||||
|
param="${suffix%% *}"
|
||||||
|
suffix="${suffix#* }"
|
||||||
|
args="${prefix}${suffix}"
|
||||||
|
ARGUMENTS="${args::-1}"
|
||||||
|
|
||||||
|
if [ -z "$CPU_FLAGS" ]; then
|
||||||
|
CPU_FLAGS="$param"
|
||||||
|
else
|
||||||
|
CPU_FLAGS+=",$param"
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
if [[ "$ARGUMENTS" == *"-cpu host"* ]]; then
|
||||||
|
ARGUMENTS="${ARGUMENTS//-cpu host/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$CPU_FLAGS" ]; then
|
if [ -z "$CPU_FLAGS" ]; then
|
||||||
if [ -z "$CPU_FEATURES" ]; then
|
if [ -z "$CPU_FEATURES" ]; then
|
||||||
CPU_FLAGS="$CPU_MODEL"
|
CPU_FLAGS="$CPU_MODEL"
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ if [ ! -d "$STORAGE" ]; then
|
|||||||
error "Storage folder ($STORAGE) not found!" && exit 13
|
error "Storage folder ($STORAGE) not found!" && exit 13
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -w "$STORAGE" ]; then
|
||||||
|
error "Storage folder ($STORAGE) is not writeable!" && exit 13
|
||||||
|
fi
|
||||||
|
|
||||||
# Check filesystem
|
# Check filesystem
|
||||||
FS=$(stat -f -c %T "$STORAGE")
|
FS=$(stat -f -c %T "$STORAGE")
|
||||||
|
|
||||||
@@ -156,6 +160,7 @@ setCountry() {
|
|||||||
[ -z "$COUNTRY" ] && getCountry "https://ifconfig.co/json" ".country_iso"
|
[ -z "$COUNTRY" ] && getCountry "https://ifconfig.co/json" ".country_iso"
|
||||||
[ -z "$COUNTRY" ] && getCountry "https://api.ip2location.io" ".country_code"
|
[ -z "$COUNTRY" ] && getCountry "https://api.ip2location.io" ".country_code"
|
||||||
[ -z "$COUNTRY" ] && getCountry "https://ipinfo.io/json" ".country"
|
[ -z "$COUNTRY" ] && getCountry "https://ipinfo.io/json" ".country"
|
||||||
|
[ -z "$COUNTRY" ] && getCountry "https://api.ipquery.io/?format=json" ".location.country_code"
|
||||||
[ -z "$COUNTRY" ] && getCountry "https://api.myip.com" ".cc"
|
[ -z "$COUNTRY" ] && getCountry "https://api.myip.com" ".cc"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -130,7 +130,10 @@ cpu() {
|
|||||||
cpu="${cpu// 12 Core/}"
|
cpu="${cpu// 12 Core/}"
|
||||||
cpu="${cpu// 16 Core/}"
|
cpu="${cpu// 16 Core/}"
|
||||||
cpu="${cpu// 32 Core/}"
|
cpu="${cpu// 32 Core/}"
|
||||||
|
cpu="${cpu// 48 Core/}"
|
||||||
cpu="${cpu// 64 Core/}"
|
cpu="${cpu// 64 Core/}"
|
||||||
|
cpu="${cpu// 96 Core/}"
|
||||||
|
cpu="${cpu// 128 Core/}"
|
||||||
cpu="${cpu//7th Gen /}"
|
cpu="${cpu//7th Gen /}"
|
||||||
cpu="${cpu//8th Gen /}"
|
cpu="${cpu//8th Gen /}"
|
||||||
cpu="${cpu//9th Gen /}"
|
cpu="${cpu//9th Gen /}"
|
||||||
|
|||||||
Reference in New Issue
Block a user