Installation
The BMDE can be installed in several ways. They differ in what your computer needs and in how you work with your projects, but all of them use the same components (devkitARM, DeSmuME, Insight...), installed in your computer or run from their Docker images.
| Method | Your computer needs | In your projects you use | Features of bmde¹ |
|---|---|---|---|
| 1. The bmde CLI (recommended) | Python, and Docker or the host components | bmde build, bmde run, ... |
✅ |
| 2. Host components | Ubuntu / Debian | make, make run, make debug, git |
❌ |
| 3. Development environment in Docker | Docker | a shell with make, git, ... |
❌ |
| 4. The bmde CLI in Docker | Docker | bmde build, bmde run, ... |
✅ |
| 5. Makefile with Docker | Docker | make, make run, make debug |
❌ |
6. From the sources (developers of bmde) |
Python, git and make | bmde, from your copy of the code |
✅ |
¹ Choosing the backend of each command, git without typing passwords (and connected to the VPN of the URV when needed), the debugger connected to the emulator automatically, FAT images, controls of the course...
The prerequisites explain how to install Python, Docker and the rest of the requirements.
1. The bmde CLI
The recommended method: the bmde command in your computer, which runs each component with the backend you choose,
in Docker or installed in your computer, so you can mix and match them.
- Install Python 3.11 or newer and pipx (prerequisites).
- Install
bmde: - Install the components that its commands need, in any of the ways to install a component:
- Check which backends each command can use (and choose them if you want):
- To use git with the server of the course, write your credentials of the VPN and of the git server in
~/.config/bmde/bmde.toml(never in a repository), in the sections[git.git],[git.ssh]and[git.vpn](see git and configuration): On Linux, the VPN may also need theppp_asynckernel module loaded on the host (sudo modprobe ppp_async, andecho ppp_async | sudo tee /etc/modules-load.d/ppp.confto load it on every boot, see git). - Use it in your projects:
Update it with pipx upgrade bmde.
2. Host components
The components installed in your computer, without bmde: the same environment as the Windows BMDE, but in Linux, so
you can follow the original documentation of the course with its Makefiles. There are no features of bmde: the
connection to the VPN, git and the debugger are done by hand.
- Install the components in your computer with
scripts/install.sh, as explained in host components: - Open a new session, so the environment of the components is loaded.
- Use the Makefile of your project, as in the Windows BMDE:
- To use the git server of the course from outside the URV, connect to the VPN with
connect_vpn.sh, as your user (it usessudoitself, only for openfortivpn). It takes your credentials from the variablesVPN_USERNAME,VPN_PASSWORD(orVPN_PASSWORD_FILE, a file with it),VPN_HOST,VPN_PORT,VPN_REALMandVPN_CERT, waits until the VPN works and stays connected until you stop it (Ctrl+C), so run it in another terminal. Then use git as usual;vpn_healthcheck.sh -vtells whether the VPN still works:
3. Development environment in Docker
A shell inside the full development environment of the BMDE (aleixmt/bmde-full), with every component and the git
and VPN helpers: your computer only needs Docker. Inside it, work as in the
host components method.
- Install Docker (prerequisites).
- From the root of your project, open a shell in the image (the first time, it downloads about 3 GB):
The project is mounted in a folder with its name, because the Makefiles of the course name the ROM after it. Your user in the image is
docker run --rm -it -e MODE=host -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \ -v "$PWD:/home/bmde/$(basename "$PWD")" -w "/home/bmde/$(basename "$PWD")" aleixmt/bmde-full:latestbmde, with UID 1000 (the one of the first user of Linux): with another UID, the files of the build are not yours. If the windows of DeSmuME and Insight do not open, allow the user of the image withxhost +SI:localuser:$(id -un). - Use it as in a host:
make,make run,make debug,git... To connect to the VPN, runconnect_vpn.sh &, which takes your credentials from/run/secrets(see below).
To avoid typing all of that, copy examples/shell/compose.yml
to the root of your project. It also brings the sound of DeSmuME, the VPN, your credentials (as Docker secrets, from
~/.config/bmde/secrets, see the comments of the file) and keeps the settings of DeSmuME and VS Code between runs:
mkdir -p ~/.config/bmde/secrets # your credentials, one file each (see compose.yml)
export PROJECT="$(basename "$PWD")" # the name of the ROM (project.nds otherwise)
docker compose run --rm shell # a shell
docker compose run --rm shell make # or one command
To add tools to the environment, copy also examples/shell/Dockerfile,
which extends aleixmt/bmde-full, add your packages to it, and replace image: by build: . in compose.yml.
With VS Code, the dev container opens the same environment from the editor.
4. The bmde CLI in Docker
The same as the bmde CLI, for computers with Docker but without Python: bmde runs in its own
image (aleixmt/bmde), which runs the images of the components with the Docker of your computer (and also has every
component, for the host backend). It needs Linux (or WSL 2), because the image mounts the Docker, the X server and
the sound of your computer.
- Install Docker (prerequisites).
- Download
compose.cli.yml, which runsbmdein its image with everything it needs, and create the folder of yourbmde.toml(even if you do not have one): - Add these lines to your
~/.bashrcand open a new terminal: your user and the group of Docker, which the container needs, and abmdecommand that runs it: - Use it as the bmde CLI, from step 4:
bmde check,bmde build,bmde run... It reads your~/.config/bmde/bmde.tomland thebmde.tomlof the project.
BMDE_TAG=1.15.0 pins a version of bmde and of the images it runs. Without compose, the same is:
docker run --rm -it --init --user "$(id -u):$(id -g)" --group-add "$(stat -c %g /var/run/docker.sock)" \
-v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:$PWD" -w "$PWD" \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" -e XDG_RUNTIME_DIR \
-v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY -e XAUTHORITY \
-v "$HOME/.config/bmde:/config/bmde:ro" \
aleixmt/bmde:latest build
The project, the runtime directory of your user and the X server are mounted at the same paths as in your computer
because the Docker of your computer, which runs the images of the components, looks for the paths that bmde gives it
in your computer, not in the container.
5. Makefile with Docker
The Makefile of your project runs each target in the Docker image of its component, so you work as in the
host components method (make, make run, make debug) with only Docker in your computer.
There are no features of bmde, and git and the VPN are not included: use the ones of your computer, or another
method for them.
- Install Docker (prerequisites).
- Replace the Makefile of your project by one of these, adaptations of the Makefile of the course
(
examples/Makefile):examples/makefile-docker/Makefile: runs the images withdocker run.examples/makefile-compose/Makefile, withcompose.ymlnext to it: runs the services ofcompose.yml, which you can edit (e.g. to extend an image with a Dockerfile, as explained in its comments).
- Use it:
Inside the containers (DOCKER_FLAG, which the Makefile passes to them), and wherever the components are installed
(DEVKITARM is set, e.g. with the host components or in the shell of the
development environment in Docker), these Makefiles are the Makefile of the
course as is, so they work in every method. BMDE_TAG=1.15.0 make pins the version of the images.
6. From the sources (developers)
For the developers of bmde: the bmde command runs the code of your copy of the repository, so your changes are
used right away. The development installation explains it:
git clone --recurse-submodules https://github.com/URV-teacher/bmde
cd bmde
make dev # venv/ with bmde in editable mode, and the tools of development
venv/bin/bmde --help
To have that bmde in your PATH (e.g. to try your changes in your NDS projects), install the copy in editable mode
with pipx: pipx install --editable .. It follows the branch that is checked out. The components are installed as in
the other methods (e.g. Docker, or scripts/install.sh), and docker buildx bake builds their images from
components/ (images).