Mask serial-getty@ttymxc0.service on production image

Hi,

I try to disable serial-getty@ttymxc0.service at boot of my torizon production image.

I tried an overlay at /usr/etc/systemd/system/getty.target.wants/getty@tty1.service → /dev/null

but it didn’t work:

sudo systemctl status serial-getty@ttymxc0
● serial-getty@ttymxc0.service - Serial Getty on ttymxc0
Loaded: loaded (/usr/lib/systemd/system/serial-getty@.service; enabled-runtime; preset: disabled)
Active: active (running) since Fri 2025-11-28 09:23:27 UTC; 2min 13s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)

Any clue ?

Main PID: 834 (agetty)
Tasks: 1 (limit: 1748)
Memory: 188.0K (peak: 444.0K)
CPU: 22ms
CGroup: /system.slice/system-serial\x2dgetty.slice/serial-getty@ttymxc0.service
└─834 /sbin/agetty -o “-p – \u” --keep-baud 115200,57600,38400,9600 - vt220

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help! Could you let me know which OS and version you are using? You can run the tdx-info command to get detailed information about your system. You can find more details about this command at https://developer.toradex.com/software/development-resources/tdx-info/.

Once I know your specific platform details, I can provide the appropriate guidance for disabling the serial getty service on your Torizon production image.

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

Here the output of tdx-info ( it’s from my production image)

Bootloader: U-Boot

Kernel version: 6.6.108-7.4.0-00057-g451f1e35226f #1-Torizon PREEMPT Mon Jun 30 14:11:55 UTC 2025
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/7e5c20d6c7027f2e4d9706932237a8eb89ea6b21337483802fe836e381591c80/0
Distro name: NAME=“Torizon OS Upstream”
Distro version: VERSION_ID=7.4.0-build.28
Distro variant: VARIANT=“Docker”
Hostname: colibri-imx6ull-emmc-08641246

Hardware info

HW model: Toradex Colibri iMX6ULL 1GB (eMMC) on Colibri Evaluation Board V3

Toradex version: 0062 V1.1D
Serial number: 08641246
Processor arch: armv7l

Thanks for providing the system information! I can see you’re running Torizon OS 7.4.0 on a Colibri iMX6ULL.

Disabling the Serial Console

Based on the Toradex documentation, there are several approaches to disable the debug UART (serial console) (1). For your Torizon OS production image, you have a few options:

Option 1: Using TorizonCore Builder with Custom Kernel Arguments

You can disable the serial console by customizing kernel arguments using TorizonCore Builder (2). This approach involves:

  1. Using the build command approach - Create a configuration file that removes or modifies the console kernel arguments (3)
  2. Using kernel argument customization - Set custom kernel arguments to disable the console output (2)

Option 2: Custom U-Boot Configuration

The documentation mentions that to disable the serial console, you need to reconfigure U-Boot following basic steps (1). This requires installing a GNU toolchain and rebuilding the bootloader (1).

Option 3: Building from Source

If you need complete control, you can build Torizon OS from source with Yocto Project/OpenEmbedded (4). This allows you to customize the base image including systemd service configurations (4).

Recommended Approach

For your production image on Torizon OS 7.4.0, I recommend using TorizonCore Builder to customize the kernel arguments, as this is the most straightforward method that doesn’t require rebuilding the entire system from source.

The overlay approach you tried (/usr/etc/systemd/system/getty.target.wants/getty@tty1.service → /dev/null) targets the wrong service - you’re dealing with serial-getty@ttymxc0.service, not getty@tty1.service.

Would you like me to provide more specific guidance on using TorizonCore Builder to customize the kernel arguments for disabling the serial console?

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

Yes. Is overlay approach the good method ? What’s service path should I target ?

Using the Overlay Approach for Disabling Serial Getty

Yes, the overlay approach can work, but you need to target the correct service. Based on the Toradex documentation, the serial getty service can be disabled by masking it (1).

Correct Service Path to Target

For your Colibri iMX6ULL, you should target:

# systemctl mask serial-getty@ttymxc0.service

(1)

Alternative Method Using U-Boot Environment

The documentation also shows you can disable the console output by modifying the U-Boot environment variable. You can set the console to a minimal configuration (1):

# fw_setenv tdxargs 'console=ttyLP0'
# reboot

(1)

Service File Location

For the overlay approach in your production image, the service file you should target is located at:

  • i.MX 6/7: /etc/systemd/system/getty.target.wants/serial-getty@ttymxc0.service (1)

So your overlay should target /usr/etc/systemd/system/getty.target.wants/serial-getty@ttymxc0.service → /dev/null instead of the getty@tty1.service you tried.

Why Your Original Overlay Didn’t Work

Your original overlay targeted getty@tty1.service, but the actual service running is serial-getty@ttymxc0.service. The documentation specifically mentions that an explicit serial getty is always started on UART_A, which needs to be masked separately (1).

The overlay approach should work once you target the correct service path for your specific hardware platform.

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

this file

/etc/systemd/system/getty.target.wants/serial-getty@ttymxc0.service

doesn’t exist in my production image

You’re correct - that file doesn’t exist in Torizon OS production images because the serial getty service is automatically generated by systemd-getty-generator (1).

Understanding the Serial Getty Service

In your system status output, you can see:

  • Service template: /usr/lib/systemd/system/serial-getty@.service
  • Status: enabled-runtime (meaning it’s enabled by systemd-getty-generator, not by a static symlink)

Correct Approaches for Torizon OS

Since the service is auto-generated, the overlay approach targeting a static symlink won’t work. Here are the proper methods:

Method 1: Mask the Service (Recommended)

You can mask the service to prevent it from starting:

systemctl mask serial-getty@ttymxc0.service

(1)

Method 2: Modify Kernel Arguments

Remove the console parameter from the kernel command line. In your current setup, you can see console=ttymxc0,115200 is likely being passed. You can modify this using TorizonCore Builder to customize kernel arguments (2).

Method 3: U-Boot Environment Variable

Modify the U-Boot console setting:

fw_setenv console ""

(1)

Why the Overlay Didn’t Work

The overlay approach failed because:

  1. The service is generated dynamically by systemd-getty-generator based on kernel console parameters
  2. There’s no static symlink file to override with /dev/null
  3. The service runs as enabled-runtime rather than being statically enabled

The masking approach (Method 1) is the most straightforward for your Torizon OS production image.

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

How do I modify boot argument in a TorizonCore builder process ?

Modifying Kernel Arguments with TorizonCore Builder

There are two main approaches to modify kernel arguments using TorizonCore Builder:

Method 1: Using the Build Command with Configuration File

You can modify kernel arguments by creating a tcbuild.yaml configuration file (1):

customization:
  kernel:
    arguments:
      - console=ttyLP0,115200
      - loglevel=3

(1)

This approach is recommended for production programming and CI/CD pipelines (2).

Method 2: Using Individual Commands

Set Custom Kernel Arguments

Use the kernel set_custom_args command to define custom arguments (3):

$ torizoncore-builder kernel set_custom_args "param1=val1" "param2=val2"
'custom-kargs_overlay.dts' compiles successfully.
Overlay custom-kargs_overlay.dtbo successfully applied.
Kernel custom arguments successfully configured with "param1=val1 param2=val2".

(3)

Important: Every time you execute the kernel set_custom_args command, the custom-kargs_overlay.dts is overwritten, so you should pass all kernel arguments in a single set_custom_args command (2).

Check Current Arguments

To see what custom kernel arguments are currently configured (3):

$ torizoncore-builder kernel get_custom_args
Currently configured custom kernel arguments: "param1=val1 param2=val2".

(3)

Clear Arguments

To remove all custom kernel arguments (3):

$ torizoncore-builder kernel clear_custom_args
Custom kernel arguments successfully cleared.

(3)

For Your Serial Console Use Case

To disable the serial console, you would want to remove or modify the console parameter. You can set custom kernel arguments that override the default console setting (2). The custom arguments are appended to the default kernel arguments defined in the image (3).

Complete Workflow

  1. Unpack a base image (2):
$ torizoncore-builder images unpack torizon-core-docker-colibri-imx6-Tezi_5.3.0+build.7.tar

(2)

  1. Set your custom kernel arguments (2):
$ torizoncore-builder kernel set_custom_args "console="
  1. Build your custom image using either the build command with a configuration file or the union command (2).

The kernel arguments are stored in a device tree overlay, so you can verify they’re applied using dto status (2).

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @didier2018!

Were you able to solve this issue? If so, could you please share how you did it?

Best regards.

Hi,

In tcbuild.yaml I configured:

customization:
kernel:

arguments:

console=

That’s did the job.

1 Like