nthdimtech / signet-base

Signet firmware and device interface library
https://www.crowdsupply.com/nth-dimension/signet
GNU General Public License v3.0
15 stars 7 forks source link

Fix old Signet firmware building #50

Closed lundacode closed 3 years ago

lundacode commented 3 years ago

Hi,

I needed quite a few changes to build the old (non-HC) firmware: mostly 'DS_' prefixes to device_state names.

I also needed to add a 'firmware-version' file. Is plain ASCII content correct for this? Is this somehow related to fw_version in mainl443xc.c? And then we also have the SIGNET..._VERSION #defines in signetdev_common.h. It's a bit confusing. Please explain.

Unfortunately I could not test it as I have no old Signet device.

P.S. I've never been in the receiving end of a pull request, but I think it is possible to rebase them without the ugly merge commits. https://github.com/susam/gitpr

nthdimtech commented 3 years ago

Looks good. Sorry for the difficulty, I haven't been building the original Signet firmware regularly. The changes look straighforward but I'll give it a try on one of my devices before merging.

I don't like merge commits either but I think I will still use them for simplicity unless starts causing some real difficulty.

nthdimtech commented 3 years ago

Oh regarding the firmware version stuff. I wanted to make it possible to update the firmware version from a single place but never worked it all out. I need to take a look back at that code but the idea was that a single file would determine what firmware version the firmware file reported and the device reported interactively to the client during startup. It's still two systems but I think there is a pathway to combining them, probably by having a generated header file. I consider this a low priority issue since I only intend to make new original Signet firmware for bug fixes or security issues.

lundacode commented 3 years ago

Added one more commit, to fix the remaining build issues. With this both firmwares and all tools compile. Also it does not need sudo and env settings.

I've tested them on different PCs (ubuntu18/i7, ubuntu20/i5, and debian10/core2-duo) it's pretty cool that they result in identical firmware binaries! You should advertise in your site somewhere that you have reproducible builds, I consider this is an important security feature.

I'll probably try to fix the issue of single source for version number. It will be good to familiarise myself with the code.

Also, if you don't mind, I'll update crosstool-ng to the next stable release, because it does not compile on more modern Linuxes (for a trivial reason: it does not know about bash5)

lundacode commented 3 years ago

Hi, Sorry for the long delay. I think, I've addressed all your concerns.

nthdimtech commented 3 years ago

Apologies on my side too. You have addressed all of my concerns, originally I had wanted to test on an original Signet device before merging but I never seem to find the time so I'll just merge it now.