From 621f3663edf5266f0424be2be330f418d81c8823 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 22 Nov 2012 12:28:38 +0100 Subject: [PATCH] postinst-script checks deps and exit if not exists; can be -.disabled. --- postinst.d/10-nvidia-drivers | 5 +++++ postinst.d/90-dracut | 4 ++++ postinst.d/zz-grub-mkconfig | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/postinst.d/10-nvidia-drivers b/postinst.d/10-nvidia-drivers index 1822186..41ec1f0 100755 --- a/postinst.d/10-nvidia-drivers +++ b/postinst.d/10-nvidia-drivers @@ -1,3 +1,8 @@ #!/usr/bin/env sh + +[ -e "$0.disabled" ] && exit 0 +which make >/dev/null 2>&1 || exit 0 +[ -d "/usr/src/nvidia-drivers" ] || exit 0 + echo Build NVIDIA module... >&2 exec make -C /usr/src/nvidia-drivers SYSSRC="/lib/modules/$1/build" install diff --git a/postinst.d/90-dracut b/postinst.d/90-dracut index edf8127..ef2bfe9 100755 --- a/postinst.d/90-dracut +++ b/postinst.d/90-dracut @@ -1,3 +1,7 @@ #!/usr/bin/env sh + +[ -e "$0.disabled" ] && exit 0 +which dracut >/dev/null 2>&1 || exit 0 + echo "dracut..." >&2 exec dracut --force --kver "$1" diff --git a/postinst.d/zz-grub-mkconfig b/postinst.d/zz-grub-mkconfig index 47a9558..9ee6f7c 100755 --- a/postinst.d/zz-grub-mkconfig +++ b/postinst.d/zz-grub-mkconfig @@ -1,3 +1,6 @@ #!/usr/bin/env sh -echo "grub-mkconfig..." >&2 + +[ -e "$0.disabled" ] && exit 0 +which grub-mkconfig >/dev/null 2>&1 || exit 0 + exec grub-mkconfig -o /boot/grub/grub.cfg