您尚未登录。

楼主 #1 2017-11-16 09:25:09

daydayup
会员
注册时间: 2017-10-09
已发帖子: 343
积分: 343

我用buildroot产生的rootfs,每次启动都要登录,有什么办法可以去掉这个登录吗?

我用buildroot产生的rootfs,每次启动都要登录,有什么办法可以去掉这个登录吗?

[    4.552696] devtmpfs: mounted
[    4.557008] Freeing unused kernel memory: 1024K
Starting logging: OK
Initializing random number generator... done.
Starting network: OK

Welcome to Buildroot
buildroot login:

离线

楼主 #2 2017-11-16 10:29:14

daydayup
会员
注册时间: 2017-10-09
已发帖子: 343
积分: 343

Re: 我用buildroot产生的rootfs,每次启动都要登录,有什么办法可以去掉这个登录吗?

找到一个类似的问题: how-to-login-automatically-without-typing-root-in-buildroot-x86-64-qemu
但是他仍然没有解决:

I've asked on the mailing list and Thomas Petazzoni replied that the:

/etc/inittab
should contain:

console::respawn:/bin/sh
instead of:

console::respawn:/sbin/getty -n -L  console 0 vt100 # GENERIC_SERIAL
With qemu_x86_defconfig, the inittab is being used by Busybox' init system, due to BR2_INIT_BUSYBOX=y.

An easy way to get it working it to just edit package/busybox/inittab directly, and rebuild busybox:

make busybox-reconfigure
The cleaner way is to use BR2_ROOTFS_OVERLAY.

This method does have a downside however: just after login, the message shows:

/bin/sh can't access tty; job control turned off
and as advertised, things like Ctrl+C will have no effect.

The /sbin/getty on Ubuntu 14.04 has a -a argument for automatic login, but BusyBox' implementation doesn't.

离线

楼主 #3 2017-11-16 10:30:16

daydayup
会员
注册时间: 2017-10-09
已发帖子: 343
积分: 343

Re: 我用buildroot产生的rootfs,每次启动都要登录,有什么办法可以去掉这个登录吗?

原来已经有大神踩过这个坑了:
https://www.kancloud.cn/lichee/lpi0/421922

开机自启动
buildroot 根文件系统
修改/etc/inittab:
ttyS0::respawn:/root/logintest -L ttyS0 115200 vt100
新建logintest:
#!/bin/sh
/bin/login -f root
自启动任务在/etc/init.d/rcS中加入即可
export 相关环境变量在/etc/profile中加入。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn