Merge branch 'master' of github.com:adafruit/Adafruit-PiTFT-Helper

# Conflicts:
#	adafruit-pitft-chroot-install
This commit is contained in:
Brennen Bearnes 2015-06-17 14:47:43 -06:00
commit 3573d57a1d
2 changed files with 17 additions and 8 deletions

View file

@ -3,9 +3,10 @@
set -e set -e
function print_help() { function print_help() {
echo "Usage: $0 -t [pitfttype]" echo "Usage: $0 -t [pitfttype] -i target.img"
echo " -h Print this help" echo " -h Print this help"
echo " -t [type] Specify the type of PiTFT: '28r' (PID 1601) or '28c' (PID 1983) or '35r' or '22'" echo " -t [type] Specify the type of PiTFT: '28r' (PID 1601) or '28c' (PID 1983) or '35r' or '22'"
echo " -i [target] Specify an ISO to perform install on (a recent Pi Foundation Raspbian)"
echo echo
echo "You must specify a type of display." echo "You must specify a type of display."
exit 1 exit 1
@ -44,8 +45,8 @@ fi
if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ] if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ]
then then
echo "Type must be '28r' (2.8\" resistive, PID 1601) or '28c' (2.8\" capacitive, PID 1983) or '35r' (3.5\" Resistive) or '22' (2.2\" no touch)" echo "Type must be '28r' (2.8\" resistive, PID 1601) or '28c' (2.8\" capacitive, PID 1983) or '35r' (3.5\" Resistive) or '22' (2.2\" no touch)"
print_help print_help
fi fi
target_mnt="/media/raspbian-target" target_mnt="/media/raspbian-target"
@ -56,12 +57,15 @@ mkdir -p $target_mnt
mount /dev/mapper/loop0p2 $target_mnt mount /dev/mapper/loop0p2 $target_mnt
mount /dev/mapper/loop0p1 $target_mnt/boot mount /dev/mapper/loop0p1 $target_mnt/boot
echo "Dropping you into Bash"
chroot $target_mnt sudo /bin/bash
echo "Adding apt.adafruit.com to sources.list" echo "Adding apt.adafruit.com to sources.list"
curl -SLs https://apt.adafruit.com/add | chroot $target_mnt /bin/bash curl -SLs https://apt.adafruit.com/add | chroot $target_mnt /bin/bash
echo "Installing adafruit-pitft-helper and dependencies" echo "Installing kernel and adafruit-pitft-helper"
chroot $target_mnt sudo apt-get install raspberrypi-bootloader chroot $target_mnt sudo apt-get install -y raspberrypi-bootloader
chroot $target_mnt sudo apt-get install adafruit-pitft-helper chroot $target_mnt sudo apt-get install -y adafruit-pitft-helper
echo "Running adafruit-pitft-helper" echo "Running adafruit-pitft-helper"
chroot $target_mnt sudo adafruit-pitft-helper -t $pitfttype chroot $target_mnt sudo adafruit-pitft-helper -t $pitfttype

View file

@ -3,7 +3,7 @@
set -e set -e
function print_version() { function print_version() {
echo "Adafruit PiTFT Helper v0.7.0" echo "Adafruit PiTFT Helper v0.7.1"
exit 1 exit 1
} }
@ -303,7 +303,12 @@ fi
if grep -q boot /proc/mounts; then if grep -q boot /proc/mounts; then
echo "/boot is mounted" echo "/boot is mounted"
else else
bail "/boot must be mounted. try: sudo mount /dev/mmcblk0p1 /boot" echo "/boot must be mounted. if you think it's not, quit here and try: sudo mount /dev/mmcblk0p1 /boot"
if ask "Continue?"; then
echo "Proceeding."
else
bail "Aborting."
fi
fi fi
if [[ ! -e "$target_homedir" || ! -d "$target_homedir" ]]; then if [[ ! -e "$target_homedir" || ! -d "$target_homedir" ]]; then