summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/docker_build.sh2
-rwxr-xr-xutil/docker_cmd.sh2
-rwxr-xr-xutil/uf2conv.py44
-rw-r--r--util/uf2families.json19
-rw-r--r--util/vagrant/Dockerfile33
-rw-r--r--util/vagrant/readme.md12
6 files changed, 44 insertions, 68 deletions
diff --git a/util/docker_build.sh b/util/docker_build.sh
index 8dce387320..828b5751af 100755
--- a/util/docker_build.sh
+++ b/util/docker_build.sh
@@ -81,5 +81,5 @@ fi
81 -e ALT_GET_KEYBOARDS=true \ 81 -e ALT_GET_KEYBOARDS=true \
82 -e SKIP_GIT="$SKIP_GIT" \ 82 -e SKIP_GIT="$SKIP_GIT" \
83 -e MAKEFLAGS="$MAKEFLAGS" \ 83 -e MAKEFLAGS="$MAKEFLAGS" \
84 qmkfm/qmk_cli \ 84 ghcr.io/qmk/qmk_cli \
85 make "$keyboard${keymap:+:$keymap}${target:+:$target}" 85 make "$keyboard${keymap:+:$keymap}${target:+:$target}"
diff --git a/util/docker_cmd.sh b/util/docker_cmd.sh
index a179cef732..4a82890603 100755
--- a/util/docker_cmd.sh
+++ b/util/docker_cmd.sh
@@ -55,5 +55,5 @@ fi
55 $uid_arg \ 55 $uid_arg \
56 -w /qmk_firmware \ 56 -w /qmk_firmware \
57 -v "$dir":/qmk_firmware \ 57 -v "$dir":/qmk_firmware \
58 qmkfm/qmk_cli \ 58 ghcr.io/qmk/qmk_cli \
59 "$@" 59 "$@"
diff --git a/util/uf2conv.py b/util/uf2conv.py
index 7f5645414a..52d3861cba 100755
--- a/util/uf2conv.py
+++ b/util/uf2conv.py
@@ -8,6 +8,7 @@ import os
8import os.path 8import os.path
9import argparse 9import argparse
10import json 10import json
11from time import sleep
11 12
12 13
13UF2_MAGIC_START0 = 0x0A324655 # "UF2\n" 14UF2_MAGIC_START0 = 0x0A324655 # "UF2\n"
@@ -276,23 +277,25 @@ def main():
276 parser = argparse.ArgumentParser(description='Convert to UF2 or flash directly.') 277 parser = argparse.ArgumentParser(description='Convert to UF2 or flash directly.')
277 parser.add_argument('input', metavar='INPUT', type=str, nargs='?', 278 parser.add_argument('input', metavar='INPUT', type=str, nargs='?',
278 help='input file (HEX, BIN or UF2)') 279 help='input file (HEX, BIN or UF2)')
279 parser.add_argument('-b' , '--base', dest='base', type=str, 280 parser.add_argument('-b', '--base', dest='base', type=str,
280 default="0x2000", 281 default="0x2000",
281 help='set base address of application for BIN format (default: 0x2000)') 282 help='set base address of application for BIN format (default: 0x2000)')
282 parser.add_argument('-o' , '--output', metavar="FILE", dest='output', type=str, 283 parser.add_argument('-f', '--family', dest='family', type=str,
284 default="0x0",
285 help='specify familyID - number or name (default: 0x0)')
286 parser.add_argument('-o', '--output', metavar="FILE", dest='output', type=str,
283 help='write output to named file; defaults to "flash.uf2" or "flash.bin" where sensible') 287 help='write output to named file; defaults to "flash.uf2" or "flash.bin" where sensible')
284 parser.add_argument('-d' , '--device', dest="device_path", 288 parser.add_argument('-d', '--device', dest="device_path",
285 help='select a device path to flash') 289 help='select a device path to flash')
286 parser.add_argument('-l' , '--list', action='store_true', 290 parser.add_argument('-l', '--list', action='store_true',
287 help='list connected devices') 291 help='list connected devices')
288 parser.add_argument('-c' , '--convert', action='store_true', 292 parser.add_argument('-c', '--convert', action='store_true',
289 help='do not flash, just convert') 293 help='do not flash, just convert')
290 parser.add_argument('-D' , '--deploy', action='store_true', 294 parser.add_argument('-D', '--deploy', action='store_true',
291 help='just flash, do not convert') 295 help='just flash, do not convert')
292 parser.add_argument('-f' , '--family', dest='family', type=str, 296 parser.add_argument('-w', '--wait', action='store_true',
293 default="0x0", 297 help='wait for device to flash')
294 help='specify familyID - number or name (default: 0x0)') 298 parser.add_argument('-C', '--carray', action='store_true',
295 parser.add_argument('-C' , '--carray', action='store_true',
296 help='convert binary file to a C array, not UF2') 299 help='convert binary file to a C array, not UF2')
297 parser.add_argument('-i', '--info', action='store_true', 300 parser.add_argument('-i', '--info', action='store_true',
298 help='display header information from UF2, do not convert') 301 help='display header information from UF2, do not convert')
@@ -337,20 +340,23 @@ def main():
337 print("Converted to %s, output size: %d, start address: 0x%x" % 340 print("Converted to %s, output size: %d, start address: 0x%x" %
338 (ext, len(outbuf), appstartaddr)) 341 (ext, len(outbuf), appstartaddr))
339 if args.convert or ext != "uf2": 342 if args.convert or ext != "uf2":
340 drives = []
341 if args.output == None: 343 if args.output == None:
342 args.output = "flash." + ext 344 args.output = "flash." + ext
343 else:
344 drives = get_drives()
345
346 if args.output: 345 if args.output:
347 write_file(args.output, outbuf) 346 write_file(args.output, outbuf)
348 else: 347 if ext == "uf2" and not args.convert and not args.info:
348 drives = get_drives()
349 if len(drives) == 0: 349 if len(drives) == 0:
350 error("No drive to deploy.") 350 if args.wait:
351 for d in drives: 351 print("Waiting for drive to deploy...")
352 print("Flashing %s (%s)" % (d, board_id(d))) 352 while len(drives) == 0:
353 write_file(d + "/NEW.UF2", outbuf) 353 sleep(0.1)
354 drives = get_drives()
355 elif not args.output:
356 error("No drive to deploy.")
357 for d in drives:
358 print("Flashing %s (%s)" % (d, board_id(d)))
359 write_file(d + "/NEW.UF2", outbuf)
354 360
355 361
356if __name__ == "__main__": 362if __name__ == "__main__":
diff --git a/util/uf2families.json b/util/uf2families.json
index fafae82a60..c2140fe351 100644
--- a/util/uf2families.json
+++ b/util/uf2families.json
@@ -77,7 +77,7 @@
77 { 77 {
78 "id": "0x57755a57", 78 "id": "0x57755a57",
79 "short_name": "STM32F4", 79 "short_name": "STM32F4",
80 "description": "ST STM32F401" 80 "description": "ST STM32F4xx"
81 }, 81 },
82 { 82 {
83 "id": "0x5a18069b", 83 "id": "0x5a18069b",
@@ -188,5 +188,20 @@
188 "id": "0x9af03e33", 188 "id": "0x9af03e33",
189 "short_name": "GD32VF103", 189 "short_name": "GD32VF103",
190 "description": "GigaDevice GD32VF103" 190 "description": "GigaDevice GD32VF103"
191 },
192 {
193 "id": "0x4f6ace52",
194 "short_name": "CSK4",
195 "description": "LISTENAI CSK300x/400x"
196 },
197 {
198 "id": "0x6e7348a8",
199 "short_name": "CSK6",
200 "description": "LISTENAI CSK60xx"
201 },
202 {
203 "id": "0x11de784a",
204 "short_name": "M0SENSE",
205 "description": "M0SENSE BL702"
191 } 206 }
192] 207] \ No newline at end of file
diff --git a/util/vagrant/Dockerfile b/util/vagrant/Dockerfile
deleted file mode 100644
index 951d4fc40d..0000000000
--- a/util/vagrant/Dockerfile
+++ /dev/null
@@ -1,33 +0,0 @@
1FROM qmkfm/qmk_cli
2
3# Basic upgrades; install sudo and SSH.
4RUN apt-get update && apt-get install --no-install-recommends -y \
5 sudo \
6 openssh-server \
7 && rm -rf /var/lib/apt/lists/*
8RUN mkdir /var/run/sshd
9RUN sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
10RUN echo 'UseDNS no' >> /etc/ssh/sshd_config
11
12# Remove the policy file once we're finished installing software.
13# This allows invoke-rc.d and friends to work as expected.
14RUN rm /usr/sbin/policy-rc.d
15
16# Add the Vagrant user and necessary passwords.
17RUN groupadd vagrant
18RUN useradd -c "Vagrant" -g vagrant -d /home/vagrant -m -s /bin/bash vagrant
19RUN echo 'root:vagrant' | chpasswd
20RUN echo 'vagrant:vagrant' | chpasswd
21
22# Allow the vagrant user to use sudo without a password.
23RUN echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant
24
25# Install Vagrant's insecure public key so provisioning and 'vagrant ssh' work.
26RUN mkdir /home/vagrant/.ssh
27ADD https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub /home/vagrant/.ssh/authorized_keys
28RUN chmod 0600 /home/vagrant/.ssh/authorized_keys
29RUN chown -R vagrant:vagrant /home/vagrant/.ssh
30RUN chmod 0700 /home/vagrant/.ssh
31
32EXPOSE 22
33CMD ["/usr/sbin/sshd", "-D"]
diff --git a/util/vagrant/readme.md b/util/vagrant/readme.md
deleted file mode 100644
index a8396007ee..0000000000
--- a/util/vagrant/readme.md
+++ /dev/null
@@ -1,12 +0,0 @@
1# QMK Vagrant Utilities
2
3## Dockerfile
4Vagrant-friendly `qmkfm/qmk_cli`.
5
6In order for the Docker provider and `vagrant ssh` to function the container has a few extra requirements.
7
8* vagrant user
9* ssh server
10 * configured with expected public key
11* sudo
12 * passwordless for vagrant user