Issue Report: Ethernet Interface Naming Issue on Toradex Verdin iMX8MP with Ivy Carrier Board
Overview
While testing the Toradex Verdin iMX8MP on the Ivy carrier board, I encountered an issue where the Ethernet interfaces are not being renamed correctly and retain their default names, end0 and end1. This behavior was observed on a Verdin device using a custom Torizon image built using the Torizon builder. After investigation, the issue appears to be related to a bug in the toradex-net-rename.sh script when the CPU serial number starts with a leading zero.
The issue occurs specifically on this device and is independent of firmware. I compared it with the same model, but the issue does not occur there (cpu serial 15721910) . Initially, I thought it was due to a firmware adjustment, but that is not the case.
Steps to Reproduce
-
Use a Toradex Verdin iMX8MP module with a CPU serial number starting with a leading
0(e.g.,08622129). -
Boot the module on an Ivy carrier board.
-
Check the Ethernet interface names using
ip linkor similar commands. -
Observe that the interfaces retain the default names
end0andend1instead of the expected custom names.
Expected Behavior
The Ethernet interfaces should be renamed according to the rules defined in /etc/udev/rules.d/10-toradex-net-rename.rules, based on the CPU serial number and other parameters, as observed in the stock Torizon build.
Actual Behavior
The Ethernet interfaces are not renamed and remain as end0 and end1. The issue was traced to a failure in the toradex-net-rename.sh script, which is invoked by the udev rule /etc/udev/rules.d/10-toradex-net-rename.rules. The script fails when processing a CPU serial number that starts with a leading zero.
Technical Details
The issue was identified during a udevadm test run on the end0 interface. Below is the relevant output:
torizon@verdin-imx8mp-08622129:~$ sudo udevadm test /sys/class/net/end0
Password:
This program is for debugging only, it does not run any program specified by a RUN key. It may show incorrect results, because some values may be different, or not available at a simulation run.
Trying to open "/etc/systemd/hwdb/hwdb.bin"…
Trying to open "/etc/udev/hwdb.bin"…
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"…
Trying to open "/usr/lib/udev/hwdb.bin"…
=== trie on-disk ===
tool version: 255
file size: 10888175 bytes
header size 80 bytes
strings 2693487 bytes
nodes 8194608 bytes
Loading kernel module index.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Found container virtualization none.
Using default interface naming scheme 'v255'.
Parsed configuration file "/usr/lib/systemd/network/99-default.link"
Parsed configuration file "/etc/systemd/network/10-toradex-wifi-ifnames.link"
Parsed configuration file "/etc/systemd/network/10-toradex-can1-ifname.link"
Parsed configuration file "/etc/systemd/network/10-toradex-can0-ifname.link"
Created link configuration context.
Reading rules file: /usr/lib/udev/rules.d/10-dm.rules
Reading rules file: /etc/udev/rules.d/10-imx.rules
Reading rules file: /etc/udev/rules.d/10-toradex-net-rename.rules
...
end0: /etc/udev/rules.d/10-toradex-net-rename.rules:2 Running PROGRAM '/usr/bin/toradex-net-rename.sh 00:14:2d end0'
end0: Starting '/usr/bin/toradex-net-rename.sh 00:14:2d end0'
Successfully forked off '(spawn)' as PID 3894.
end0: '/usr/bin/toradex-net-rename.sh 00:14:2d end0'(err) '/usr/bin/toradex-net-rename.sh: line 27: 08622129: value too great for base (error token is "08622129")'
end0: Process '/usr/bin/toradex-net-rename.sh 00:14:2d end0' failed with exit code 1.
end0: /etc/udev/rules.d/10-toradex-net-rename.rules:2 Command "/usr/bin/toradex-net-rename.sh 00:14:2d end0" returned 1 (error)
...
end0: Config file /usr/lib/systemd/network/99-default.link is applied
end0: MAC address on the device already matches policy "persistent".
end0: Policy keep: keeping existing userspace name
end0: /usr/lib/udev/rules.d/80-net-setup-link.rules:11 NAME 'end0'
...
torizon@verdin-imx8mp-08622129:~$ cat /proc/device-tree/serial-number
08622129
Key Observations
-
The error occurs in the
toradex-net-rename.shscript at line 27, where the CPU serial number08622129is interpreted as an invalid value due to its leading zero. -
The script likely treats the serial number as an octal number due to the leading zero, causing a parsing error (“value too great for base”).
-
This issue does not occur in the stock Torizon build, suggesting that the custom image introduces or exposes the bug, possibly due to differences in udev rules, script versions, or environment variables.
-
The problem is device-specific and not related to firmware adjustments, as confirmed by comparison with an identical model where the issue does not appear.
Additional Information
-
Hardware: Toradex Verdin iMX8MP on Ivy carrier board
-
Software: Custom Torizon image built with Torizon builder
-
CPU Serial Number:
08622129(starts with a leading zero) -
Comparison Device: Same model, no issue observed; ruled out firmware adjustments as the cause
-
Relevant Files:
-
/etc/udev/rules.d/10-toradex-net-rename.rules -
/usr/bin/toradex-net-rename.sh
-
Suggested Fix
The toradex-net-rename.sh script should be updated to handle CPU serial numbers with leading zeros correctly. Specifically:
-
Ensure the script does not interpret the serial number as an octal value.
-
Strip leading zeros or explicitly treat the serial number as a string to avoid base conversion errors.
-
Test the script with a variety of CPU serial numbers, including those starting with zero, to ensure robustness.
Request
Please investigate and fix the bug in the toradex-net-rename.sh script to ensure proper Ethernet interface renaming in Torizon when the CPU serial number starts with a leading zero. Please include this fix in the next Torizon release.
Contact
For further clarification or additional details, please feel free to contact me.
Thank you,
Jormen Janssen