diff options
| author | Shokara Kou <kou@13f0.net> | 2022-05-13 11:50:27 -0400 |
|---|---|---|
| committer | Shokara Kou <kou@13f0.net> | 2022-12-10 16:12:53 -0500 |
| commit | 81255a3b68be5969bf107bcb46e75a11187c2f53 (patch) | |
| tree | 2cabd9daa890f5252ef69a62a95ca2b2a73c9964 /smdev | |
| parent | 06c57325ffbe336a670222b818a1c9bee4512b92 (diff) | |
add smdev and udev-compatible library
Diffstat (limited to 'smdev')
| -rw-r--r-- | smdev/.footprint | 2 | ||||
| -rw-r--r-- | smdev/.md5sum | 2 | ||||
| -rw-r--r-- | smdev/Pkgfile | 24 | ||||
| -rw-r--r-- | smdev/config.h | 52 | ||||
| -rw-r--r-- | smdev/include-sysmacros_h.diff | 12 |
5 files changed, 92 insertions, 0 deletions
diff --git a/smdev/.footprint b/smdev/.footprint new file mode 100644 index 0000000..3a92c1a --- /dev/null +++ b/smdev/.footprint | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | drwxr-xr-x root/root bin/ | ||
| 2 | -rwxr-xr-x root/root bin/smdev | ||
diff --git a/smdev/.md5sum b/smdev/.md5sum new file mode 100644 index 0000000..172e150 --- /dev/null +++ b/smdev/.md5sum | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | 6575f64bb2997388b290dab356fca39b config.h | ||
| 2 | 62ff7b5a4853b6db6c5f89362f15dea0 include-sysmacros_h.diff | ||
diff --git a/smdev/Pkgfile b/smdev/Pkgfile new file mode 100644 index 0000000..9dbac90 --- /dev/null +++ b/smdev/Pkgfile | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # Description: suckless mdev-like device manager | ||
| 2 | # URL: https://git.suckless.org/smdev/file/README.html | ||
| 3 | # Maintainer: Shokara Kou, kou at 13f0 dot net | ||
| 4 | # Depends on: | ||
| 5 | |||
| 6 | name=smdev | ||
| 7 | commit=8d07540 | ||
| 8 | version=git-$commit | ||
| 9 | release=2 | ||
| 10 | source=(include-sysmacros_h.diff config.h) | ||
| 11 | |||
| 12 | gitsource=git://git.suckless.org/smdev/ | ||
| 13 | |||
| 14 | build() { | ||
| 15 | git clone $gitsource | ||
| 16 | cd $name | ||
| 17 | git checkout $commit | ||
| 18 | |||
| 19 | git apply $SRC/include-sysmacros_h.diff | ||
| 20 | cp $SRC/config.h . | ||
| 21 | |||
| 22 | make | ||
| 23 | make PREFIX=/ DESTDIR=$PKG install | ||
| 24 | } | ||
diff --git a/smdev/config.h b/smdev/config.h new file mode 100644 index 0000000..7fdd3ca --- /dev/null +++ b/smdev/config.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | ||
| 2 | struct rule { | ||
| 3 | const char *devregex; | ||
| 4 | const char *user; | ||
| 5 | const char *group; | ||
| 6 | int mode; | ||
| 7 | const char *path; | ||
| 8 | const char *cmd; | ||
| 9 | } rules[] = { | ||
| 10 | { "null", "root", "root", 0666, NULL, NULL }, | ||
| 11 | { "zero", "root", "root", 0666, NULL, NULL }, | ||
| 12 | { "full", "root", "root", 0666, NULL, NULL }, | ||
| 13 | { "random", "root", "root", 0666, NULL, NULL }, | ||
| 14 | { "urandom", "root", "root", 0444, NULL, NULL }, | ||
| 15 | { "hwrandom", "root", "root", 0660, NULL, NULL }, | ||
| 16 | { "mem", "root", "root", 0640, NULL, NULL }, | ||
| 17 | { "kmem", "root", "root", 0640, NULL, NULL }, | ||
| 18 | { "port", "root", "root", 0640, NULL, NULL }, | ||
| 19 | { "console", "root", "tty", 0600, NULL, NULL }, | ||
| 20 | { "ptmx", "root", "tty", 0666, NULL, NULL }, | ||
| 21 | { "tty", "root", "tty", 0666, NULL, NULL }, | ||
| 22 | { "tty[0-9]", "root", "root", 0600, NULL, NULL }, | ||
| 23 | { "tty[0-9][0-9]","root", "tty", 0660, NULL, NULL }, | ||
| 24 | { "ttyS[0-9]*", "root", "tty", 0660, NULL, NULL }, | ||
| 25 | { "pty.*", "root", "tty", 0660, NULL, NULL }, | ||
| 26 | { "vcs[0-9]*", "root", "tty", 0660, NULL, NULL }, | ||
| 27 | { "vcsa*[0-9]*", "root", "tty", 0660, NULL, NULL }, | ||
| 28 | { "sd[a-z].*", "root", "disk", 0660, NULL, NULL }, | ||
| 29 | { "ts[0-9]+", "root", "root", 0640, "=input/", NULL }, | ||
| 30 | { "input/.*", "root", "input", 0660, "=input/", NULL }, | ||
| 31 | { "dri/.*", "root", "video", 0660, "=dri/", NULL }, | ||
| 32 | { "snd/.*", "root", "audio", 0660, "=snd/", NULL }, | ||
| 33 | { "midi.*", "root", "audio", 0660, "=snd/", NULL }, | ||
| 34 | { "seq", "root", "audio", 0660, "=snd/", NULL }, | ||
| 35 | { "timer", "root", "audio", 0660, "=snd/", NULL }, | ||
| 36 | { "rtc[0-9]*", "root", "root", 0664, NULL, NULL }, | ||
| 37 | { "vbi[0-9]", "root", "video", 0660, NULL, NULL }, | ||
| 38 | { "video[0-9]", "root", "video", 0660, NULL, NULL }, | ||
| 39 | { "fuse", "root", "root", 0666, NULL, NULL }, | ||
| 40 | { ".*", "root", "root", 0660, NULL, NULL }, | ||
| 41 | }; | ||
| 42 | |||
| 43 | /* Fill into this table if you want to rename the network interface | ||
| 44 | * identified by `mac' to `name'. By default no such renaming takes | ||
| 45 | * place. | ||
| 46 | */ | ||
| 47 | struct mac2name { | ||
| 48 | unsigned char mac[6]; | ||
| 49 | const char *name; | ||
| 50 | } mac2names[] = { | ||
| 51 | { .mac = { 0 }, .name = NULL } | ||
| 52 | }; | ||
diff --git a/smdev/include-sysmacros_h.diff b/smdev/include-sysmacros_h.diff new file mode 100644 index 0000000..4c62bd4 --- /dev/null +++ b/smdev/include-sysmacros_h.diff | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | diff --git a/smdev.c b/smdev.c | ||
| 2 | index b774908..0418b7d 100644 | ||
| 3 | --- a/smdev.c | ||
| 4 | +++ b/smdev.c | ||
| 5 | @@ -1,6 +1,7 @@ | ||
| 6 | /* See LICENSE file for copyright and license details. */ | ||
| 7 | #include <sys/ioctl.h> | ||
| 8 | #include <sys/stat.h> | ||
| 9 | +#include <sys/sysmacros.h> | ||
| 10 | #include <sys/types.h> | ||
| 11 | |||
| 12 | #include <linux/sockios.h> | ||
