Compare commits

..

4 Commits

Author SHA1 Message Date
Kroese
2c44669d91 feat: Improve Codespaces configuration (#1079) 2025-10-17 13:25:02 +02:00
Kroese
175d90aad7 fix: Move order in entry file (#1078) 2025-10-17 13:04:03 +02:00
Kroese
e1e5f8f91d fix: Validate status messages (#1077) 2025-10-17 12:07:13 +02:00
Kroese
dff8abbe1e build: Validate JSON and YML files (#1076) 2025-10-17 10:05:52 +02:00
7 changed files with 34 additions and 14 deletions

View File

@@ -3,7 +3,8 @@ services:
container_name: dsm
image: vdsm/virtual-dsm
environment:
RAM_SIZE: "max"
ALLOCATE: "Y"
RAM_SIZE: "half"
DISK_SIZE: "max"
CPU_CORES: "max"
devices:

View File

@@ -2,9 +2,7 @@
"name": "Virtual DSM",
"service": "dsm",
"containerEnv": {
"RAM_SIZE": "max",
"DISK_SIZE": "max",
"CPU_CORES": "max"
"ALLOCATE": "Y"
},
"forwardPorts": [5000],
"portsAttributes": {

View File

@@ -1,4 +1,5 @@
.dockerignore
.devcontainer
.git
.github
.gitignore

View File

@@ -22,3 +22,8 @@ jobs:
dockerfile: Dockerfile
ignore: DL3008,DL3003,DL3006,DL3013
failure-threshold: warning
-
name: Validate JSON and YML files
uses: GrantBirki/json-yaml-validate@v4
with:
yaml_exclude_regex: ".*\\kubernetes\\.yml$"

View File

@@ -18,8 +18,8 @@ cd /run
. proc.sh # Initialize processor
. serial.sh # Initialize serialport
. power.sh # Configure shutdown
. config.sh # Configure arguments
. memory.sh # Check available memory
. config.sh # Configure arguments
. finish.sh # Finish initialization
trap - ERR

View File

@@ -2,7 +2,7 @@
set -Eeuo pipefail
RAM_AVAIL=$(free -b | grep -m 1 Mem: | awk '{print $7}')
if [[ "$RAM_CHECK" != [Nn]* && "${RAM_SIZE,,}" != "max" && "${RAM_SIZE,,}" != "half" ]]; then
AVAIL_MEM=$(formatBytes "$RAM_AVAIL")
@@ -59,15 +59,15 @@ if [[ "${RAM_SIZE,,}" == "max" ]]; then
RAM_WANTED=$(( RAM_WANTED / 1073741825 ))
if (( "$RAM_WANTED" < 1 )); then
RAM_WANTED=$(( RAM_AVAIL - RAM_SPARE ))
RAM_WANTED=$(( RAM_WANTED / 1048577 ))
if (( "$RAM_WANTED" < 1 )); then
RAM_WANTED=$(( RAM_AVAIL ))
RAM_WANTED=$(( RAM_WANTED / 1048577 ))
fi
RAM_SIZE="${RAM_WANTED}M"
@@ -80,7 +80,7 @@ if [[ "${RAM_SIZE,,}" == "max" ]]; then
else
RAM_SIZE="${RAM_WANTED}G"
fi
fi
return 0

View File

@@ -1,16 +1,31 @@
#!/usr/bin/env bash
set -Eeuo pipefail
lastmsg=""
path="/run/shm/msg.html"
if [ -f "$path" ] && [ -s "$path" ]; then
echo -n "s: " && cat "$path"
fi
refresh() {
[ ! -f "$path" ] && return 0
[ ! -s "$path" ] && return 0
msg=$(< "$path")
msg="${msg%$'\n'}"
[ -z "$msg" ] && return 0
[[ "$msg" == "$lastmsg" ]] && return 0
lastmsg="$msg"
echo "s: $msg"
return 0
}
refresh
inotifywait -m "$path" |
while read -r fp event fn; do
case "${event,,}" in
"modify"* ) echo -n "s: " && cat "$path" ;;
"modify"* ) refresh ;;
"delete_self" ) echo "c: vnc" ;;
esac
done