mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-01 10:22:08 +00:00
Keep guests running during the PVE 8 to 9 upgrade and complete the help menu
- The upgrade no longer restarts pve-manager while preparing the host, so running guests are not stopped - The upgrade stops before touching any repository when the Proxmox VE 8 update fails or is cancelled - The unattended mode continues into the upgrade instead of exiting after the mode question - Without a subscription, the enterprise repository added by pve-manager 9 is left disabled after the upgrade - grub-efi-amd64 is installed with its output visible in interactive mode - Help menu: qm unlock and pct unlock entries in the VM/CT section, renumbered items and aligned labels - Help menu: pvesm scan nfs takes the server address, and pveupgrade is described as the interactive upgrade - Help menu: an empty choice no longer runs the previous command - translate() finds catalog entries for texts with leading or trailing spaces and keeps the padding - Spanish help menu texts use the tú form and the Intro key - New help and upgrade messages translated into all languages
This commit is contained in:
@@ -188,7 +188,8 @@ EOF
|
||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
||||
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||
return 0
|
||||
# Not an error, but the system was not updated.
|
||||
return 3
|
||||
elif [[ $MENU_RESULT -eq 2 ]]; then
|
||||
msg_ok "$(translate "System is already up to date. No update needed.")"
|
||||
echo -e "\nSystem is already up to date." >> "$log_file"
|
||||
@@ -280,6 +281,12 @@ EOF
|
||||
tput ed
|
||||
tput cnorm
|
||||
msg_ok "$(translate "System upgrade completed")"
|
||||
else
|
||||
tput rc
|
||||
tput ed
|
||||
tput cnorm
|
||||
msg_error "$(translate "Proxmox VE 8 package upgrade failed. Review the APT output before retrying.")"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
+64
-31
@@ -95,6 +95,7 @@ show_system_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Check for Esc key press
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -184,17 +185,24 @@ show_vm_ct_commands() {
|
||||
echo -e " 8) ${GREEN}pct config <ctid>${NC} - $(translate 'Show container configuration. Use the correct <ctid>')"
|
||||
echo -e " 9) ${GREEN}qm destroy <vmid>${NC} - $(translate 'Delete a VM (irreversible). Use the correct <vmid>')"
|
||||
echo -e "10) ${GREEN}pct destroy <ctid>${NC} - $(translate 'Delete a CT (irreversible). Use the correct <ctid>')"
|
||||
echo -e "11) ${GN}[Only with menu] Show CT users for permission mapping${NC} - $(translate 'root and real users only')"
|
||||
echo -e "12) ${GREEN}pct exec <ctid> -- getent passwd | column -t -s :${NC} - $(translate 'Show CT users in table format')"
|
||||
echo -e "13) ${GREEN}pct exec <ctid> -- ps aux --sort=-%mem | head${NC} - $(translate 'Top memory processes in CT')"
|
||||
echo -e "14) ${GREEN}cat /etc/pve/qemu-server/<vmid>.conf${NC} - $(translate 'View raw VM configuration file')"
|
||||
echo -e "15) ${GREEN}cat /etc/pve/lxc/<ctid>.conf${NC} - $(translate 'View raw CT configuration file')"
|
||||
echo -e "16) ${GREEN}nano /etc/pve/qemu-server/<vmid>.conf${NC} - $(translate 'Edit raw VM configuration file')"
|
||||
echo -e "17) ${GREEN}nano /etc/pve/lxc/<ctid>.conf${NC} - $(translate 'Edit raw CT configuration file')"
|
||||
echo -e "11) ${GREEN}qm unlock <vmid>${NC} - $(translate 'Remove the lock left on a VM by an interrupted task')"
|
||||
echo -e "12) ${GREEN}pct unlock <ctid>${NC} - $(translate 'Remove the lock left on a container by an interrupted task')"
|
||||
# Translated label: pad it so its description lines up with 14-19.
|
||||
local users_label pad
|
||||
users_label="$(translate 'Show CT users and their UID/GID on the host')"
|
||||
pad=$((51 - ${#users_label})); (( pad < 1 )) && pad=1
|
||||
echo -e "13) ${GN}${users_label}${NC}$(printf '%*s' "$pad" '')- $(translate 'root and real users only')"
|
||||
echo -e "14) ${GREEN}pct exec <ctid> -- getent passwd | column -t -s :${NC} - $(translate 'Show CT users in table format')"
|
||||
echo -e "15) ${GREEN}pct exec <ctid> -- ps aux --sort=-%mem | head${NC} - $(translate 'Top memory processes in CT')"
|
||||
echo -e "16) ${GREEN}cat /etc/pve/qemu-server/<vmid>.conf${NC} - $(translate 'View raw VM configuration file')"
|
||||
echo -e "17) ${GREEN}cat /etc/pve/lxc/<ctid>.conf${NC} - $(translate 'View raw CT configuration file')"
|
||||
echo -e "18) ${GREEN}nano /etc/pve/qemu-server/<vmid>.conf${NC} - $(translate 'Edit raw VM configuration file')"
|
||||
echo -e "19) ${GREEN}nano /etc/pve/lxc/<ctid>.conf${NC} - $(translate 'Edit raw CT configuration file')"
|
||||
echo -e " ${DEF}0) $(translate ' Back to previous menu or Esc + Enter')"
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Check for Esc key press
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -212,7 +220,9 @@ show_vm_ct_commands() {
|
||||
8) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct config $id" ;;
|
||||
9) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm destroy $id" ;;
|
||||
10) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct destroy $id" ;;
|
||||
11)
|
||||
11) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm unlock $id" ;;
|
||||
12) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct unlock $id" ;;
|
||||
13)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||
read -r id
|
||||
|
||||
@@ -236,34 +246,34 @@ show_vm_ct_commands() {
|
||||
done
|
||||
;;
|
||||
|
||||
12)
|
||||
14)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="pct exec $id -- getent passwd | column -t -s :"
|
||||
;;
|
||||
|
||||
13)
|
||||
15)
|
||||
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="pct exec $id -- ps aux --sort=-%mem | head"
|
||||
;;
|
||||
14)
|
||||
16)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="cat /etc/pve/qemu-server/$id.conf"
|
||||
;;
|
||||
15)
|
||||
17)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="cat /etc/pve/lxc/$id.conf"
|
||||
;;
|
||||
16)
|
||||
18)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="nano /etc/pve/qemu-server/$id.conf"
|
||||
;;
|
||||
17)
|
||||
19)
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||
read -r id
|
||||
cmd="nano /etc/pve/lxc/$id.conf"
|
||||
@@ -272,8 +282,10 @@ show_vm_ct_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -324,6 +336,7 @@ show_storage_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Esc key exit
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -550,8 +563,10 @@ show_storage_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -588,6 +603,7 @@ show_network_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
break
|
||||
@@ -630,8 +646,10 @@ show_network_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -658,6 +676,7 @@ show_update_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Check for Esc key press
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -674,8 +693,10 @@ show_update_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -698,7 +719,7 @@ show_gpu_commands() {
|
||||
echo -e " 4) ${GREEN}dmesg -T | grep -Ei 'DMAR|IOMMU|vfio|pcie'${NC} - $(translate 'Inspect passthrough/kernel events')"
|
||||
echo -e " 5) ${GREEN}find /sys/kernel/iommu_groups -type l${NC} - $(translate 'List IOMMU group mapping')"
|
||||
echo -e " 6) ${GREEN}lsmod | grep -E 'vfio|nvidia|amdgpu|apex'${NC} - $(translate 'Check loaded GPU/TPU modules')"
|
||||
echo -e " 7) ${GREEN}grep -R \"vfio-pci|blacklist\" /etc/modprobe.d${NC} - $(translate 'Review passthrough config files')"
|
||||
echo -e " 7) ${GREEN}grep -R \"vfio-pci|blacklist\" /etc/modprobe.d${NC} - $(translate 'Review passthrough config files')"
|
||||
echo -e " 8) ${GREEN}nvidia-smi${NC} - $(translate 'Check NVIDIA driver and devices')"
|
||||
echo -e " 9) ${GREEN}qm config <vmid> | grep 'hostpci|bios'${NC} - [T] $(translate 'Check VM passthrough settings')"
|
||||
echo -e "10) ${GREEN}pct config <ctid> | grep 'dev|lxc.cgroup2'${NC} - [T] $(translate 'Check LXC GPU/TPU mapping')"
|
||||
@@ -713,6 +734,7 @@ show_gpu_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
break
|
||||
@@ -794,8 +816,10 @@ show_gpu_commands() {
|
||||
continue
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -830,6 +854,7 @@ show_zfs_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Detect ESC
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -883,8 +908,10 @@ show_zfs_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -916,6 +943,7 @@ show_backup_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Check for Esc key press
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -967,8 +995,10 @@ show_backup_commands() {
|
||||
*) cmd="$user_input" ;;
|
||||
esac
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
@@ -1001,6 +1031,7 @@ show_tools_commands() {
|
||||
echo
|
||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command: ') ${CL}"
|
||||
read -r user_input
|
||||
cmd=""
|
||||
|
||||
# Check for Esc key press
|
||||
if [[ "$user_input" == $'\x1b' ]]; then
|
||||
@@ -1063,8 +1094,10 @@ show_tools_commands() {
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
if [[ -n "$cmd" ]]; then
|
||||
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||
bash -c "$cmd"
|
||||
fi
|
||||
echo
|
||||
msg_success "$(translate 'Press ENTER to continue...')"
|
||||
read -r tmp
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
# broken repo config).
|
||||
# - dist-upgrade with --force-confdef --force-confold in
|
||||
# unattended mode; user-driven dpkg prompts in interactive mode.
|
||||
# - Post-upgrade: installs grub-efi-amd64 on EFI hosts, restarts
|
||||
# pve-manager, re-runs pve8to9 to surface residual issues.
|
||||
# - Post-upgrade: installs grub-efi-amd64 on EFI hosts and
|
||||
# re-runs pve8to9 to surface residual issues.
|
||||
# - Reboot prompt at the end.
|
||||
# - Full log written to /var/log/pve8-a-pve9-<timestamp>.log.
|
||||
# ==========================================================
|
||||
@@ -117,7 +117,7 @@ ask_run_mode() {
|
||||
msg_ok "$(translate "Run mode: Unattended")"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export APT_LISTCHANGES_FRONTEND=none
|
||||
exit 0
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
@@ -625,7 +625,14 @@ apt_upgrade() {
|
||||
exit 1
|
||||
|
||||
else
|
||||
bash "$LOCAL_SCRIPTS/global/update-pve8.sh"
|
||||
local update_rc=0
|
||||
bash "$LOCAL_SCRIPTS/global/update-pve8.sh" || update_rc=$?
|
||||
if [[ $update_rc -eq 3 ]]; then
|
||||
exit 0
|
||||
elif [[ $update_rc -ne 0 ]]; then
|
||||
msg_error "$(translate "The Proxmox VE 8 update did not finish. The upgrade to Proxmox VE 9 was not started.")"
|
||||
exit 1
|
||||
fi
|
||||
hash -r
|
||||
|
||||
fi
|
||||
@@ -641,10 +648,6 @@ regenerate_pve_cache() {
|
||||
mkdir -p /var/lib/pve-manager
|
||||
chmod 755 /var/lib/pve-manager
|
||||
|
||||
systemctl restart pve-manager 2>/dev/null || true
|
||||
|
||||
sleep 2
|
||||
|
||||
timeout 10 pvesh get /nodes/localhost/apt/update 2>/dev/null || true
|
||||
|
||||
msg_ok "$(translate "PVE cache regenerated")"
|
||||
@@ -1009,6 +1012,13 @@ else
|
||||
bash -lc "apt-get dist-upgrade"
|
||||
fi
|
||||
|
||||
# pve-manager 9 ships pve-enterprise.sources during the upgrade.
|
||||
if [[ "$REPO_MODE" == "no-subscription" && -f /etc/apt/sources.list.d/pve-enterprise.sources ]] \
|
||||
&& ! grep -qi '^Enabled:[[:space:]]*\(false\|no\)' /etc/apt/sources.list.d/pve-enterprise.sources; then
|
||||
disable_enterprise_repo_if_present
|
||||
msg_ok "$(translate "Enterprise Proxmox repository disabled")"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# ==========================================================
|
||||
@@ -1029,7 +1039,7 @@ if [[ -d /sys/firmware/efi ]]; then
|
||||
run_step \
|
||||
"Installing grub-efi-amd64" \
|
||||
"grub-efi-amd64 installed or already present" \
|
||||
"apt-get install grub-efi-amd64 >/dev/null 2>&1"
|
||||
"apt-get install -y grub-efi-amd64 >/dev/null 2>&1"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -271,6 +271,18 @@ translate() {
|
||||
echo "$cached"
|
||||
return
|
||||
fi
|
||||
# The catalog stores texts trimmed; keep the caller's surrounding spaces.
|
||||
local lead="${text%%[![:space:]]*}"
|
||||
local core="${text#"$lead"}"
|
||||
local trail="${core##*[![:space:]]}"
|
||||
core="${core%"$trail"}"
|
||||
if [ -n "$core" ] && [ "$core" != "$text" ]; then
|
||||
cached=$(jq -r --arg text "$core" '.[$text] // .[($text | gsub("\\\\n"; "\n"))] // empty' "$lang_file" 2>/dev/null)
|
||||
if [ -n "$cached" ]; then
|
||||
echo "${lead}${cached}${trail}"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$text"
|
||||
|
||||
Reference in New Issue
Block a user