Allow to skip kernel cleanup
For some use cases, it can be useful to keep all the kernels and not just keep the latest one. Add a parameter that allows it, and continue cleaning up kernels by default. Change-Id: Ia6e6c1fa18e3724c1eb89226151d81e9e748b793
This commit is contained in:
parent
cf2030c2f6
commit
c1bac651cb
@ -22,3 +22,10 @@ DIB_LOCAL_IMAGE
|
||||
by diskimage-builder. It should be a full disk image, not just a filesystem
|
||||
image.
|
||||
:Example: ``DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150224.0.x86_64.qcow2``
|
||||
|
||||
DIB_DISABLE_KERNEL_CLEANUP
|
||||
:Required: No
|
||||
:Default: 0
|
||||
:Description: Specify if kernel needs to be cleaned up or not. When set to
|
||||
true, the bits that cleanup old kernels will not be executed.
|
||||
:Example: DIB_DISABLE_KERNEL_CLEANUP=1
|
||||
|
1
elements/redhat-common/environment.d/50-redhat-common
Executable file
1
elements/redhat-common/environment.d/50-redhat-common
Executable file
@ -0,0 +1 @@
|
||||
export DIB_DISABLE_KERNEL_CLEANUP=${DIB_DISABLE_KERNEL_CLEANUP:-0}
|
@ -6,6 +6,11 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
if [ $DIB_DISABLE_KERNEL_CLEANUP -ne 0 ]; then
|
||||
echo "Skipping kernel cleanup as configured"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
YUM=${YUM:-yum}
|
||||
|
||||
if [[ ${YUM} == "dnf" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user