let cp remove the destination files

clone of e1206cf45b
This commit is contained in:
Dan Horák 2023-11-10 11:59:34 +01:00
parent 7a5c89e84a
commit ca71fe340e

View File

@ -55,8 +55,7 @@ case "$COMMAND" in
add) add)
if [[ "${KERNEL_DIR}" != "/boot" ]]; then if [[ "${KERNEL_DIR}" != "/boot" ]]; then
# rename to match the name used in the pseudo-BLS snippet above # rename to match the name used in the pseudo-BLS snippet above
rm -f "/boot/vmlinuz-${KERNEL_VERSION}" cp --remove-destination --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
cp --preserve=timestamps -T "${KERNEL_IMAGE}" "/boot/vmlinuz-${KERNEL_VERSION}"
command -v restorecon &>/dev/null && \ command -v restorecon &>/dev/null && \
restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}" restorecon -R "/boot/vmlinuz-${KERNEL_VERSION}"