pillar: Implement console disabling during runtime - #6220
Conversation
a601adb to
7599656
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6220 +/- ##
==========================================
+ Coverage 23.21% 23.56% +0.35%
==========================================
Files 510 520 +10
Lines 93470 95227 +1757
==========================================
+ Hits 21697 22442 +745
- Misses 70025 70853 +828
- Partials 1748 1932 +184 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude finished @rene's task in 3m 22s —— View job Code Review
I reviewed the change and left 3 inline comments. Summary: 🔴 Likely blocking — 🟠 Console may not be fully released (rungetty.sh) 🟡 Backport hygiene (domainmgr.go) Verified OK: |
8130060 to
e2128b4
Compare
|
Claude finished @rene's task in 1m 52s —— View job Re-review of updated PR
Thanks for the updates — the 🟠 🟡 Discarded error (handlegetty.go:69) Verified OK / resolved:
Nothing blocking beyond the |
e2128b4 to
005f8dc
Compare
|
Claude finished @rene's task in 1m 0s —— View job Re-review of updated PR
Thanks — both items from the last round are now resolved: ✅ ✅ Discarded error — Verified OK / resolved from earlier rounds:
One remaining minor note (non-blocking, left inline): Nothing blocking. LGTM. |
005f8dc to
231d4f1
Compare
Change variable name "any", which is a predeclared type alias (added in Go
1.18) for interface{}. This fixes the following revive issue:
- revive: redefinition of the built-in type any
Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
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>
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>
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>
231d4f1 to
66a0c78
Compare
Description
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 if debug.enable.console" is set to false. Also, it always check if device is onboarded during initialization, if device is onboarded, it will not enable console by default but wait until
debug.enable.consoleis read.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.make live run-liveormake live run-live-gui, although VGA is not required. The focus is the serial console.debug.enable.consoletofalse(if it's not false by default)debug.enable.consoletotrueDifferent combinations can also be tried:
debug.enable.consoletofalse, reboot the device to ensure serial console is never enableddebug.enable.consoletotrue, reboot the device to ensure serial console is enabledChangelog notes
Fix: allow disabling serial consoles at runtime when debug.enable.console is set to false and skip default console enablement on onboarded devices.
PR Backports
This fix will be required for users running 16.0.x, I think it makes sense to backport at least to 17.0 and 16.0-stable. I can backport to other branches as well, if required.
Checklist
check them.