summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormrxx2016-04-17 17:33:00 +0200
committermrxx2016-04-17 17:33:00 +0200
commit8fc660f4315abc67334ec6764c3511db2926bd59 (patch)
tree97146f36aaed368351b530d75ac5e70e78f6c460
downloadaur-8fc660f4315abc67334ec6764c3511db2926bd59.tar.gz
Initial import v0.8
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD33
-rw-r--r--boot-digest-alert4
-rw-r--r--boot-digest-alert.desktop6
-rw-r--r--boot-digest-check.service9
-rw-r--r--boot-digest-mkinitcpio7
-rw-r--r--boot-digest.install15
-rw-r--r--boot-digest.mkinitcpio-hook11
8 files changed, 112 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..e803c883499
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+# Generated by mksrcinfo v8
+# Sun Apr 17 15:28:13 UTC 2016
+pkgbase = boot-digest
+ pkgdesc = Digest boot partition for disk encryption integrity
+ pkgver = 0.8
+ pkgrel = 1
+ url = https://github.com/alonbl/boot-digest
+ install = boot-digest.install
+ arch = any
+ license = MIT
+ makedepends = git
+ depends = bash
+ source = git+https://github.com/alonbl/boot-digest.git
+ source = boot-digest-check.service
+ source = boot-digest-mkinitcpio
+ source = boot-digest.mkinitcpio-hook
+ source = boot-digest-alert
+ source = boot-digest-alert.desktop
+ sha1sums = SKIP
+ sha1sums = 948c773af5ac6963163179538bf6446fa821c3ed
+ sha1sums = 29e0e6005b319ed0d404a13f94e605f0c48895e1
+ sha1sums = 45b20e72bdc59d96bc07e8b339a560fef3af7e05
+ sha1sums = f4c99af8914e8dd842a4a84b2945c5c2af2f5ba1
+ sha1sums = f6c3dc2b5cd8fbd8b1f38936ebe167e2556aaef6
+
+pkgname = boot-digest
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..98e3fcaac9e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,33 @@
+# Maintainer: mrxx <mrxx at cyberhome dot at>
+
+pkgname=boot-digest
+pkgver=0.8
+pkgrel=1
+pkgdesc="Digest boot partition for disk encryption integrity"
+arch=('any')
+url="https://github.com/alonbl/boot-digest"
+license=('MIT')
+depends=('bash')
+makedepends=('git')
+source=('git+https://github.com/alonbl/boot-digest.git' 'boot-digest-check.service' 'boot-digest-mkinitcpio' 'boot-digest.mkinitcpio-hook' 'boot-digest-alert' 'boot-digest-alert.desktop' )
+sha1sums=('SKIP'
+ '948c773af5ac6963163179538bf6446fa821c3ed'
+ '29e0e6005b319ed0d404a13f94e605f0c48895e1'
+ '45b20e72bdc59d96bc07e8b339a560fef3af7e05'
+ 'f4c99af8914e8dd842a4a84b2945c5c2af2f5ba1'
+ 'f6c3dc2b5cd8fbd8b1f38936ebe167e2556aaef6')
+
+install=boot-digest.install
+
+package() {
+ cd "$srcdir/$pkgname"
+ sed -i '2,3d' boot-digest-mark
+ install -Dm755 -t ${pkgdir}/usr/bin boot-digest-calc boot-digest-check boot-digest-mark
+ install -Dm644 -t ${pkgdir}/usr/share/licenses/${pkgname} LICENSE
+ install -Dm644 -t ${pkgdir}/usr/share/doc/${pkgname} ChangeLog
+ cd "$srcdir"
+ install -Dm644 boot-digest.mkinitcpio-hook ${pkgdir}/usr/lib/initcpio/install/boot-digest
+ install -Dm644 -t ${pkgdir}/usr/lib/systemd/system boot-digest-check.service
+ install -Dm755 -t ${pkgdir}/usr/bin boot-digest-alert boot-digest-mkinitcpio
+ install -Dm644 -t ${pkgdir}/etc/xdg/autostart boot-digest-alert.desktop
+}
diff --git a/boot-digest-alert b/boot-digest-alert
new file mode 100644
index 00000000000..4670d7b1918
--- /dev/null
+++ b/boot-digest-alert
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+systemctl status boot-digest-check.service|grep -q failed
+[ $? -eq 0 ] && notify-send -t 0 -u critical -i /usr/share/icons/gnome/24x24/status/error.png --app-name='Boot loader Checksum' 'boot-digest FAILED!'
diff --git a/boot-digest-alert.desktop b/boot-digest-alert.desktop
new file mode 100644
index 00000000000..6de7d57081c
--- /dev/null
+++ b/boot-digest-alert.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Exec=/usr/bin/boot-digest-alert
+Name=Boot digest alert
+Type=Application
+Version=1.0
+X-LXQt-Need-Tray=true
diff --git a/boot-digest-check.service b/boot-digest-check.service
new file mode 100644
index 00000000000..8826dbee73f
--- /dev/null
+++ b/boot-digest-check.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Check boot partition checksums
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh /usr/bin/boot-digest-check
+
+[Install]
+WantedBy=multi-user.target
diff --git a/boot-digest-mkinitcpio b/boot-digest-mkinitcpio
new file mode 100644
index 00000000000..ce99ac757c1
--- /dev/null
+++ b/boot-digest-mkinitcpio
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+while [[ -d "/proc/$PPID" ]]; do
+ sleep 1
+done
+
+/usr/bin/boot-digest-mark
diff --git a/boot-digest.install b/boot-digest.install
new file mode 100644
index 00000000000..6d943670aa1
--- /dev/null
+++ b/boot-digest.install
@@ -0,0 +1,15 @@
+post_install() {
+ hooks=$(grep '^HOOKS=' /etc/mkinitcpio.conf|cut -f2 -d'"')
+ if [ ! -z "${hooks##*boot-digest*}" ]; then
+ hooks="$hooks boot-digest"
+ sed -i "s/^HOOKS=.*/HOOKS=\"$hooks\"/" /etc/mkinitcpio.conf
+ fi
+ /usr/bin/boot-digest-mark
+ systemctl enable boot-digest-check.service
+}
+
+pre_remove() {
+ grep -q boot-digest /etc/mkinitcpio.conf
+ [ $? -eq 0 ] && sed -i "s/ boot-digest//" /etc/mkinitcpio.conf
+ systemctl disable boot-digest-check.service
+}
diff --git a/boot-digest.mkinitcpio-hook b/boot-digest.mkinitcpio-hook
new file mode 100644
index 00000000000..25e43dc175e
--- /dev/null
+++ b/boot-digest.mkinitcpio-hook
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+build() {
+ /usr/bin/boot-digest-mkinitcpio &
+}
+
+help() {
+ cat <<HELPEOF
+This hook waits for mkinitcpio to finish, then recalculates the boot digest.
+HELPEOF
+}