machines: back: switch ConnectX-3 ports to ethernet mode on boot

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2024-01-27 18:14:46 +01:00
parent fe5310c72f
commit b98a8e47e2
Signed by: c8h4
GPG key ID: 6817E9C75C0785D7

View file

@ -69,4 +69,14 @@
};
services.openssh.settings.AllowUsers = [ "backup" ];
systemd.services.switch-mlx4-ports-to-eth = {
serviceConfig.Type = "oneshot";
description = "switch Mellanox ConnectX-3 Pro ports to ethernet mode";
script = ''
echo eth >/sys/bus/pci/devices/0000\:04\:00.0/mlx4_port1
echo eth >/sys/bus/pci/devices/0000\:04\:00.0/mlx4_port2
'';
wantedBy = [ "multi-user.target" ];
};
}