-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add ffbs-debugbathosts #129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like this package to have a way to be set from the site.conf and overwrite this file in the upgrade process?
Very nice, i did not kbow about this behaviour before :)
We have thought about a way to fill in the file during build process with information from e.g. meshviewer / yannic. |
It would also be possible to have a small script which you call as: That way, the site.conf config is not spoiled with many entries, and this package is a little mor useful than only being a placeholder :) |
Would love to have an automatic feature to populate /etc/bat-hosts (symlinked from /tmp/bat-hosts, to avoid flash writes). This would make debugging issues so much easier! Another, additional idea would be to populate at least from direct neighbors (via respondd?) as a solution that would work offline as well. (As is, I don't see much value, it's something that is already documented in the batctl README. But of course wouldn't break anything either, so no reason to not merge this PR as is in the community repository.) PS: spelling: contian -> contain |
I just created a small script which does about this: https://gist.github.com/maurerle/3586f2b8d825a69df0f523f60b731efa One can install it using:
One can then call it using you communities nodes.json: Though this takes quite a few seconds on router cpus but is decent on x86. Few notes:
This is available under MIT license and can be integrated into this package if wanted :) Update: I gave the script an option to show only the gateways int bat-hosts at least. |
67798f0
to
1b193f9
Compare
This package provides means to map MAC addresses to names for `batctl`. This is done with two components: * `/etc/bat-hosts` is a mapping file consumed by `batctl`. It is delivered empty and only contains help for the user. It is mostly intended as a reminder that this functions exists at all. * `update-bat-hosts` is a lua-script that loads a `nodes.json` from a given URL and populates `/etc/bat-hosts` with the nodes found. The script `update-bat-hosts` is only intended to be run by an experienced user by hand to ease debugging. The result is directly written into to `/etc/` and thus, usually, into flash memory. The number of write/erase cycles caused by this should be negligible.
1b193f9
to
db60e8f
Compare
@maurerle your first review comments came in before my CI/CT had time for a turnaround :-D I've integrated your script. Thanks for sharing! I have changed a few details:
|
Fixed. |
I've also thought about having the file populated at compile time. I would not favor such solution since it would make the build less reproducible: A changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, I'm a bit late to the party, but I have some minor suggestions.
@@ -0,0 +1,95 @@ | |||
#!/usr/bin/lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to have this in ffbs-debugbathosts/luasrc
instead of ffbs-debugbathosts/files
so that the Lua compressor can reduce the size of the script.
local url = arg[1] | ||
|
||
local gateway_only = false | ||
if #arg == 2 and arg[2] == '--gw' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to rename this to --gw-only
. If I see the parameter --gw
I would think it includes gws 🙂
Thanks for the feedback. I'll pack those changes into a new PR in a few days. |
This package provides
/etc/bat-hosts
.his file can be used to map mac-addresses to names in
batctl
.This file is empty by default and mainly serves as a reminder on how this can be used on the devices itself.