egzumer / uv-k5-firmware-custom

A merge between https://github.com/OneOfEleven/uv-k5-firmware-custom and https://github.com/fagci/uv-k5-firmware-fagci-mod
Apache License 2.0
1.09k stars 337 forks source link

Restructure Repository for faster building/development #532

Open Akira25 opened 3 months ago

Akira25 commented 3 months ago

In the last weeks I worked with this repository and used the included Dockerfile and the container built from it as compiler.

The dockerfile builds an archlinux-container with an arm-none-eabi-gcc included and copies the repository into the container, before it starts building within it.

I have two minor issues with this:

Proposal

Instead of rebuilding the container everytime and copy the repo into it, it feels more straight forward to me, to build the container with the compiler only, once. Then we can mount the source code into it. This has the advantage, that every change is accessible by the compiler in the container immediately.

To realise this, it would be benefitial to restructure the repo. For example, moving the source code into a src/ directory, that can be mounted in the container more easily. In addition, it might increase the readability of the repo, by separating firmware code from helper code, like dockerfiles, scripts etc.

The container size could be reduced by roughly 600 MiB, when running the pacman commands all in the same layer and flushing the cache afterwards.

I have a rather radical PR, which implements all proposed changes, at hand. If you are okay with the proposal, I can hand it in as a draft request.