labgrid-project / labgrid-project/labgrid

disabling kernel messages (dmesg -n 1) is not realiable

Open
#1,749 5 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.