From a7b01857f55ebab1aabb28dc81f98f859f018923 Mon Sep 17 00:00:00 2001 From: Lasse Dalegaard Date: Mon, 31 Jan 2022 08:48:04 +0100 Subject: 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 --- src/rp2040/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2