diff options
author | Jesus Alvarez | 2016-09-12 22:38:18 -0700 |
---|---|---|
committer | Jesus Alvarez | 2016-09-12 22:38:18 -0700 |
commit | 2748de5ec10e9675bb4816fe361bc60e2464179d (patch) | |
tree | 7865f44102850a8b4d220db91915fd21f7366ed6 | |
parent | 4d0fbfa36088c15e8dbe2e6ba237b8dc8bc9ab44 (diff) | |
download | aur-2748de5ec10e9675bb4816fe361bc60e2464179d.tar.gz |
Semi-automated update for 4.7.2_1-6
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | zfs-utils.initcpio.hook | 86 | ||||
-rw-r--r-- | zfs-utils.initcpio.install | 14 | ||||
-rw-r--r-- | zfs-utils.install | 14 |
5 files changed, 99 insertions, 60 deletions
@@ -1,26 +1,27 @@ # Generated by mksrcinfo v8 -# Fri Jul 15 15:21:50 UTC 2016 +# Tue Sep 13 04:52:17 UTC 2016 pkgbase = zfs-utils-linux pkgdesc = Kernel module support files for the Zettabyte File System. - pkgver = 0.6.5.7_4.6.4_1 - pkgrel = 1 + pkgver = 0.6.5.8_4.7.2_1 + pkgrel = 6 url = http://zfsonlinux.org/ + install = zfs-utils.install arch = x86_64 groups = archzfs-linux license = CDDL - makedepends = linux-headers=4.6.4 + makedepends = linux-headers=4.7.2 depends = spl-linux - depends = linux=4.6.4 + depends = linux=4.7.2 provides = zfs-utils replaces = zfs-utils-git - source = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.5.7.tar.gz + source = https://github.com/zfsonlinux/zfs/releases/download/zfs-0.6.5.8/zfs-0.6.5.8.tar.gz source = zfs-utils.bash-completion-r1 source = zfs-utils.initcpio.install source = zfs-utils.initcpio.hook - sha256sums = 4a9e271bb9a6af8d564e4d5800e4fff36224f1697b923a7253659bdda80dc590 + sha256sums = d77f43f7dc38381773e2c34531954c52f3de80361b7bb10c933a7482f89cfe84 sha256sums = b60214f70ffffb62ffe489cbfabd2e069d14ed2a391fac0e36f914238394b540 - sha256sums = 1e20071fa61a33874505dae0f2d71bb560f43e7faaea735cbde770ea10c133df - sha256sums = 67a96169d36853d8f18ee5a2443ecfcd2461a20f9109f4b281bee3945d83518a + sha256sums = dfafce18240722bee26b5864982b4db1cd6d682c4b93a8b1f4832c98686f50d2 + sha256sums = 5f749dbe3b853c5b569d5050b50226b53961cf1fa2cfc5cea0ecc3df75885d2f pkgname = zfs-utils-linux @@ -15,38 +15,39 @@ # archzfs github page. # pkgname="zfs-utils-linux" -pkgver=0.6.5.7_4.6.4_1 -pkgrel=1 +pkgver=0.6.5.8_4.7.2_1 +pkgrel=6 pkgdesc="Kernel module support files for the Zettabyte File System." -depends=("spl-linux" "linux=4.6.4") -makedepends=("linux-headers=4.6.4") +depends=("spl-linux" "linux=4.7.2") +makedepends=("linux-headers=4.7.2") arch=("x86_64") url="http://zfsonlinux.org/" -source=("http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.5.7.tar.gz" +source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-0.6.5.8/zfs-0.6.5.8.tar.gz" "zfs-utils.bash-completion-r1" "zfs-utils.initcpio.install" "zfs-utils.initcpio.hook") -sha256sums=("4a9e271bb9a6af8d564e4d5800e4fff36224f1697b923a7253659bdda80dc590" +sha256sums=("d77f43f7dc38381773e2c34531954c52f3de80361b7bb10c933a7482f89cfe84" "b60214f70ffffb62ffe489cbfabd2e069d14ed2a391fac0e36f914238394b540" - "1e20071fa61a33874505dae0f2d71bb560f43e7faaea735cbde770ea10c133df" - "67a96169d36853d8f18ee5a2443ecfcd2461a20f9109f4b281bee3945d83518a") + "dfafce18240722bee26b5864982b4db1cd6d682c4b93a8b1f4832c98686f50d2" + "5f749dbe3b853c5b569d5050b50226b53961cf1fa2cfc5cea0ecc3df75885d2f") license=("CDDL") groups=("archzfs-linux") provides=("zfs-utils") +install=zfs-utils.install replaces=("zfs-utils-git") build() { - cd "${srcdir}/zfs-0.6.5.7" + cd "${srcdir}/zfs-0.6.5.8" ./autogen.sh ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --with-mounthelperdir=/usr/bin \ --libdir=/usr/lib --datadir=/usr/share --includedir=/usr/include \ - --with-udevdir=/lib/udev --libexecdir=/usr/lib/zfs-0.6.5.7 \ + --with-udevdir=/lib/udev --libexecdir=/usr/lib/zfs-0.6.5.8 \ --with-config=user make } package() { - cd "${srcdir}/zfs-0.6.5.7" + cd "${srcdir}/zfs-0.6.5.8" make DESTDIR="${pkgdir}" install # Remove uneeded files rm -r "${pkgdir}"/etc/init.d @@ -54,6 +55,9 @@ package() { # move module tree /lib -> /usr/lib cp -r "${pkgdir}"/{lib,usr} rm -r "${pkgdir}"/lib + # Autoload the zfs module at boot + mkdir -p "${pkgdir}/etc/modules-load.d" + printf "%s\n" "zfs" > "${pkgdir}/etc/modules-load.d/zfs.conf" # Install the support files install -D -m644 "${srcdir}"/zfs-utils.initcpio.hook "${pkgdir}"/usr/lib/initcpio/hooks/zfs install -D -m644 "${srcdir}"/zfs-utils.initcpio.install "${pkgdir}"/usr/lib/initcpio/install/zfs diff --git a/zfs-utils.initcpio.hook b/zfs-utils.initcpio.hook index 57df9c168b7d..8f1d587b01ab 100644 --- a/zfs-utils.initcpio.hook +++ b/zfs-utils.initcpio.hook @@ -2,7 +2,7 @@ ZPOOL_FORCE="" ZPOOL_IMPORT_FLAGS="" zfs_get_bootfs () { - for zfs_dataset in $(/usr/bin/zpool list -H -o bootfs); do + for zfs_dataset in $(zpool list -H -o bootfs); do case ${zfs_dataset} in "" | "-") # skip this line/dataset @@ -20,14 +20,12 @@ zfs_get_bootfs () { } zfs_mount_handler () { - local node=$1 - if [ "$ZFS_DATASET" = "bootfs" ] ; then + if [ "${ZFS_DATASET}" = "bootfs" ] ; then if ! zfs_get_bootfs ; then # Lets import everything and try again - /usr/bin/zpool import $ZPOOL_IMPORT_FLAGS -N -a $ZPOOL_FORCE + zpool import ${ZPOOL_IMPORT_FLAGS} -N -a ${ZPOOL_FORCE} if ! zfs_get_bootfs ; then - echo "ZFS: Cannot find bootfs." - return 1 + die "ZFS: Cannot find bootfs." fi fi fi @@ -35,39 +33,61 @@ zfs_mount_handler () { local pool="${ZFS_DATASET%%/*}" local rwopt_exp=${rwopt:-ro} - if ! "/usr/bin/zpool" list -H $pool 2>&1 > /dev/null ; then - if [ "$rwopt_exp" != "rw" ]; then - msg "ZFS: Importing pool $pool readonly." - ZPOOL_IMPORT_FLAGS="$ZPOOL_IMPORT_FLAGS -o readonly=on" + if ! zpool list -H ${pool} 2>1 > /dev/null ; 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." + msg "ZFS: Importing pool ${pool}." fi - if ! "/usr/bin/zpool" import $ZPOOL_IMPORT_FLAGS -N $pool $ZPOOL_FORCE ; then - echo "ZFS: Unable to import pool $pool." - return 1 + if ! zpool import ${ZPOOL_IMPORT_FLAGS} -N ${pool} ${ZPOOL_FORCE} ; then + die "ZFS: Unable to import pool ${pool}." fi fi - local mountpoint=$("/usr/bin/zfs" get -H -o value mountpoint $ZFS_DATASET) - if [ "$mountpoint" = "legacy" ] ; then - mount -t zfs -o ${rwopt_exp} "$ZFS_DATASET" "$node" - else - mount -o zfsutil,${rwopt_exp} -t zfs "$ZFS_DATASET" "$node" - 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 == 1 ]] && ZPOOL_FORCE='-f' - [[ "$zfs_import_dir" != "" ]] && ZPOOL_IMPORT_FLAGS="$ZPOOL_IMPORT_FLAGS -d $zfs_import_dir" + # Force import the pools, useful if the pool has not properly been exported using 'zpool export <pool>' + [[ ${zfs_force} == 1 ]] && ZPOOL_FORCE='-f' + + # Add import directory to import command flags + [[ "${zfs_import_dir}" != "" ]] && ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -d ${zfs_import_dir}" - if [ "$root" = 'zfs' ]; then + # Wait 15 seconds for ZFS devices to show up + [[ "${zfs_wait}" == "" ]] && ZFS_WAIT="15" || ZFS_WAIT="${zfs_wait}" + + if [[ "${root}" == 'zfs' ]]; then mount_handler='zfs_mount_handler' fi - case $zfs in + case ${zfs} in "") # skip this line/dataset ;; @@ -76,24 +96,20 @@ run_hook() { mount_handler="zfs_mount_handler" ;; *) - ZFS_DATASET=$zfs + ZFS_DATASET=${zfs} mount_handler="zfs_mount_handler" ;; esac - if [ ! -f "/etc/hostid" ] ; then - echo "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly." - fi - - # Allow up to 10 seconds for zfs device to show up - for i in 1 2 3 4 5 6 7 8 9 10; do - [ -c "/dev/zfs" ] && break + # Allow up to n seconds for zfs device to show up + for i in {1..${ZFS_WAIT}}; do + [[ -c "/dev/zfs" ]] && break sleep 1 done } run_latehook () { - /usr/bin/zpool import -N -a $ZPOOL_FORCE + zpool import -N -a ${ZPOOL_FORCE} } # vim:set ts=4 sw=4 ft=sh et: diff --git a/zfs-utils.initcpio.install b/zfs-utils.initcpio.install index c128d1006371..3cfb836dba7d 100644 --- a/zfs-utils.initcpio.install +++ b/zfs-utils.initcpio.install @@ -27,14 +27,15 @@ build() { zstreamdump \ ztest \ splat \ - hostid \ /lib/udev/vdev_id \ - /lib/udev/zvol_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/udev/rules.d/90-zfs.rules \ + /lib/libgcc_s.so.1 map add_dir \ /etc/zfs/zed.d @@ -42,11 +43,10 @@ build() { add_runscript # allow mount(8) to "autodetect" ZFS - echo 'zfs' >>"$BUILDROOT/etc/filesystems" + 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() { @@ -73,6 +73,10 @@ Command Line Setup: 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 diff --git a/zfs-utils.install b/zfs-utils.install new file mode 100644 index 000000000000..ba23cb0f98ac --- /dev/null +++ b/zfs-utils.install @@ -0,0 +1,14 @@ +show_warning() { + echo ">>> WARNING: The systemd unit files for archzfs have changed!" + echo ">>> You may need re-enable the zfs systemd service." + echo ">>> See https://github.com/archzfs/archzfs/issues/72" +} + +post_install() { + show_warning +} + +post_upgrade() { + show_warning +} + |