Compare commits

...

39 commits

Author SHA1 Message Date
Melissa LeBlanc-Williams
625ae04c38 Updated new script location 2021-11-16 15:26:59 -08:00
Limor "Ladyada" Fried
5f42dd279b
Update README.md 2018-03-28 12:08:12 -04:00
ladyada
a1efb3bbd4 updated! 2018-03-28 11:54:38 -04:00
Limor "Ladyada" Fried
a9565919c6
Merge pull request #23 from bunchc/patch-2
Update adafruit-pitft-helper2.sh
2018-03-13 21:58:31 -04:00
bunchc
fd9875e826
Update adafruit-pitft-helper2.sh
Per Ladyada's comment in #22, changing line 184 from pi2 to pi3 resolved the CPU disabled issue.
2018-01-23 08:28:28 -06:00
ladyada
ea39b5ed3f 3.5" rotation 2017-12-01 18:24:40 -05:00
ladyada
17f75dfc21 2.2" works, also add resolutions 2017-11-28 18:36:33 -05:00
ladyada
1ad86c65df add rotation support, 2.8" etc display rotate touchscreen 2017-11-28 18:35:20 -05:00
ladyada
d69eda94a2 pretty scaling 2017-11-10 02:24:38 -05:00
ladyada
3050ae6466 2.8" capacitive & faster fbcp! 2017-11-10 01:54:42 -05:00
ladyada
ef9cd1ba66 3.5" and proper overlays 2017-11-10 00:33:08 -05:00
ladyada
80a890dd28 allow disabling of fbcp / hdmi noodle if console desired 2017-11-09 23:27:35 -05:00
ladyada
4b5fce978f notificaiton 2017-11-09 23:12:40 -05:00
ladyada
d5ace93de9 try different resolutions 2017-11-09 23:09:29 -05:00
ladyada
a15386bbe5 stretch lite console mirroring 2017-11-09 23:04:33 -05:00
ladyada
6e8fc56252 *sigh* time to zzz 2017-11-08 00:57:28 -05:00
ladyada
909fcb7651 better matching 2017-11-08 00:29:01 -05:00
ladyada
b9306384ad mystery 2017-11-08 00:21:09 -05:00
ladyada
36ad0f8830 ? calibration constants 2017-11-08 00:14:55 -05:00
ladyada
be391b66ae fix exit 0 2017-11-08 00:08:42 -05:00
ladyada
fbb75859b3 add reboot 2017-11-07 23:57:12 -05:00
Limor "Ladyada" Fried
8660d1e689
Update adafruit-pitft-helper2.sh 2017-11-07 23:52:29 -05:00
ladyada
fdcf849b0f add fbcp, x calibration and such things. probably time for testing! 2017-11-07 23:22:13 -05:00
ladyada
ac97a91dd9 touchmouse starting to happen... 2017-11-07 20:59:34 -05:00
ladyada
6974f7ddf0 newer! better! not done yet! 2017-11-07 00:35:15 -05:00
Phillip Burgess
c135a09d46 Add note re: RetroPie 2017-05-26 10:23:17 -07:00
Todd Treece
c6e40c97c8 35r default speed is now 25,000,000 2016-11-08 14:15:22 -05:00
Todd Treece
dc709de686 rotate 35r by 180 degrees 2016-10-18 21:11:10 -04:00
Todd Treece
5729d8bb96 Merge pull request #16 from adafruit/4.4.y
rpi-4.4.y overlay changes
2016-10-18 18:30:00 -04:00
Todd Treece
b819c194be use 28c overlay instead of upstream overlay 2016-10-18 18:29:42 -04:00
Todd Treece
e206e787b0 add console blanking to rc.local 2016-10-12 16:48:56 -04:00
Todd Treece
02588226a6 add changes to support overlays included with rpi-4.4.y 2016-10-11 10:42:47 -04:00
Brennen Bearnes
979d9f69f3 README.md: now reflects jessie-related changes, adfruit-pi-chroot 2015-10-28 16:40:44 -06:00
Brennen Bearnes
71bfb09083 adafruit-pitft-chroot-install: necessary tweaks for jessie
Modifies mount behavior, mostly.
2015-10-28 16:27:05 -06:00
Brennen Bearnes
e530e04500 add adafruit-pi-chroot for getting chroot shells in ISOs 2015-10-28 16:26:50 -06:00
Brennen Bearnes
a6c3430e54 v0.8.0 2015-10-02 00:44:11 +00:00
Brennen Bearnes
a95be2b8ab add necessary configuration for lightdm to find /dev/fb1 2015-10-01 19:16:02 +00:00
Brennen Bearnes
53fb7db162 disable boot-to-desktop
This is a stopgap.
2015-10-01 19:02:31 +00:00
Brennen Bearnes
f71d09f43c add init-system checking, raspi-config style 2015-10-01 18:50:00 +00:00
5 changed files with 185 additions and 9 deletions

View file

@ -1,6 +1,17 @@
# Adafruit-PiTFT-Helper
A script for configuring Adafruit's PiTFT displays on a Raspberry Pi.
### This script/repository is deprecated, as trying to do kernel updates on the fast-moving Raspberry Pi wasn't sustainable! We're now using a simpler device-tree-only script, available at https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/main/adafruit-pitft.py
We'll keep this repo public but archived for the curious.
---------------------------------
A (deprecated) script for configuring Adafruit's PiTFT displays on a Raspberry Pi.
## Attention RETROPIE Users:
Do not use the adafruit-pitft-helper script with RetroPie. Instead, follow the directions on this page:
https://learn.adafruit.com/running-opengl-based-games-and-emulators-on-adafruit-pitft-displays/pitft-setup
## PiTFT Documentation
@ -81,6 +92,19 @@ sudo adafruit-pitft-chroot-install -t 28r -i ~/2015-02-16-raspbian-wheezy.img
...where `-t` specifies the type of PiTFT just like the same option to
`adafruit-pitft-helper`, and `-i` specifies the path to an image file.
You can also use [`adafruit-pi-chroot`][pi-chroot] to run a `chroot`ed shell
inside of a Raspbian ISO image. Like the install wrapper, this relies on
`kpartx`.
These are the scripts we use to produce the Easy Install images offered in
Adafruit product documentation. They may be a bit rough around the edges.
## Older Versions
For the version supporting Raspbian Wheezy, check out the `wheezy` branch
on this repository.
[o]: https://github.com/adafruit/Adafruit-Occidentalis
[p]: https://github.com/adafruit/Adafruit-Pi-Finder
[c]: https://github.com/adafruit/Adafruit-PiTFT-Helper/blob/master/adafruit-pitft-chroot-install
[pi-chroot]: https://github.com/adafruit/Adafruit-PiTFT-Helper/blob/master/adafruit-pi-chroot

58
adafruit-pi-chroot Executable file
View file

@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -e
function print_help() {
echo "$0: get a chroot shell inside of a Raspbian ISO"
echo "Usage: $0 target.img"
echo " -h Print this help"
echo " -i [target] Specify an ISO to chroot to (probably a Pi Foundation Raspbian)"
exit 1
}
args=$(getopt -uo 'ht:i:' -- $*)
[ $? != 0 ] && print_help
set -- $args
for i
do
case "$i"
in
-h)
print_help
;;
-i)
target_image="$2"
echo "Image = ${2}"
shift
shift
;;
esac
done
if [[ $EUID -ne 0 ]]; then
echo "$0 must be run as root. try: sudo $0"
exit 1
fi
target_mnt="/media/raspbian-target"
# assemble a mostly-legit filesystem by mounting / and /boot from the target
# iso, plus /dev from the host pi (/dev/(u)random seems to be required by
# recent versions of GPG):
echo "Mounting $target_image on $target_mnt"
kpartx -av $target_image
mkdir -p $target_mnt
mount /dev/dm-1 $target_mnt
mount /dev/dm-0 $target_mnt/boot
mkdir -p $target_mnt/dev
mount --bind /dev $target_mnt/dev
echo "Dropping you into Bash - image will be unmounted after exit"
chroot $target_mnt sudo /bin/bash
echo "Unmounting $target_image"
umount $target_mnt/boot
umount $target_mnt/dev
umount $target_mnt
kpartx -d $target_image

View file

@ -1,7 +1,5 @@
#!/usr/bin/env bash
set -e
function print_help() {
echo "Usage: $0 -t [pitfttype] -i target.img"
echo " -h Print this help"
@ -51,11 +49,16 @@ fi
target_mnt="/media/raspbian-target"
# assemble a mostly-legit filesystem by mounting / and /boot from the target
# iso, plus /dev from the host pi (/dev/(u)random seems to be required by
# recent versions of GPG):
echo "Mounting $target_image on $target_mnt"
kpartx -av $target_image
mkdir -p $target_mnt
mount /dev/dm-1 $target_mnt
mount /dev/dm-0 $target_mnt/boot
mkdir -p $target_mnt/dev
mount --bind /dev $target_mnt/dev
echo "Dropping you into Bash before install"
chroot $target_mnt sudo /bin/bash
@ -67,8 +70,8 @@ curl -SLs https://apt.adafruit.com/add | chroot $target_mnt /bin/bash
echo -e "Package: *\nPin: origin \"apt.adafruit.com\"\nPin-Priority: 1001" | chroot $target_mnt bash -c "cat > /etc/apt/preferences.d/adafruit"
echo "Installing kernel and adafruit-pitft-helper"
chroot $target_mnt sudo apt-get install -y raspberrypi-bootloader
chroot $target_mnt sudo apt-get install -y adafruit-pitft-helper
chroot $target_mnt sudo apt-get install raspberrypi-bootloader
chroot $target_mnt sudo apt-get install adafruit-pitft-helper
echo "Running adafruit-pitft-helper"
chroot $target_mnt sudo adafruit-pitft-helper -t $pitfttype
@ -78,5 +81,6 @@ chroot $target_mnt sudo /bin/bash
echo "Unmounting $target_image"
umount $target_mnt/boot
umount $target_mnt/dev
umount $target_mnt
kpartx -d $target_image

View file

@ -3,7 +3,7 @@
set -e
function print_version() {
echo "Adafruit PiTFT Helper v0.7.2"
echo "Adafruit PiTFT Helper v0.8.0"
exit 1
}
@ -87,7 +87,7 @@ function update_configtxt() {
fi
if [ "${pitfttype}" == "28r" ]; then
overlay="dtoverlay=pitft28r,rotate=90,speed=32000000,fps=20"
overlay="dtoverlay=pitft28-resistive,rotate=90,speed=32000000,fps=20"
fi
if [ "${pitfttype}" == "28c" ]; then
@ -95,7 +95,7 @@ function update_configtxt() {
fi
if [ "${pitfttype}" == "35r" ]; then
overlay="dtoverlay=pitft35r,rotate=90,speed=42000000,fps=20"
overlay="dtoverlay=pitft35-resistive,rotate=270,speed=25000000,fps=20"
fi
date=`date`
@ -121,6 +121,14 @@ EOF
function update_xorg() {
mkdir -p /etc/X11/xorg.conf.d
cat > /etc/X11/xorg.conf.d/99-fbdev.conf <<EOF
Section "Device"
Identifier "myfb"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
EOF
if [ "${pitfttype}" == "28r" ]; then
cat > /etc/X11/xorg.conf.d/99-calibration.conf <<EOF
Section "InputClass"
@ -216,12 +224,59 @@ function install_console() {
echo "/boot/cmdline.txt already updated"
fi
sed -i 's/BLANK_TIME=.*/BLANK_TIME=0/g' "/etc/kbd/config"
cat > /etc/rc.local <<EOF
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# disable console blanking on PiTFT
sudo sh -c "TERM=linux setterm -blank 0 >/dev/tty0"
exit 0
EOF
}
function uninstall_console() {
sed -i 's/rootwait fbcon=map:10 fbcon=font:VGA8x8/rootwait/g' "/boot/cmdline.txt"
sed -i 's/BLANK_TIME=0/BLANK_TIME=10/g' "/etc/kbd/config"
echo "Screen blanking time reset to 10 minutes"
cat > /etc/rc.local <<EOF
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
exit 0
EOF
}
function update_etcmodules() {
@ -263,6 +318,19 @@ EOF
fi
}
function update_bootprefs() {
echo "Turning off boot-to-desktop"
if [ -e /etc/init.d/lightdm ]; then
if [ $SYSTEMD -eq 1 ]; then
systemctl set-default multi-user.target
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
else
update-rc.d lightdm disable 2
sed /etc/inittab -i -e "s/1:2345:respawn:\/bin\/login -f pi tty1 <\/dev\/tty1 >\/dev\/tty1 2>&1/1:2345:respawn:\/sbin\/getty --noclear 38400 tty1/"
fi
fi
}
# MAIN
target_homedir="/home/pi"
@ -300,6 +368,18 @@ if [[ $EUID -ne 0 ]]; then
bail "adafruit-pitft-helper must be run as root. try: sudo adadfruit-pitft-helper"
fi
# check init system (technique borrowed from raspi-config):
info PITFT 'Checking init system...'
if command -v systemctl > /dev/null && systemctl | grep -q '\-\.mount'; then
echo "Found systemd"
SYSTEMD=1
elif [ -f /etc/init.d/cron ] && [ ! -h /etc/init.d/cron ]; then
echo "Found sysvinit"
SYSTEMD=0
else
bail "Unrecognised init system"
fi
if grep -q boot /proc/mounts; then
echo "/boot is mounted"
else
@ -357,6 +437,8 @@ if [ "${pitfttype}" != "35r" ]; then
fi
fi
# update_bootprefs || bail "Unable to set boot preferences"
info PITFT "Updating /boot/config.txt..."
update_configtxt || bail "Unable to update /boot/config.txt"

View file

@ -0,0 +1,8 @@
#!/bin/bash
echo "This script has been updated and now lives at https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/master/adafruit-pitft.sh"
echo "please run:"
echo "-----------"
echo "# wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/adafruit-pitft.sh"
echo "# chmod +x adafruit-pitft.sh"
echo "# sudo ./adafruit-pitft.sh"