2013-09-20 04:27:56 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# postinst script for a2pi
|
|
|
|
#
|
|
|
|
# see: dh_installdeb(1)
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# summary of how this script can be called:
|
|
|
|
# * <postinst> `configure' <most-recently-configured-version>
|
|
|
|
# * <old-postinst> `abort-upgrade' <new version>
|
|
|
|
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
|
|
|
# <new-version>
|
|
|
|
# * <postinst> `abort-remove'
|
|
|
|
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
|
|
|
# <failed-install-package> <version> `removing'
|
|
|
|
# <conflicting-package> <version>
|
|
|
|
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
|
|
# the debian-policy package
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
2013-09-22 05:52:21 +00:00
|
|
|
#
|
|
|
|
# Update /boot partition files.
|
|
|
|
#
|
2013-09-22 20:06:33 +00:00
|
|
|
if [ "$(grep ttyAMA0 /boot/cmdline.txt)" != "" ] ; then
|
2013-10-07 03:53:38 +00:00
|
|
|
cp /boot/cmdline.txt /boot/cmdline.bak
|
2013-10-06 21:09:28 +00:00
|
|
|
sed -i 's/console=ttyAMA0,[0-9]* kgdboc=ttyAMA0,[0-9]* //g' /boot/cmdline.txt
|
2013-09-22 05:52:21 +00:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Disable getty on built-in serial port.
|
|
|
|
#
|
2015-11-18 19:27:27 +00:00
|
|
|
if [ -e /etc/inittab ] ; then
|
|
|
|
ttyline=`grep ttyAMA0 /etc/inittab`
|
|
|
|
case "$ttyline" in
|
|
|
|
T0*)
|
|
|
|
mv /etc/inittab /etc/inittab.bak
|
|
|
|
sed 's/^T0/#T0/' /etc/inittab.bak > /etc/inittab
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2013-09-22 05:52:21 +00:00
|
|
|
#
|
|
|
|
# Disable joystick as a mouse in X
|
|
|
|
#
|
|
|
|
if [ -d /usr/share/X11/xorg.conf.d ] ; then
|
|
|
|
cp /usr/share/a2pi/11-joy.conf /usr/share/X11/xorg.conf.d
|
|
|
|
fi
|
2013-09-22 20:06:33 +00:00
|
|
|
#
|
2013-09-22 23:14:50 +00:00
|
|
|
# Add default Pi user,pi, to groups fuse and input
|
|
|
|
#
|
2015-11-18 19:27:27 +00:00
|
|
|
# addgroup pi fuse
|
2013-09-22 23:14:50 +00:00
|
|
|
# addgroup pi input # already there by default
|
|
|
|
#
|
2013-12-11 04:26:38 +00:00
|
|
|
# Allow other users (root) to access FUSE mount points
|
|
|
|
#
|
|
|
|
if [ "$(grep \#user_allow_other /etc/fuse.conf)" != "" ] ; then
|
|
|
|
mv /etc/fuse.conf /etc/fuse.conf.bak
|
|
|
|
sed 's/^#user_allow_other/user_allow_other/' /etc/fuse.conf.bak > /etc/fuse.conf
|
|
|
|
fi
|
|
|
|
#
|
2014-02-13 01:30:06 +00:00
|
|
|
# Set up PIDRIVEs
|
2014-02-06 07:19:45 +00:00
|
|
|
#
|
2015-02-28 03:17:24 +00:00
|
|
|
#if [ ! -s /usr/share/a2pi/A2VD1.PO ] ; then
|
|
|
|
if [ -e /usr/share/a2pi/A2VD1.PO ] || [ -L /usr/share/a2pi/A2VD1.PO ] ; then
|
2014-02-13 01:30:06 +00:00
|
|
|
rm /usr/share/a2pi/A2VD1.PO
|
|
|
|
fi
|
2015-07-10 03:50:56 +00:00
|
|
|
ln -s /usr/share/a2pi/A2PI-1.6.PO /usr/share/a2pi/A2VD1.PO
|
2015-02-28 03:17:24 +00:00
|
|
|
#fi
|
2014-02-13 01:30:06 +00:00
|
|
|
if [ ! -s /usr/share/a2pi/A2VD2.PO ] ; then
|
|
|
|
if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then
|
|
|
|
rm /usr/share/a2pi/A2VD2.PO
|
|
|
|
fi
|
2014-02-14 16:57:31 +00:00
|
|
|
ln -s /usr/share/a2pi/UTILS.PO /usr/share/a2pi/A2VD2.PO
|
2014-02-08 18:50:56 +00:00
|
|
|
fi
|
2014-02-06 07:19:45 +00:00
|
|
|
#
|
2013-09-22 20:06:33 +00:00
|
|
|
# Add schmenk.is-a-geek.com to apt sources
|
|
|
|
#
|
|
|
|
if [ "$(grep schmenk /etc/apt/sources.list)" = "" ] ; then
|
2015-11-18 19:27:27 +00:00
|
|
|
echo "deb http://schmenk.is-a-geek.com/raspbian jessie contrib" >> /etc/apt/sources.list
|
2013-09-22 20:06:33 +00:00
|
|
|
fi
|
|
|
|
#
|
2017-05-20 21:43:29 +00:00
|
|
|
# Add a2pi service to systemd
|
2013-09-22 20:06:33 +00:00
|
|
|
#
|
2017-05-20 22:21:00 +00:00
|
|
|
if [ -f /usr/share/a2pi/a2pi.service ] && [ -d /lib/systemd/system ] ; then
|
|
|
|
cp /usr/share/a2pi/a2pi.service /lib/systemd/system
|
2017-05-20 21:43:29 +00:00
|
|
|
systemctl enable a2pi
|
|
|
|
fi
|
2013-09-20 04:27:56 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# dh_installdeb will replace this with shell code automatically
|
|
|
|
# generated by other debhelper scripts.
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|