mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-15 14:28:21 +00:00
Update 1.2.2.2 beta
This commit is contained in:
@@ -49,6 +49,20 @@ fi
|
||||
echo "Pending dir: $PENDING_DIR"
|
||||
echo "Apply list: $APPLY_LIST"
|
||||
echo "Include ZFS: $HB_RESTORE_INCLUDE_ZFS"
|
||||
|
||||
# Hardware-drift skips persisted by _rs_prepare_pending_restore.
|
||||
# Each line is an absolute path; we drop any rel path that matches
|
||||
# (exact or descendant) before writing it back to disk. Without this
|
||||
# the post-boot apply restored e.g. /etc/kernel/proxmox-boot-uuids
|
||||
# from the backup, leaving the new bootloader pointing at a stale
|
||||
# EFI UUID.
|
||||
RS_SKIP_PATHS=""
|
||||
SKIP_PATHS_FILE="$PENDING_DIR/rs-skip-paths.txt"
|
||||
if [[ -f "$SKIP_PATHS_FILE" ]]; then
|
||||
RS_SKIP_PATHS=$(cat "$SKIP_PATHS_FILE")
|
||||
echo "Skip paths: $(wc -l <"$SKIP_PATHS_FILE") entries (drift)"
|
||||
fi
|
||||
|
||||
echo "running" >"$STATE_FILE"
|
||||
|
||||
backup_root="${PRE_BACKUP_BASE}/$(date +%Y%m%d_%H%M%S)-onboot"
|
||||
@@ -70,6 +84,24 @@ while IFS= read -r rel; do
|
||||
continue
|
||||
fi
|
||||
|
||||
# Hardware-drift skip filter — match exact path or descendant.
|
||||
if [[ -n "$RS_SKIP_PATHS" ]]; then
|
||||
_abs="/$rel"
|
||||
_drop=0
|
||||
while IFS= read -r _skip; do
|
||||
[[ -z "$_skip" ]] && continue
|
||||
if [[ "$_abs" == "$_skip" || "$_abs" == "$_skip"/* ]]; then
|
||||
_drop=1
|
||||
break
|
||||
fi
|
||||
done <<<"$RS_SKIP_PATHS"
|
||||
if (( _drop )); then
|
||||
echo " drift-skip: $rel"
|
||||
((skipped++))
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cluster data (/etc/pve, /var/lib/pve-cluster) goes into a
|
||||
# recovery dir for forensics/rollback, but unlike the live-
|
||||
# menu apply path we ALSO apply it for real here: at this
|
||||
|
||||
@@ -1390,9 +1390,10 @@ _rs_apply() {
|
||||
if [[ -n "$CLUSTER_DATA_EXTRACTED" ]]; then
|
||||
export HB_CLUSTER_DATA_EXTRACTED="$CLUSTER_DATA_EXTRACTED"
|
||||
_rs_write_cluster_recovery_helper "$CLUSTER_DATA_EXTRACTED"
|
||||
msg_warn "$(translate "Cluster data was extracted for safe manual recovery at:") $CLUSTER_DATA_EXTRACTED"
|
||||
msg_warn "$(translate "Generated helper script:") $CLUSTER_DATA_EXTRACTED/apply-cluster-restore.sh"
|
||||
msg_warn "$(translate "Run it only in a maintenance window.")"
|
||||
msg_info2 "$(translate "Cluster data (/etc/pve, /var/lib/pve-cluster) will be applied automatically at next boot once pve-cluster.service is up.")"
|
||||
msg_info2 "$(translate "A safety copy + manual-apply helper are also available in case you need to re-apply later:")"
|
||||
msg_info2 " $CLUSTER_DATA_EXTRACTED/apply-cluster-restore.sh"
|
||||
msg_info2 "$(translate "(Optional — only run it during a maintenance window if you need to re-apply the cluster data manually.)")"
|
||||
else
|
||||
unset HB_CLUSTER_DATA_EXTRACTED
|
||||
fi
|
||||
@@ -1719,6 +1720,15 @@ RESTORE_ID=${restore_id}
|
||||
CREATED_AT=${created_at}
|
||||
HB_RESTORE_INCLUDE_ZFS=${HB_RESTORE_INCLUDE_ZFS:-0}
|
||||
EOF
|
||||
# Persist hardware-drift skips so apply_pending_restore.sh can filter
|
||||
# them at boot. The RS_SKIP_PATHS env var only lives in the restore
|
||||
# menu session; without writing it to disk, paths that would break
|
||||
# the boot (stale EFI UUIDs, foreign zpool.cache, ...) leaked through
|
||||
# to the post-boot apply and ended up corrupting the bootloader.
|
||||
if [[ -n "${RS_SKIP_PATHS:-}" ]]; then
|
||||
printf '%s\n' "$RS_SKIP_PATHS" > "$pending_dir/rs-skip-paths.txt"
|
||||
chmod 600 "$pending_dir/rs-skip-paths.txt"
|
||||
fi
|
||||
echo "pending" > "$pending_dir/state"
|
||||
|
||||
ln -sfn "$pending_dir" "$pending_base/current"
|
||||
|
||||
Reference in New Issue
Block a user