[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.
This commit is contained in:
parent
eaf9a0bde8
commit
df8eaa0544
@ -47,7 +47,9 @@ arista_net_rename() {
|
|||||||
local new_name="$2"
|
local new_name="$2"
|
||||||
local from_name="$3"
|
local from_name="$3"
|
||||||
devname=$(arista_net_devname "$device_path" "$from_name")
|
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
|
# Sets the MAC address to the value passed by Aboot through /proc/cmdline
|
||||||
|
Reference in New Issue
Block a user