Compare commits

..
Author SHA1 Message Date
MickLesk a8862fe9e9 Docker VM: take the imported disk from vm_import_disk
Same parser as haos-vm: PVE 9.2's import message and the pvesm fallback both missed the new volume.
2026-10-31 18:49:10 +01:00
3 changed files with 11 additions and 34 deletions

No files matched your search

+5 -9
View File
@@ -9,7 +9,7 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
APP="PS5-MQTT"
var_tags="${var_tags:-smarthome;automation}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-2048}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-3}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
@@ -37,16 +37,12 @@ function update_script() {
systemctl stop ps5-mqtt
msg_ok "Stopped service"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
msg_info "Configuring ${APP}"
cd /opt/ps5-mqtt
$STD corepack yarn install --immutable
$STD env PREPARE_ONLY=1 corepack yarn workspace @ps5-mqtt/server run package
cd /opt/ps5-mqtt/ps5-mqtt/server/.packaged/server
$STD npm install --omit=dev --omit=optional
sed -i 's|^WorkingDirectory=.*|WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt/server/.packaged|' /etc/systemd/system/ps5-mqtt.service
systemctl daemon-reload
cd /opt/ps5-mqtt/ps5-mqtt/
$STD npm install
$STD npm run build
msg_ok "Configured ${APP}"
msg_info "Starting service"
+4 -6
View File
@@ -23,11 +23,9 @@ NODE_VERSION="24" NODE_MODULE="playactor" setup_nodejs
fetch_and_deploy_gh_release "ps5-mqtt" "FunkeyFlo/ps5-mqtt" "tarball"
msg_info "Configuring PS5-MQTT"
cd /opt/ps5-mqtt
$STD corepack yarn install --immutable
$STD env PREPARE_ONLY=1 corepack yarn workspace @ps5-mqtt/server run package
cd /opt/ps5-mqtt/ps5-mqtt/server/.packaged/server
$STD npm install --omit=dev --omit=optional
cd /opt/ps5-mqtt/ps5-mqtt/
$STD npm install
$STD npm run build
mkdir -p /opt/.config/ps5-mqtt/
mkdir -p /opt/.config/ps5-mqtt/playactor
cat <<EOF >/opt/.config/ps5-mqtt/config.json
@@ -68,7 +66,7 @@ Description=PS5-MQTT Daemon
After=syslog.target network.target
[Service]
WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt/server/.packaged
WorkingDirectory=/opt/ps5-mqtt/ps5-mqtt
Environment="CONFIG_PATH=/opt/.config/ps5-mqtt/config.json"
Environment="DEBUG='@ha:ps5:*'"
Restart=always
+2 -19
View File
@@ -391,24 +391,7 @@ msg_ok "Created VM shell"
# ==============================================================================
# DISK IMPORT
# ==============================================================================
msg_info "Importing disk into storage ($STORAGE)"
if qm disk import --help >/dev/null 2>&1; then
IMPORT_CMD=(qm disk import)
else
IMPORT_CMD=(qm importdisk)
fi
IMPORT_OUT="$("${IMPORT_CMD[@]}" "$VMID" "$WORK_FILE" "$STORAGE" ${DISK_IMPORT:-} 2>&1 || true)"
DISK_REF_IMPORTED="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully imported disk '\([^']\+\)'.*/\1/p" | tr -d "\r\"'")"
[[ -z "$DISK_REF_IMPORTED" ]] && DISK_REF_IMPORTED="$(pvesm list "$STORAGE" | awk -v id="$VMID" '$5 ~ ("vm-"id"-disk-") {print $1":"$5}' | sort | tail -n1)"
[[ -z "$DISK_REF_IMPORTED" ]] && {
msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT"
exit 226
}
msg_ok "Imported disk (${CL}${BL}${DISK_REF_IMPORTED}${CL})"
vm_import_disk "$VMID" "$WORK_FILE" "$STORAGE" "${DISK_IMPORT#--format }" || exit 226
# Clean up work file
rm -f "$WORK_FILE"
@@ -420,7 +403,7 @@ msg_info "Attaching EFI and root disk"
qm set "$VMID" \
--efidisk0 "${STORAGE}:0,efitype=4m" \
--scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \
--scsi0 "${VM_IMPORTED_DISK},${DISK_CACHE}${THIN%,}" \
--boot order=scsi0 \
--serial0 socket >/dev/null