aboutsummaryrefslogtreecommitdiff
path: root/mdevd
diff options
context:
space:
mode:
authorWoodpecker CI <emmett1.2miligrams@protonmail.com>2025-06-03 14:32:36 +0000
committerWoodpecker CI <emmett1.2miligrams@protonmail.com>2025-06-03 14:32:36 +0000
commit93a354611e38a6949add5c2e5ccc93ef79b9755f (patch)
tree7fee41752b1047d74c59f8ee046cd62735e7e934 /mdevd
parent35912580b66e9439f91ea441938828ad8aa33b0d (diff)
downloadalicelinux-93a354611e38a6949add5c2e5ccc93ef79b9755f.tar.gz
alicelinux-93a354611e38a6949add5c2e5ccc93ef79b9755f.zip
Woodpecker CI 5171f1fdd74e7137c305450dd69a29fa5be4143f [SKIP CI]
Diffstat (limited to 'mdevd')
-rw-r--r--mdevd/.checksum3
-rw-r--r--mdevd/.files13
-rw-r--r--mdevd/abuild20
-rw-r--r--mdevd/depends1
-rw-r--r--mdevd/mdevd.conf70
-rw-r--r--mdevd/mdevd.run5
6 files changed, 112 insertions, 0 deletions
diff --git a/mdevd/.checksum b/mdevd/.checksum
new file mode 100644
index 00000000..648f71f5
--- /dev/null
+++ b/mdevd/.checksum
@@ -0,0 +1,3 @@
+096ebaf60f1b70bc4a9904071a6c65b0de4fb07400d91bf5ec0cb704750a0551 mdevd-v0.1.7.0.tar.gz
+2e60d9f1a12c1b5332b7e49d0698ec1091c97fbd4fa68bb9dd712054844d1c09 mdevd.conf
+462a2ffcd9fdea2416dedff9b385bc3ddcc3a9e4e02b2134a77285e79ce54fa4 mdevd.run
diff --git a/mdevd/.files b/mdevd/.files
new file mode 100644
index 00000000..b7496fb0
--- /dev/null
+++ b/mdevd/.files
@@ -0,0 +1,13 @@
+drwxr-xr-x root/root etc/
+-rw-r--r-- root/root etc/mdevd.conf.new
+drwxr-xr-x root/root etc/sv/
+drwxr-xr-x root/root etc/sv/mdevd/
+-rwxr-xr-x root/root etc/sv/mdevd/run.new
+lrwxrwxrwx root/root etc/sv/mdevd/supervise -> ../../../run/runit/supervise.mdevd
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/mdevd
+-rwxr-xr-x root/root usr/bin/mdevd-coldplug
+drwxr-xr-x root/root usr/include/
+drwxr-xr-x root/root usr/include/mdevd/
+-rw-r--r-- root/root usr/include/mdevd/config.h
diff --git a/mdevd/abuild b/mdevd/abuild
new file mode 100644
index 00000000..c00ceff6
--- /dev/null
+++ b/mdevd/abuild
@@ -0,0 +1,20 @@
+name=mdevd
+version=0.1.7.0
+release=1
+source="https://github.com/skarnet/${name}/archive/v${version}/${name}-v${version}.tar.gz
+ mdevd.conf
+ mdevd.run"
+sv="mdevd.run"
+keep_static=1
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --enable-static-libc \
+ --disable-shared
+ make
+ make install
+
+ mkdir "$PKG/etc"
+ mv "$SRC/mdevd.conf" "$PKG/etc/mdevd.conf"
+}
diff --git a/mdevd/depends b/mdevd/depends
new file mode 100644
index 00000000..5baacc7b
--- /dev/null
+++ b/mdevd/depends
@@ -0,0 +1 @@
+skalibs
diff --git a/mdevd/mdevd.conf b/mdevd/mdevd.conf
new file mode 100644
index 00000000..0c88a022
--- /dev/null
+++ b/mdevd/mdevd.conf
@@ -0,0 +1,70 @@
+# Configuration based on 'mdev-like-a-boss'.
+# https://github.com/slashbeast/mdev-like-a-boss/blob/master/mdev.conf
+
+null root:root 666 @chmod 666 $MDEV
+zero root:root 666
+full root:root 666
+random root:root 444
+urandom root:root 444
+hwrandom root:root 444
+grsec root:root 660
+kmem root:root 640
+mem root:root 640
+
+port root:root 640
+console root:tty 600 @chmod 600 $MDEV
+ptmx root:tty 666
+pty.* root:tty 660
+tty root:tty 666
+tty[0-9]* root:tty 660
+vcsa*[0-9]* root:tty 660
+
+# Kernel based virtual machine.
+kvm root:kvm 660
+vhost-net root:kvm 660
+
+# Block devices.
+ram([0-9]*) root:disk 660 >rd/%1
+loop([0-9]+) root:disk 660 >loop/%1
+sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
+fd[0-9]* root:floppy 660
+
+net/tun[0-9]* root:kvm 660
+net/tap[0-9]* root:root 600
+fuse root:root 666
+agpgart root:root 660 >misc/
+psaux root:root 660 >misc/
+rtc root:root 664 >misc/
+
+# Audio stuff.
+adsp root:audio 660 >sound/
+audio root:audio 660 >sound/
+dsp root:audio 660 >sound/
+mixer root:audio 660 >sound/
+sequencer.* root:audio 660 >sound/
+snd/.* root:audio 660
+
+# Raid controllers.
+cciss!(.*) root:disk 660 =cciss/%1
+ida!(.*) root:disk 660 =ida/%1
+rd!(.*) root:disk 660 =rd/%1
+
+# Input stuff.
+SUBSYSTEM=input;.* root:input 660
+
+# Video stuff.
+card[0-9] root:video 660 =dri/
+vbi[0-9] root:video 660 >v4l/
+video[0-9] root:video 660 >v4l/
+dri/.* root:video 660
+
+# Don't create old usbdev* devices.
+usbdev[0-9].[0-9]* root:root 660 !
+
+# Stop creating x:x:x:x which looks like /dev/dm-*.
+[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
+
+# /dev/cpu support.
+microcode root:root 600 =cpu/
+cpu([0-9]+) root:root 600 =cpu/%1/cpuid
+msr([0-9]+) root:root 600 =cpu/%1/msr
diff --git a/mdevd/mdevd.run b/mdevd/mdevd.run
new file mode 100644
index 00000000..2088c604
--- /dev/null
+++ b/mdevd/mdevd.run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Null the legacy hotplugger as the service will take over from here.
+printf '\n' 2>/dev/null > /proc/sys/kernel/hotplug
+exec mdevd -f /etc/mdevd.conf -O 4 -C