Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxmox-boot-tool #13

Open
Taurolyon opened this issue Apr 20, 2024 · 2 comments
Open

proxmox-boot-tool #13

Taurolyon opened this issue Apr 20, 2024 · 2 comments

Comments

@Taurolyon
Copy link

This utility doesn't account for the boot method used; it seems to focus on GRUB installations, and disregards UEFI systemd-boot installations which require the use of proxmox-boot-tool refresh to update the kernel boot list.

@github-tomster
Copy link

i also confirm the incompatibility with pure EFi systems ⚠️

___________________________________________

 OS: Debian GNU/Linux 12 (bookworm)
 Boot Disk: % full [/ used,  free]
 Current Kernel: 6.8.4-3-pve
___________________________________________

[-] Can we install PVE Kernel Cleaner to your /usr/local/sbin for easier access [y/N]

[*] Boot disk space used is N/A at % capacity ( free)
[-] Searching for old PVE kernels on your system...
  + "6.5" added to the kernel remove list
  + "6.5.11-4-pve-signed" added to the kernel remove list
  + "6.5.13-5-pve-signed" added to the kernel remove list
  + "6.8" added to the kernel remove list
[-] PVE kernel search complete!
[!] Would you like to remove the 4 selected PVE kernels listed above? [y/N]:


Exiting...
See you later ⎦˚◡˚⎣
root@ooo:/opt/scripts# uname -r
6.8.4-3-pve
root@ooo:/opt/scripts#

it reads that the script would remove 6.8 🤔

@beckerr-rzht
Copy link

proxmox-kernel-6.8 is a metapackage. Here is a patch to ignore this:

--- pvekclean.sh        2024-09-01 09:39:05.370885863 +0200
+++ /usr/local/sbin/pvekclean   2024-09-01 10:23:16.328897602 +0200
@@ -136,7 +136,7 @@
 # Show current system information
 kernel_info() {
        # Lastest kernel installed
-       latest_kernel=$(dpkg --list | awk '/proxmox-kernel-.*-pve/{print $2}' | sed -n 's/proxmox-kernel-//p' | sort -V | tail -n 1 | tr -d '[:space:]')
+       latest_kernel=$(dpkg --list | grep -vw Latest | awk '/proxmox-kernel-.*-pve/{print $2}' | sed -n 's/proxmox-kernel-//p' | sort -V | tail -n 1 | tr -d '[:space:]')
        [ -z "$latest_kernel" ] && latest_kernel="N/A"
        # Show operating system used
        printf " ${bold}OS:${reset} $(cat /etc/os-release | grep "PRETTY_NAME" | sed 's/PRETTY_NAME=//g' | sed 's/["]//g' | awk '{print $0}')\n"
@@ -333,7 +333,7 @@
 # PVE Kernel Clean main function
 pve_kernel_clean() {
        # Find all the PVE kernels on the system
-       kernels=$(dpkg --list | grep -E "(pve-kernel|proxmox-kernel)-[0-9].*" | grep -E "Kernel Image" | grep -vE "${latest_kernel%-pve}|series|transitional" | awk '{print $2}' | sed 
-n 's/\(pve\|proxmox\)-kernel-\(.*\)/\2/p' | sort -V)
+       kernels=$(dpkg --list | grep -vw Latest | grep -E "(pve-kernel|proxmox-kernel)-[0-9].*" | grep -E "Kernel Image" | grep -vE "${latest_kernel%-pve}|series|transitional" | awk '
{print $2}' | sed -n 's/\(pve\|proxmox\)-kernel-\(.*\)/\2/p' | sort -V)
        # List of kernels that will be removed (adds them as the script goes on)
        kernels_to_remove=()
        # Boot drive status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants