postinst is in fs2ram 0.3.12.
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 | #!/bin/sh
# postinst script for fs2ram
#
# see: dh_installdeb(1)
set -e
. /usr/share/debconf/confmodule
set_perms() {
USER=$1
GROUP=$2
MODE=$3
FILE=$4
if ! dpkg-statoverride --list $FILE > /dev/null 2>&1; then
chown $USER:$GROUP $FILE
chmod $MODE $FILE
fi
}
set_rcs_param() {
file="$1"
key="$2"
new_value="$3"
(
if grep -qe "^$key=" $file ; then
unset $key
. $file
eval "current_value=\$$key"
if [ "$current_value" != "$new_value" ]; then
sed -e "s/^$key=.*/$key=$new_value/" -i $file
fi
else
echo "$key=$new_value" >> $file
fi
)
}
case "$1" in
configure)
if [ "$2" != "" ]; then
# Upgrade old installation
if $(dpkg --compare-versions $2 lt 0.3.7); then
if [ -f '/etc/fs2ram.conf' ]; then
echo "Moving the default configuration file to /etc/fs2ram/fs2ram.conf."
mv -f /etc/fs2ram.conf /etc/fs2ram/fs2ram.conf
fi
fi
fi
db_get fs2ram/main_install_type
install_type="$RET"
case "$install_type" in
"Content-preserving")
fs2ram_conffile=/usr/share/doc/fs2ram/examples/fs2ram.conf.wear
;;
"Structure-preserving")
fs2ram_conffile=/usr/share/doc/fs2ram/examples/fs2ram.conf.privacy
;;
*)
# Include the case "No configuration"
fs2ram_conffile=/usr/share/doc/fs2ram/examples/fs2ram.conf.empty
;;
esac
# Handle fs2ram.conf with ucf
ucf --debconf-ok $fs2ram_conffile /etc/fs2ram/fs2ram.conf
# Support also squeeze (for backports)
initscripts_version=$(dpkg-query -W initscripts | cut -f 2)
if dpkg --compare-versions "$initscripts_version" lt "2.88dsf-13.3" ; then
[ -f "/etc/default/rcS" ] && . /etc/default/rcS
if [ "$RAMRUN" != "yes" ]; then
echo " Making /var/run available as ram file system (By default, the changes take effect after the next reboot) ..."
set_rcs_param /etc/default/rcS RAMRUN yes
fi
fi
# Execute the unmount scripts once to be sure to keep data accross the
# next reboot.
echo " Executing the unmount scripts ..."
fs2ram execute-unmount-script -a > /dev/null || true
# Fix some permissions
set_perms root root 700 /var/lib/fs2ram/mount-scripts
set_perms root root 700 /etc/fs2ram/unmount-scripts
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
db_stop
# Automatically added by dh_installinit
if [ -x "/etc/init.d/fs2ram" ]; then
if [ ! -e "/etc/init/fs2ram.conf" ]; then
update-rc.d fs2ram start 36 S . start 39 0 6 . >/dev/null
fi
fi
# End automatically added section
exit 0
|