Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from BjoKaSH/maczfs_74_2_integration
Browse files Browse the repository at this point in the history
Maczfs 74 2 integration
  • Loading branch information
alblue committed Aug 27, 2012
2 parents 5652197 + 104b7a9 commit 3f73c6c
Show file tree
Hide file tree
Showing 41 changed files with 3,091 additions and 1,223 deletions.
64 changes: 64 additions & 0 deletions CREDITS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Credits

Many people contributed to ZFS in general and to Mac OSX port MacZFS. Those we know of are listed here:

The inventors and principal engineers of ZFS, at Sun Microsystems
* Jeff Bonwick and Matthew Ahrens, and their team (possibly listed
below; clarification is needed)

Co-founders of ZFS on Mac OS, at Apple, Inc:
* Chris Emura, the Filesystem Development Manager within Apple's
CoreOS organization (cemura at apple.com)
* Don Brady, principal software engineer

Other original contributors at Apple, Inc
* Noel Dellofano, software engineer
* who else?

Contributors to the public MacZFS project
* Dustin Sallings: software engineer
* Jason R. McNeil: software engineer
* Bj�rn Kahl: software engineer, documentation -- Github
* Alex Blewitt, software engineer, release engineer, documentation --
Github
* Daniel Bethe -- webmaster, documentation
* Lucien Pullen -- documentation
* Matthew Earlywine -- launchd scripts
* KonaB1end -- launchd scripts and hard core hacking

These additional names were harvested from the git repository, dating
back to the original ZFS code. They are presented in no significant
order.

When it comes to a volunteer project, remember this above all...

There are NO small roles. The community thanks you all.

johansen, esaxe, elowe, dp78419, dm120769, casper, mh27603, ly149593,
frankho, susans, stans, rm160521, mishra, eota, edp, ck153898, anish,
egillett, dv142724, dp, cindi, vb160487, trevtom, szhou, stevel, sethg,
rg137905, rd117015, qiao, meem, jg, gt29601, govinda, cwb, akolb,
zh199473, wesolows, vsakar, vikram, th199096, tabriz, stephh, sp92102,
schwartz, rsb, robinson, rica, ramat, phitran, peterte, paulsan, mrj,
maheshvs, llai1, kupfer, krgopi, kp158701, jjc, is, ha137994, gjelinek,
evanl, eh208807, dougm, dilpreet, dduvall, darrenm, carlsonj, bmc,
blakej, billm, ae112802, yq193411, vb70745, udpa, tsien, taylor,
sudheer, seb, rs135747, rb150246, prabahar, peteh, ns92644, nordmark,
nn35248, myers, mws, mlf, ml93401, mjnelson, lclee, ksn, krishna,
kk112340, kg150529, josephb, jkennedy, jdunham, jarrett, gp87344,
georges, gd78059, fr157268, fl147353, esolom, ericheng, eg155566,
dr146992, dmick, dh155122, bs21162, baban, artem, Timeless, yz147069,
yx209491, yt160523, yl150051, xy158873, xs154138, wroche, wentaoy,
webaker, vv149972, vivek, ton, timh, timf, swilcox, stevel@tonic-gate,
ss146032, srust, sommerfe, sjelinek, sherrym, shepler, sdebnath, robj,
rh87107, rbourbon, randyf, rab, ps57422, pramodbg, pm145316, petede,
pd144616, paulson, owenr, osaeed, nw141292, nr123932, nf202958,
mp46848, mp204432, mm156350, ml29623, micheng, mcneal, mc142369,
mb158278, masputra, lq150181, kz151634, kcpoon, kalai, kais, jwahlig,
jwadams, jpk, johnny, johnlev, jl139090, jj204856, jj146644, jimp, jhd,
jfrank, jchu, jc25722, jacobs, ja97890, hx147065, huah, hiremath,
hg115875, gz161490, gm149974, girish, ggredvig, gfaden, gavinm,
ethindra, et142600, dstaff, dp201428, dg199075, craigm, convert-repo,
cm136836, cg149915, bm42561, bg159949, batschul, ayznaga, at204353,
as145665, ap25164, andyb, andrei, agiri, acruz, achartre, ab196087

32 changes: 25 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
MacZFS is a community effort to prolong the life of ZFS on Mac OS X,
since the Apple Open Source project was shut down. It is supported on
both Leopard (Intel/PPC) and Snow Leopard (Intel 32-bit and 64-bit)
platforms, although it may require Snow Leopard in order to build.
Preview support for Lion is included.
About MacZFS
============

