BusPirate / Bus_Pirate

Community driven firmware and hardware for Bus Pirate version 3 and 4
625 stars 131 forks source link

Add dockerized toolchain support #170

Open matsievskiysv opened 1 year ago

matsievskiysv commented 1 year ago

This PR adds support for dockerized build toolchain, which would allow adding CI/CD to this project.

Notes:

DerekGn commented 1 year ago

@matsievskiysv

I tried to build the v4 firmware using the docker image in this PR. However I am getting an error

From BASH shell

xxxxxxxxxxxxxxxxxxxx MINGW64 /d/Git/Bus_Pirate/Bootloaders/BPv4-bootloader/firmware-v1 (pr-docker)
$ docker run --rm -it -v $PWD:/work buspirate:latest
make: *** No targets specified and no makefile found.  Stop.

From Powershell

D:\Git\Bus_Pirate\Bootloaders\BPv4-bootloader\firmware-v1>docker run --rm -it -v %cd%/work buspirate:latest
make: *** No targets specified and no makefile found.  Stop.

I am running docker on windows. Any ideas?

matsievskiysv commented 1 year ago

You should check that folder got mounted. Issue command

docker run --rm -it -v $PWD:/work --entrypoint bash buspirate:latest

This will take you to the shell inside the container. Check that firmware files are present in /work folder.

DerekGn commented 1 year ago

Its empty

$ docker run --rm -it -v $PWD:/work --entrypoint bash buspirate:latest root@8c2156db0d15:/work# ls root@8c2156db0d15:/work#

matsievskiysv commented 1 year ago

You could double-check that $PWD points to the right folder

ls $PWD

If it does, then the docker installation is messed up. I actually don't know if windows docker supports folder mounts.

DerekGn commented 1 year ago

It seems to be OK

root@8c2156db0d15:/work# ls $PWD
root@8c2156db0d15:/work# ls $PWD
root@8c2156db0d15:/work#

It was probably a stretch trying to get this to work on windows. I will move over to debian and give it a try. Thanks for the help.

matsievskiysv commented 1 year ago

It seems to be OK

No, I've meant to issue this command from mingw, not from inside the container.

DerekGn commented 1 year ago

Sorry misunderstood

xxxxxxxxx MINGW64 /d/Git/Bus_Pirate/Bootloaders/BPv4-bootloader/firmware-v1 (pr-docker)
$ ls $PWD
boot_config.h  bootloader.c  bootloader.h  bpv4-bootloader.X/  cdc.c  cdc.h  descriptors.h  globals.h  main.c  Makefile  p24FJ256GB106.gld  picusb.h  usb_lang.h  usb_stack.c  usb_stack.h