Skip to content

Check if certain sections are still required in bootstrap #301

Description

@jweisz

It's unclear if we still need to do these operations in bootstrap.

  1. Don't install on armv6l? I'm not even sure where this came from 🤷
#----don't install on an armv6l, it's not supported
CPUARCH=$(lscpu | grep Arch | cut -d':' -f2 | awk '{$1=$1};1')
if [ "$CPUARCH" = 'armv6l' ];
   then
      echo "ARMv6 is not supported for TJBot due to software availability on this processor architecture. Please use another Raspberry Pi model."
      exit 1
else
   echo "$CPUARCH processor architecture supported. Proceeding with setup."
fi
  1. This is a very old version of Raspian. At this point we might want to bump the minimum version to bookworm (12).
#----raspian versions older than jessie (8) won't work
RASPBIAN_VERSION_ID=$(cat /etc/os-release | grep VERSION_ID | cut -d '"' -f 2)
if [ "$RASPBIAN_VERSION_ID" -lt 8 ]; then
  1. Do we need to install these additional packages? These might all be present in a vanilla install of Raspian at this point.
#----install additional packages
echo ""
echo "Installing additional software packages [apt-get install libasound2-dev libportaudio0 libportaudio2 libportaudiocpp0 porta
udio19-dev]"
apt-get install -y libasound2-dev libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
  1. Is all of this necessary anymore to enable the Pi camera? Also, is it specific to RPi 3/4 or does it need to be done on an RPi 5?
#----enable camera on raspbery pi
echo ""
echo "If your Raspberry Pi has a camera installed, TJBot can use it to see."
read -r -p "Enable camera? [y/N] " choice </dev/tty
case "$choice" in
    "y" | "Y")
        if grep "start_x=1" /boot/config.txt
        then
            echo "Camera is already enabled."
        else
            echo "Enabling camera."
            if grep "start_x=0" /boot/config.txt
            then
                sed -i "s/start_x=0/start_x=1/g" /boot/config.txt
            else
                echo "start_x=1" | tee -a /boot/config.txt >/dev/null 2>&1
            fi
            if grep "gpu_mem=128" /boot/config.txt
            then
                :
            else
                echo "gpu_mem=128" | tee -a /boot/config.txt >/dev/null 2>&1
            fi
        fi
        ;;
    *) ;;
esac

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions