Skip to content

[16.0-stable] pillar: Implement console disabling during runtime - #6265

Open
rene wants to merge 3 commits into
lf-edge:16.0-stablefrom
rene:fix-serial-console-access-bp16
Open

[16.0-stable] pillar: Implement console disabling during runtime#6265
rene wants to merge 3 commits into
lf-edge:16.0-stablefrom
rene:fix-serial-console-access-bp16

Conversation

@rene

@rene rene commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

Backport of #6220

How to test and validate this PR

I tested with QEMU, but it can be tested on any device with a working UART console and the console=<serial device> is present in the kernel command line.

  1. Build and run live image: make live run-live or make live run-live-gui, although VGA is not required. The focus is the serial console.
  2. First boot device will not be onboarded, so serial console must be enabled and functional
  3. Onboard the device
  4. Set device property debug.enable.console to false (if it's not false by default)
  5. Serial console must be disabled during runtime for inputs
  6. Set device property debug.enable.console to true
  7. Serial console access should be recovered during runtime

Different combinations can also be tried:

  1. Set debug.enable.console to false, reboot the device to ensure serial console is never enabled
  2. Set debug.enable.console to true, reboot the device to ensure serial console is enabled

Changelog notes

Fix: allow disabling serial consoles at runtime when debug.enable.console is set to false and skip default console enablement on onboarded devices.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've added a reference link to the original PR
  • PR's title follows the template
  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

rene added 3 commits August 3, 2026 15:17
rungetty.sh runs on an infinite loop so it can re-spawn a console shell
when exited from getty. However, this makes impossible to disable a console
during runtime if device property debug.enable.console is set to false.

This script changes to rungetty.sh to trap signal USR1 and kill the current
getty process, which will allow stop the console from pillar during
runtime.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
(cherry picked from commit 81424ce)
Pillar starts on a fresh boot with USB, VGA and console enabled. This
isn't an issue if no serial consoles are present in the cmdline because
for video terminals, the TUI + VGA + usb inputs can be disabled during
runtime. So as soon as pillar gets the global configuration from the
controller, it can disabled all of them. However, if any serial console
is present at the cmdline, like console=ttyAMA0, pillar will start getty
on that console through the rungetty.sh script, which spawns a getty
process on every console from /proc/cmdline. The script use to run a
infinte loop, so even if pillar killed the getty process, it would be
restarted again.

The behavior of rungetty.sh was changed so it really stops getty if it
receives a USR1 signal. This commit implements the stopGetty() to send the
signal and really stop the console, allowing disabling serial consoles
during runtime if "debug.enable.console" is set to false.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
(cherry picked from commit 07f9fc5)
Update to the latest version of dom0-ztools in the following packages:

- pkg/pillar
- pkg/vtpm

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.55%. Comparing base (9f69150) to head (a4452a1).
⚠️ Report is 141 commits behind head on 16.0-stable.

Additional details and impacted files
@@               Coverage Diff               @@
##           16.0-stable    #6265      +/-   ##
===============================================
+ Coverage        19.52%   23.55%   +4.02%     
===============================================
  Files               19       19              
  Lines             3021     2509     -512     
===============================================
+ Hits               590      591       +1     
+ Misses            2310     1787     -523     
- Partials           121      131      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants