apple2pi/debian/postinst

66 lines
1.7 KiB
Plaintext
Raw Normal View History

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.
#
ttyline=`grep ttyAMA0 /boot/cmdline.txt`
if [ "$ttyline" != "" ] ; then
mv /boot/cmdline.txt /boot/cmdline.bak
echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait" > /boot/cmdline.txt
fi
#
# Disable getty on built-in serial port.
#
ttyline=`grep ttyAMA0 /etc/inittab`
case "$gettyline" in
T*)
mv /etc/inittab /etc/inittab.bak
sed 's/^T0*/#T0*/' /etc/inittab.bak > /etc/inittab
;;
*)
;;
esac
#
# 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-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