hussain
hussain

Reputation: 61

Creating a file under /sys/devices in Linux

I want to create a file under /sys/devices directory in Linux. What is the best way to do this?

Upvotes: 3

Views: 3273

Answers (1)

Payne
Payne

Reputation: 354

These answer and explanation came up after a quick google-search:

Why cant I create a directory in /sys - Link removed because of limitation

Wikipedia: Sysfs - Link removed because of limitation

If you absolutely have to modify/create anything there, you should first understand how /sys works. And why you want to change it.

EDIT: Petesh pointed out that you where indeed referring to drivers.

As I understand it, /sys/devices is simply a place for devices to dump information about themselves. You don't insert drivers here.

The drivers, or modules, are either implemented into the kernel before compiling it. Or you can add the module to /usr/lib/modules/uname -r/extramodules/, or overwrite it in /usr/lib/modules/uname -r/kernel/fs/btrfs/

You may also want to look at these:

Arch: Manual module handling

The Linux Kernel Module Programming Guide

Upvotes: 2

Related Questions