labgrid-project / labgrid-project/labgrid
disabling kernel messages (dmesg -n 1) is not realiable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 528
- Forks
- 278
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Description
After the login_prompt of "Please press Enter to activate this console.", the ShellDriver writes dmesg -n 1 on the console to disable kernel messages on the console. But this does not always work. Sometimes the first couple characters are missing, sometime random characters are missing. Here are some examples from the log...
CONSOLE SerialLogger.ma: SerialDriver(main) > dmesg -n 1␍
INFO StepLogger: → SerialDriver.expect(pattern=['root@[-\\w()]+:[^ ]+ ', 'Please press Enter to activate this console.', 'Password: ', <class 'pexpect.exceptions.TIMEOUT'>])
CONSOLE SerialLogger.ma: SerialDriver(main) < mesg -n 1␍
CONSOLE SerialLogger.ma: SerialDriver(main) < -ash: mesg: not found␍
INFO StepLogger: → SerialDriver.expect(pattern=['root@[-\\w()]+:[^ ]+ ', 'Please press Enter to activate this console.', 'Password: ', <class 'pexpect.exceptions.TIMEOUT'>])
CONSOLE SerialLogger.ma: SerialDriver(main) < ms- ␍
CONSOLE SerialLogger.ma: SerialDriver(main) < -ash: ms-: not found␍
Perhaps some kind of check to see if dmesg -n 1 worked would be useful, which can be done by checking the contents of /proc/sys/kernel/printk. Or possibly it would be beneficial to add a sleep (user configurable with a default of 0 seconds) before running dmesg -n 1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ShellDriver handling after the login_prompt and reproduce the serial-console examples where dmesg -n 1 is truncated. Compare the command result with /proc/sys/kernel/printk, then define done as reliably disabling kernel messages, with any delay configurable if that approach is chosen.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100