Semi-automated update for zfs 2.0.4

master
Archzfs Buildbot 1 year ago
parent 3df75aa3d8
commit a4daaddccd
  1. 6
      .SRCINFO
  2. 6
      PKGBUILD
  3. 46
      zfs-utils.initcpio.hook
  4. 2
      zfs-utils.initcpio.zfsencryptssh.install

@ -1,7 +1,7 @@
pkgbase = zfs-utils
pkgdesc = Kernel module support files for the Zettabyte File System.
pkgver = 2.0.4
pkgrel = 1
pkgrel = 2
url = http://zfsonlinux.org/
install = zfs-utils.install
arch = x86_64
@ -29,8 +29,8 @@ pkgbase = zfs-utils
source = zfs-utils.initcpio.zfsencryptssh.install
sha256sums = 7d1344c5433b91823f02c2e40b33d181fa6faf286bea5591f4b1965f23d45f6c
sha256sums = 29a8a6d76fff01b71ef1990526785405d9c9410bdea417b08b56107210d00b10
sha256sums = 449a6db4abd3f166562bb67a63950af053e9ec07eabbfcdff827c5ed0113a2d6
sha256sums = 29080a84e5d7e36e63c4412b98646043724621245b36e5288f5fed6914da5b68
sha256sums = ad3e7244aca20fce005860c5118d46a77a0b4f5644d73e9648ea3ba5ff87c4c3
sha256sums = 93e6ac4e16f6b38b2fa397a63327bcf7001111e3a58eb5fb97c888098c932a51
pkgname = zfs-utils

@ -8,7 +8,7 @@
pkgname="zfs-utils"
pkgver=2.0.4
pkgrel=1
pkgrel=2
pkgdesc="Kernel module support files for the Zettabyte File System."
makedepends=("python" "python-setuptools" "python-cffi")
optdepends=("python: pyzfs and extra utilities", "python-cffi: pyzfs")
@ -20,8 +20,8 @@ source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-${pkgver}/zfs-$
"zfs-utils.initcpio.zfsencryptssh.install")
sha256sums=("7d1344c5433b91823f02c2e40b33d181fa6faf286bea5591f4b1965f23d45f6c"
"29a8a6d76fff01b71ef1990526785405d9c9410bdea417b08b56107210d00b10"
"449a6db4abd3f166562bb67a63950af053e9ec07eabbfcdff827c5ed0113a2d6"
"29080a84e5d7e36e63c4412b98646043724621245b36e5288f5fed6914da5b68")
"ad3e7244aca20fce005860c5118d46a77a0b4f5644d73e9648ea3ba5ff87c4c3"
"93e6ac4e16f6b38b2fa397a63327bcf7001111e3a58eb5fb97c888098c932a51")
license=("CDDL")
groups=("archzfs-linux")
provides=("zfs-utils" "spl-utils")

@ -29,24 +29,44 @@ zfs_get_bootfs () {
zfs_decrypt_fs() {
dataset=$1
# check if 'zfs load-key' is available
zfs 2>&1 | grep load-key > /dev/null || return 0
# Make sure dataset is encrypted; get fails if ZFS does not support encryption
encryption="$(zfs get -H -o value encryption "${dataset}" 2>/dev/null)" || return 0
[ "${encryption}" != "off" ] || return 0
# check if dataset is encrypted
[ "$(zfs get -H -o value encryption "${dataset}")" != "off" ] || return 0
# Make sure the dataset is locked
keystatus="$(zfs get -H -o value keystatus "${dataset}")" || return 0
[ "${keystatus}" != "available" ] || return 0
# check if key is already loaded
[ "$(zfs get -H -o value keystatus "${dataset}")" != "available" ] || return 0
# Make sure the encryptionroot is sensible
encryptionroot="$(zfs get -H -o value encryptionroot "${dataset}")" || return 0
[ "${encryptionroot}" != "-" ] || return 0
# get the encryption root
encryptionroot=$(zfs get -H -o value encryptionroot "${dataset}")
# export encription root to be used by other hooks (SSH)
# Export encryption root to be used by other hooks (SSH)
echo "${encryptionroot}" > /.encryptionroot
# loop until we get the correct password or key is unlocked by another vector (SSH for instance)
while [ "$(zfs get -H -o value keystatus "${encryptionroot}")" != "available" ] &&
! eval zfs load-key "${encryptionroot}"; do
# If key location is a file, determine if it can by overridden by prompt
prompt_override=""
if keylocation="$(zfs get -H -o value keylocation "${dataset}")"; then
if [ "${keylocation}" != "prompt" ]; then
if keyformat="$(zfs get -H -o value keyformat "${dataset}")"; then
[ "${keyformat}" = "passphrase" ] && prompt_override="yes"
fi
fi
fi
# Loop until key is loaded here or by another vector (SSH, for instance)
while [ "$(zfs get -H -o value keystatus "${encryptionroot}")" != "available" ]; do
# Try the default loading mechanism
zfs load-key "${encryptionroot}" && break
# Load failed, try a prompt if the failure was not a prompt
if [ -n "${prompt_override}" ]; then
echo "Unable to load key ${keylocation}; please type the passphrase"
echo "To retry the file, interrupt now or repeatedly input a wrong passphrase"
zfs load-key -L prompt "${encryptionroot}" && break
fi
# Throttle retry attempts
sleep 2
done

@ -1,7 +1,7 @@
#!/bin/bash
make_etc_passwd() {
echo 'root:x:0:0:root:/root:/bin/zfsdecrypt_shell' > "${BUILDROOT}"/etc/passwd
echo 'root:x:0:0:root:/root:/bin/zfsdecrypt_shell' >> "${BUILDROOT}"/etc/passwd
echo '/bin/zfsdecrypt_shell' > "${BUILDROOT}"/etc/shells
}

Loading…
Cancel
Save