From ef74ca197b195a572d0d1cae52502f09e02c3ae2 Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Tue, 2 Jun 2015 20:56:09 +0000 Subject: [PATCH 1/2] handle un-mounted /boot more gracefully; document more of chroot helper --- adafruit-pitft-chroot-install | 16 ++++++++++------ adafruit-pitft-helper | 7 ++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/adafruit-pitft-chroot-install b/adafruit-pitft-chroot-install index 7168218..2f9f478 100755 --- a/adafruit-pitft-chroot-install +++ b/adafruit-pitft-chroot-install @@ -3,9 +3,10 @@ set -e function print_help() { - echo "Usage: $0 -t [pitfttype]" + echo "Usage: $0 -t [pitfttype] -i target.img" 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 " -i [target] Specify an ISO to perform install on (a recent Pi Foundation Raspbian)" echo echo "You must specify a type of display." exit 1 @@ -44,8 +45,8 @@ fi if [ "${pitfttype}" != "28r" ] && [ "${pitfttype}" != "28c" ] && [ "${pitfttype}" != "35r" ] && [ "${pitfttype}" != "22" ] 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)" - print_help + 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 fi target_mnt="/media/raspbian-target" @@ -56,12 +57,15 @@ mkdir -p $target_mnt mount /dev/mapper/loop0p2 $target_mnt 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" curl -SLs https://apt.adafruit.com/add | chroot $target_mnt /bin/bash -echo "Installing adafruit-pitft-helper and dependencies" -chroot $target_mnt sudo apt-get install raspberrypi-bootloader-adafruit-pitft -chroot $target_mnt sudo apt-get install adafruit-pitft-helper +echo "Installing kernel and adafruit-pitft-helper" +chroot $target_mnt sudo apt-get install -y raspberrypi-bootloader-adafruit-pitft +chroot $target_mnt sudo apt-get install -y adafruit-pitft-helper echo "Running adafruit-pitft-helper" chroot $target_mnt sudo adafruit-pitft-helper -t $pitfttype diff --git a/adafruit-pitft-helper b/adafruit-pitft-helper index cb83993..1a69558 100755 --- a/adafruit-pitft-helper +++ b/adafruit-pitft-helper @@ -303,7 +303,12 @@ fi if grep -q boot /proc/mounts; then echo "/boot is mounted" 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 if [[ ! -e "$target_homedir" || ! -d "$target_homedir" ]]; then From 18de48b64205c6c4ce58a62860a957becc28398a Mon Sep 17 00:00:00 2001 From: Brennen Bearnes Date: Tue, 2 Jun 2015 20:57:05 +0000 Subject: [PATCH 2/2] v0.7.1 --- adafruit-pitft-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit-pitft-helper b/adafruit-pitft-helper index 1a69558..682bd53 100755 --- a/adafruit-pitft-helper +++ b/adafruit-pitft-helper @@ -3,7 +3,7 @@ set -e function print_version() { - echo "Adafruit PiTFT Helper v0.7.0" + echo "Adafruit PiTFT Helper v0.7.1" exit 1 }