1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env bash ESP_DIR="$(bootctl --print-esp-path)" while read -r line; do if [[ "$line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then read -r pkgbase < "/${line}" kver="${line#'usr/lib/modules/'}" kver="${kver%'/pkgbase'}" rm -f "${ESP_DIR}/EFI/${pkgbase}/${pkgbase}-${kver}.efi" fi done