Skip to content

Instantly share code, notes, and snippets.

@rlaager
Created March 4, 2020 21:33
Show Gist options
  • Save rlaager/c7b43787d6260c9e2bf446690b2763a9 to your computer and use it in GitHub Desktop.
Save rlaager/c7b43787d6260c9e2bf446690b2763a9 to your computer and use it in GitHub Desktop.
--- zfs.py.orig 2020-03-04 15:31:11.857503452 -0600
+++ zfs.py 2020-03-04 15:33:16.511328056 -0600
@@ -33,11 +33,11 @@
from json import loads as dejson
def zfsonlinux():
- sources = {'master':'https://raw.githubusercontent.com/zfsonlinux/zfs/master/man/man5/zpool-features.5'}
+ sources = {'master':'https://raw.githubusercontent.com/openzfs/zfs/master/man/man5/zpool-features.5'}
with urlopen('https://zfsonlinux.org') as web:
versions = findall(r'download/zfs-([0-9.]+)', web.read().decode('utf-8', 'ignore'))
for ver in set(versions):
- sources[ver] = 'https://raw.githubusercontent.com/zfsonlinux/zfs/zfs-{}/man/man5/zpool-features.5'.format(ver)
+ sources[ver] = 'https://raw.githubusercontent.com/openzfs/zfs/zfs-{}/man/man5/zpool-features.5'.format(ver)
return sources
def openzfsonosx():
@@ -137,7 +137,12 @@
line = line[4:]
if line.startswith('GUID'):
guid = line.split()[-1]
- if guid == 'org.open-zfs:large_block':
+ if guid == 'com.intel:allocation_classes':
+ # This is wrong in the documentation for Illumos and
+ # FreeBSD. The actual code in zfeature_common.c uses
+ # org.zfsonlinux:allocation_classes.
+ guid = 'org.zfsonlinux:allocation_classes'
+ elif guid == 'org.open-zfs:large_block':
guid += 's'
domain, feature = guid.split(':', 1)
features[(feature, domain)].append((name, ver))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment