mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update install_coral_pve.sh
This commit is contained in:
parent
45cbae23f0
commit
624960d21f
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ==========================================================
|
||||
|
||||
# ProxMenu - A menu-driven script for Proxmox VE management
|
||||
# ==========================================================
|
||||
# Author : MacRimi
|
||||
@ -33,46 +33,40 @@ initialize_cache
|
||||
|
||||
# Prompt before installation
|
||||
pre_install_prompt() {
|
||||
if ! whiptail --title "Coral TPU Installation" --yesno "Installing Coral TPU drivers requires rebooting the server after installation. Do you want to proceed?" 8 60; then
|
||||
echo -ne "\r${TAB}${YW}-$(translate 'Installation cancelled by user. Exiting.') ${CL}"
|
||||
if ! whiptail --title "$(translate 'Coral TPU Installation')" --yesno "$(translate 'Installing Coral TPU drivers requires rebooting the server after installation. Do you want to proceed?')" 10 70; then
|
||||
msg_warn "$(translate 'Installation cancelled by user.')"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Verificar y configurar repositorios en el host
|
||||
# Verify and configure repositories on the host
|
||||
verify_and_add_repos() {
|
||||
|
||||
msg_info "Configuring necessary repositories on the host..."
|
||||
msg_info "$(translate 'Configuring necessary repositories on the host...')"
|
||||
sleep 2
|
||||
|
||||
if ! grep -q "pve-no-subscription" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then
|
||||
echo "deb http://download.proxmox.com/debian/pve $(lsb_release -sc) pve-no-subscription" | tee /etc/apt/sources.list.d/pve-no-subscription.list
|
||||
msg_ok "Repositorio pve-no-subscription añadido."
|
||||
msg_ok "$(translate 'pve-no-subscription repository added.')"
|
||||
fi
|
||||
|
||||
if ! grep -q "non-free-firmware" /etc/apt/sources.list; then
|
||||
echo "deb http://deb.debian.org/debian $(lsb_release -sc) main contrib non-free-firmware
|
||||
deb http://deb.debian.org/debian $(lsb_release -sc)-updates main contrib non-free-firmware
|
||||
deb http://security.debian.org/debian-security $(lsb_release -sc)-security main contrib non-free-firmware" | tee -a /etc/apt/sources.list
|
||||
msg_ok "Repositorios non-free-firmware añadidos."
|
||||
msg_ok "$(translate 'non-free-firmware repositories added.')"
|
||||
fi
|
||||
|
||||
msg_ok "Added repositories"
|
||||
sleep 2
|
||||
msg_ok "$(translate 'Added repositories')"
|
||||
sleep 2
|
||||
|
||||
msg_info "Verifying repositories..."
|
||||
apt-get update &>/dev/null
|
||||
msg_info "$(translate 'Verifying repositories...')"
|
||||
apt-get update &>/dev/null
|
||||
|
||||
msg_ok "Verified and updated repositories."
|
||||
msg_ok "$(translate 'Verified and updated repositories.')"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Function to install Coral TPU drivers on the host
|
||||
install_coral_host() {
|
||||
|
||||
verify_and_add_repos
|
||||
|
||||
apt-get install -y git devscripts dh-dkms dkms pve-headers-$(uname -r) >/dev/null 2>&1
|
||||
@ -81,39 +75,35 @@ install_coral_host() {
|
||||
rm -rf gasket-driver
|
||||
git clone https://github.com/google/gasket-driver.git
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_error "Error: Could not clone the repository."
|
||||
msg_error "$(translate 'Error: Could not clone the repository.')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd gasket-driver/
|
||||
debuild -us -uc -tc -b
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_error "Error: Failed to build driver packages."
|
||||
msg_error "$(translate 'Error: Failed to build driver packages.')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dpkg -i ../gasket-dkms_*.deb
|
||||
if [ $? -ne 0 ]; then
|
||||
msg_error "Error: Failed to install the driver packages."
|
||||
msg_error "$(translate 'Error: Failed to install the driver packages.')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg_ok "Coral TPU drivers installed successfully on the host."
|
||||
msg_ok "$(translate 'Coral TPU drivers installed successfully on the host.')"
|
||||
}
|
||||
|
||||
# Prompt for reboot after installation
|
||||
restart_prompt() {
|
||||
|
||||
if whiptail --title "Coral TPU Installation" --yesno "The installation requires a server restart to apply changes. Do you want to restart now?" 8 60; then
|
||||
|
||||
echo -ne "\r${TAB}${YW}-$(translate 'Restarting the server...') ${CL}"
|
||||
if whiptail --title "$(translate 'Coral TPU Installation')" --yesno "$(translate 'The installation requires a server restart to apply changes. Do you want to restart now?')" 10 70; then
|
||||
#echo -ne "\r${TAB}${YW}-$(translate 'Restarting the server...') ${CL}"
|
||||
msg_warn "$(translate 'Restarting the server...')"
|
||||
reboot
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Main logic
|
||||
pre_install_prompt
|
||||
install_coral_host
|
||||
|
Loading…
x
Reference in New Issue
Block a user