如何在Yocto Linux中禁用虚拟终端 [英] How to disable a Virtual Terminal in Yocto Linux

查看:273
本文介绍了如何在Yocto Linux中禁用虚拟终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人会知道如何在linux中禁用虚拟终端吗?我在i.MX6处理器上使用Yocto Morty版本.尽管我们的基本发行版是Yocto,但不幸的是,我们已经不再使用配方来构建它,因此,与Yocto相比,这更是一个直接的Linux问题……

Would anyone know how to disable the virtual terminals in linux? I am using Yocto, Morty version on an i.MX6 processor. Even though our base distribution is Yocto, unfortunately we have diverged from building it with recipes, so this is more of a straight linux question than Yocto…

为我的问题提供一些细节:它用于具有HDMI端口的嵌入式设备-当我将终端连接到HDMI端口时,它会显示Linux Penguin徽标,盖蒂服务,并在600秒后消失.我只想将hdmi端口用作输出,而在输出上不显示任何内容,并且希望它始终保持打开状态.

To give some detail as to my problem: It is for an embedded device that has an HDMI port - when I attach a terminal to the HDMI port it shows the Linux Penguin logo, a getty service and blanks out after 600 seconds. I just want to use the hdmi port as an output with nothing displayed on the output and I want it to stay on all the time.

我发现hdmi端口映射到/dev/tty1 –输入时:echo"asdfasdf">/dev/tty1我看到了输出到监视器的字符.

I have found that the hdmi port maps to /dev/tty1 – when I type: echo "asdfasdf" > /dev/tty1 I see the characters output to the monitor.

有些事情我没有用,如果我能弄清楚如何将其禁用为虚拟终端,则不需要很多……

Here are a few things I have tried to no avail – a lot of these are not needed if I can figure out how to disable it as a virtual terminal…

•我想出了如何禁用getty服务的方法,但是光标仍然闪烁.我什至不想显示光标

• I figured out how to disable the getty service but a cursor still blinks. I don’t even want a cursor to show

•我试图通过禁用内核配置参数中的LOGO来禁用企鹅的显示-我用LOGO out注释了一切:

• I have tried to disable the display of the penguins by disabling the LOGO in the kernel config parameters - I commented anything with LOGO out:

CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y

无济于事.徽标仍显示:.

To no avail. The logo still shows : .

•它在600秒后消隐的事实是控制台消隐–我可以在文件/sys/module/kernel/parameters/consoleblank中将其设置为600.当我发出命令时:echo -e'\ 033 [9; 0]'>/dev/tty1它将控制台空白设置为0并唤醒终端.能够唤醒控制台的成功有限,但我想完全禁用虚拟终端…

• The fact that it blanks after 600 seconds is console blanking – I can see it set to 600 in the file: /sys/module/kernel/parameters/consoleblank. When I issue the command: echo -e '\033[9;0]'>/dev/tty1 It sets the console blanking to 0 and wakes the terminal. Being able to wake the console up is limited success but I would like to disable the virtual terminal altogether…

•我试图注释掉配置文件中定义的任何虚拟终端都无济于事:

• I tried commenting out any virtual terminal defines in the config file to no avail:

CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y

我阅读的所有内容都表明/dev/tty1是虚拟终端或控制台.根据我对VT选项的了解,禁用CONFIG_VT应该可以做到:

Everything I have read suggests that /dev/tty1 is a virtual terminal or console. From what I read about the VT option, disabling the CONFIG_VT should do it:

VT —虚拟终端在此处说是"以获得对终端设备的支持与显示和键盘设备.这些之所以称为虚拟",是因为您可以运行多个虚拟终端(也称为虚拟控制台)在一个物理终端上.您至少需要一个虚拟终端设备,以便使用您的键盘和显示器.所以,只有配置嵌入式系统的人才会在这里拒绝为了节省一些内存;登录这样的系统的唯一方法然后通过串行或网络连接.虚拟终端是之所以有用,是因为,例如,一个虚拟终端可以显示系统消息和警告,另一种可以用于文本模式用户会话,三分之一可以并行运行X会话.虚拟终端之间的切换是通过某些键完成的组合,通常是Alt功能键.如果不确定,请说是,或者否则,您将无法在Linux系统上做很多事情.

VT — Virtual terminal Say yes here to get support for terminal devices with display and keyboard devices. These are called "virtual" because you can run several virtual terminals (also called virtual consoles) on one physical terminal. You need at least one virtual terminal device in order to make use of your keyboard and monitor. Therefore, only people configuring an embedded system would want to say no here in order to save some memory; the only way to log into such a system is then via a serial or network connection. Virtual terminals are useful because, for example, one virtual terminal can display system messages and warnings, another one can be used for a text-mode user session, and a third could run an X session, all in parallel. Switching between virtual terminals is done with certain key combinations, usually Alt-function key. If you are unsure, say yes, or else you won't be able to do much with your Linux system.

