What I needed was the major and minor numbers for all devices are available in the system. Once I figured that out I could use mknod to create them myself. Quick and dirty, like everything else Trinux. Of course the downside is /sbin/udevd is a daemon that is running and I assume helps. I will have to manually run the scripts that created the devices as new kernel modules are installed and new classes of devices. Of course, with ubuntutrinux I'm building as large as kernels as possible with almost everything in it as possible.
So how do I find out what devices are there and learn the major/minor numbers?
That is where sysfs comes in, allowing you to get detailed information about hardware devices. A funny side note. I wouldn't recommend browsing this hierarchy with the busybox ls because I was getting segfaults.
So let's look at the SCSI (actually SATA) devices present on my Dell server and where they show up with sysfs.
mdfranz@gx620:/sys$ ls -al /dev/sd*
brw-rw---- 1 root disk 8, 0 2007-04-25 16:20 /dev/sda
brw-rw---- 1 root disk 8, 1 2007-04-25 16:20 /dev/sda1
brw-rw---- 1 root disk 8, 2 2007-04-25 16:20 /dev/sda2
brw-rw---- 1 root disk 8, 3 2007-04-25 16:20 /dev/sda3
brw-rw---- 1 root disk 8, 16 2007-04-25 16:20 /dev/sdb
brw-rw---- 1 root disk 8, 17 2007-04-25 16:20 /dev/sdb1
brw-rw---- 1 root disk 8, 18 2007-04-25 16:20 /dev/sdb2
mdfranz@gx620:/sys$ find /sys -name "sd*"
/sys/module/sd_mod
/sys/block/sdb
/sys/block/sdb/sdb2
/sys/block/sdb/sdb1
/sys/block/sda
/sys/block/sda/sda3
/sys/block/sda/sda2
/sys/block/sda/sda1
/sys/bus/scsi/drivers/sd
mdfranz@gx620:/sys$ cd /sys/block/sdb/
mdfranz@gx620:/sys/block/sdb$ cat dev
8:16
No comments:
Post a Comment