postinst is in bumblebee-nvidia 3.2.1-5.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/bin/sh
# postinst script for bumblebee-nvidia
#
# see: dh_installdeb(1)
set -e
xconffile=/etc/bumblebee/xorg.conf.nvidia
case "$1" in
configure)
# Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
# Also, do not rely solely on dpkg-vendor (see LP: #1061769)
if (which dpkg-vendor >/dev/null && dpkg-vendor --derives-from Ubuntu) || \
[ -e /etc/dpkg/origins/ubuntu ]; then
# == Ubuntu specific section ==
# Repair GL on the intel display
for arch in x86_64-linux-gnu i386-linux-gnu; do
update-alternatives --force --set \
${arch}_gl_conf /usr/lib/$arch/mesa/ld.so.conf 2>/dev/null || true
done
# assume first device to be discrete in nvidia/nvidia
busid=$(lspci -d10de: -nn | grep '\[030[02]\]' | cut -d' ' -f1 | tr . : | head -1)
if [ -z "$busid" ]; then
echo "No Nvidia card found. If you really have an Optimus system,"
echo "try selecting the Optimus setup in BIOS and run:"
echo "sudo dpkg-reconfigure bumblebee-nvidia"
else
echo "Selecting $busid as discrete nvidia card. If this is incorrect,"
echo "edit the BusID line in $xconffile"
sed -i $xconffile -r -e "s/^([\t ]*)#([\t ]*BusID[\t ]*)\"[^\"]*\"$/\\1 \\2\"PCI\:$busid\"/"
fi
else
# == Debian specific section ==
# Repair GL on the intel display
update-alternatives --force --set \
glx /usr/lib/mesa-diverted 2>/dev/null || true
fi
ldconfig
# this has a chance of crashing the machine with mainline kernels...
grep -q '^nouveau ' /proc/modules && rmmod nouveau || true
if [ -e "/etc/init/bumblebeed.conf" ]; then
invoke-rc.d bumblebeed restart || true
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0
|