但是由于某种原因它什么也没做!

But for some reason it doesn’t do anything!

•我找到了这个线程; https://askubuntu.com/questions/357039/how-do-i-disable-virtual-consoles-tty1-6 等,但是没有太大帮助,因为我的发行版中没有该线程提供的解决方案中的任何目录,也没有我找到的任何其他目录.例如,我没有/etc/events.d,也没有/etc/default/console-setup文件,也没有/etc/init目录……我想这是因为我的发行版使用systemd而解决方案可能是基于SysV的init?

• I found this thread; https://askubuntu.com/questions/357039/how-do-i-disable-virtual-consoles-tty1-6 among others, but none are much help since my distribution does not have any of the directories in the solutions offered in this thread or any others I have found. For instance I do not have a /etc/events.d nor do I have a /etc/default/console-setup file nor do I have a /etc/init directory… I imagine the reason for this is that my distribution uses systemd and the solutions are SysV based init maybe?

如果我能弄清楚如何禁用该端口作为终端,则不需要禁用徽标或控制台空白...

Disabling the logo or console blanking would not be necessary if I could just figure out how to disable that port as a terminal…

那么有人有指针或我可以尝试的事情吗?我相对较新(10年后返回-10年前我曾使用DNX v2.6,似乎我对init所了解的一切都已经过时了),所以我敢肯定我会错过很多……

So does anyone have pointers or things I could try? I am relatively new (returning after 10 years - I worked with DNX 10 years ago v2.6 and it seems everything I knew about init is fairly obsolete lol) to linux so I am sure I am missing a lot…

谢谢,-查克(Chuck)

Thanks, - Chuck

推荐答案

我认为我找到了问题的答案.这实际上是这里记录的帧缓冲区控制台:Documentation/fb/fbcon.txt.从文档中:

I think I found the answer to my question. This is actually a frame buffer console documented here: Documentation/fb/fbcon.txt. From the documentation:

顾名思义,framebuffer控制台(fbcon)是一个文本在帧缓冲设备顶部运行的控制台.它具有任何标准文本控制台驱动程序(例如VGA)的功能控制台,其附加功能可归因于帧缓冲区的图形性质.

The framebuffer console (fbcon), as its name implies, is a text console running on top of the framebuffer device. It has the functionality of any standard text console driver, such as the VGA console, with the added features that can be attributed to the graphical nature of the framebuffer.

注释行

CONFIG_FRAMEBUFFER_CONSOLE = y

CONFIG_FRAMEBUFFER_CONSOLE=y

在/arch/arm/configs中的配置文件中将其禁用.

In the configuration file located in /arch/arm/configs will disable it.

文档的这一部分还向您展示了如何在运行时将其禁用:

Also this part of the documentation shows you how to disable it at runtime:

那么,我们如何从控制台取消绑定fbcon?部分答案在文档/控制台/console.txt.总结一下:

So, how do we unbind fbcon from the console? Part of the answer is in Documentation/console/console.txt. To summarize:

向代表帧缓冲控制台的绑定文件回显一个值司机.因此,假设vtcon1代表fbcon,则:

Echo a value to the bind file that represents the framebuffer console driver. So assuming vtcon1 represents fbcon, then:

echo 1> sys/class/vtconsole/vtcon1/bind-附加帧缓冲控制台至控制台层echo 0> sys/class/vtconsole/vtcon1/bind-从以下位置分离framebuffer控制台控制台层

echo 1 > sys/class/vtconsole/vtcon1/bind - attach framebuffer console to console layer echo 0 > sys/class/vtconsole/vtcon1/bind - detach framebuffer console from console layer

当我发出echo 0命令时,光标停止闪烁,而在发出echo 1命令时再次开始闪烁.

When I issue the echo 0 command, the cursor stops blinking and starts blinking again when I issue the echo 1 command.

我认为还有另一种方法,可以通过将USE_VT ="0"放入OpenEmbedded机器配置文件中来修改Yocto构建环境.sysvinit-inittab配方引用"USE_VT"变量.这个答案是从Yocto Linux邮件列表中获得的-但由于我们与Yocto有所不同,因此我尚未对其进行测试...

I think there is another way of doing it as well by modifying the Yocto build environment by putting the USE_VT="0" in the OpenEmbedded machine config file. The "USE_VT" variable is referenced by the sysvinit-inittab recipe. This answer was given to me from the Yocto Linux mailing list - but I have not tested it since we have diverged from Yocto...

这篇关于如何在Yocto Linux中禁用虚拟终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