Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cli: add autologin function #62

Merged
merged 3 commits into from
Jul 17, 2024
Merged

Conversation

CodeChenL
Copy link
Contributor

No description provided.

@CodeChenL
Copy link
Contributor Author

@RadxaYuntian 先提交cli部分,接口稳定了再写tui

Copy link
Member

@RadxaYuntian RadxaYuntian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TUI的操作流程应该是这样:

  1. 检测可以被配置的选项(查询enabled的getty服务,检查哪些窗口管理器被安装)
  2. 一个checklist选择需要开启的选项,并标记哪些服务已经开启(简单grep一下对应关键词就好)
  3. 一个inputbox选择对应的用户(默认填入当前用户名)

基于这个流程,CLI应该提供一个统一的入口set_autologin_status,需要接收需配置的服务、登陆用户、以及状态;以及一个get_autologin_status,来查询当前状态。

src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
@RadxaYuntian
Copy link
Member

RadxaYuntian commented Jun 19, 2024

另外点了request review后就禁止force push了,写了一半告诉我diff失效无法提交

@RadxaYuntian
Copy link
Member

另外cli应该能安全的反复执行,比如多次on或多次off。TUI这边应该是一个循环内按照是否选中来全部都重新设置一遍,而不会去单独检查服务此前的状态。

src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Outdated Show resolved Hide resolved
src/usr/lib/rsetup/cli/system.sh Show resolved Hide resolved
@RadxaYuntian
Copy link
Member

#65 有一些获取当前用户的脚本,可以参考

@RadxaYuntian
Copy link
Member

librtui的更新先拆出去一个pr吧,这样panda那边也可以用上

@CodeChenL
Copy link
Contributor Author

librtui的更新先拆出去一个pr吧,这样panda那边也可以用上

好的

@CodeChenL CodeChenL mentioned this pull request Jun 26, 2024
@RadxaYuntian
Copy link
Member

刚刚注意到有一个__user_enable_auto_login

这是我目前用来在串口自动登陆的命令

mkdir -p /etc/systemd/system/[email protected]/
cat << EOF > /etc/systemd/system/serial-getty\@.service.d/50-oem-autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -f -- \\\\u' --keep-baud --autologin oem --noclear 1500000,115200,57600,38400,9600 %I \$TERM
EOF

@RadxaYuntian
Copy link
Member

这个自动登陆的tui需要暴露出来供oem配置使用

@CodeChenL CodeChenL force-pushed the main branch 2 times, most recently from 6788d06 to c8159e8 Compare July 4, 2024 07:06
@RadxaYuntian
Copy link
Member

修改了一些地方,麻烦测试一下

@RadxaYuntian
Copy link
Member

另外我们其实已有一个TUI了,也修改了一下来使用新的函数

@CodeChenL
Copy link
Contributor Author

修改了一些地方,麻烦测试一下

已测试,checklisth只有gdm, 可以正常开关autologin

@RadxaYuntian
Copy link
Member

这个是按照开启的服务来的,应该也有两个getty的才对

@CodeChenL
Copy link
Contributor Author

@RadxaYuntian request a review

Copy link
Member

@RadxaYuntian RadxaYuntian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rebase 一下吧

Copy link
Member

@RadxaYuntian RadxaYuntian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodeChenL
Copy link
Contributor Author

本地的librtui不需要更新?https://github.com/radxa-pkg/rsetup/compare/d14a0180cceca3982f92af30193fa8dc07a72297..9e66f320f67a60744ca979af468d4c4844d3b260

一开始使用获取真实用户的utils需要更新,现在直接使用logname就不需要更新了

@RadxaYuntian RadxaYuntian merged commit cb7ea9d into radxa-pkg:main Jul 17, 2024
2 checks passed
@CodeChenL CodeChenL mentioned this pull request Jul 22, 2024
6 tasks
@RadxaYuntian RadxaYuntian linked an issue Jul 22, 2024 that may be closed by this pull request
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

添加自动登陆的支持
2 participants