aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/docker_build.sh2
-rwxr-xr-xutil/freebsd_install.sh2
-rwxr-xr-xutil/linux_install.sh9
-rwxr-xr-xutil/macos_install.sh3
-rwxr-xr-xutil/msys2_install.sh3
-rwxr-xr-xutil/new_keyboard.sh13
-rwxr-xr-xutil/travis_build.sh2
-rwxr-xr-xutil/travis_compiled_push.sh3
-rw-r--r--util/travis_test.sh2
-rw-r--r--util/vagrant/Dockerfile33
-rw-r--r--util/vagrant/readme.md12
-rwxr-xr-xutil/wsl_install.sh5
12 files changed, 81 insertions, 8 deletions
diff --git a/util/docker_build.sh b/util/docker_build.sh
index c573ebcae..6feeb1f5d 100755
--- a/util/docker_build.sh
+++ b/util/docker_build.sh
@@ -46,5 +46,5 @@ fi
dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows
# Run container and build firmware
-docker run --rm -it $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \
+docker run --rm -it $usb_args -w /qmk_firmware/ -v "$dir":/qmk_firmware qmkfm/base_container \
make "$keyboard${keymap:+:$keymap}${target:+:$target}"
diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh
index c8696e8cc..815759203 100755
--- a/util/freebsd_install.sh
+++ b/util/freebsd_install.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+util_dir=$(dirname "$0")
pkg update
pkg install -y \
git \
@@ -17,3 +18,4 @@ pkg install -y \
arm-none-eabi-newlib \
diffutils \
python3
+pip3 install -r ${util_dir}/../requirements.txt
diff --git a/util/linux_install.sh b/util/linux_install.sh
index efb2ee774..d21cd3c1c 100755
--- a/util/linux_install.sh
+++ b/util/linux_install.sh
@@ -2,12 +2,14 @@
# Note: This file uses tabs to indent. Please don't mix tabs and spaces.
-GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki."
+GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmkfirmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki."
SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured."
SOLUS_INFO="Your tools are now installed. To start using them, open new terminal or source these scripts:\n\t/usr/share/defaults/etc/profile.d/50-arm-toolchain-path.sh\n\t/usr/share/defaults/etc/profile.d/50-avr-toolchain-path.sh"
+util_dir=$(dirname "$0")
+
if grep ID /etc/os-release | grep -qE "fedora"; then
sudo dnf install \
arm-none-eabi-binutils-cs \
@@ -118,7 +120,7 @@ elif grep ID /etc/os-release | grep -q sabayon; then
elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then
CROSS_AVR_GCC=cross-avr-gcc8
CROSS_ARM_GCC=cross-arm-none-gcc8
- if grep ID /etc/os-release | grep -q "15.0"; then
+ if grep ID /etc/os-release | grep -q "15."; then
CROSS_AVR_GCC=cross-avr-gcc7
CROSS_ARM_GCC=cross-arm-none-gcc7
fi
@@ -183,3 +185,6 @@ else
echo
echo "https://docs.qmk.fm/#/contributing"
fi
+
+# Global install tasks
+pip3 install -r ${util_dir}/../requirements.txt
diff --git a/util/macos_install.sh b/util/macos_install.sh
index 915ff3143..f7e304424 100755
--- a/util/macos_install.sh
+++ b/util/macos_install.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+util_dir=$(dirname "$0")
+
if ! brew --version 2>&1 > /dev/null; then
echo "Error! Homebrew not installed or broken!"
echo -n "Would you like to install homebrew now? [y/n] "
@@ -24,3 +26,4 @@ brew tap PX4/homebrew-px4
brew update
brew install avr-gcc@8 gcc-arm-none-eabi dfu-programmer avrdude dfu-util python3
brew link --force avr-gcc@8
+pip3 install -r ${util_dir}/../requirements.txt
diff --git a/util/msys2_install.sh b/util/msys2_install.sh
index bcb628ab2..bed176da6 100755
--- a/util/msys2_install.sh
+++ b/util/msys2_install.sh
@@ -5,6 +5,7 @@ download_dir=~/qmk_utils
avrtools=avr8-gnu-toolchain
armtools=gcc-arm-none-eabi
installflip=false
+util_dir=$(dirname "$0")
echo "Installing dependencies needed for the installation (quazip)"
pacman --needed -S base-devel mingw-w64-x86_64-toolchain msys/git msys/p7zip msys/python3 msys/unzip
@@ -92,6 +93,8 @@ else
fi
popd
+pip3 install -r ${util_dir}/../requirements.txt
+
cp -f "$dir/activate_msys2.sh" "$download_dir/"
if grep "^source ~/qmk_utils/activate_msys2.sh$" ~/.bashrc
diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh
index e9ce30978..35d89e402 100755
--- a/util/new_keyboard.sh
+++ b/util/new_keyboard.sh
@@ -70,6 +70,18 @@ replace_placeholders() {
echo " done"
}
+# Replace %YEAR% with the current year.
+replace_year_placeholders() {
+ local replace_year_filenames=(
+ "${keyboard_dir}/config.h"
+ "${keyboard_dir}/${keyboard_name}.c"
+ "${keyboard_dir}/${keyboard_name}.h"
+ "${keyboard_dir}/keymaps/default/config.h"
+ "${keyboard_dir}/keymaps/default/keymap.c"
+ )
+ replace_placeholders "%YEAR%" "$(date +%Y)" "${replace_year_filenames[@]}"
+}
+
# Replace %KEYBOARD% with the keyboard name.
replace_keyboard_placeholders() {
local replace_keyboard_filenames=(
@@ -149,6 +161,7 @@ echo
copy_templates
set_sed_i
+replace_year_placeholders
replace_keyboard_placeholders
[ -n "$username" ] && replace_name_placeholders
diff --git a/util/travis_build.sh b/util/travis_build.sh
index 554ec8b68..fd5511a72 100755
--- a/util/travis_build.sh
+++ b/util/travis_build.sh
@@ -3,7 +3,7 @@
# if docker is installed - call make within the qmk docker image
if command -v docker >/dev/null; then
function make() {
- docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/qmk_firmware make "$@"
+ docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
}
fi
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index 25ed83fb0..04021ae7c 100755
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -29,8 +29,7 @@ NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/
if [[ $NEFM -gt 0 ]] ; then
echo "Essential files modified."
git fetch --tags
- #lasttag=$(git describe --tags $(git rev-list --tags --max-count=10) | grep -Ev '\-' | xargs -I@ git log --format=format:"%ai @%n" -1 @ | sort -V | awk '{print $4}' | tail -1)
- lasttag=$(git describe --tags $(git rev-list --tags --max-count=10) | grep -Ev '\-' | sort -V | tail -1)
+ lasttag=$(git tag --sort=-creatordate --no-column --list '*.*.*' | grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$')
newtag=$(increment_version $lasttag)
until git tag $newtag; do
newtag=$(increment_version $newtag)
diff --git a/util/travis_test.sh b/util/travis_test.sh
index 3be4afff7..e6a50ac16 100644
--- a/util/travis_test.sh
+++ b/util/travis_test.sh
@@ -22,7 +22,7 @@ fi
# if docker is installed - call make within the qmk docker image
if command -v docker >/dev/null; then
function make() {
- docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/qmk_firmware make "$@"
+ docker run --rm -e MAKEFLAGS="$MAKEFLAGS" -w /qmk_firmware/ -v "$PWD":/qmk_firmware --user $(id -u):$(id -g) qmkfm/base_container make "$@"
}
fi
diff --git a/util/vagrant/Dockerfile b/util/vagrant/Dockerfile
new file mode 100644
index 000000000..1936ee023
--- /dev/null
+++ b/util/vagrant/Dockerfile
@@ -0,0 +1,33 @@
+FROM qmkfm/base_container
+
+# Basic upgrades; install sudo and SSH.
+RUN apt-get update && apt-get install --no-install-recommends -y \
+ sudo \
+ openssh-server \
+ && rm -rf /var/lib/apt/lists/*
+RUN mkdir /var/run/sshd
+RUN sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
+RUN echo 'UseDNS no' >> /etc/ssh/sshd_config
+
+# Remove the policy file once we're finished installing software.
+# This allows invoke-rc.d and friends to work as expected.
+RUN rm /usr/sbin/policy-rc.d
+
+# Add the Vagrant user and necessary passwords.
+RUN groupadd vagrant
+RUN useradd -c "Vagrant" -g vagrant -d /home/vagrant -m -s /bin/bash vagrant
+RUN echo 'root:vagrant' | chpasswd
+RUN echo 'vagrant:vagrant' | chpasswd
+
+# Allow the vagrant user to use sudo without a password.
+RUN echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant
+
+# Install Vagrant's insecure public key so provisioning and 'vagrant ssh' work.
+RUN mkdir /home/vagrant/.ssh
+ADD https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub /home/vagrant/.ssh/authorized_keys
+RUN chmod 0600 /home/vagrant/.ssh/authorized_keys
+RUN chown -R vagrant:vagrant /home/vagrant/.ssh
+RUN chmod 0700 /home/vagrant/.ssh
+
+EXPOSE 22
+CMD ["/usr/sbin/sshd", "-D"]
diff --git a/util/vagrant/readme.md b/util/vagrant/readme.md
new file mode 100644
index 000000000..e4b870a64
--- /dev/null
+++ b/util/vagrant/readme.md
@@ -0,0 +1,12 @@
+# QMK Vagrant Utilities
+
+## Dockerfile
+Vagrant-friendly `qmkfm/base_container`.
+
+In order for the Docker provider and `vagrant ssh` to function the container has a few extra requirements.
+
+* vagrant user
+* ssh server
+ * configured with expected public key
+* sudo
+ * passwordless for vagrant user
diff --git a/util/wsl_install.sh b/util/wsl_install.sh
index c2c206d2b..197d9f089 100755
--- a/util/wsl_install.sh
+++ b/util/wsl_install.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
+util_dir=$(dirname "$0")
+dir=$(cd -P -- "$util_dir" && pwd -P)
pushd "$dir";
if [[ $dir != /mnt/* ]];
@@ -28,6 +29,8 @@ download_dir=wsl_downloaded
source "$dir/win_shared_install.sh"
+pip3 install -r ${util_dir}/../requirements.txt
+
pushd "$download_dir"
while true; do
echo