Add mirror 'zfs-utils' at 'bc1ae33'

This commit is contained in:
Nathan 2022-10-05 13:13:05 -05:00
parent d9f4bd5bf9
commit bcea64b89d
5 changed files with 322 additions and 0 deletions

View file

@ -16,6 +16,11 @@
"branch": "master",
"revision": "ea6aeca101aa866895617ddb007ccb703c2ffa6d"
},
"zfs-utils": {
"url": "https://aur.archlinux.org/zfs-utils.git",
"branch": "master",
"revision": "bc1ae3304485ac89aeab2804c7e3c6f2bd3459b6"
},
"zfsbootmenu": {
"url": "https://aur.archlinux.org/zfsbootmenu.git",
"branch": "master",

26
zfs-utils/.SRCINFO Normal file
View file

@ -0,0 +1,26 @@
pkgbase = zfs-utils
pkgdesc = Userspace utilities for the Zettabyte File System.
pkgver = 2.1.6
pkgrel = 1
url = https://zfsonlinux.org/
arch = i686
arch = x86_64
arch = aarch64
license = CDDL
optdepends = python: for arcstat/arc_summary/dbufstat
source = https://github.com/zfsonlinux/zfs/releases/download/zfs-2.1.6/zfs-2.1.6.tar.gz
source = https://github.com/zfsonlinux/zfs/releases/download/zfs-2.1.6/zfs-2.1.6.tar.gz.asc
source = zfs.initcpio.install
source = zfs.initcpio.hook
validpgpkeys = 4F3BA9AB6D1F8D683DC2DFB56AD860EED4598027
validpgpkeys = C33DF142657ED1F7C328A2960AB9E991C6AF658B
sha256sums = 15339014f8d2131348eb937bf8893849806b6d2645ea607a18c7f117749dbd7a
sha256sums = SKIP
sha256sums = da1cdc045d144d2109ec7b5d97c53a69823759d8ecff410e47c3a66b69e6518d
sha256sums = 9c20256093997f7cfa9e7eb5d85d4a712d528a6ff19ef35b83ad03fb1ceae3bc
b2sums = 615fe7a2128af77c6c855ea52b6503a78f0c992ea845b02875ac19aa9dd155c5d4110b668da91c463f96a54767ab92e67e5303572337352484c055c0a0ff9e46
b2sums = SKIP
b2sums = 570e995bba07ea0fb424dff191180b8017b6469501964dc0b70fd51e338a4dad260f87cc313489866cbfd1583e4aac2522cf7309c067cc5314eb83c37fe14ff3
b2sums = e14366cbf680e3337d3d478fe759a09be224c963cc5207bee991805312afc49a49e6691f11e5b8bbe8dde60e8d855bd96e7f4f48f24a4c6d4a8c1bab7fc2bba0
pkgname = zfs-utils

70
zfs-utils/PKGBUILD Normal file
View file

@ -0,0 +1,70 @@
# Maintainer: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Iacopo Isimbaldi <isiachi@rhye.it>
# All my PKGBUILDs are managed at https://github.com/eli-schwartz/pkgbuilds
pkgname=zfs-utils
pkgver=2.1.6
pkgrel=1
pkgdesc="Userspace utilities for the Zettabyte File System."
arch=("i686" "x86_64" "aarch64")
url="https://zfsonlinux.org/"
license=('CDDL')
optdepends=('python: for arcstat/arc_summary/dbufstat')
source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-${pkgver}/zfs-${pkgver}.tar.gz"{,.asc}
"zfs.initcpio.install"
"zfs.initcpio.hook")
sha256sums=('15339014f8d2131348eb937bf8893849806b6d2645ea607a18c7f117749dbd7a'
'SKIP'
'da1cdc045d144d2109ec7b5d97c53a69823759d8ecff410e47c3a66b69e6518d'
'9c20256093997f7cfa9e7eb5d85d4a712d528a6ff19ef35b83ad03fb1ceae3bc')
b2sums=('615fe7a2128af77c6c855ea52b6503a78f0c992ea845b02875ac19aa9dd155c5d4110b668da91c463f96a54767ab92e67e5303572337352484c055c0a0ff9e46'
'SKIP'
'570e995bba07ea0fb424dff191180b8017b6469501964dc0b70fd51e338a4dad260f87cc313489866cbfd1583e4aac2522cf7309c067cc5314eb83c37fe14ff3'
'e14366cbf680e3337d3d478fe759a09be224c963cc5207bee991805312afc49a49e6691f11e5b8bbe8dde60e8d855bd96e7f4f48f24a4c6d4a8c1bab7fc2bba0')
validpgpkeys=('4F3BA9AB6D1F8D683DC2DFB56AD860EED4598027' # Tony Hutter (GPG key for signing ZFS releases) <hutter2@llnl.gov>
'C33DF142657ED1F7C328A2960AB9E991C6AF658B') # Brian Behlendorf <behlendorf1@llnl.gov>
prepare() {
cd "${srcdir}"/zfs-${pkgver}
# pyzfs is not built, but build system tries to check for python anyway
ln -sf /bin/true python3-fake
autoreconf -fi
}
build() {
cd "${srcdir}"/zfs-${pkgver}
./configure --prefix=/usr \
--sysconfdir=/etc \
--sbindir=/usr/bin \
--with-mounthelperdir=/usr/bin \
--with-udevdir=/usr/lib/udev \
--libexecdir=/usr/lib/zfs \
--with-python="$PWD/python3-fake" \
--enable-pyzfs=no \
--enable-systemd \
--with-config=user
make
}
package() {
cd "${srcdir}"/zfs-${pkgver}
make DESTDIR="${pkgdir}" install
install -D -m644 contrib/bash_completion.d/zfs "${pkgdir}"/usr/share/bash-completion/completions/zfs
# Remove uneeded files
rm -r "${pkgdir}"/etc/init.d
rm -r "${pkgdir}"/etc/sudoers.d #???
# We're experimenting with dracut in [extra], so start installing this.
#rm -r "${pkgdir}"/usr/lib/dracut
rm -r "${pkgdir}"/usr/lib/modules-load.d
rm -r "${pkgdir}"/usr/share/initramfs-tools
rm -r "${pkgdir}"/usr/share/zfs
install -D -m644 "${srcdir}"/zfs.initcpio.hook "${pkgdir}"/usr/lib/initcpio/hooks/zfs
install -D -m644 "${srcdir}"/zfs.initcpio.install "${pkgdir}"/usr/lib/initcpio/install/zfs
}

119
zfs-utils/zfs.initcpio.hook Normal file
View file

@ -0,0 +1,119 @@
#
# WARNING: This script is parsed by ash in busybox at boot time, not bash!
# http://linux.die.net/man/1/ash
# https://wiki.ubuntu.com/DashAsBinSh
# http://www.jpsdomain.org/public/2008-JP_bash_vs_dash.pdf
#
ZPOOL_FORCE=""
ZPOOL_IMPORT_FLAGS=""
zfs_get_bootfs () {
for zfs_dataset in $(zpool list -H -o bootfs); do
case ${zfs_dataset} in
"" | "-")
# skip this line/dataset
;;
"no pools available")
return 1
;;
*)
ZFS_DATASET=${zfs_dataset}
return 0
;;
esac
done
return 1
}
zfs_mount_handler () {
if [ "${ZFS_DATASET}" = "bootfs" ] ; then
if ! zfs_get_bootfs ; then
# Lets import everything and try again
zpool import ${ZPOOL_IMPORT_FLAGS} -N -a ${ZPOOL_FORCE}
if ! zfs_get_bootfs ; then
die "ZFS: Cannot find bootfs."
fi
fi
fi
local pool="${ZFS_DATASET%%/*}"
local rwopt_exp="${rwopt:-ro}"
if ! zpool list -H "${pool}" >/dev/null 2>&1; then
if [ ! "${rwopt_exp}" = "rw" ]; then
msg "ZFS: Importing pool ${pool} readonly."
ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -o readonly=on"
else
msg "ZFS: Importing pool ${pool}."
fi
if ! zpool import ${ZPOOL_IMPORT_FLAGS} -N "${pool}" ${ZPOOL_FORCE} ; then
die "ZFS: Unable to import pool ${pool}."
fi
fi
local node="$1"
local tab_file="${node}/etc/fstab"
local zfs_datasets="$(zfs list -H -o name -t filesystem -r ${ZFS_DATASET})"
# Mount the root, and any child datasets
for dataset in ${zfs_datasets}; do
mountpoint=$(zfs get -H -o value mountpoint "${dataset}")
case ${mountpoint} in
"none")
# skip this line/dataset.
;;
"legacy")
if [ -f "${tab_file}" ]; then
if findmnt -snero source -F "${tab_file}" -S "${dataset}" > /dev/null 2>&1; then
opt=$(findmnt -snero options -F "${tab_file}" -S "${dataset}")
mnt=$(findmnt -snero target -F "${tab_file}" -S "${dataset}")
mount -t zfs -o "${opt}" "${dataset}" "${node}${mnt}"
fi
fi
;;
*)
mount -t zfs -o "zfsutil,${rwopt_exp}" "${dataset}" "${node}${mountpoint}"
;;
esac
done
}
run_hook() {
# Force import the pools, useful if the pool has not properly been exported using 'zpool export <pool>'
[ ! "${zfs_force}" = "" ] && ZPOOL_FORCE="-f"
# Add import directory to import command flags
[ ! "${zfs_import_dir}" = "" ] && ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -d ${zfs_import_dir}"
# Wait 15 seconds for ZFS devices to show up
[ "${zfs_wait}" = "" ] && ZFS_WAIT="15" || ZFS_WAIT="${zfs_wait}"
[ "${root}" = "zfs" ] && mount_handler="zfs_mount_handler"
case ${zfs} in
"")
# skip this line/dataset
;;
auto|bootfs)
ZFS_DATASET="bootfs"
mount_handler="zfs_mount_handler"
;;
*)
ZFS_DATASET="${zfs}"
mount_handler="zfs_mount_handler"
;;
esac
# Allow up to n seconds for zfs device to show up
for i in $(seq 1 ${ZFS_WAIT}); do
[ -c "/dev/zfs" ] && break
sleep 1
done
}
run_latehook () {
zpool import -N -a ${ZPOOL_FORCE}
}
# vim:set ts=4 sw=4 ft=sh et:

View file

@ -0,0 +1,102 @@
#!/bin/bash
build() {
map add_module \
zavl \
znvpair \
zunicode \
zcommon \
zfs \
spl
map add_binary \
fsck.zfs \
mount.zfs \
seq \
zdb \
zed \
zfs \
zhack \
zinject \
zpool \
zstreamdump \
/lib/udev/vdev_id \
/lib/udev/zvol_id \
findmnt
map add_file \
/lib/udev/rules.d/60-zvol.rules \
/lib/udev/rules.d/69-vdev.rules \
/lib/udev/rules.d/90-zfs.rules \
/lib/libgcc_s.so.1
map add_dir \
/etc/zfs/zed.d
add_runscript
# allow mount(8) to "autodetect" ZFS
echo 'zfs' >>"${BUILDROOT}/etc/filesystems"
[[ -f /etc/zfs/zpool.cache ]] && add_file "/etc/zfs/zpool.cache"
[[ -f /etc/modprobe.d/zfs.conf ]] && add_file "/etc/modprobe.d/zfs.conf"
[[ -f /etc/hostid ]] && add_file "/etc/hostid"
}
help() {
cat<<HELPEOF
This hook allows you to use ZFS as your root filesystem.
Command Line Setup:
You can append the following arguments to your kernel parameters list. See
https://wiki.archlinux.org/index.php/Kernel_parameters for more information.
To use ZFS as your boot filesystem:
zfs=bootfs or zfs=auto or root=zfs
To use a pool or dataset:
zfs=<pool/dataset>
To force importing of a ZFS pool:
zfs_force=1
If set to 1, this will use "zpool import -f" when attempting to import
pools.
To change the seconds of time to wait for ZFS devices to show up at boot:
zfs_wait=30
To search for devices in a directory other than "/dev":
zfs_import_dir=/dev/disk/by-uuid
or
zfs_import_dir=/dev/disk/by-partuuid
or
zfs_import_dir=/dev/disk/by-path
etc.
Following initcpio convention, the 'rw' option must be specified to load the
pool as read/write. Pools are loaded as read only by default.
Examples:
To use bootfs on your pool, use
zfs=bootfs rw
This will setup your root using tank/root zfs pool.
zfs=tank/root rw
If you want to set properties for zfs-on-linux module, you should add them to
/etc/modprobe.d/zfs.conf and then rebuild initcpio.
HELPEOF
}
# vim: set ts=4 sw=4 ft=sh et: