only attempt to do grub if grub is installed

This commit is contained in:
Fredrik Eriksson 2024-03-22 16:27:59 +01:00
parent 7ac103033c
commit cd33f98b8b
Signed by: feffe
GPG Key ID: E6B5580B853D322B

View File

@ -207,7 +207,7 @@ def pkg_upgrade():
if line.startswith(' * '): if line.startswith(' * '):
log.warning(line) log.warning(line)
if do_grub: if do_grub and os.path.exists(GRUB_MKCONFIG):
keep_kernels = conf.getint('default', 'keep_kernels', fallback=4) keep_kernels = conf.getint('default', 'keep_kernels', fallback=4)
if keep_kernels < 1: if keep_kernels < 1:
log.error('keep_kernels cannot be less than one; falling back to default') log.error('keep_kernels cannot be less than one; falling back to default')