From df8eaa0544f3f2d9fe25f4a50147166d9654e4f2 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 19 Apr 2022 06:58:20 -0700 Subject: [PATCH] [Arista] Fix arista-net initramfs hook The interface renaming logic fails if one interface is missing. Because of the `set -e` the whole initramfs hook would abort early on error. This change fixes the current behavior to make sure missing interfaces are properly skipped and ensure existing interface are renamed. --- files/initramfs-tools/arista-net | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/initramfs-tools/arista-net b/files/initramfs-tools/arista-net index 6430863009..bfa4f8a650 100644 --- a/files/initramfs-tools/arista-net +++ b/files/initramfs-tools/arista-net @@ -47,7 +47,9 @@ arista_net_rename() { local new_name="$2" local from_name="$3" devname=$(arista_net_devname "$device_path" "$from_name") - [ -n "$devname" ] && ip link set "$devname" name "$new_name" + if [ -n "$devname" ]; then + ip link set "$devname" name "$new_name" + fi } # Sets the MAC address to the value passed by Aboot through /proc/cmdline