0666起動時に/ devファイルの権限を設定する

0666起動時に/ devファイルの権限を設定する

いくつかの追加モジュールをロードする必要があります。そのうちの1つが/ dev / knemファイルを生成します。権限を0666に設定する必要がありますが、デフォルトでは問題ありませんが、起動chmod 0666 /dev/knem時に直接割り当てたいと思います。

モジュールをロードするときにカーネルが直接設定するように設定をどこに作成する必要がありますか?

事前にありがとう

ベストアンサー1

私は間違っているかもしれませんが、/ dev / knemをマウントするときにudevルールを使用して0666権限を割り当てることができませんか?

http://www.reactivated.net/writing_udev_rules.html#syntax

Controlling permissions and ownership

udev allows you to use additional assignments in rules to control ownership and permission attributes on each device.

The GROUP assignment allows you to define which Unix group should own the device node. Here is an example rule which defines that the video group will own the framebuffer devices:

    KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video"

The OWNER key, perhaps less useful, allows you to define which Unix user should have ownership permissions on the device node. Assuming the slightly odd situation where you would want john to own your floppy devices, you could use:

    KERNEL=="fd[0-9]*", OWNER="john"

udev defaults to creating nodes with Unix permissions of 0660 (read/write to owner and group). If you need to, you can override these defaults on certain devices using rules including the MODE assignment. As an example, the following rule defines that the inotify node shall be readable and writable to everyone:

    KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666"

UDEVルールを作成するためのステップバイステップのガイドラインは、この資料にあります。http://ubuntuforums.org/showthread.php?t=168221

おすすめ記事