summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher A. Williamson2019-04-09 17:54:24 +0000
committerChristopher A. Williamson2019-04-09 17:54:24 +0000
commitb8a11a3355c8a636e174b09eb25254b5bc75aae4 (patch)
treee0538e21441026c973c03849267e2e6a1ef9e5ac
downloadaur-b8a11a3355c8a636e174b09eb25254b5bc75aae4.tar.gz
Initial release of stratisd-boot package
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD52
-rw-r--r--initcpio-install51
-rw-r--r--stratisd-boot.service17
4 files changed, 143 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b68da255615d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = stratisd-boot
+ pkgdesc = Stratis binary for inclusion in initramfs to allow using Stratis as boot volume
+ pkgver = 1.0.3
+ pkgrel = 1
+ url = https://stratis-storage.github.io
+ arch = x86_64
+ license = MPL2
+ makedepends = asciidoc
+ makedepends = cargo
+ makedepends = git
+ makedepends = mpfr
+ makedepends = rust
+ provides = stratisd-boot
+ conflicts = stratisd-boot
+ source = stratisd-1.0.3.tar.gz::https://github.com/stratis-storage/stratisd/archive/v1.0.3.tar.gz
+ source = initcpio-install
+ source = stratisd-boot.service
+ sha256sums = 27e8dcae06b5bbb89ed4e798435f004fd86964400da7162fa2a56742cb4e9bc3
+ sha256sums = ba1812d04a837df55475d4348d4325f3cf4ceae30f963bd9e99a2eb81b0c9b63
+ sha256sums = 2fb79ecabe72885ae637412ad208d3c3290cf1a6754f4165366458714aa14ea9
+
+pkgname = stratisd-boot
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a83ef7d1fe3b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,52 @@
+pkgname='stratisd-boot'
+pkgver=1.0.3
+pkgrel=1
+pkgdesc='Stratis binary for inclusion in initramfs to allow using Stratis as boot volume'
+arch=('x86_64')
+url='https://stratis-storage.github.io'
+license=('MPL2')
+makedepends=('asciidoc' 'cargo' 'git' 'mpfr' 'rust')
+provides=("${pkgname}")
+conflicts=("${pkgname}")
+
+source=(
+ "stratisd-${pkgver}.tar.gz::https://github.com/stratis-storage/stratisd/archive/v${pkgver}.tar.gz"
+ 'initcpio-install'
+ 'stratisd-boot.service'
+)
+sha256sums=(
+ '27e8dcae06b5bbb89ed4e798435f004fd86964400da7162fa2a56742cb4e9bc3'
+ 'ba1812d04a837df55475d4348d4325f3cf4ceae30f963bd9e99a2eb81b0c9b63'
+ '2fb79ecabe72885ae637412ad208d3c3290cf1a6754f4165366458714aa14ea9'
+)
+
+build() {
+ cd "stratisd-${pkgver}"
+
+ msg2 "Patching makefile to enable release build"
+ sed -i 's,--target ,--release --target ,g' Makefile
+
+ msg2 "Building stratisd-boot"
+ make build-no-default
+}
+
+
+check() {
+ cd "stratisd-${pkgver}"
+
+ # Disabled temporarily - warning breaks compile
+ #make test
+}
+
+package() {
+ cd "stratisd-${pkgver}"
+
+ install -d -m 755 "${pkgdir}/usr/bin"
+ install -d -m 755 "${pkgdir}/usr/lib/initcpio/install"
+ install -d -m 755 "${pkgdir}/usr/lib/systemd/system"
+
+ install -m 755 'target/x86_64-unknown-linux-gnu/release/stratisd' "${pkgdir}/usr/bin/stratisd-boot"
+ install -m 644 '../stratisd-boot.service' "${pkgdir}/usr/lib/systemd/system"
+ install -m 644 '../initcpio-install' "${pkgdir}/usr/lib/initcpio/install/stratis"
+}
+
diff --git a/initcpio-install b/initcpio-install
new file mode 100644
index 000000000000..2c2a9b08669e
--- /dev/null
+++ b/initcpio-install
@@ -0,0 +1,51 @@
+#!/usr/bin/bash
+
+build() {
+ local mod
+ local symlink
+
+ # add necessary modules
+ for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-smq dm-thin-pool xfs; do
+ add_module "$mod"
+ done
+
+ # binaries from device-mapper
+ add_binary "dmsetup"
+
+ # add stratis-boot binary
+ add_binary "stratisd-boot"
+
+ # add thin-provisioning-tools
+ add_binary "pdata_tools"
+ for symlink in cache_{check,dump,meatadata_size,repair,restore} thin_{check,delta,dump,ls,metadata_size,repair,restore,rmap,trim}; do
+ add_symlink "/usr/bin/${symlink}" "pdata_tools"
+ done
+
+ # add xfs tools
+ for bin in mkfs.xfs xfs_db xfs_growfs; do
+ add_binary "${bin}"
+ done
+
+ # udev rules
+ add_file "/usr/lib/udev/rules.d/10-dm.rules"
+ add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
+ add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
+ add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
+
+ # add service
+ add_file "/usr/lib/systemd/system/stratisd-boot.service"
+
+ # enable service
+ add_symlink "/var/run" "/run"
+ add_symlink \
+ "/etc/systemd/system/basic.target.wants/stratisd-boot.service" \
+ "/usr/lib/systemd/stratisd-boot.service"
+}
+
+help() {
+ cat <<HELPEOF
+This hook enables Stratis volumes in initramfs.
+HELPEOF
+}
+
+# vim: set ft=sh ts=2 sw=2 et:
diff --git a/stratisd-boot.service b/stratisd-boot.service
new file mode 100644
index 000000000000..e2ce0c433842
--- /dev/null
+++ b/stratisd-boot.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Stratis boot daemon
+Documentation=man:stratisd(8)
+After=systemd-udevd.service
+Before=local-fs-pre.target
+Conflicts=stratisd.service
+DefaultDependencies=no
+
+[Service]
+ExecStart=/usr/bin/stratisd-boot --debug
+KillSignal=SIGINT
+Restart=on-abort
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=basic.target