summarylogtreecommitdiffstats
path: root/dracut-remove
blob: c56dcae9d3ed364031beab9b17c65337c7ec9f5b (plain)
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