summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPlaton Ryzhikov2019-02-07 15:16:03 +0300
committerPlaton Ryzhikov2019-02-07 15:16:03 +0300
commite6b6b49f957c8837ab986d0eefb69691794a7aca (patch)
treeb9d14658a1fe2f717e6cba3828101a25b9509e90
parenteff88c60dba8afbf2be424c4267760f08837e9b9 (diff)
downloadaur-e6b6b49f957c8837ab986d0eefb69691794a7aca.tar.gz
Add initramfs support
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD13
-rw-r--r--hook21
-rw-r--r--install23
4 files changed, 59 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f562c2314c8..44b014b3a21 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = nldev-phkr
pkgdesc = frontend for mdev, replacing the over-engineered udevd
pkgver = 0.3
- pkgrel = 4
+ pkgrel = 5
url = http://git.r-36.net/nldev/
arch = i686
arch = x86_64
@@ -10,9 +10,13 @@ pkgbase = nldev-phkr
source = git://git.r-36.net/nldev#commit=e0713f6
source = 0000-change_shell.patch
source = 0001-increase_buffer.patch
+ source = hook
+ source = install
md5sums = SKIP
md5sums = f96e7f40e2f4c5378c93c5cc97d4185d
md5sums = 508367c15bf5117870c7dc0765cba2b9
+ md5sums = 613a765dc1e0c2f203dbfae452f346ed
+ md5sums = af9a39fb39a042e10f92257efb159154
pkgname = nldev
diff --git a/PKGBUILD b/PKGBUILD
index bcf73d6775e..046fbd8afd0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgbase=nldev-phkr
pkgname=nldev
pkgver=0.3
-pkgrel=4
+pkgrel=5
pkgdesc="frontend for mdev, replacing the over-engineered udevd"
url="http://git.r-36.net/nldev/"
arch=('i686' 'x86_64')
@@ -12,10 +12,14 @@ license=('MIT')
_commit=e0713f6
source=("git://git.r-36.net/nldev#commit=$_commit"
"0000-change_shell.patch"
- "0001-increase_buffer.patch")
+ "0001-increase_buffer.patch"
+ 'hook'
+ 'install')
md5sums=('SKIP'
'f96e7f40e2f4c5378c93c5cc97d4185d'
- '508367c15bf5117870c7dc0765cba2b9')
+ '508367c15bf5117870c7dc0765cba2b9'
+ '613a765dc1e0c2f203dbfae452f346ed'
+ 'af9a39fb39a042e10f92257efb159154')
prepare() {
cd "${srcdir}/${pkgname}"
@@ -32,4 +36,7 @@ package() {
cd "$srcdir/$pkgname"
make DESTDIR="$pkgdir" PREFIX=/usr install
install -m644 -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ cd "$srcdir"
+ install -m644 -D hook "$pkgdir/usr/lib/initcpio/hooks/nldev"
+ install -m644 -D install "$pkgdir/usr/lib/initcpio/install/nldev"
}
diff --git a/hook b/hook
new file mode 100644
index 00000000000..556e58878ed
--- /dev/null
+++ b/hook
@@ -0,0 +1,21 @@
+#!/usr/bin/ash
+
+run_earlyhook() {
+ ln -sf /proc/self/fd /dev/fd
+ ln -sf /proc/self/fd/0 /dev/stdin
+ ln -sf /proc/self/fd/1 /dev/stdout
+ ln -sf /proc/self/fd/2 /dev/stderr
+ nldev -r /usr/bin/smdev &
+ echo $! > /run/nldev.pid
+}
+
+run_hook() {
+ msg ":: Triggering uevents..."
+ nltrigger add all
+ sleep 1s
+}
+
+run_cleanuphook() {
+ kill $(cat /run/nldev.pid)
+ rm /run/nldev.pid
+}
diff --git a/install b/install
new file mode 100644
index 00000000000..a3df118bee2
--- /dev/null
+++ b/install
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+build() {
+ add_binary /etc/smdev/proceeddev
+ add_binary /usr/bin/mksh
+ add_binary /usr/bin/smdev
+ add_binary /usr/bin/nldev
+ add_binary /usr/bin/nltrigger
+ add_binary /usr/bin/find
+ add_file /usr/lib/libm.so.6
+
+ for file in /etc/smdev/add/*; do
+ add_file $file
+ done
+
+ add_runscript
+}
+
+help() {
+ cat <<HELPEOF
+This hook will use nldev to process device uevents. It prepares your root device and adds some else device nodes.
+HELPEOF
+}