Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #22 from jarnos/patch-1
Remove possible .old-dkms initrd backup
  • Loading branch information
Perry.Yuan committed Apr 17, 2017
2 parents 81c695b + 859034b commit 4d29e7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion dkms
Expand Up @@ -286,7 +286,6 @@ make_initrd()

# Back up our current initrd
echo $""
[[ $2 = ia64 && -d /boot/efi/efi/redhat ]] && initrd_dir="/boot/efi/efi/redhat"
# Find out what the proper filename will be
for initrd in "initrd-$1.img" "initramfs-$1.img" "initrd.img-$1" "initrd-$1" ''; do
[[ $initrd && -f $initrd_dir/$initrd ]] && break
Expand Down
12 changes: 11 additions & 1 deletion kernel_prerm.d_dkms
@@ -1,8 +1,18 @@
#!/bin/bash

# We're passed the version of the kernel being installed
# We're passed the version of the kernel being removed
inst_kern=$1

# This is applied from make_initrd function in dkms command, which
# creates the possible initrd backup file.
remove_initrd_backup() {
for initrd in "initrd-$1.img" "initramfs-$1.img" "initrd.img-$1" "initrd-$1"; do
rm -fv /boot/"${initrd}".old-dkms >&2
done
}

remove_initrd_backup "$inst_kern"

if [ -x /usr/sbin/dkms ]; then
while read line; do
name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
Expand Down

0 comments on commit 4d29e7e

Please sign in to comment.