diff --git a/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/networking.service.d/switchdev-online.conf b/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/networking.service.d/switchdev-online.conf new file mode 100644 index 000000000..4e9b7d40d --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/networking.service.d/switchdev-online.conf @@ -0,0 +1,2 @@ +[Unit] +After=network-pre.target diff --git a/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/switchdev-online@.service b/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/switchdev-online@.service new file mode 100644 index 000000000..1b786ffe0 --- /dev/null +++ b/builds/any/rootfs/stretch/common/overlay/etc/systemd/system/switchdev-online@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Online state for switchdev device %i + +# See e.g. +# https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ +Wants=network-pre.target +Before=network-pre.target + +# this is the naming scheme currently used for network devices +Wants=sys-subsystem-net-devices-%i.device +After=sys-subsystem-net-devices-%i.device + +[Service] +Type=simple +RemainAfterExit=yes +ExecStart=/bin/true +TimeoutStartSec=30 + +[Install] +WantedBy=network.target diff --git a/packages/platforms/accton/arm64/as4224/as4224-52p/platform-config/r0/src/python/arm64_accton_as4224_52p_r0/__init__.py b/packages/platforms/accton/arm64/as4224/as4224-52p/platform-config/r0/src/python/arm64_accton_as4224_52p_r0/__init__.py index 66e56f07c..edb1aaab9 100644 --- a/packages/platforms/accton/arm64/as4224/as4224-52p/platform-config/r0/src/python/arm64_accton_as4224_52p_r0/__init__.py +++ b/packages/platforms/accton/arm64/as4224/as4224-52p/platform-config/r0/src/python/arm64_accton_as4224_52p_r0/__init__.py @@ -52,4 +52,9 @@ def baseconfig(self): self.insmod("prestera_sw.ko") self.insmod("prestera_pci.ko") + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/accton/arm64/as4224/as4224-52t/platform-config/r0/src/python/arm64_accton_as4224_52t_r0/__init__.py b/packages/platforms/accton/arm64/as4224/as4224-52t/platform-config/r0/src/python/arm64_accton_as4224_52t_r0/__init__.py index ac18b3cf7..cb3a11317 100644 --- a/packages/platforms/accton/arm64/as4224/as4224-52t/platform-config/r0/src/python/arm64_accton_as4224_52t_r0/__init__.py +++ b/packages/platforms/accton/arm64/as4224/as4224-52t/platform-config/r0/src/python/arm64_accton_as4224_52t_r0/__init__.py @@ -52,4 +52,9 @@ def baseconfig(self): self.insmod("prestera_sw.ko") self.insmod("prestera_pci.ko") + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/accton/arm64/as4224/as5114-48x/platform-config/r0/src/python/arm64_accton_as5114_48x_r0/__init__.py b/packages/platforms/accton/arm64/as4224/as5114-48x/platform-config/r0/src/python/arm64_accton_as5114_48x_r0/__init__.py index 86d03be73..98767ff21 100644 --- a/packages/platforms/accton/arm64/as4224/as5114-48x/platform-config/r0/src/python/arm64_accton_as5114_48x_r0/__init__.py +++ b/packages/platforms/accton/arm64/as4224/as5114-48x/platform-config/r0/src/python/arm64_accton_as5114_48x_r0/__init__.py @@ -52,5 +52,9 @@ def baseconfig(self): self.insmod("prestera_sw.ko") self.insmod("prestera_pci.ko") + # set up systemctl rules + for swp in range(1, 49): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) return True diff --git a/packages/platforms/delta/arm64/tn48m-dn/tn4810m-dn/platform-config/r0/src/python/arm64_delta_tn4810m_dn_r0/__init__.py b/packages/platforms/delta/arm64/tn48m-dn/tn4810m-dn/platform-config/r0/src/python/arm64_delta_tn4810m_dn_r0/__init__.py index 76438aaae..6d5999fd8 100755 --- a/packages/platforms/delta/arm64/tn48m-dn/tn4810m-dn/platform-config/r0/src/python/arm64_delta_tn4810m_dn_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m-dn/tn4810m-dn/platform-config/r0/src/python/arm64_delta_tn4810m_dn_r0/__init__.py @@ -41,4 +41,9 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 49): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m-dn/tn48m-dn/platform-config/r0/src/python/arm64_delta_tn48m_dn_r0/__init__.py b/packages/platforms/delta/arm64/tn48m-dn/tn48m-dn/platform-config/r0/src/python/arm64_delta_tn48m_dn_r0/__init__.py index 77fb9dbec..def6f2e10 100755 --- a/packages/platforms/delta/arm64/tn48m-dn/tn48m-dn/platform-config/r0/src/python/arm64_delta_tn48m_dn_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m-dn/tn48m-dn/platform-config/r0/src/python/arm64_delta_tn48m_dn_r0/__init__.py @@ -30,5 +30,10 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m-dn/tn48m-poe-dn/platform-config/r0/src/python/arm64_delta_tn48m_poe_dn_r0/__init__.py b/packages/platforms/delta/arm64/tn48m-dn/tn48m-poe-dn/platform-config/r0/src/python/arm64_delta_tn48m_poe_dn_r0/__init__.py index 7caff4327..dc4241265 100755 --- a/packages/platforms/delta/arm64/tn48m-dn/tn48m-poe-dn/platform-config/r0/src/python/arm64_delta_tn48m_poe_dn_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m-dn/tn48m-poe-dn/platform-config/r0/src/python/arm64_delta_tn48m_poe_dn_r0/__init__.py @@ -39,4 +39,9 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m/tn4810m/platform-config/r0/src/python/arm64_delta_tn4810m_r0/__init__.py b/packages/platforms/delta/arm64/tn48m/tn4810m/platform-config/r0/src/python/arm64_delta_tn4810m_r0/__init__.py index 72573130c..708a557ed 100755 --- a/packages/platforms/delta/arm64/tn48m/tn4810m/platform-config/r0/src/python/arm64_delta_tn4810m_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m/tn4810m/platform-config/r0/src/python/arm64_delta_tn4810m_r0/__init__.py @@ -45,4 +45,9 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 49): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m/tn48m-poe/platform-config/r0/src/python/arm64_delta_tn48m_poe_r0/__init__.py b/packages/platforms/delta/arm64/tn48m/tn48m-poe/platform-config/r0/src/python/arm64_delta_tn48m_poe_r0/__init__.py index db5704d03..4632d51e6 100755 --- a/packages/platforms/delta/arm64/tn48m/tn48m-poe/platform-config/r0/src/python/arm64_delta_tn48m_poe_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m/tn48m-poe/platform-config/r0/src/python/arm64_delta_tn48m_poe_r0/__init__.py @@ -39,4 +39,9 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m/tn48m/platform-config/r0/src/python/arm64_delta_tn48m_r0/__init__.py b/packages/platforms/delta/arm64/tn48m/tn48m/platform-config/r0/src/python/arm64_delta_tn48m_r0/__init__.py index a52c4d619..338272f4f 100755 --- a/packages/platforms/delta/arm64/tn48m/tn48m/platform-config/r0/src/python/arm64_delta_tn48m_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m/tn48m/platform-config/r0/src/python/arm64_delta_tn48m_r0/__init__.py @@ -30,5 +30,10 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True diff --git a/packages/platforms/delta/arm64/tn48m/tn48m2/platform-config/r0/src/python/arm64_delta_tn48m2_r0/__init__.py b/packages/platforms/delta/arm64/tn48m/tn48m2/platform-config/r0/src/python/arm64_delta_tn48m2_r0/__init__.py index 332ad9660..20d829e6c 100755 --- a/packages/platforms/delta/arm64/tn48m/tn48m2/platform-config/r0/src/python/arm64_delta_tn48m2_r0/__init__.py +++ b/packages/platforms/delta/arm64/tn48m/tn48m2/platform-config/r0/src/python/arm64_delta_tn48m2_r0/__init__.py @@ -30,4 +30,9 @@ def baseconfig(self): # Suggested by Taras Chornyi self.modprobe('prestera_pci') + # set up systemctl rules + for swp in range(1, 53): + cmd = "systemctl enable switchdev-online@swp%d" % swp + subprocess.check_call(cmd, shell=True) + return True