grubby-bls should only check if kernel exists and not if was installed

When a new BLS entry is added, the script checks if the kernel image exists
and also if it was installed from a rpm package. But the latter isn't really
needed, it should be valid to just copy a kernel image and add a BLS entry.

Resolves: rhbz#1634740

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2018-10-04 17:35:33 +02:00
parent b8c8cdcf6c
commit f9880644e6
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69
1 changed files with 3 additions and 2 deletions

View File

@ -159,7 +159,7 @@ param_to_indexes() {
fi
for i in ${!bls_file[@]}; do
if [[ $param = "${bls_linux[$i]}" ]]; then
if [[ $param = "${bls_linux[$i]}" || "/${param##*/}" = "${bls_linux[$i]}" ]]; then
indexes="$indexes $i"
fi
@ -247,11 +247,12 @@ add_bls_fragment() {
if [[ $kernel = *"vmlinuz-"* ]]; then
kernelver="${kernel##*/vmlinuz-}"
prefix="vmlinuz-"
else
kernelver="${kernel##*/}"
fi
if [[ ! -d "/lib/modules/${kernelver}" || ! -f "/boot/vmlinuz-${kernelver}" ]] &&
if [[ ! -f "/boot/${prefix}${kernelver}" ]] &&
[[ $bad_image != "true" ]]; then
print_error "The ${kernelver} kernel isn't installed in the machine"
fi