Skip to content

Commit 7d569e9

Browse files
dkwomobinmob
authored andcommitted
mdevd: add conf and service
1 parent 57d824c commit 7d569e9

3 files changed

Lines changed: 79 additions & 2 deletions

File tree

srcpkgs/mdevd/files/mdev.conf

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configuration based on 'mdev-like-a-boss'.
2+
# https://github.com/slashbeast/mdev-like-a-boss/blob/master/mdev.conf
3+
4+
null root:root 666 @chmod 666 $MDEV
5+
zero root:root 666
6+
full root:root 666
7+
random root:root 444
8+
urandom root:root 444
9+
hwrandom root:root 444
10+
grsec root:root 660
11+
kmem root:root 640
12+
mem root:root 640
13+
14+
port root:root 640
15+
console root:tty 600 @chmod 600 $MDEV
16+
ptmx root:tty 666
17+
pty.* root:tty 660
18+
tty root:tty 666
19+
tty[0-9]* root:tty 660
20+
vcsa*[0-9]* root:tty 660
21+
22+
# Kernel based virtual machine.
23+
kvm root:kvm 660
24+
vhost-net root:kvm 660
25+
26+
# Block devices.
27+
ram([0-9]*) root:disk 660 >rd/%1
28+
loop([0-9]+) root:disk 660 >loop/%1
29+
sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
30+
fd[0-9]* root:floppy 660
31+
32+
net/tun[0-9]* root:kvm 660
33+
net/tap[0-9]* root:root 600
34+
fuse root:root 666
35+
agpgart root:root 660 >misc/
36+
psaux root:root 660 >misc/
37+
rtc root:root 664 >misc/
38+
39+
# Audio stuff.
40+
adsp root:audio 660 >sound/
41+
audio root:audio 660 >sound/
42+
dsp root:audio 660 >sound/
43+
mixer root:audio 660 >sound/
44+
sequencer.* root:audio 660 >sound/
45+
snd/.* root:audio 660
46+
47+
# Raid controllers.
48+
cciss!(.*) root:disk 660 =cciss/%1
49+
ida!(.*) root:disk 660 =ida/%1
50+
rd!(.*) root:disk 660 =rd/%1
51+
52+
# Input stuff.
53+
SUBSYSTEM=input;.* root:input 660
54+
55+
# Video stuff.
56+
card[0-9] root:video 660 =dri/
57+
vbi[0-9] root:video 660 >v4l/
58+
video[0-9] root:video 660 >v4l/
59+
dri/.* root:video 660
60+
61+
# Don't create old usbdev* devices.
62+
usbdev[0-9].[0-9]* root:root 660 !
63+
64+
# Stop creating x:x:x:x which looks like /dev/dm-*.
65+
[0-9]+\:[0-9]+\:[0-9]+\:[0-9]+ root:root 660 !
66+
67+
# /dev/cpu support.
68+
microcode root:root 600 =cpu/
69+
cpu([0-9]+) root:root 600 =cpu/%1/cpuid
70+
msr([0-9]+) root:root 600 =cpu/%1/msr

srcpkgs/mdevd/files/mdevd/run

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
exec 2>&1
4+
exec mdevd -f /etc/mdev.conf -D 3 -b 200000 -O4

srcpkgs/mdevd/template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'mdevd'
22
pkgname=mdevd
33
version=0.1.6.2
4-
revision=1
4+
revision=2
55
build_style=configure
66
configure_args="--includedir=/usr/include --bindir=/usr/bin --libdir=/usr/lib
77
--with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps
@@ -15,9 +15,10 @@ homepage="https://skarnet.org/software/mdevd/"
1515
changelog="https://skarnet.org/software/mdevd/upgrade.html"
1616
distfiles="https://skarnet.org/software/mdevd/mdevd-${version}.tar.gz"
1717
checksum=ac2fcf9004f07904592c5894e2c401e15bb027ecf37bcb8ea661e2a7993447be
18-
18+
conf_files="/etc/mdev.conf"
1919
build_options="static"
2020
desc_option_static="Build static binaries"
21+
make_check=no # no tests
2122

2223
case "$XBPS_TARGET_MACHINE" in
2324
*-musl)
@@ -30,6 +31,8 @@ post_install() {
3031
vlicense COPYING
3132
vdoc README
3233
vcopy "doc/*" usr/share/doc/${pkgname}
34+
vsv mdevd
35+
vcopy ${FILESDIR}/mdev.conf etc/mdev.conf
3336
}
3437

3538
mdevd-doc_package() {

0 commit comments

Comments
 (0)