aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLasse Dalegaard <dalegaard@gmail.com>2022-01-31 08:48:04 +0100
committerKevinOConnor <kevin@koconnor.net>2022-01-31 11:10:02 -0500
commita7b01857f55ebab1aabb28dc81f98f859f018923 (patch)
treeedee081ce462d953baca8600004848da0830a0ad /src
parent15ffa859540cd051bc06c2e333ed5c93994aa10b (diff)
downloadkutter-a7b01857f55ebab1aabb28dc81f98f859f018923.tar.gz
kutter-a7b01857f55ebab1aabb28dc81f98f859f018923.tar.xz
kutter-a7b01857f55ebab1aabb28dc81f98f859f018923.zip
flash_usb: use sudo for rp2040 flashing
The rp2040 can be flashed without sudo when using udev rules to give the user permission, but in a standard configuration sudo is required. Here we make it possible for flash_usb to use sudo for the rp2040 target, and make it the default when using `make flash` for the rp2040. As for other targets, one can set `NOSUDO=1` to not call through sudo. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/rp2040/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile
index fbeccb97..f15302d1 100644
--- a/src/rp2040/Makefile
+++ b/src/rp2040/Makefile
@@ -51,4 +51,4 @@ lib/rp2040_flash/rp2040_flash:
# Flash rules
flash: $(OUT)klipper.uf2 lib/rp2040_flash/rp2040_flash
@echo " Flashing $< to $(FLASH_DEVICE)"
- $(Q)$(PYTHON) ./scripts/flash_usb.py -t $(CONFIG_MCU) -d "$(FLASH_DEVICE)" $(OUT)klipper.uf2
+ $(Q)$(PYTHON) ./scripts/flash_usb.py -t $(CONFIG_MCU) -d "$(FLASH_DEVICE)" $(if $(NOSUDO),--no-sudo) $(OUT)klipper.uf2