public
anonymous / changes.patch.txt
Created

changes.patch

  • Download Gist
changes.patch.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
diff -Naur zfs/PKGBUILD zfs.new/PKGBUILD
--- zfs/PKGBUILD 2012-06-23 13:36:36.000000000 -0400
+++ zfs.new/PKGBUILD 2012-06-23 16:09:19.890161072 -0400
@@ -1,33 +1,39 @@
+# Maintainer: Kyle Fuller <inbox@kylefuller.co.uk>
+# Contributor: Jonathan Vasquez <jvasquez1011@gmail.com>
+
pkgname=zfs
pkgver=0.6.0_rc9
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc="Native ZFS for Linux"
url="http://zfsonlinux.org/"
-depends=('util-linux' "spl=$pkgver-$pkgrel")
+depends=('util-linux' "spl=${pkgver}-${pkgrel}")
makedepends=('linux-headers')
+
source=(http://github.com/downloads/zfsonlinux/zfs/zfs-${pkgver//_/-}.tar.gz
preempt.patch
zfs.initcpio.hook
zfs.initcpio.install)
+
md5sums=('f41082bd7073198cabf37e6e54359a07'
'9a5dc8b83c6b523fd2bd0be842278e2c'
- 'ca13cbbfa056847aa5a3a1479b43a066'
- 'af4deb337da54312591dbbc9b6a9380e')
+ 'e41fe7004a9b64c2af825e6b1663e8c8'
+ '8f93649b8eaab7bb9873aaae551ea1cb')
+
license=('CDDL')
install=zfs.install
build() {
- cd "$srcdir/$pkgname-${pkgver//_/-}"
- patch -p1 -i $srcdir/preempt.patch
+ cd "${srcdir}/${pkgname}-${pkgver//_/-}"
+ patch -p1 -i ${srcdir}/preempt.patch
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc
make
}
package() {
- cd "$srcdir/$pkgname-${pkgver//_/-}"
- make DESTDIR="$pkgdir" install
- install -D -m644 zfs.initcpio.hook "$pkgdir"/lib/initcpio/hooks/zfs
- install -D -m644 zfs.initcpio.install "$pkgdir"/lib/initcpio/install/zfs
+ cd "${srcdir}/${pkgname}-${pkgver//_/-}"
+ make DESTDIR="${pkgdir}" install
+ install -D -m644 ../zfs.initcpio.hook "${pkgdir}"/lib/initcpio/hooks/zfs
+ install -D -m644 ../zfs.initcpio.install "${pkgdir}"/lib/initcpio/install/zfs
}
diff -Naur zfs/zfs.initcpio.hook zfs.new/zfs.initcpio.hook
--- zfs/zfs.initcpio.hook 2012-03-27 18:15:17.000000000 -0400
+++ zfs.new/zfs.initcpio.hook 2012-06-23 16:07:51.345461747 -0400
@@ -1,14 +1,17 @@
ZPOOL_FORCE=""
-zfs_get_bootfs () {
+zfs_get_bootfs() {
ZFS_DATASET=`/usr/sbin/zpool list -H -o bootfs | sed 'q'`
if [ "$?" != "0" ] || [ "$ZFS_DATASET" = "" ] || [ "$ZFS_DATASET" = "no pools available" ] ; then
return 1
fi
}
-zfs_mount_handler () {
+zfs_mount_handler() {
local node=$1
+
+ # If ZFS_DATASET was set to bootfs in the kernel parameters
+ # then try to import the entire pool.
if [ "$ZFS_DATASET" = "bootfs" ] ; then
if ! zfs_get_bootfs ; then
# Lets import everything and try again
@@ -21,16 +24,19 @@
fi
local pool="${ZFS_DATASET%%/*}"
- if ! "/usr/sbin/zpool" list -H $pool > /dev/null ; then
- echo "ZFS: Importing pool $pool."
-
+
+ # Try to list the $pool, if any errors, hide them.
+ if ! "/usr/sbin/zpool" list -H $pool 2> /dev/null ; then
+ # Try to import the pool without mounting any of the datasets
if ! "/usr/sbin/zpool" import -N $pool $ZPOOL_FORCE ; then
- echo "ZFS: Unable to import pool $pool."
+ echo "ZFS: Unable to import pool: $pool."
return 1
fi
fi
local mountpoint=$("/usr/sbin/zfs" get -H -o value mountpoint $ZFS_DATASET)
+
+ # Check to see if the mountpoint is legacy
if [ "$mountpoint" = "legacy" ] ; then
mount -t zfs "$ZFS_DATASET" "$node"
else
@@ -38,7 +44,7 @@
fi
}
-run_hook ()
+run_hook()
{
input="$(cat /proc/cmdline)"
for i in $input; do
@@ -66,7 +72,8 @@
esac
done
- if [ ! -f "/etc/hostid" ] ; then
- echo "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly."
- fi
+ # This is not necessary, most of the time the pool mounts fine without the hostid info
+ #if [ ! -f "/etc/hostid" ] ; then
+ #echo "ZFS: No hostid found on kernel command line or /etc/hostid. ZFS pools may not import correctly."
+ #fi
}
diff -Naur zfs/zfs.initcpio.install zfs.new/zfs.initcpio.install
--- zfs/zfs.initcpio.install 2012-03-27 18:18:18.000000000 -0400
+++ zfs.new/zfs.initcpio.install 2012-06-23 16:08:16.512512982 -0400
@@ -1,20 +1,20 @@
build() {
- MODULES=" zfs zcommon znvpair zavl zunicode spl zlib_deflate" # zlib_inflate
+ MODULES="zfs zcommon znvpair zavl zunicode spl zlib_deflate" # zlib_inflate
BINARIES=""
FILES=""
SCRIPT="zfs"
- add_file "/lib/udev/rules.d/60-zpool.rules"
- add_file "/lib/udev/rules.d/60-zvol.rules"
- add_file "/lib/udev/rules.d/90-zfs.rules"
+ add_file "/usr/lib/udev/rules.d/60-zpool.rules"
+ add_file "/usr/lib/udev/rules.d/60-zvol.rules"
+ add_file "/usr/lib/udev/rules.d/90-zfs.rules"
add_file "/etc/zfs/zdev.conf"
- add_file "/etc/zfs/zpool.cache"
+ [ -f "/etc/zfs/zpool.cache" ] && add_file "/etc/zfs/zpool.cache"
[ -f "/etc/hostid" ] && add_file "/etc/hostid"
add_binary "/usr/sbin/zfs"
add_binary "/usr/sbin/zpool"
add_binary "/usr/bin/zpool_layout"
- add_binary "/lib/udev/zpool_id"
- add_binary "/lib/udev/zvol_id"
- add_binary "/usr/sbin/mount.zfs"
+ add_binary "/usr/lib/udev/zpool_id"
+ add_binary "/usr/lib/udev/zvol_id"
+ add_binary "/sbin/mount.zfs"
add_binary "/usr/bin/hostid"
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.