summaryrefslogtreecommitdiff
path: root/util/freebsd_install.sh
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-05-20 11:09:13 -0400
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit5aa3747ec157e37e4529bf9a7cf578319a96bede (patch)
tree2ca1e97ceb92251d1d6a76e5b8f888e47a8a7cd1 /util/freebsd_install.sh
parentb86d1cad9eca5ac6fb5436141979f6e5db4785ba (diff)
CLI: Improve experience when running `qmk setup` on FreeBSD. (#8798)
* CLI: Improve experience when running `qmk setup` on FreeBSD. * Install the `avrdude` package as well. * Switch to installing python packages w/ `--user` flag. * Basic getting started sections for FreeBSD. * Update `util/freebsd_install.sh` for root/non-root branches. * Add ID to doc section. Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com> * Add ID to another docs section. Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com> * Use `; then` in script for consistency. Co-Authored-By: skullydazed <skullydazed@users.noreply.github.com> * Updated to use sudo in one shot if available. * Apply suggestions from code review Co-authored-by: Erovia <Erovia@users.noreply.github.com> * Style fixes for latest version in master. * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: skullydazed <skullydazed@users.noreply.github.com> Co-authored-by: Erovia <Erovia@users.noreply.github.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'util/freebsd_install.sh')
-rwxr-xr-xutil/freebsd_install.sh26
1 files changed, 22 insertions, 4 deletions
diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh
index 8157592031..09669024cc 100755
--- a/util/freebsd_install.sh
+++ b/util/freebsd_install.sh
@@ -1,7 +1,5 @@
#!/bin/sh
-util_dir=$(dirname "$0")
-pkg update
-pkg install -y \
+packages=$(cat <<EOF
git \
wget \
gmake \
@@ -13,9 +11,29 @@ pkg install -y \
avr-libc \
dfu-programmer \
dfu-util \
+ avrdude \
arm-none-eabi-gcc \
arm-none-eabi-binutils \
arm-none-eabi-newlib \
diffutils \
python3
-pip3 install -r ${util_dir}/../requirements.txt
+EOF
+)
+util_dir=$(dirname "$0")
+if [ $(id -u) = 0 ]; then
+ pkg update
+ pkg install -y ${packages}
+ echo ""
+ echo "Re-run the setup as your normal user to install the qmk python dependencies"
+ exit 1
+else
+ if command -v sudo > /dev/null 2>&1; then
+ sudo pkg update
+ sudp pkg install -y ${packages}
+ else
+ echo "Make sure you run setup as root first to install base OS dependencies..."
+ echo ""
+ fi
+
+ python3 -m pip install --user -r ${util_dir}/../requirements.txt
+fi