-
Notifications
You must be signed in to change notification settings - Fork 3
Add Serial Number to Avahi Service for Board Deduplication #48
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
base: main
Are you sure you want to change the base?
Conversation
lucarin91
left a comment
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 didn't figure out that we needed to add another sudoers file for this feature, which I would avoid to do it. So I think we should change the approach here, and we could instead do that in a systemd unit that is triggered only on the first boot, e.g., https://github.com/arduino/arduino-app-cli/blob/main/debian/arduino-app-cli/etc/systemd/system/arduino-burn-bootloader.service.
The Serial number of the board should not change, so we can do it just the first time you flash the board, and in there, you have all the permission to patch the Avahi service.
How to test it
|
debian/arduino-app-cli/etc/systemd/system/arduino-avahi-serial.service
Outdated
Show resolved
Hide resolved
lucarin91
left a comment
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 also add the disable command in postrm as for the other services
lucarin91
left a comment
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.
LGTM, I would improve a little bit the schell script
debian/arduino-app-cli/etc/systemd/system/arduino-avahi-serial.service
Outdated
Show resolved
Hide resolved
9723d4b to
ba934d4
Compare
lucarin91
left a comment
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.
@mirkoCrobu I think you need to update rebase main, I see changes not related to this PR
|
@lucarin91 I had to change a commit author already includedd in main to pass license/cla. |
ba934d4 to
c1eb54f
Compare
lucarin91
left a comment
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 think it is safe to always return errors
Motivation
A board connected via both USB and Network currently shows up as two separate devices in the board list. This makes it difficult for a client application to know it is the same physical board.
We need a way to "deduplicate" these entries by providing a common identifier, allowing the client to show just one entry for that board.
Change description
A simple approach is to add the board's serial number to its Avahi service file. This change will be made at runtime when the EnableNetworkMode function is executed.
Specifically, we will add a new containing the serial number (e.g., serial_number=YOUR_SERIAL) to the board's .service file.
Additional Notes
Reviewer checklist
main.