MacZFS is a community effort hosted on www.maczfs.org to prolong
the life of ZFS on Mac OS X, since the Apple Open Source project
was shut down. It is supported on both Leopard (Intel/PPC) and
Snow Leopard (Intel 32-bit and 64-bit)platforms, including newer
releases up to Mountain Lion.


Getting involved
================

If you would like to help, the source code is avaialble and an issue
tracker exists to track bugs.
The MacZFS community welcomes everyone who wants to share thoughts,
opinions or success stories or wants to contribute to the project's
further development.

Discussion of use cases, user-to-user help and future development takes
place on our mailing list hosted at http://groups.google.com/group/zfs-macos/

Problem reports and feature requests should be submitted to the issue
tracker at http://code.google.com/p/maczfs/

If you want to help with development, the source code is available on
Github at http://github.com/alblue/mac-zfs

Resources:
Source: http://github.com/alblue/mac-zfs
Issues: http://code.google.com/p/maczfs/
Groups: http://groups.google.com/group/zfs-macos/
IRC: http://webchat.freenode.net/ , select a nick name and enter channel #mac-zfs


Backups
=======
Expand All @@ -30,6 +47,7 @@ of problems. You should therefore take full responsiblity of backups
of data in the event that a restoration is needed. Any single filing
system, including ZFS, is not a substitute for backups.


Disclaimer
==========

Expand Down
4 changes: 4 additions & 0 deletions support/MacZFS.pmdoc/01zfs-contents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
</f>
</f>
</f>
<f n="bin" o="root" g="wheel" p="16749">
<f n="ztest" o="root" g="wheel" p="33133" />
</f>
<f n="sbin" o="root" g="wheel" p="16749">
<f n="zpool" o="root" g="wheel" p="33133" />
<f n="zfs" o="root" g="wheel" p="33133" />
<f n="zdb" o="root" g="wheel" p="33133" />
</f>
</f>
<f n="System" o="root" g="wheel" p="16749">
Expand Down
7 changes: 7 additions & 0 deletions support/MacZFS.pmdoc/01zfs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@
<packageStore type="internal" />
<mod>installFrom.isRelativeType</mod>
<mod>installTo</mod>
<mod>scripts.scriptsDirectoryPath.path</mod>
<mod>identifier</mod>
<mod>parent</mod>
<mod>version</mod>
<mod>scripts.postinstall.isRelativeType</mod>
<mod>installFrom.isRelativeType</mod>
</config>
<scripts>
<postinstall relative="true" mod="true">post-install.sh</postinstall>
<scripts-dir relative="true" mod="true">Resources</scripts-dir>
</scripts>
<contents>
<file-list>01zfs-contents.xml</file-list>
<component id="com.bandlem.mac.zfs.util"
Expand Down
4 changes: 4 additions & 0 deletions support/MacZFS.pmdoc/02zfs-contents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
</f>
</f>
</f>
<f n="bin" o="root" g="wheel" p="16749">
<f n="ztest" o="root" g="wheel" p="33133" />
</f>
<f n="sbin" o="root" g="wheel" p="16749">
<f n="zpool" o="root" g="wheel" p="33133" />
<f n="zfs" o="root" g="wheel" p="33133" />
<f n="zdb" o="root" g="wheel" p="33133" />
</f>
</f>
<f n="System" o="root" g="wheel" p="16749">
Expand Down
7 changes: 7 additions & 0 deletions support/MacZFS.pmdoc/02zfs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@
<packageStore type="internal" />
<mod>installFrom.isRelativeType</mod>
<mod>installTo</mod>
<mod>scripts.scriptsDirectoryPath.path</mod>
<mod>identifier</mod>
<mod>parent</mod>
<mod>version</mod>
<mod>scripts.postinstall.isRelativeType</mod>
<mod>installFrom.isRelativeType</mod>
</config>
<scripts>
<postinstall relative="true" mod="true">post-install.sh</postinstall>
<scripts-dir relative="true" mod="true">Resources</scripts-dir>
</scripts>
<contents>
<file-list>02zfs-contents.xml</file-list>
<component id="com.bandlem.mac.zfs.util"
Expand Down
24 changes: 18 additions & 6 deletions support/MacZFS.pmdoc/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
<versions min-spec="1.000000" />
<scripts></scripts>
</distribution>
<description>Welcome to MacZFS, a free implementation of the ZFS file system for Mac OSX Leopard and newer.

MacZFS offers nearly unlimited storage capacity, only limited by the amount and size of hard disks connected to an computer. It offers data replication in mirror or raidz configuration, dynamic stripping and build-in storage pool based volume management.

MacZFS has end-to-end compression and strong data checksumming, including self-healing of bit-rot or any other read problem in redundant pools and offers unlimited, nearly-instantaneous snapshot support for backup and ecovery. Snapshots can be mount for read-only inspection, efficiently transfered between storage pools for off-site backups or promoted to full read-write filesystems.

MacZFS is based on the original Sun implementation of the ZFS file system and Apple's initial port to Leopard whch was discontinued before public release.

Today, MacZFS is developed by a community effort on www.maczfs.org and released under the CDDL and APSL liecenses.
</description>
<contents>
<choice title="ZFS for Leopard" id="zfs105"
tooltip="ZFS for Leopard"
Expand All @@ -29,9 +39,9 @@
startHidden="unchanged" />
</choice-reqs>
</choice>
<choice title="ZFS for Snow Leopard and Lion" id="zfs106"
<choice title="ZFS for Snow Leopard, Lion and Mountain Lion" id="zfs106"
tooltip="ZFS for Snow Leopard and Lion"
description="ZFS for Snow Leopard and Lion on Intel 32 bit and 64 bit machines"
description="ZFS for Snow Leopard, Lion and Mountain Lion on Intel 32 bit and 64 bit machines"
starts_selected="true" starts_enabled="true"
starts_hidden="false">
<pkgref id="com.bandlem.mac.zfs.106.pkg" />
Expand All @@ -40,7 +50,7 @@
selected="no" enabled="no" hidden="yes"
startSelected="unchanged" startEnabled="unchanged"
startHidden="unchanged" />
<requirement id="tosv" operator="lt" value="'10.8'"
<requirement id="tosv" operator="lt" value="'10.9'"
selected="no" enabled="no" hidden="yes"
startSelected="unchanged" startEnabled="unchanged"
startHidden="unchanged" />
Expand All @@ -59,20 +69,22 @@
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 This will install the next-generation ZFS support for Mac OSX systems running either Leopard or Snow Leopard. Preview support for Lion is available.}]]>
\f0\fs26 \cf0 This will install the next-generation ZFS support for Mac OSX systems running either Leopard or Snow Leopard and newer.}]]>
</resource>
<resource relative="true" mod="true" type="conclusion">../CREDITS.txt</resource>
</locale>
</resources>
<requirements>
<requirement id="tosv" operator="ge" value="'10.5'">
<message>Mac ZFS needs at least Leopard to run.</message>
</requirement>
<requirement id="tosv" operator="lt" value="'10.8'">
<message>Mac ZFS is only certified to run on Leopard and Snow Leopard at this time, though preview support for Lion is available.</message>
<requirement id="tosv" operator="lt" value="'10.9'">
<message>Mac ZFS is only certified to run on Mac OSX Leopard to Mountain Lion.</message>
</requirement>
</requirements>
<flags />
<item type="file">01zfs.xml</item>
<item type="file">02zfs.xml</item>
<mod>properties.title</mod>
<mod>description</mod>
</pkmkdoc>
3 changes: 3 additions & 0 deletions support/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /bin/sh
chmod -R u+w,go-w,a+r /System/Library/Extensions/zfs.kext

10 changes: 7 additions & 3 deletions support/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ then
fi

USER=`whoami`
GROUP=`id -n -g`

