Open dl1com opened 4 years ago
I've been working on a first version of this. Current state:
create_sysroot.sh
build_scripts
)build_firmware.sh
I do not want to download the whole firmware repo from scratch every time. It takes much time to download and even more time to compile the linux kernel from scratch every time. What is a good way to check whether it is already downloaded? Currently plutosdr-fw download path is fixed and a check whether the dir exists is performed.
Do we want to let the user choose where to create the plutosdr-fw dir?
Kernel patching and changing the buildroot+kernel configuration must be only done once or it will fail. How to check if this has already been done? The current script does not properly handle this.
Please see my comments in your commit https://github.com/HAMNET-Access-Protocol/HNAP4PlutoSDR/commit/05bd6211b5ce5f05ca07e61bf4cb6f6ed419b974
Open questions
I do not want to download the whole firmware repo from scratch every time. It takes much time to download and even more time to compile the linux kernel from scratch every time. What is a good way to check whether it is already downloaded? Currently plutosdr-fw download path is fixed and a check whether the dir exists is performed.
Do we want to let the user choose where to create the plutosdr-fw dir?
I'd propose a fixed directory inside a designated build
directory within the repo.
Kernel patching and changing the buildroot+kernel configuration must be only done once or it will fail. How to check if this has already been done? The current script does not properly handle this.
I'd propose touching a flag file and check if it exists prior to applying the Kernel modifications. This method won't be sufficient for many cases (e.g. changing to a different Tag / Branch in plutosdr-fw), but for our current quasi-static use case (always v0.32), this would be working, I guess.
While setting up CI for the build_standalone_binaries.sh script (https://github.com/HAMNET-Access-Protocol/HNAP4PlutoSDR/compare/develop...workflow), I became aware of something we might want to optimize. Currently, the custom sysroot would be built each time we trigger a build, which increases build time unnecessarily to about 3 minutes. We could reduce it by either caching the custom sysroot folder or downloading an already customized sysroot folder:
[x] Add a folder
build_scripts
where buildscripts for the various artifacts reside. This enables re-usage of the scripts for the end-user as well as for the automated Github actions.[x] Add script
create_sysroot.sh
This script pulls the plutosdr-fw repo with a given Tag or Commit hash from the Analog Devices Github account and alters its content according to our needs (compilation of fftw, libconfig, libfec and liquid-dsp). The result is called custom sysroot. The sysroot gets zipped and uploaded to Github releases to be available end-users and thebuild_binaries.sh
script (see below).[x] Add script
build_standalone_binaries.sh
This script also makes use of the custom sysroot artifact. As it would be to much effort to re-generate the custom sysroot on every build of the binaries (especially for Github actions), the chosen version of the custom sysroot artifact is downloaded from Github releases instead.[x] Add script
build_firmware.sh
This script makes use of the custom sysroot which was created with the script mentioned above. Additionally, it patches and configures the Linux Kernel according to our needs and configures the Linux userspace. Finally, it builds the firmware image calledpluto.frm
.[ ] Update manual.hnap.de accordingly
No actions for the x86 binaries yet (they are already implemented as Github actions in
.github/workflows
)