Keep 4 old versions of kernels
This commit is contained in:
parent
8d89b5cd8d
commit
65537f8fe6
7
debian/create-efi-kernel
vendored
7
debian/create-efi-kernel
vendored
@ -32,7 +32,12 @@ while IFS= read -r OLD_EFI_ENTRY; do
|
||||
done < "${temp_efi_list_file}"
|
||||
# }}}
|
||||
# Clean old kernels {{{
|
||||
## Remove all unified kernels
|
||||
## Rename last version of generic kernel for backup
|
||||
mv -- "${EFI_MOUNT_PATH}/EFI/debian/linux.debian.efi" "${EFI_MOUNT_PATH}/EFI/debian/backup.debian.efi.$(date +%Y%m%d-%H%M)"
|
||||
## Keep only the 4 more recent backup kernels
|
||||
find "${EFI_MOUNT_PATH}/EFI/debian" -type f -iname "backup.debian.efi.*" | sort --reverse --numeric-sort -- | tail --lines=+5 -- | xargs --replace={} rm -- {}
|
||||
|
||||
## Remove all previous unified kernels with version in filename
|
||||
find "${EFI_MOUNT_PATH}/EFI/debian" -type f -iname "linux.debian.*.efi" -delete
|
||||
# }}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user