2013-08-27 23:20:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Update /boot partition files.
|
|
|
|
#
|
|
|
|
if [ ! -f /boot/cmdline.bak ] ; 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.
|
|
|
|
#
|
|
|
|
gettyline=`grep ttyAMA0 /etc/inittab`
|
|
|
|
if [ -n "$gettyline" -a ${gettyline:0:1} = T ] ; then
|
|
|
|
mv /etc/inittab /etc/inittab.bak
|
|
|
|
sed 's/^T0*/#T0*/' /etc/inittab.bak > /etc/inittab
|
|
|
|
fi
|
|
|
|
#
|
2013-09-20 04:03:28 +00:00
|
|
|
# Add a2joy and a2pid to rc.local
|
2013-08-27 23:20:01 +00:00
|
|
|
#
|
|
|
|
if [ -f /etc/rc.local ] ; then
|
|
|
|
if ! grep a2pid /etc/rc.local > /dev/null ; then
|
|
|
|
mv /etc/rc.local /etc/rc.local.bak
|
2013-09-22 05:52:21 +00:00
|
|
|
sed -e '/^exit/i\# Start Apple II Pi' -e '/^exit/i\/usr/local/sbin/a2pid --daemon' -e '/^exit/i\wait 1' -e '/^exit/i\/usr/local/bin/a2joy' /etc/rc.local.bak > /etc/rc.local
|
2013-08-28 22:13:01 +00:00
|
|
|
chmod +x /etc/rc.local
|
2013-08-27 23:20:01 +00:00
|
|
|
fi
|
2013-09-10 04:12:08 +00:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Disable joystick as a mouse in X
|
|
|
|
#
|
2013-09-22 05:52:21 +00:00
|
|
|
if [ -d /usr/share/X11/xorg.conf.d ] ; then
|
|
|
|
cp 11-joy.conf /usr/share/X11/xorg.conf.d
|
|
|
|
fi
|
2013-09-19 23:41:30 +00:00
|
|
|
#
|
|
|
|
# Make sure a2mount is executable
|
|
|
|
#
|
|
|
|
if [ -f /usr/local/bin/a2mount ] ; then
|
|
|
|
chmod +x /usr/local/bin/a2mount
|
|
|
|
fi
|
2013-09-22 05:52:21 +00:00
|
|
|
#
|
|
|
|
# Remove old a2pid
|
|
|
|
#
|
|
|
|
if [ -f /usr/local/bin/apid ] ; then
|
|
|
|
rm /usr/local/bin/a2pid
|
|
|
|
fi
|