PiRogueToolSuite / pirogue-admin

PiRogue administration agent
0 stars 0 forks source link

Extend configure_isolated_interface to support more network stacks #8

Open CyrilBrulebois opened 3 weeks ago

CyrilBrulebois commented 3 weeks ago

At the moment, we only support IFUPDOWN and NETWORKD_RESOLVED, we'll want to support more use cases so that the APPLIANCE mode can be used with a Debian system set up with other network stacks (e.g. NetworkManager).

See also https://github.com/PiRogueToolSuite/pirogue-admin/issues/7 regarding reverting such modifications.

CyrilBrulebois commented 2 weeks ago

The current plan is to wait for the upcoming point release (12.7, planned tomorrow) to get fresh images, and use “debian-installer test laptops” as generic machines.

CyrilBrulebois commented 1 week ago

First things first: netinst, no desktop, therefore ifupdown is broken: the detection fails, and we end up with NetworkStack.UNKNOWN.

In this scenario, we have everything configured via /etc/network/interfaces directly, as opposed to using snippets (one per interface) under /etc/network/interfaces.d/ as that is the case with Debian/PTS images.

In passing, if we end up making it possible to toggle between interfaces, we might have some interfaces configured via snippets, some others via /etc/network/interfaces itself.

Edit: In any case, the code isn't/wasn't crazy: it relies on the output of ifquery --list --all which for some reasons only returns lo… But then we encounter an annoying issue, the auto vs. allow-hotplug duality. --all only operates on auto interfaces, while D-I configures ifupdown with allow-hotplug ones.

Proposed change: Run ifquery --list --all once for auto interfaces, and ifquery --list --allow hotplug once for allow-hotplug interfaces. At least in Debian 12, both can't be combined, otherwise only allow-hotplug interfaces are returned.

CyrilBrulebois commented 1 week ago

Marking with in-progress as I think I'm all done: we have a successful configuration with:

Most desktop environments use NetworkManager (newly-supported). Text-only uses ifupdown (already supported before those changes). Exceptions are LXDE and LQXt, which use connman. I haven't investigated integrating with that one, as ifupdown is installed as well, and can be configured as usual. If we get complaints about the lack of integration of isolated interface management into connman, we can always recommend against those two desktop environments…

This can be closed once tests have been documented in a dedicated page.