LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: inn

lfs中udev的问题

[复制链接]
发表于 2005-6-4 22:15:36 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2005-6-6 14:52:08 | 显示全部楼层
Post by inn
我安装了lfs6.0后,系统无法启动
>>>>>>>>>>>你的系统报什么错,可能我的系统不能启动也是这个原因
++++++报找不到/dev下的设备文件

,在rc.d/init.d/udev脚本中加入了手工创建/dev设备节点
的命令后,系统可以启动。
>>>>>>>>>>>你是怎么加的?
++++++++用mknod命令加,参数参考主系统的设备号

但是lfs6.0的第7章第4节中是这样描述udev的:
The udevstart program then walks through the /sys filesystem and creates devices under /dev that match the descriptions. For example, /sys/class/tty/vcs/dev contains the string “7:0” This string is used by udevstart to create /dev/vcs with major number 7 and minor 0.
我查看了我的/sys目录,发现里面有相应的设备文件,但是我的/dev目录下却仅仅只有我手动创建的设备节点,请问为什么没有象文档里说的,udevstart遍历/sys目录,并创建这些设备节点?
>>>>>>>>>>>>>你是指你LFS重启前查看,还是你问题解决之后再去查看?
我再LFS重启前也看到这种情形,装grub时就有问题,然后我运行了udev后其它设备才出现,grub才能装上去
++++++++我是解决了启动问题后,进入LFS后看的。
++++++++重新看了文档之后,怀疑是我的udev配置的不对,它把所有的设备节点都创建到了/udev目录下了

最近没有空解决udev这个问题了,请各位给一些有关udev的资料让我看看
谢谢了!



能否把你的rc.d/init.d/udev贴出来,让我参考一下。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-7 09:29:08 | 显示全部楼层
我加了一句话,把/udev下的东西都拷贝到/dev下了,这样暂时能用了
不过不是根本的解决之道,最明显的就是现在我的u盘插上之后不能识别。
这个方法不知道对你有没有用。

#!/bin/sh
# Begin $rc_base/init.d/udev - Udev cold-plugging script

# Written by Zack Winkles  - winkie@linuxfromscratch.org

. /etc/sysconfig/rc
. $rc_functions

# Assure that sysfs is mounted and that udev is present.
[ -d /sys/block -a -x /sbin/udev ] || exit 0

# Create some things that sysfs does not, and should not export for us.  Feel
# free to add devices to this list.
make_extra_nodes() {
        ln -s /proc/self/fd /dev/fd
        ln -s /proc/self/fd/0 /dev/stdin
        ln -s /proc/self/fd/1 /dev/stdout
        ln -s /proc/self/fd/2 /dev/stderr
        ln -s /proc/kcore /dev/core
        mkdir /dev/pts
        mkdir /dev/shm
}

case "$1" in
        start)
                # Don't attempt to populate the /dev directory when something
                # else has already set it up.
                [ -f /dev/.udev.tdb ] && exit 0

                echo "opulating /dev with device nodes..."

                # Mount a temporary file system over /dev, so that any devices
                # made or removed during this boot don't affect the next one.
                # The reason we don't write to mtab is because we don't ever
                # want /dev to be unavailable (such as by `umount -a').
                mount -n -t ramfs ramfs /dev
                if [ $? != 0 ]
                then
                        print_status failure
                        echo -n -e $FAILURE
                        echo
                        echo "Cannot mount a ramfs onto /dev, this system will be halted."
                        echo
                        echo -n "When you press Enter, this system will be halted."
                        echo -n -e $NORMAL
                        echo
                        echo "ress Enter to continue..."
                        read ENTER

                        halt -f
                fi

                # Assign udev to get hotplug events.  This will be overwritten
                # in the hotplug bootscript.
                echo /sbin/udevsend > /proc/sys/kernel/hotplug

                # Populate /dev with all the devices that are already available,
                # and save it's status so we can report failures.
                udevstart || failed=1

                # Now, create some required files/directories/devices that sysfs
                # doesn't export for us.
                make_extra_nodes
                cp -rf /udev/* /dev
                # When reporting the status, base it on the success or failure
                # of the `udevstart' command, since that's the most important.
                (exit $failed)
                evaluate_retval
                ;;
        *)
                echo "Usage $0 {start}"
                exit 1
                ;;
esac

# End $rc_base/init.d/udev
回复 支持 反对

使用道具 举报

发表于 2005-6-7 15:39:13 | 显示全部楼层
我加进去了,但好像不起作用,我还不能确认这个脚本是否运行了?
请问有没有把启动的log信息记录下来?
谢谢!
回复 支持 反对

使用道具 举报

发表于 2005-6-9 13:45:39 | 显示全部楼层
hotplug和coldplug,,都装了没?。。。
回复 支持 反对

使用道具 举报

发表于 2005-6-9 21:33:26 | 显示全部楼层
看了半天没有错误信息贴出来啊!

要手动建立null和console的。特别是如果/dev/没有console就不能期待的。提示什么init什么的。
回复 支持 反对

使用道具 举报

发表于 2005-6-11 11:06:07 | 显示全部楼层
Post by 黯然销魂
hotplug和coldplug,,都装了没?。。。

你是指编译进内核?
回复 支持 反对

使用道具 举报

发表于 2005-6-11 11:07:27 | 显示全部楼层
Post by hongfeng
看了半天没有错误信息贴出来啊!

要手动建立null和console的。特别是如果/dev/没有console就不能期待的。提示什么init什么的。


请看:
http://www.linuxsir.cn/bbs/showt ... mp;page=1&pp=15
我现在情况是root分区都不能被mount
回复 支持 反对

使用道具 举报

发表于 2005-6-12 00:49:59 | 显示全部楼层
那就是这个帖子的问题,暂时不用管了?

null/console两个节点是需要的,其他就不用了。。。
回复 支持 反对

使用道具 举报

发表于 2005-6-12 00:53:13 | 显示全部楼层
Post by Fedora000
你是指编译进内核?



安装 bootscripts,,

不过好像你的问题不是这个。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表