gpt4 book ai didi

linux - 如何自动登录 tty 并执行脚本

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:25:08 24 4
gpt4 key购买 nike

我已经在桌面上安装了 android x86。当我在 grub 中选择 android 的启动选项时,它会转到 tty8,然后我使用 alt+F1 转到 tty1,然后登录到我的 Ubuntu 用户帐户(我的android 图像被存储)运行一个加载 android 的启动 shell 脚本。我需要的是自动化这些过程,即当我选择 android 的启动选项时,它应该转到 tty1 并自动执行 shell 脚本,而无需登录。

这可行吗?如果可以,怎么做?

最佳答案

您可以使用“mingetty”自动登录。

sudo apt-get install mingetty

然后编辑/etc/init/tty1.conf

换行说

exec /sbin/getty -8 38400 tty1

进入

exec /sbin/mingetty --autologin root --noclear tty1

请注意,这会自动登录 root,也许您需要其他用户。至于自动运行 shell 脚本:您可以将您的(或从中调用)脚本放在 ~/.bash_profile

关于linux - 如何自动登录 tty 并执行脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14152026/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com