From 5abcb4705103294b11b81b1e62518bc26ac90bf9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 28 May 2025 21:23:30 +0200 Subject: [PATCH] Umbrel: Fix MachineType (#4810) * Umbrel: Fix MachineType * Update umbrel-os-vm.sh * Update umbrel-os-vm.sh --- vm/umbrel-os-vm.sh | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/vm/umbrel-os-vm.sh b/vm/umbrel-os-vm.sh index 0e238d6ee..4cfef379f 100644 --- a/vm/umbrel-os-vm.sh +++ b/vm/umbrel-os-vm.sh @@ -50,6 +50,7 @@ MACADDRESS="${TAB}🔗${TAB}${CL}" VLANTAG="${TAB}🏷️${TAB}${CL}" CREATING="${TAB}🚀${TAB}${CL}" ADVANCED="${TAB}🧩${TAB}${CL}" + THIN="discard=on,ssd=1," set -e trap 'error_handler $LINENO "$BASH_COMMAND"' ERR @@ -60,8 +61,8 @@ function error_handler() { local exit_code="$?" local line_number="$1" local command="$2" - post_update_to_api "failed" "${command}" local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}" + post_update_to_api "failed" "${command}" echo -e "\n$error_message\n" cleanup_vmid } @@ -162,7 +163,7 @@ function ssh_check() { fi } -function exit_script() { +function exit-script() { clear echo -e "\n${CROSS}${RD}User exited script${CL}\n" exit @@ -172,9 +173,9 @@ function default_settings() { VMID=$(get_valid_nextid) FORMAT=",efitype=4m" MACHINE="" - DISK_CACHE="" DISK_SIZE="32G" - HN="umbrel-os" + DISK_CACHE="" + HN="umbrelos" CPU_TYPE="" CORE_COUNT="2" RAM_SIZE="4096" @@ -234,7 +235,7 @@ function advanced_settings() { MACHINE="" fi else - exit_script + exit-script fi if DISK_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Disk Size in GiB (e.g., 10, 20)" 8 58 "$DISK_SIZE" --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -246,10 +247,10 @@ function advanced_settings() { echo -e "${DISKSIZE}${BOLD}${DGN}Disk Size: ${BGN}$DISK_SIZE${CL}" else echo -e "${DISKSIZE}${BOLD}${RD}Invalid Disk Size. Please use a number (e.g., 10 or 10G).${CL}" - exit_script + exit-script fi else - exit_script + exit-script fi if DISK_CACHE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "DISK CACHE" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \ @@ -264,19 +265,19 @@ function advanced_settings() { DISK_CACHE="" fi else - exit_script + exit-script fi - if VM_NAME=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Hostname" 8 58 umbrel-os --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then + if VM_NAME=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Hostname" 8 58 umbrelos --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then if [ -z $VM_NAME ]; then - HN="umbrel-os" + HN="umbrelos" echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}" else HN=$(echo ${VM_NAME,,} | tr -d ' ') echo -e "${HOSTNAME}${BOLD}${DGN}Hostname: ${BGN}$HN${CL}" fi else - exit_script + exit-script fi if CPU_TYPE1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "CPU MODEL" --radiolist "Choose" --cancel-button Exit-Script 10 58 2 \ @@ -291,7 +292,7 @@ function advanced_settings() { CPU_TYPE="" fi else - exit_script + exit-script fi if CORE_COUNT=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate CPU Cores" 8 58 2 --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -302,7 +303,7 @@ function advanced_settings() { echo -e "${CPUCORE}${BOLD}${DGN}CPU Cores: ${BGN}$CORE_COUNT${CL}" fi else - exit_script + exit-script fi if RAM_SIZE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Allocate RAM in MiB" 8 58 2048 --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -313,7 +314,7 @@ function advanced_settings() { echo -e "${RAMSIZE}${BOLD}${DGN}RAM Size: ${BGN}$RAM_SIZE${CL}" fi else - exit_script + exit-script fi if BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -324,7 +325,7 @@ function advanced_settings() { echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}" fi else - exit_script + exit-script fi if MAC1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a MAC Address" 8 58 $GEN_MAC --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -336,7 +337,7 @@ function advanced_settings() { echo -e "${MACADDRESS}${BOLD}${DGN}MAC Address: ${BGN}$MAC1${CL}" fi else - exit_script + exit-script fi if VLAN1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Vlan(leave blank for default)" 8 58 --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -349,7 +350,7 @@ function advanced_settings() { echo -e "${VLANTAG}${BOLD}${DGN}VLAN: ${BGN}$VLAN1${CL}" fi else - exit_script + exit-script fi if MTU1=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set Interface MTU Size (leave blank for default)" 8 58 --title "MTU SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3); then @@ -362,7 +363,7 @@ function advanced_settings() { echo -e "${DEFAULT}${BOLD}${DGN}Interface MTU Size: ${BGN}$MTU1${CL}" fi else - exit_script + exit-script fi if (whiptail --backtitle "Proxmox VE Helper Scripts" --title "START VIRTUAL MACHINE" --yesno "Start VM when completed?" 10 58); then @@ -393,13 +394,14 @@ function start_script() { advanced_settings fi } + check_root arch_check pve_check ssh_check start_script -post_to_api_vm +post_to_api_vm msg_info "Validating Storage" while read -r line; do TAG=$(echo $line | awk '{print $1}')