Torizon ethernet rename script bug when cpu serial starts with 0

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

  1. Use a Toradex Verdin iMX8MP module with a CPU serial number starting with a leading 0 (e.g., 08622129).

  2. Boot the module on an Ivy carrier board.

  3. Check the Ethernet interface names using ip link or similar commands.

  4. Observe that the interfaces retain the default names end0 and end1 instead 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.sh script at line 27, where the CPU serial number 08622129 is 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:

  1. Ensure the script does not interpret the serial number as an octal value.

  2. Strip leading zeros or explicitly treat the serial number as a string to avoid base conversion errors.

  3. 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

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


(1)

Ethernet Interface Naming Issue on Verdin iMX8MP with Ivy Carrier Board

Thank you for your detailed issue report regarding the Ethernet interface naming problem on the Verdin iMX8MP with the Ivy Carrier Board. This appears to be a legitimate bug in the toradex-net-rename.sh script when handling CPU serial numbers that start with leading zeros.

Issue Analysis

Your analysis is correct - the problem occurs when the script attempts to process a CPU serial number like 08622129 that starts with a leading zero. The script is likely interpreting this as an octal number, which causes a parsing error since 8 and 9 are not valid octal digits.

Hardware Compatibility Confirmation

The Verdin iMX8MP is fully compatible with the Ivy Carrier Board (2). The Ivy Carrier Board supports the entire Verdin family, including the Verdin iMX8M Plus modules (3). This confirms that your hardware configuration is supported and the issue is indeed software-related.

Network Interface Naming Context

According to the Toradex documentation, there is support for custom CAN interface names in the BSP (1). While this specifically mentions CAN interfaces, it indicates that Toradex has implemented custom naming schemes for network interfaces in their software stack.

Recommended Actions

Based on your analysis, the fix should involve:

  1. Modify the script to handle leading zeros properly - Either strip leading zeros or treat the serial number as a string to avoid octal interpretation
  2. Test with various serial number formats - Ensure the script works with different CPU serial number patterns
  3. Update the script in the Torizon image - Include the fix in future releases

Workaround Options

While waiting for an official fix, you could:

  • Create a custom overlay or modification to the toradex-net-rename.sh script in your TorizonCore Builder configuration
  • Implement a temporary udev rule that handles your specific case
  • Use manual interface renaming as a temporary solution

Next Steps

Your bug report is well-documented and should be submitted through the appropriate Toradex support channels. The issue affects devices with CPU serial numbers starting with zero, which could impact other users with similar hardware configurations.

The Ivy Carrier Board provides 2x Gigabit Ethernet interfaces (3), so ensuring proper naming is important for network configuration and management.

Best regards,
Toradex AI Assistant.

Greetings @JormenJanssen,

What version of Torizon OS did you observe this on? Our team actually did fix this fairly recently as seen here: toradex-net-rename: fix serial to MAC conversion · torizon/meta-toradex-torizon@f037853 · GitHub

Though this commit was only in Scarthgap (i.e Torizon OS 7.X). If you are on Torizon OS 7.X then this has already been fixed in recent versions. If you are on Torizon OS 6.X then I guess the issue could still be present.

Best Regards,
Jeremias

Jeremias,

I’m using Torizon OS version 7.3.0-quarterly-build-18 for production devices on the Verdin iMX8M Plus. My configuration is as follows:

easy-installer:
  toradex-feed:
    version: "7.3.0"
    release: quarterly
    machine: verdin-imx8mp
    distro: torizon
    variant: torizon-docker
    build-number: "18"

I understand a fix was committed on August 6, 2025, but I’m unsure of the build date for 7.3.0-quarterly-build-18, which was the latest quarterly release available when I set up my devices. I’m preparing to launch a 0-series for a new product, requiring long-term stability and maintenance.

I’m considering switching to a nightly build if the August 6 fix is included there, but I’m concerned about stability for production. If I deploy devices with a nightly build, I’d like to transition them to a quarterly release post-rollout using a Torizon OTA update. Could you advise on:

  1. Whether the August 6, 2025 fix is included in 7.3.0-quarterly-build-18.
  2. The suitability of using a nightly build for production devices.
  3. The feasibility for switching devices from a nightly build to a quarterly release using a Torizon cloud OTA update.

Thank you for your assistance.

Best regards,
Jormen Janssen

Whether the August 6, 2025 fix is included in 7.3.0-quarterly-build-18.

It should not be. As seen on this page: Download Links | Toradex Developer Center

The Torizon OS 7.3.0 release came out July 24/25. So this commit came right after that release. Meaning it would not be a part of it.

If you want to confirm this you can also just look at the /usr/bin/toradex-net-rename.sh script file on your device and see if it contains the change/fix from the commit I linked earlier.

The suitability of using a nightly build for production devices.

It is possible to use a nightly build for production, but we really don’t recommend it. Nightly images are not held to the same standard and testing as our release images. You may encounter an issue or bug in a nightly image that won’t get fixed till the next release. Or even bugs that we have not found yet ourselves.

Therefore, if you choose to do so it would be at your own risk understanding the limitations/differences between a nightly and release build from us.

The feasibility for switching devices from a nightly build to a quarterly release using a Torizon cloud OTA update.

Yes you could certainly do this. One concern would be if hypothetically the nightly build you deployed the devices with ended up having a bug/issue that affected OTA updates. That would obviously hinder your plan here.

What is your timeline here for your product launch that you would even risk deploying a nightly image into production?

Our next stable Quarterly release (7.4.0) is planned for the start of October. Barring any unforeseen delays.

Best Regards,
Jeremias

Hi Jeremias,

With our launch coming up on October 1st, I decided to pivot to a different approach for the fix. Rather than moving to a nightly build, I’ve incorporated it as a customization in the Torizon Core Builder. This keeps things flexible and easy to manage.

Here’s the updated configuration:

Input:

easy-installer:
  toradex-feed:
    version: "7.3.0"
    release: quarterly
    machine: verdin-imx8mp
    distro: torizon
    variant: torizon-docker
    build-number: "18"

Customization:

customization:
  filesystem:
    - customizations/serial-fix
    - customizations/ath11k-firmware
    - customizations/provisioning
    - customizations/bluetooth
    - customizations/docker

For the serial-fix customization, I’ve set it up with the following structure (from the directory listing):

Directory: C:\Projects\verdin-firmware\customizations\serial-fix

Mode LastWriteTime Length Name
d---- 9/17/2025 9:08 AM - usr
-a---- 9/17/2025 9:32 AM 106 .tcattr

Subdirectory: usr

Mode LastWriteTime Length Name
d---- 9/17/2025 9:08 AM - bin

Subdirectory: usr\bin

Mode LastWriteTime Length Name
-a---- 9/17/2025 9:08 AM 1941 toradex-net-rename.sh

This should resolve the serial issue cleanly.

I’ve incorporated it as a customization in the Torizon Core Builder. This keeps things flexible and easy to manage.

True that is also another option. It also runs less risk of deploying a nightly image. Just make sure to validate the customization to ensure it has the intended effect on devices with a 0-leading serial number.

Looking at what you did though it seems you’re just patching/customizing the script responsible, which should be okay.

Also just keep in mind to remove your customization if you ever migrate to a future version that already has the fix.

Best Regards,
Jeremias