rootfs运行时udev cannot open /dev/null?

发布于 2022-09-18 04:30:56 字数 2030 浏览 28 评论 0

自己编译了一个基本的rootfs,启动时发现udev 无法打开/dev/null。bash可以进去,但之前有一连串的报错,请高手帮忙看看。错误信息如下:

VFS: Mounted root (nfs filesystem) on device 0:11.
Freeing init memory: 128K
INIT: version 2.86 booting
INIT: /etc/inittab[10]: duplicate ID field "1"
can't create lock file /etc/mtab~927: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~928: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~929: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~930: Permission denied (use -n flag to override)
Starting udev ... cannot open /dev/null
udevd[932]: cannot open /dev/null

udevd[932]: specified group 'tty' unknown

udevd[932]: specified group 'dialout' unknown

udevd[932]: specified group 'kmem' unknown

udevd[932]: specified group 'video' unknown

udevd[932]: specified group 'lp' unknown

udevd[932]: specified group 'disk' unknown

udevd[932]: specified group 'floppy' unknown

udevd[932]: specified group 'cdrom' unknown

udevd[932]: specified group 'tape' unknown

udevd-event[995]: open /dev/null failed: No such file or directory

udevd-event[1003]: open /dev/null failed: No such file or directory
udevd-event[1005]: open /dev/null failed: No such file or directory

udevd-event[1008]: open /dev/null failed: No such file or directory

udevd-event[1007]: open /dev/null failed: No such file or directory

udevd-event[1016]: open /dev/null failed: No such file or directory
udevd-event[1015]: open /dev/null failed: No such file or directory

udevd-event[1018]: open /dev/null failed: No such file or directory

udevd-event[1017]: open /dev/null failed: No such file or directory

udevd-event[1026]: open /dev/null failed: No such file or directory

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

月棠 2022-09-25 04:30:56

缺少了group配置文件

旧街凉风 2022-09-25 04:30:56

可以把主机端的/etc/group copy到你的rootfs/etc/ 目录下

长伴 2022-09-25 04:30:56

你的rootfs是好像只读的,can't create lock file /etc/mtab~,能正常进入系统吗?

夢归不見 2022-09-25 04:30:56

多谢楼上,我拷贝了主机端的group文件,前边的报错没了。可是后边的报错还在。
Starting udev ... cannot open /dev/null
udevd[929]: cannot open /dev/null

udevd-event[1001]: open /dev/null failed: No such file or directory

udevd-event[1002]: open /dev/null failed: No such file or directory

udevd-event[1014]: open /dev/null failed: No such file or directory
udevd-event[1017]: open /dev/null failed: No such file or directory

udevd-event[1011]: open /dev/null failed: No such file or directory

udevd-event[1016]: open /dev/null failed: No such file or directory

udevd-event[1015]: open /dev/null failed: No such file or directory

udevd-event[1027]: open /dev/null failed: No such file or directory

udevd-event[1018]: open /dev/null failed: No such file or directory

udevd-event[1026]: open /dev/null failed: No such file or directory

对了,我的etc/init.d/rcS文件中内容如下:

mount -t sysfs sysfs  /sys
mount -t tmpfs tmpfs  /dev
mount -t proc  proc   /proc
mount -t tmpfs tmpfs  /tmp

[ -e /dev/console ] || mknod /dev/console c 5 1

echo -n "Starting udev ... "
udevd --daemon
udevadm trigger
echo "OK."

七七 2022-09-25 04:30:56

能进入系统吗?

绿萝 2022-09-25 04:30:56

/dev/null是不是在启动udev之前手工创建的?你把创建null设备放在rcS文件中试一下

mount -t sysfs sysfs  /sys
mount -t tmpfs tmpfs  /dev
mount -t proc  proc   /proc
mount -t tmpfs tmpfs  /tmp

[ -e /dev/console ] || mknod /dev/console c 5 1
[ -e /dev/null] || mknod /dev/null c 1 3

echo -n "Starting udev ... "
udevd --daemon
udevadm trigger
echo "OK."

怪异←思 2022-09-25 04:30:56

可以正常进入系统,改了rcS后前边问题解决了,但是还是有报错。哎。。。

INIT: version 2.86 booting
INIT: /etc/inittab[10]: duplicate ID field "1"
can't create lock file /etc/mtab~927: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~928: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~929: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~930: Permission denied (use -n flag to override)
/etc/init.d/rcS: line 9: [: missing `]'
Starting udev ... uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
end_request: I/O error, dev mtdblock2, sector 8
Buffer I/O error on device mtdblock2, logical block 1
uncorrectable error :
end_request: I/O error, dev mtdblock2, sector 16
Buffer I/O error on device mtdblock2, logical block 2
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock2, sector 24
Buffer I/O error on device mtdblock2, logical block 3
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock2, sector 0
Buffer I/O error on device mtdblock2, logical block 0
end_request: I/O error, dev mtdblock0, sector 0
Buffer I/O error on device mtdblock0, logical block 0
end_request: I/O error, dev mtdblock0, sector 0
Buffer I/O error on device mtdblock0, logical block 0
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock4, sector 456448
Buffer I/O error on device mtdblock4, logical block 57056
uncorrectable error :
uncorrectable error :
end_request: I/O error, dev mtdblock4, sector 456448
Buffer I/O error on device mtdblock4, logical block 57056
OK.

情何以堪。 2022-09-25 04:30:56

/etc/init.d/rcS: line 9: [: missing `]'

rcS脚本有问题!

蹲在坟头点根烟 2022-09-25 04:30:56

can't create lock file /etc/mtab~927: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~928: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~929: Permission denied (use -n flag to override)
can't create lock file /etc/mtab~930: Permission denied (use -n flag to override)

ROOTFS 是只读文件系统,CMDLINE发来看看

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文