post_install() { _ver=$(echo $1|awk -F'-' '{print $1}') dkms add -m amzn-drivers -v $_ver dkms build -m amzn-drivers -v $_ver printf 'Make sure to add "ena" to the "/etc/mkinitcpio.conf" "MODULES" section' printf ' and rebuild the initramfs with "mkinitcpio -P"\n' } post_upgrade() { _ver_new=$(echo $1|awk -F'-' '{print $1}') _ver_old=$(echo $2|awk -F'-' '{print $1}') # Omitting error from dkms removal as the old driver may have been removed already. dkms uninstall -m amzn-drivers -v $_ver_old --all 2> /dev/null dkms remove -m amzn-drivers -v $_ver_old --all 2> /dev/null dkms unbuild -m amzn-drivers -v $_ver_old --all 2> /dev/null dkms build -m amzn-drivers -v $_ver_new }