Skip to content

Commit

Permalink
fix: dkms.post_remove: optimize code logic
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeChenL committed Mar 19, 2024
1 parent 7f858cc commit eaad66c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions debian/dkms.post_remove
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ set -e
base_dir="${PWD%/*}/$(uname -r)/$(arch)/module/arch"
install_dir="/usr/lib/linux-image-$(uname -r)"

if [[ "$(readlink "$install_dir/amlogic/overlays")" == "$base_dir/arm64/boot/dts/amlogic/overlays" ]]
then
echo "Remove $install_dir/amlogic/overlays"
rm "$install_dir/amlogic/overlays"
fi

if [[ "$(readlink "$install_dir/rockchip/overlays")" == "$base_dir/arm64/boot/dts/rockchip/overlays" ]]
then
echo "Remove $install_dir/rockchip/overlays"
rm "$install_dir/rockchip/overlays"
fi
for vendor in "rockchip" "amlogic"
do
if [[ "$(readlink "$install_dir/$vendor/overlays")" == "$base_dir/arm64/boot/dts/$vendor/overlays" ]]
then
echo "Remove $install_dir/$vendor/overlays"
rm "$install_dir/$vendor/overlays"
fi
done

echo "Remove $base_dir"
rm -rf "$base_dir"

0 comments on commit eaad66c

Please sign in to comment.