summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD25
-rw-r--r--shared-cryptboot-build6
-rw-r--r--shared-cryptboot-build.hook10
-rw-r--r--shared-cryptboot-mount.hook17
-rw-r--r--shared-cryptboot-unmount.hook16
7 files changed, 94 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..45e898cb675
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = shared-cryptboot-utils
+ pkgdesc = Utilities for having boot files on a shared encrypted device
+ pkgver = 1.0.0
+ pkgrel = 1
+ arch = any
+ license = GPL
+ source = shared-cryptboot-build.hook
+ source = shared-cryptboot-mount.hook
+ source = shared-cryptboot-unmount.hook
+ source = shared-cryptboot-build
+ sha256sums = 5dd4951e1a2956591f87d37122b843758698dd459c67d6e3e0c04a420cb6a193
+ sha256sums = 5cbe670efb0863c433c9c0e20dbba969e8679e028e1fbba69f81e9b395de3714
+ sha256sums = 7bd9067a71d410f0c13c3816eef56dcf2f4a07b621ea47186e6d1e6e88e2c909
+ sha256sums = 7816db0e31df365852a8041bc04c841c12a4e705bebd9659ea4b89772a82fe2d
+
+pkgname = shared-cryptboot-utils
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..ce6740e87cf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/src/
+/pkg/
+/*.tar.xz
+/*.tar.xz.sig
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..563318963e8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,25 @@
+# Author: Emil Lundberg <lundberg.emil@gmail.com>.
+
+pkgname=shared-cryptboot-utils
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Utilities for having boot files on a shared encrypted device"
+arch=('any')
+license=('GPL')
+source=(
+ shared-cryptboot-build.hook
+ shared-cryptboot-mount.hook
+ shared-cryptboot-unmount.hook
+ shared-cryptboot-build
+)
+sha256sums=('5dd4951e1a2956591f87d37122b843758698dd459c67d6e3e0c04a420cb6a193'
+ '5cbe670efb0863c433c9c0e20dbba969e8679e028e1fbba69f81e9b395de3714'
+ '7bd9067a71d410f0c13c3816eef56dcf2f4a07b621ea47186e6d1e6e88e2c909'
+ '7816db0e31df365852a8041bc04c841c12a4e705bebd9659ea4b89772a82fe2d')
+
+package() {
+ install -D -m 444 "${srcdir}"/shared-cryptboot-build.hook "${pkgdir}"/usr/share/libalpm/hooks/shared-cryptboot-build.hook
+ install -D -m 444 "${srcdir}"/shared-cryptboot-mount.hook "${pkgdir}"/usr/share/libalpm/hooks/shared-cryptboot-mount.hook
+ install -D -m 444 "${srcdir}"/shared-cryptboot-unmount.hook "${pkgdir}"/usr/share/libalpm/hooks/shared-cryptboot-unmount.hook
+ install -D -m 555 "${srcdir}"/shared-cryptboot-build "${pkgdir}"/usr/share/libalpm/scripts/shared-cryptboot-build
+}
diff --git a/shared-cryptboot-build b/shared-cryptboot-build
new file mode 100644
index 00000000000..c1327300a82
--- /dev/null
+++ b/shared-cryptboot-build
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+SHARED_CRYPTBOOT_IMAGE_SUFFIX=${SHARED_CRYPTBOOT_IMAGE_SUFFIX:-$(hostname)}
+
+cp /boot/vmlinuz-linux /boot/vmlinuz-linux-${SHARED_CRYPTBOOT_IMAGE_SUFFIX}
+cp /boot/initramfs-linux.img /boot/initramfs-linux-${SHARED_CRYPTBOOT_IMAGE_SUFFIX}.img
diff --git a/shared-cryptboot-build.hook b/shared-cryptboot-build.hook
new file mode 100644
index 00000000000..76c92353747
--- /dev/null
+++ b/shared-cryptboot-build.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = linux
+
+[Action]
+Description = Rebuilding boot files on shared boot device...
+When = PostTransaction
+Exec = /usr/share/libalpm/scripts/shared-cryptboot-build
diff --git a/shared-cryptboot-mount.hook b/shared-cryptboot-mount.hook
new file mode 100644
index 00000000000..03d36e0bb82
--- /dev/null
+++ b/shared-cryptboot-mount.hook
@@ -0,0 +1,17 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = File
+Target = boot/*
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = linux
+
+[Action]
+Description = Mounting /boot ...
+When = PreTransaction
+Exec = /usr/bin/mount /boot
+AbortOnFail
diff --git a/shared-cryptboot-unmount.hook b/shared-cryptboot-unmount.hook
new file mode 100644
index 00000000000..92aa062ee3a
--- /dev/null
+++ b/shared-cryptboot-unmount.hook
@@ -0,0 +1,16 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = File
+Target = boot/*
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = linux
+
+[Action]
+Description = Unmounting /boot ...
+When = PostTransaction
+Exec = /usr/bin/umount /boot