(
mkdir -p ${DIR}/../${BUILD}
rm -rf ${DIR}/../${BUILD}/ZFS105
rm -rf ${DIR}/../${BUILD}/ZFS105
rm -rf ${DIR}/../${BUILD}/ZFS106
cp -R ${DIR}/MacZFS.pmdoc ${DIR}/../${BUILD}
cp -R ${DIR}/post-install.sh ${DIR}/../${BUILD}
sed -i~ -e "s/0\\.0\\.0/${VERSION}/g" ${DIR}/../${BUILD}/MacZFS.pmdoc/*

cd ${DIR}/..
xcodebuild -sdk macosx10.5 -configuration ${CONFIG} -parallelizeTargets install INSTALL_OWNER=${USER} SYMROOT=${BUILD}/${CONFIG}105 DSTROOT=${BUILD}/ZFS105 || exit 2
xcodebuild -sdk macosx10.5 -configuration ${CONFIG} -parallelizeTargets install INSTALL_OWNER=${USER} INSTALL_GROUP=${GROUP} SYMROOT=${BUILD}/${CONFIG}105 DSTROOT=${BUILD}/ZFS105 || exit 2

chmod -Rv u+w,go-w,a+r ${BUILD}/ZFS105
# No point in building on 10.5, it'll just do the same thing again
if [ "`sysctl -b kern.osrelease`" != "9.8.0" ]
then
xcodebuild -sdk macosx10.6 -configuration ${CONFIG} -parallelizeTargets install INSTALL_OWNER=${USER} SYMROOT=${BUILD}/${CONFIG}106 DSTROOT=${BUILD}/ZFS106 || exit 3
xcodebuild -sdk macosx10.6 -configuration ${CONFIG} -parallelizeTargets install INSTALL_OWNER=${USER} INSTALL_GROUP=${GROUP} SYMROOT=${BUILD}/${CONFIG}106 DSTROOT=${BUILD}/ZFS106 || exit 3
chmod -R u+w,go-w,a+r ${BUILD}/ZFS106
fi

cd ${BUILD}
Expand Down
47 changes: 44 additions & 3 deletions usr/src/cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Portions Copyright 2007-2008 Apple Inc. All rights reserved.
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <stdio.h>
#ifndef __APPLE__
#include <stdio_ext.h>
#endif
#include <stdlib.h>
#include <ctype.h>
#include <sys/zfs_context.h>
Expand Down Expand Up @@ -66,6 +71,8 @@ int zopt_objects = 0;
int zdb_advance = ADVANCE_PRE;
zbookmark_t zdb_noread = { 0, 0, ZB_NO_LEVEL, 0 };
libzfs_handle_t *g_zfs;
boolean_t zdb_sig_user_data = B_TRUE;
int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256;

/*
* These libumem hooks provide a reasonable set of defaults for the allocator's
Expand Down Expand Up @@ -110,7 +117,7 @@ usage(void)
(void) fprintf(stderr, " -U use zpool.cache in /tmp\n");
(void) fprintf(stderr, " -B objset:object:level:blkid -- "
"simulate bad block\n");
(void) fprintf(stderr, " -R read and display block from a"
(void) fprintf(stderr, " -R read and display block from a "
"device\n");
(void) fprintf(stderr, " -e Pool is exported/destroyed\n");
(void) fprintf(stderr, " -p <Path to vdev dir> (use with -e)\n");
Expand Down Expand Up @@ -1190,6 +1197,18 @@ dump_label(const char *dev)
exit(1);
}

#ifdef __APPLE__
/* OS X: we can't use fstat to get the size of a block device */
if (S_ISBLK(statbuf.st_mode)) {
if ((statbuf.st_size = get_disk_size(fd)) == -1) {
statbuf.st_size = 0;
(void) printf("failed to stat '%s': %s\n", dev,
strerror(errno));
exit(1);

}
}
#endif
psize = statbuf.st_size;
psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));

Expand Down Expand Up @@ -2206,12 +2225,22 @@ main(int argc, char **argv)
int exported = 0;
char *vdev_dir = NULL;

#ifdef __APPLE__
volatile int zdb_forever = 0;
#endif

(void) setrlimit(RLIMIT_NOFILE, &rl);
(void) enable_extended_FILE_stdio(-1, -1);

dprintf_setup(&argc, argv);

while ((c = getopt(argc, argv, "udibcsvCLO:B:UlRep:")) != -1) {
while ((c = getopt(argc, argv,
#ifdef __APPLE__
"udibcsvCLO:B:UlRep:D"
#else
"udibcsvCLO:B:UlRep:"
#endif
)) != -1) {
switch (c) {
case 'u':
case 'd':
Expand Down Expand Up @@ -2280,6 +2309,11 @@ main(int argc, char **argv)
case 'p':
vdev_dir = optarg;
break;
#ifdef __APPLE__
case 'D':
zdb_forever = 1;
break;
#endif
default:
usage();
break;
Expand All @@ -2289,15 +2323,22 @@ main(int argc, char **argv)
if (vdev_dir != NULL && exported == 0)
(void) fatal("-p option requires use of -e\n");

#ifdef __APPLE__
/* to attach gdb, run zdb with "-D" and say in gdb "set zdb_forever = 0" */
while (zdb_forever) {}
#endif

kernel_init(FREAD);
g_zfs = libzfs_init();
ASSERT(g_zfs != NULL);

#ifndef __APPLE__
/*
* Disable vdev caching. If we don't do this, live pool traversal
* won't make progress because it will never see disk updates.
*/
zfs_vdev_cache_size = 0;
#endif

for (c = 0; c < 256; c++) {
if (dump_all && c != 'L' && c != 'l' && c != 'R')
Expand Down
Loading

0 comments on commit 3f73c6c

Please sign in to comment.