问题描述

buildroot编译完成后拷贝至nfs目录,启动时出现以下问题:

[    7.427626] VFS: Mounted root (nfs filesystem) on device 0:18.
[    7.433957] devtmpfs: mounted
[    7.439180] Freeing unused kernel memory: 1024K
[    7.498569] Run /sbin/init as init process
mount: you must be root
mount: you must be root
mkdir: can't create directory '/dev/pts': Permission denied
mkdir: can't create directory '/dev/shm': Permission denied
mount: you must be root
hostname: sethostname: Operation not permitted
seedrng: can't determine pool size, assuming 256 bits: No such file or directory
Saving 256 bits of creditable seed for next boot
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Starting mdev... OK
modprobe: can't change directory to '/lib/modules': No such file or directory
Starting network: ip: RTNETLINK answers: Operation not permitted
FAIL
can't open /dev/console: Permission denied
can't open /dev/console: Permission denied
can't open /dev/console: Permission denied
can't open /dev/console: Permission denied

解决办法

将根文件系统中/bin/busybox文件的s权限去除。

lrwxrwxrwx 1 ying ying      7  9月 25 09:37 arch -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 ash -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 base32 -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 base64 -> busybox
-rwsr-xr-x 1 ying ying 861848  9月 25 09:16 busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 cat -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chattr -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chgrp -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chmod -> busybox

执行指令chmod a-s busybox

lrwxrwxrwx 1 ying ying      7  9月 25 09:37 arch -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 ash -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 base32 -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 base64 -> busybox
-rwxr-xr-x 1 ying ying 861848  9月 25 09:16 busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 cat -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chattr -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chgrp -> busybox
lrwxrwxrwx 1 ying ying      7  9月 25 09:37 chmod -> busybox

重启开发板后正常启动。


应家三千金
1 声望0 粉丝