summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorA. Wilcox <awilcox@wilcox-tech.com>2019-10-05 19:28:20 +0000
committerA. Wilcox <awilcox@wilcox-tech.com>2019-10-05 19:28:20 +0000
commitb9b051749c7bbaa706152c103f6a277cbe8068a7 (patch)
treee60a5dd3b73d5be66e2a9dc42bc24e0d3eb83f22 /system
parentc21edcce6991a2615532a893f4f7c7df2d8e937f (diff)
parentc9ee32b12586ce3e6cb2e8be86dbf810846af1eb (diff)
downloadpackages-b9b051749c7bbaa706152c103f6a277cbe8068a7.tar.gz
packages-b9b051749c7bbaa706152c103f6a277cbe8068a7.tar.bz2
packages-b9b051749c7bbaa706152c103f6a277cbe8068a7.tar.xz
packages-b9b051749c7bbaa706152c103f6a277cbe8068a7.zip
Merge branch 'skaware.20191003' into 'master'
Skaware.20191003 See merge request adelie/packages!359
Diffstat (limited to 'system')
-rw-r--r--system/gettys-openrc/gettys.initd26
-rw-r--r--system/mdevd/APKBUILD55
-rw-r--r--system/mdevd/mdev.conf77
-rw-r--r--system/mdevd/mdevd.initd41
-rw-r--r--system/mdevd/mdevd.run3
-rw-r--r--system/s6-linux-init/APKBUILD16
-rw-r--r--system/s6-linux-init/earlygetty.run31
-rw-r--r--system/s6-rc/APKBUILD70
8 files changed, 301 insertions, 18 deletions
diff --git a/system/gettys-openrc/gettys.initd b/system/gettys-openrc/gettys.initd
index a1fbb2082..1f02d29f4 100644
--- a/system/gettys-openrc/gettys.initd
+++ b/system/gettys-openrc/gettys.initd
@@ -11,14 +11,11 @@ makeservice() {
tty="$1"
eval 'options="$GETTYS_'"$tty"'_OPTIONS"'
eval 'baud="$GETTYS_'"$tty"'_BAUDRATE"'
- if test -z "$baud" ; then
- baud=38400
- fi
mkdir -p -m 0755 "/var/lib/s6/services/getty-$tty"
{
echo '#!/bin/execlineb -P'
echo
- echo "/sbin/agetty $options -- $baud $tty linux"
+ echo "/sbin/agetty $options -- $tty $baud"
} > "/var/lib/s6/services/getty-$tty/run"
chmod 0755 "/var/lib/s6/services/getty-$tty/run"
}
@@ -32,6 +29,17 @@ nomatchname() {
return 0
}
+notearly() {
+ if test -d /etc/s6-linux-init/current/run-image/service/s6-linux-init-early-getty ; then
+ if early=`head -n 1 /run/kernel_env/earlygetty` ; then
+ early="${early%%,*}"
+ else
+ early=tty2
+ fi
+ test "$1" != "$early"
+ fi
+}
+
start() {
set -e
ebegin "Applying getty configuration"
@@ -46,13 +54,9 @@ start() {
done
for i in $GETTYS ; do
- if test -c /dev/"$i" ; then
- if test -d "/etc/s6-linux-init/current/run-image/service/getty-$i" ; then
- :
- else
- makeservice "$i"
- ln -nsf "/var/lib/s6/services/getty-$i" "/run/service/getty-$i"
- fi
+ if test -c /dev/"$i" && notearly "$i" ; then
+ makeservice "$i"
+ ln -nsf "/var/lib/s6/services/getty-$i" "/run/service/getty-$i"
fi
done
diff --git a/system/mdevd/APKBUILD b/system/mdevd/APKBUILD
new file mode 100644
index 000000000..b21a0be09
--- /dev/null
+++ b/system/mdevd/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Laurent Bercot <ska-adelie@skarnet.org>
+# Maintainer: Laurent Bercot <ska-adelie@skarnet.org>
+pkgname=mdevd
+pkgver=0.1.1.0
+pkgrel=2
+pkgdesc="A small uevent manager daemon"
+url="https://skarnet.org/software/$pkgname/"
+arch="all"
+options="!check" # No test suite.
+license="ISC"
+_skalibs_version=2.9.0.0
+makedepends="skalibs-dev>=$_skalibs_version"
+subpackages="$pkgname-doc $pkgname-openrc"
+source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz mdev.conf mdevd.run mdevd.initd"
+
+build() {
+ cd "$builddir"
+ ./configure --enable-allstatic --enable-static-libc
+ make
+}
+
+package() {
+ svcdir="$pkgdir/etc/s6-linux-init/current/run-image/service/mdevd"
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ mkdir -p -m 0755 "$svcdir"
+ cp -f "$srcdir/mdev.conf" "$pkgdir/etc/"
+ chmod 0644 "$pkgdir/etc/mdev.conf"
+ cp -f "$srcdir/mdevd.run" "$svcdir/run"
+ echo 3 > "$svcdir/notification-fd"
+ touch "$svcdir/down"
+}
+
+
+doc() {
+ pkgdesc="$pkgdesc (documentation)"
+ depends=
+ install_if="docs $pkgname=$pkgver-r$pkgrel"
+ mkdir -p "$subpkgdir/usr/share/doc"
+ cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
+}
+
+
+openrc() {
+ rldir="$subpkgdir"/etc/runlevels/sysinit
+ default_openrc
+ mkdir -p "$rldir"
+ ln -s ../../init.d/mdevd "$rldir/mdevd"
+ ln -s ../../init.d/mdevd-coldplug "$rldir/mdevd-coldplug"
+}
+
+sha512sums="94bbcaf0c39511da392c932c5d38ced7029727a46997877d03bba41fc7302df3d4400d3957be9361055e954f3a22b785db40d56bb2f031bc49bb2f398179efe0 mdevd-0.1.1.0.tar.gz
+b237443837c3d76f8964e2b1a48c2278af7b4a4e7f735da6fc861b7598cbf50017e961e5a4fd1f20dd9cb7dd46f4cdf68144539d909b1f245e110b75c2d849db mdev.conf
+31231b28d0b980dda634e8b043a2ee31960493d60c2c9aac8a4f3f68ca1d130342569af2acd0bc04d9d8008b8e234ba949b64d9ec3ff1bded64b4e4f0ce3786b mdevd.run
+f6f9eebf49c2de6abde9cfb7a9d7b3a6b3afdd3e01ba4155f1b95dfa27e522363059b69cec19305881773d776ffeccf6c1106d537d01780468bd3b9846edb2cc mdevd.initd"
diff --git a/system/mdevd/mdev.conf b/system/mdevd/mdev.conf
new file mode 100644
index 000000000..49f040ca2
--- /dev/null
+++ b/system/mdevd/mdev.conf
@@ -0,0 +1,77 @@
+# Thanks to Piotr Karbowski for mdev-like-a-boss.
+# TODO: audit the helpers and adapt them to Adélie
+
+$MODALIAS=.* 0:0 0600 @modprobe -b "$MODALIAS"
+
+console 0:0 0600
+null 0:0 0666
+urandom 0:0 0666
+random 0:0 0444
+kmem 0:0 0000
+zero 0:0 0444
+full 0:0 0222
+ptmx 0:0 0666
+pty.* 0:0 0600
+fuse 0:0 0666
+
+mem root:kmem 0640
+ptmx root:tty 0666
+
+# Typical devices
+tty root:tty 0666
+tty[0-9]* root:tty 0660
+vcs* root:tty 0660
+ttyS[0-9]* root:dialout 0660
+
+# block devices
+ram([0-9]*) root:disk 0660
+loop([0-9]+) root:disk 0660
+fd[0-9]* root:floppy 0660
+sd[a-z].* root:disk 0660 # */opt/mdev/helpers/storage-device
+vd[a-z].* root:disk 0660 # */opt/mdev/helpers/storage-device
+hd[a-z].* root:disk 0660 # */opt/mdev/helpers/storage-device
+md[0-9]* root:disk 0660 # */opt/mdev/helpers/storage-device
+dm-[0-9]* root:disk 0660 # */opt/mdev/helpers/storage-device
+bcache[0-9]* root:disk 0660 # */opt/mdev/helpers/storage-device
+mmcblk[0-9].* root:disk 0660 # */opt/mdev/helpers/storage-device
+sr[0-9]* root:cdrom 0660 @ln -sf $MDEV cdrom
+
+# Run settle-nics every time new NIC appear.
+# If you don't want to auto-populate /etc/mactab with NICs, run 'settle-nics' without '--write-mactab' param.
+# -SUBSYSTEM=net;DEVPATH=.*/net/.*;.* root:root 600 @/opt/mdev/helpers/settle-nics --write-mactab
+
+net/tun[0-9]* root:kvm 0660
+net/tap[0-9]* root:root 0600
+
+# alsa sound devices and audio stuff
+SUBSYSTEM=sound;.* root:audio 0660 # @/opt/mdev/helpers/sound-control
+
+adsp root:audio 0660 # >sound/
+audio root:audio 0660 # >sound/
+dsp root:audio 0660 # >sound/
+mixer root:audio 0660 # >sound/
+sequencer.* root:audio 0660 # >sound/
+
+
+# raid controllers
+cciss!(.*) root:disk 0660 =cciss/%1
+ida!(.*) root:disk 0660 =ida/%1
+rd!(.*) root:disk 0660 =rd/%1
+
+agpgart root:root 0660 # >misc/
+psaux root:root 0660 # >misc/
+rtc[0-9]* root:root 0600 @ln -sf $MDEV rtc
+
+# input stuff
+SUBSYSTEM=input;.* root:input 0660
+
+# v4l stuff
+vbi[0-9] root:video 660 >v4l/
+video[0-9] root:video 660 >v4l/
+
+# dvb stuff
+dvb.* root:video 660
+
+# drm etc
+card[0-9] root:video 0660 =dri/
+dri/.* root:video 0660
diff --git a/system/mdevd/mdevd.initd b/system/mdevd/mdevd.initd
new file mode 100644
index 000000000..3f6bccf86
--- /dev/null
+++ b/system/mdevd/mdevd.initd
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 2019 Adélie Linux
+
+description="mdevd manages device permissions and symbolic links in /dev"
+extra_started_commands="reload"
+description_reload="Reload the mdevd configuration file"
+
+depend()
+{
+ use modloop
+ need sysfs dev-mount
+ before checkfs fsck
+ keyword -lxc -systemd-nspawn -vserver
+ provide dev
+}
+
+stop()
+{
+ ebegin "Stopping mdevd"
+ touch /run/service/mdevd/down
+ s6-svc -d /run/service/mdevd
+ eend $?
+}
+
+start()
+{
+ ebegin "Starting mdevd"
+ rm -f /run/service/mdevd/down
+ s6-svc -uwU /run/service/mdevd
+ eend $?
+ ebegin "Coldplugging devices"
+ mdevd-coldplug
+ eend $?
+}
+
+reload()
+{
+ ebegin "Reloading mdevd config file"
+ s6-svc -h /run/service/mdevd
+ eend $?
+}
diff --git a/system/mdevd/mdevd.run b/system/mdevd/mdevd.run
new file mode 100644
index 000000000..d4b5b8320
--- /dev/null
+++ b/system/mdevd/mdevd.run
@@ -0,0 +1,3 @@
+#!/bin/execlineb -P
+
+mdevd -D 3
diff --git a/system/s6-linux-init/APKBUILD b/system/s6-linux-init/APKBUILD
index 7dff13d2e..39af18ecf 100644
--- a/system/s6-linux-init/APKBUILD
+++ b/system/s6-linux-init/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Laurent Bercot <ska-adelie@skarnet.org>
pkgname=s6-linux-init
pkgver=1.0.3.0
-pkgrel=0
+pkgrel=1
pkgdesc="A s6-based init system"
url="https://skarnet.org/software/$pkgname/"
arch="all"
@@ -12,10 +12,9 @@ _skalibs_version=2.9.0.0
depends="execline s6 s6-linux-init-common"
makedepends="skalibs-dev>=$_skalibs_version execline-dev s6-dev utmps-dev"
subpackages="$pkgname-common:common:noarch $pkgname-early-getty:earlygetty:noarch $pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc"
-source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz rc.init runlevel rc.shutdown reboot.sh"
+source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz rc.init runlevel rc.shutdown reboot.sh earlygetty.run"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
provides="/sbin/init=0"
-_earlytty=tty2
build() {
cd "$builddir"
@@ -46,7 +45,7 @@ package() {
./s6-linux-init-maker \
-u catchlog \
- -G "/sbin/agetty -- 38400 $_earlytty linux" \
+ -G "sleep 86400" \
-1 \
-L \
-p "/usr/bin:/usr/sbin:/bin:/sbin" \
@@ -78,12 +77,14 @@ common() {
earlygetty() {
- pkgdesc="Files for an early getty on $_earlytty"
+ pkgdesc="Files for a configurable early getty"
depends="s6-linux-init-common"
svcimg="$pkgdir/etc/s6-linux-init/current/run-image/service"
subsvcimg="$subpkgdir/etc/s6-linux-init/current/run-image/service"
mkdir -p -m 0755 "$subsvcimg"
- mv "$svcimg/s6-linux-init-early-getty" "$subsvcimg/getty-$_earlytty"
+ mv "$svcimg/s6-linux-init-early-getty" "$subsvcimg/"
+ cp -f "$srcdir/earlygetty.run" "$subsvcimg/s6-linux-init-early-getty/run"
+ chmod 0755 "$subsvcimg/s6-linux-init-early-getty/run"
}
@@ -123,4 +124,5 @@ sha512sums="defcf58a21dc763b899212f66879ecece350d7248ea77974fda7b4679035143172bb
756b0cbbe5dabb4631380c3c7ea199cc213224b2e36e50a2d012a61948170078b78bf49b85d886319fecf59843087f937d3d804723b2553ac9f94d088a2f0fd8 rc.init
e73c3c32b118831074288d23fadace2158a2b15d5a13ffa73290b92a9e39c2a21c73d3b0eabea29bcbaa5f6381611fd8d0aaa6aa691ec7de91b8ef6ae404b6da runlevel
7bb050248a5c2ab6a56c50c35f87cde724f97ff9882f5e60b0f0f2f14bd93c1df7d99fedc3d81c8519cf1a1ed90e03f1cbb9bf891c7b3618aa9a5f5738d262f4 rc.shutdown
-6fb2a1112988fd2322b4bc4862bfb948a1c2e43921c5d01ae873c0d31b39fe74fc2934a5018c08b1704a2b2199b31d3a3d7365be369bba734f153b74e000aa74 reboot.sh"
+6fb2a1112988fd2322b4bc4862bfb948a1c2e43921c5d01ae873c0d31b39fe74fc2934a5018c08b1704a2b2199b31d3a3d7365be369bba734f153b74e000aa74 reboot.sh
+67b8dfc5e4174d7ec6fab4ac618e6acf27481808bbaa7cfd3d805dc3e66c017f76e30c5e1ce5d5a5bb5ba3fbf97c0d8b864d8095fae40d1ae9dad3ae629811f9 earlygetty.run"
diff --git a/system/s6-linux-init/earlygetty.run b/system/s6-linux-init/earlygetty.run
new file mode 100644
index 000000000..5e60e7028
--- /dev/null
+++ b/system/s6-linux-init/earlygetty.run
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+tty=tty2
+baud=
+options='-L'
+
+if line=`head -n 1 /run/kernel_env/earlygetty` ; then
+ tty="${line%%,*}"
+ bpnf="${line##*,}"
+ nf=
+ f=
+ clean=false
+ case "$bpnf" in
+ *n*) baud=${bpnf%%n*} ; nf="${bpnf##*n}" ; clean=true ;;
+ *o*) baud=${bpnf%%o*} ; nf="${bpnf##*o}" ;;
+ *e*) baud=${bpnf%%e*} ; nf="${bpnf##*e}" ;;
+ [[:digit:]]*) baud=$bpnf
+ esac
+ case "$nf" in
+ 7*) clean=false ; f="${nf#7}" ;;
+ [[:digit:]]*) clean=true ; f="${nf#?}"
+ esac
+ if $clean ; then
+ options="$options -8"
+ fi
+ if test "$f" = 'r' ; then
+ options="$options -h"
+ fi
+fi
+
+exec /sbin/agetty $options -- "$tty" $baud
diff --git a/system/s6-rc/APKBUILD b/system/s6-rc/APKBUILD
new file mode 100644
index 000000000..c8e4895db
--- /dev/null
+++ b/system/s6-rc/APKBUILD
@@ -0,0 +1,70 @@
+# Contributor: Laurent Bercot <ska-adelie@skarnet.org>
+# Maintainer: Laurent Bercot <ska-adelie@skarnet.org>
+pkgname=s6-rc
+pkgver=0.5.1.0
+pkgrel=0
+pkgdesc="skarnet.org's service manager, working on top of s6"
+url="https://skarnet.org/software/s6-rc/"
+arch="all"
+options="!check"
+license="ISC"
+_skalibs_version=2.9.0.0
+_s6_version=2.9.0.0
+depends="execline"
+makedepends="skalibs-dev>=$_skalibs_version execline-dev s6-dev>=$_s6_version"
+subpackages="$pkgname-libs $pkgname-dev $pkgname-libs-dev:libsdev $pkgname-doc"
+source="https://skarnet.org/software/$pkgname/$pkgname-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --enable-shared \
+ --enable-static \
+ --enable-allstatic \
+ --enable-static-libc \
+ --libdir=/usr/lib \
+ --libexecdir="/lib/$pkgname" \
+ --with-dynlib=/lib
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+
+libs() {
+ pkgdesc="$pkgdesc (shared libraries)"
+ depends="skalibs-libs>=$_skalibs_version s6-libs>=$_s6_version"
+ mkdir -p "$subpkgdir/lib"
+ mv "$pkgdir"/lib/*.so.* "$subpkgdir/lib/"
+}
+
+
+dev() {
+ pkgdesc="$pkgdesc (development files)"
+ depends="skalibs-dev>=$_skalibs_version s6-dev>=$_s6_version"
+ mkdir -p "$subpkgdir/usr/include" "$subpkgdir/usr/lib"
+ mv "$pkgdir/usr/include" "$subpkgdir/usr/"
+ mv "$pkgdir"/usr/lib/*.a "$subpkgdir/usr/lib/"
+}
+
+
+libsdev() {
+ pkgdesc="$pkgdesc (development files for dynamic linking)"
+ depends="$pkgname-dev"
+ mkdir -p "$subpkgdir/lib"
+ mv "$pkgdir"/lib/*.so "$subpkgdir/lib/"
+}
+
+
+doc() {
+ pkgdesc="$pkgdesc (documentation)"
+ depends=
+ install_if="docs $pkgname=$pkgver-r$pkgrel"
+ mkdir -p "$subpkgdir/usr/share/doc"
+ cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
+}
+
+sha512sums="e529545e90110986ced7ff445bc831de74a953e76aef0a9802b28228ef3705dcc8bf1abd90034d6e8de8c29dd3f4512e492168c4a1582a15a9e9e8ad8dc88909 s6-rc-0.5.1.0.tar.gz"