Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded solutions support #830

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mobrembski
Copy link

I like this project, and i wanted to use it in open source embedded router firmware FreshTomato.
What was very surprise for me, it works very well with just a few little changes:

  1. Added customization at compile time of path to resolv.conf. Don't hardcode it. In embedded systems /etc directory is sometimes placed on read-only flash partiton, which lead application to fail with modification.
  2. Surround AC_CHECK_FILES with testing if we're under cross-build. Autotools doesn't support AC_CHECK_FILES in such case. i propose to fall-back to default configuration in that cases.
  3. Add borrowed from Samba project libreplace ifaddrs.c, for embedded replacement of getifaddrs and freeifaddrs. My project doesn't have ifaddrs, but this replacement works very well.

Any comments are welcome.

@mobrembski
Copy link
Author

Now good question is how i should deal with coding style for ifaddrs.c?
It's borrowed component, i could fix it but then any update from upstream would be painful.

@DimitriPapadopoulos
Copy link
Collaborator

Now good question is how i should deal with coding style for ifaddrs.c?

Just skip the file when testing, see run.sh.

Copy link
Author

@mobrembski mobrembski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good :) done :)

configure.ac Show resolved Hide resolved
When cross-compiling, AC_CHECK_FILE macro is not supported by autotools.
Falling back to default in that case.
@mobrembski mobrembski force-pushed the embedded_solutions_support branch 2 times, most recently from ebb302e to 69aef13 Compare February 24, 2021 21:45
@mobrembski
Copy link
Author

It seems that somehow GitHub actions is pulling old tests/lint/run.sh.
Style check fails on ifaddrs.c file, which is (and should be) ignored.
I've added an rule but github actions is still using old one.

@DimitriPapadopoulos
Copy link
Collaborator

Ah, after changing from Travis CI to GitHub Actions, we do not use tests/lint/run.sh any more, see .github/workflows/openfortivpn.yml.

Thinking about it, it's a confusing regression: manual checks and GitHub Actions are triggerred differently. On the other hand we get better reports from GitHub Actions.

In case if system doesn't provide above functions, don't fail and use
Samba project libreplace implementation.
This allows to run app on embedded systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants