postinst is in module-init-tools 3.16-1ubuntu2.
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | #!/bin/sh -e
# This script can be called in the following ways:
#
# After the package was installed:
# <postinst> configure <old-version>
#
#
# If prerm fails during upgrade or fails on failed upgrade:
# <old-postinst> abort-upgrade <new-version>
#
# If prerm fails during deconfiguration of a package:
# <postinst> abort-deconfigure in-favour <new-package> <version>
# removing <old-package> <version>
#
# If prerm fails during replacement due to conflict:
# <postinst> abort-remove in-favour <new-package> <version>
# Remove a no-longer used conffile
rm_conffile()
{
CONFFILE="$1"
if [ -e "$CONFFILE".dpkg-obsolete ]; then
echo "Removing obsolete conffile $CONFFILE"
rm -f "$CONFFILE".dpkg-obsolete
fi
}
# Remove a conffile directory if it's not empty
rm_confdir()
{
CONFDIR="$1"
if [ -d "$CONFDIR" ]; then
rmdir "$CONFDIR" 2>/dev/null \
|| echo "Unable to remove $CONFDIR, not empty"
fi
}
# Move a conffile without triggering a dpkg question
mv_conffile() {
OLDCONFFILE="$1"
NEWCONFFILE="$2"
if [ -e "$OLDCONFFILE".dpkg-moving ]; then
echo "Preserving user changes to $NEWCONFFILE"
mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
mv -f "$OLDCONFFILE".dpkg-moving "$NEWCONFFILE"
elif [ -e "$OLDCONFFILE".dpkg-bak ]; then
rm -f "$OLDCONFFILE".dpkg-bak
fi
}
# Migrate config to 3.7-style
migrate_config_37()
{
rm_conffile /etc/modprobe.d/aliases
rm_conffile /etc/modprobe.d/isapnp
rm_conffile /etc/modprobe.d/options
rm_conffile /etc/modprobe.d/arch/alpha
rm_conffile /etc/modprobe.d/arch/i386
rm_conffile /etc/modprobe.d/arch/ia64
rm_conffile /etc/modprobe.d/arch/m68k.amiga
rm_conffile /etc/modprobe.d/arch/m68k.atari
rm_conffile /etc/modprobe.d/arch/m68k.generic
rm_conffile /etc/modprobe.d/arch/mips
rm_conffile /etc/modprobe.d/arch/parisc
rm_conffile /etc/modprobe.d/arch/powerpc.apus
rm_conffile /etc/modprobe.d/arch/powerpc.generic
rm_conffile /etc/modprobe.d/arch/powerpc.pmac
rm_conffile /etc/modprobe.d/arch/s390
rm_conffile /etc/modprobe.d/arch/sparc
rm_conffile /etc/modprobe.d/arch/x86_64
rm_confdir /etc/modprobe.d/arch
rm_conffile /etc/modprobe.d/blacklist-amd76-edac
mv_conffile /etc/modprobe.d/blacklist \
/etc/modprobe.d/blacklist.conf
mv_conffile /etc/modprobe.d/blacklist-firewire \
/etc/modprobe.d/blacklist-firewire.conf
mv_conffile /etc/modprobe.d/blacklist-framebuffer \
/etc/modprobe.d/blacklist-framebuffer.conf
mv_conffile /etc/modprobe.d/blacklist-watchdog \
/etc/modprobe.d/blacklist-watchdog.conf
mv_conffile /etc/modprobe.d/intel-5300-iwlagn-disable11n \
/etc/modprobe.d/intel-5300-iwlagn-disable11n.conf
}
# Create /etc/modules
create_etc_modules()
{
if [ ! -e /etc/modules ]; then
cat <<EOF >/etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
EOF
chmod 644 /etc/modules
fi
}
# Run depmod for installed kernels
run_depmod()
{
for KVER in $(/bin/ls -v /lib/modules); do
[ -f "/boot/System.map-$KVER" ] || continue
echo "Running depmod for $KVER..."
/sbin/depmod -a -F "/boot/System.map-$KVER" "$KVER"
done
}
case "$1" in
configure)
# Upgrade from intrepid
if dpkg --compare-versions "$2" lt "3.7~pre7-1"; then
migrate_config_37
run_depmod
fi
create_etc_modules
;;
abort-upgrade|abort-deconfigure|abort-remove)
;;
*)
echo "$0 called with unknown argument \`$1'" 1>&2
exit 1
;;
esac
# iwlwifi split into 2 drivers as of 2.6.38; iwl3945 and iwlagn
dpkg-maintscript-helper rm_conffile /etc/modprobe.d/intel-5300-iwlagn-disable11n.conf 3.12-1ubuntu4 -- "$@"
# Automatically added by dh_installinit
update-rc.d -f module-init-tools remove >/dev/null || exit $?
# End automatically added section
exit 0
|