From 81255a3b68be5969bf107bcb46e75a11187c2f53 Mon Sep 17 00:00:00 2001 From: Shokara Kou Date: Fri, 13 May 2022 11:50:27 -0400 Subject: add smdev and udev-compatible library --- smdev/.footprint | 2 ++ smdev/.md5sum | 2 ++ smdev/Pkgfile | 24 +++++++++++++++++++ smdev/config.h | 52 ++++++++++++++++++++++++++++++++++++++++++ smdev/include-sysmacros_h.diff | 12 ++++++++++ 5 files changed, 92 insertions(+) create mode 100644 smdev/.footprint create mode 100644 smdev/.md5sum create mode 100644 smdev/Pkgfile create mode 100644 smdev/config.h create mode 100644 smdev/include-sysmacros_h.diff (limited to 'smdev') diff --git a/smdev/.footprint b/smdev/.footprint new file mode 100644 index 0000000..3a92c1a --- /dev/null +++ b/smdev/.footprint @@ -0,0 +1,2 @@ +drwxr-xr-x root/root bin/ +-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 @@ +6575f64bb2997388b290dab356fca39b config.h +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 @@ +# Description: suckless mdev-like device manager +# URL: https://git.suckless.org/smdev/file/README.html +# Maintainer: Shokara Kou, kou at 13f0 dot net +# Depends on: + +name=smdev +commit=8d07540 +version=git-$commit +release=2 +source=(include-sysmacros_h.diff config.h) + +gitsource=git://git.suckless.org/smdev/ + +build() { + git clone $gitsource + cd $name + git checkout $commit + + git apply $SRC/include-sysmacros_h.diff + cp $SRC/config.h . + + make + make PREFIX=/ DESTDIR=$PKG install +} 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 @@ +/* See LICENSE file for copyright and license details. */ +struct rule { + const char *devregex; + const char *user; + const char *group; + int mode; + const char *path; + const char *cmd; +} rules[] = { + { "null", "root", "root", 0666, NULL, NULL }, + { "zero", "root", "root", 0666, NULL, NULL }, + { "full", "root", "root", 0666, NULL, NULL }, + { "random", "root", "root", 0666, NULL, NULL }, + { "urandom", "root", "root", 0444, NULL, NULL }, + { "hwrandom", "root", "root", 0660, NULL, NULL }, + { "mem", "root", "root", 0640, NULL, NULL }, + { "kmem", "root", "root", 0640, NULL, NULL }, + { "port", "root", "root", 0640, NULL, NULL }, + { "console", "root", "tty", 0600, NULL, NULL }, + { "ptmx", "root", "tty", 0666, NULL, NULL }, + { "tty", "root", "tty", 0666, NULL, NULL }, + { "tty[0-9]", "root", "root", 0600, NULL, NULL }, + { "tty[0-9][0-9]","root", "tty", 0660, NULL, NULL }, + { "ttyS[0-9]*", "root", "tty", 0660, NULL, NULL }, + { "pty.*", "root", "tty", 0660, NULL, NULL }, + { "vcs[0-9]*", "root", "tty", 0660, NULL, NULL }, + { "vcsa*[0-9]*", "root", "tty", 0660, NULL, NULL }, + { "sd[a-z].*", "root", "disk", 0660, NULL, NULL }, + { "ts[0-9]+", "root", "root", 0640, "=input/", NULL }, + { "input/.*", "root", "input", 0660, "=input/", NULL }, + { "dri/.*", "root", "video", 0660, "=dri/", NULL }, + { "snd/.*", "root", "audio", 0660, "=snd/", NULL }, + { "midi.*", "root", "audio", 0660, "=snd/", NULL }, + { "seq", "root", "audio", 0660, "=snd/", NULL }, + { "timer", "root", "audio", 0660, "=snd/", NULL }, + { "rtc[0-9]*", "root", "root", 0664, NULL, NULL }, + { "vbi[0-9]", "root", "video", 0660, NULL, NULL }, + { "video[0-9]", "root", "video", 0660, NULL, NULL }, + { "fuse", "root", "root", 0666, NULL, NULL }, + { ".*", "root", "root", 0660, NULL, NULL }, +}; + +/* Fill into this table if you want to rename the network interface + * identified by `mac' to `name'. By default no such renaming takes + * place. + */ +struct mac2name { + unsigned char mac[6]; + const char *name; +} mac2names[] = { + { .mac = { 0 }, .name = NULL } +}; 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 @@ +diff --git a/smdev.c b/smdev.c +index b774908..0418b7d 100644 +--- a/smdev.c ++++ b/smdev.c +@@ -1,6 +1,7 @@ + /* See LICENSE file for copyright and license details. */ + #include + #include ++#include + #include + + #include -- cgit v1.2.3