Revert "Use rpm -e instead of dnf for cleaning old kernels"
Using rpm -e to remove old kernels fails when other packages also
depend on the removed kernel.
This change reverts back to using dnf to remove the kernel, but also
sets the config value protect_running_kernel=False to avoid the issue
where the build host kernel version matches the version of the package
being deleted.
reverts commit 1ac31afd62
.
Change-Id: Ie58630c23a34f2db34f3934abbd0c1076ab9d835
This commit is contained in:
parent
2aa151b295
commit
19ecc16d97
@ -18,7 +18,7 @@ if [[ ${YUM} == "dnf" ]]; then
|
|||||||
# http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
|
# http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
|
||||||
_old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)"
|
_old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)"
|
||||||
if [[ -n "${_old_kernels}" ]]; then
|
if [[ -n "${_old_kernels}" ]]; then
|
||||||
rpm -e ${_old_kernels}
|
dnf remove -y --setopt=protect_running_kernel=False ${_old_kernels}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
install-packages yum-utils
|
install-packages yum-utils
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
fixes:
|
|
||||||
- |
|
|
||||||
Fixed an issue where cleaning old kernels on systems runing ``dnf`` would
|
|
||||||
fail in case the kernel packages being removed matches the running kernel
|
|
||||||
of the system building the image. See Bug: `1623409
|
|
||||||
<https://bugs.launchpad.net/diskimage-builder/+bug/1623409>`_.
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user