mdev really does is basically:https://github.com/brgl/busybox/blob/abbf17abccbf832365d9acf1c280369ba7d5f8b2/util-linux/mdev.c#L743-L778
Which is to say
mdev or udev:- Scans /sys/class/xxx, looking for directories which have dev file (it is of the form "M:m\n")
- Uses the information in the
dev file <major>:<minor> to create entries in /dev of the appropriate type (Character device, Block device, etc)- Calls
mknod() syscall to create the filesystem nodeI _think_ I can do this fairly easily with either go-udev or libudev
mdev really does is basically:https://github.com/brgl/busybox/blob/abbf17abccbf832365d9acf1c280369ba7d5f8b2/util-linux/mdev.c#L743-L778
Which is to say
mdev or udev:- Scans /sys/class/xxx, looking for directories which have dev file (it is of the form "M:m\n")
- Uses the information in the
dev file <major>:<minor> to create entries in /dev of the appropriate type (Character device, Block device, etc)- Calls
mknod() syscall to create the filesystem nodeI _think_ I can do this fairly easily with either go-udev or libudev
mdev really does is basically:https://github.com/brgl/busybox/blob/abbf17abccbf832365d9acf1c280369ba7d5f8b2/util-linux/mdev.c#L743-L778
Which is to say
mdev or udev:- Scans /sys/class/xxx, looking for directories which have dev file (it is of the form "M:m\\n")
- Uses the information in the
dev file <major>:<minor> to create entries in /dev of the appropriate type (Character device, Block device, etc)- Calls
mknod() syscall to create the filesystem nodeI _think_ I can do this fairly easily with either go-udev or libudev