Initial Commit

This commit is contained in:
Yehia Hafez
2021-05-26 14:06:56 +02:00
commit 4a5782607e
14 changed files with 1517 additions and 0 deletions

15
LICENSE Normal file
View File

@@ -0,0 +1,15 @@
Copyleft (ɔ) 2021 Yehia Hafez. All wrongs reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
# macos-btrfs port
This project aims to port the BTRFS filesystem from the Linux kernel into a usable MacOS kernel extension, seamlessly integrated into diskutil. It's released under the GNU GPL v2, and much of it is based on the Apple ntfs extension source code, the Linux Kernel implementation of BTRFS, and the btrfs-progs project (all linked below).
Currently, only the btrfs.fs module is working, allowing macos to detect a BTRFS filesystem and its UUID (and stop annoying you about initializing it).
Apple Open Source NTFS Implementation: https://opensource.apple.com/source/ntfs/
BTRFS Wiki documentation: https://btrfs.wiki.kernel.org/index.php/On-disk_Format
BTRFS-Progs: https://github.com/kdave/btrfs-progs
Linux Kernel BTRFS Implementation: https://github.com/torvalds/linux/tree/master/fs/btrfs

283
btrfs.util/btrfs.util.c Normal file
View File

@@ -0,0 +1,283 @@
//
// btrfs.c
// macos-btrfs
//
// Created by Yehia Hafez on 5/24/21.
//
#include <stddef.h>
#include <stdbool.h>
#include <sys/disk.h>
#include <sys/loadable_fs.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "btrfs_layout.h"
#include "btrfs_endian.h"
#ifndef FSUC_GETUUID
#define FSUC_GETUUID 'k'
#endif
static void usage(const char *progname) __attribute__((noreturn));
static void usage(const char *progname)
{
fprintf(stderr, "usage: %s action_arg device_arg [mount_point_arg] [Flags]\n", progname);
fprintf(stderr, "action_arg:\n");
fprintf(stderr, " -%c (Get UUID Key)\n", FSUC_GETUUID);
fprintf(stderr, " -%c (Mount)\n", FSUC_MOUNT);
fprintf(stderr, " -%c (Probe)\n", FSUC_PROBE);
fprintf(stderr, " -%c (Unmount)\n", FSUC_UNMOUNT);
fprintf(stderr, "device_arg:\n");
fprintf(stderr, " device we are acting upon (for example, 'disk0s2')\n");
fprintf(stderr, "mount_point_arg:\n");
fprintf(stderr, " required for Mount and Unmount\n");
fprintf(stderr, "Flags:\n");
fprintf(stderr, " required for Mount and Probe\n");
fprintf(stderr, " indicates removable or fixed (for example 'fixed')\n");
fprintf(stderr, " indicates readonly or writable (for example 'readonly')\n");
fprintf(stderr, "Flags (Mount only):\n");
fprintf(stderr, " indicates suid or nosuid (for example 'nosuid')\n");
fprintf(stderr, " indicates dev or nodev (for example 'nodev')\n");
fprintf(stderr, "Examples:\n");
fprintf(stderr, " %s -p disk0s2 fixed writable\n", progname);
fprintf(stderr, " %s -m disk0s2 /my/hfs removable readonly nosuid nodev\n", progname);
exit(FSUR_INVAL);
}
static int get_volume_superblock_record(char *rdev, BTRFS_SUPERBLOCK *sbrec) {
BTRFS_SUPERBLOCK *sb;
int f, opresult = FSUR_UNRECOGNIZED;
void *buf;
f = open(rdev, O_RDONLY);
if (f == -1) return FSUR_IO_FAIL;
buf = malloc(BTRFS_SUPERBLOCK_SIZE);
if(!buf) {opresult = -ENOMEM;}
else {
// Read superblock record and check that the magic works
if(pread(f, buf, BTRFS_SUPERBLOCK_SIZE, 0x10000) != BTRFS_SUPERBLOCK_SIZE) {opresult = FSUR_IO_FAIL;}
else {
sb = (BTRFS_SUPERBLOCK *)buf;
if(!bcmp(sb->sb_magic, BTRFS_MAGIC, 0x8)) {
memcpy(sbrec, sb, sizeof(*sb));
opresult = FSUR_RECOGNIZED;
}
else {opresult = FSUR_UNRECOGNIZED;}
}
}
if(buf) free(buf);
(void) close(f);
return opresult;
}
/**
* do_getuuid - Get the UUID key of a BTRFS volume.
*
* If the volume is recognized as a BTRFS volume look up its UUID key if it
* exists and output it to stdout then return FSUR_RECOGNIZED.
*
* If there is no UUID then return FSUR_INVAL and do not output anything to
* stdout.
*
* If the volume is not an BTRFS volume return FSUR_UNRECOGNIZED.
*
* On error return FSUR_INVAL or FSUR_IO_FAIL.
*/
static int do_getuuid(char *rdev) {
BTRFS_SUPERBLOCK *sb;
int err = FSUR_INVAL;
sb = malloc(BTRFS_SUPERBLOCK_SIZE);
if(sb) {
err = get_volume_superblock_record(rdev, sb);
if(err == FSUR_RECOGNIZED) {
char uuid[37];
// todo: clean this up
// right: 9d5bce63-3a73-4fb3-b8bd-9d00a6d9c30a
// wrong: 63ce5b9d-733a-b34f-b8bd-9d00a6d9c30a
if(snprintf(uuid, 37, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
sb->fsid[0], sb->fsid[1], sb->fsid[2], sb->fsid[3],
sb->fsid[4], sb->fsid[5], sb->fsid[6], sb->fsid[7],
sb->fsid[8], sb->fsid[9], sb->fsid[10], sb->fsid[11],
sb->fsid[12], sb->fsid[13], sb->fsid[14], sb->fsid[15]) != 36)
err = FSUR_IO_FAIL;
else {
(void)write(STDOUT_FILENO, uuid, 36);
err = FSUR_IO_SUCCESS;
}
}
else fprintf(stderr, "Failure: %d\n", err);
free(sb);
} else err = -ENOMEM;
return err;
}
/**
* do_probe - Examine a volume to see if we recognize it as an NTFS volume.
*
* If the volume is recognized as an NTFS volume look up its volume label and
* output it to stdout then return FSUR_RECOGNIZED.
*
* If the volume is not an NTFS volume return FSUR_UNRECOGNIZED.
*
* On error return FSUR_INVAL or FSUR_IO_FAIL.
*/
static int do_probe(char *rdev, const bool removable __attribute__((unused)),
const bool writable __attribute__((unused)))
{
// UUID="9d5bce63-3a73-4fb3-b8bd-9d00a6d9c30a" UUID_SUB="9cb965da-c2df-44ca-9917-47b96cc786a2" TYPE="btrfs" PARTUUID="ff67145c-01"
int err = FSUR_IO_FAIL;
BTRFS_SUPERBLOCK *sb;
sb = malloc(BTRFS_SUPERBLOCK_SIZE);
if(sb) {
err = get_volume_superblock_record(rdev, sb);
if(err == FSUR_RECOGNIZED) {
(void)write(STDOUT_FILENO, sb->label, strlen(sb->label)+1);
} else fprintf(stderr, "err: %d\n", err);
free(sb);
} else err = -ENOMEM;
return err;
}
int main(int argc, char **argv) {
char *progname, *dev, *mp = NULL;
int err;
char opt;
bool removable, readonly, nosuid, nodev;
char rawdev[MAXPATHLEN];
char blockdev[MAXPATHLEN];
struct stat sb;
nodev = nosuid = readonly = removable = false;
// Save & strip off program name.
progname = argv[0];
argc--;
argv++;
if (argc < 2 || argv[0][0] != '-')
usage(progname);
opt = argv[0][1];
dev = argv[1];
argc -= 2;
argv += 2;
// Check we have the right number of arguments
switch (opt) {
case FSUC_GETUUID:
if (argc)
usage(progname);
break;
case FSUC_PROBE:
// For probe need the two mountflags also.
if (argc != 2)
usage(progname);
break;
case FSUC_MOUNT:
// For mount need the mount point and four mountflags also.
if (argc != 5)
usage(progname);
break;
case FSUC_UNMOUNT:
// For unmount need the mount point also.
if (argc != 1)
usage(progname);
break;
default:
// Unsupported command.
usage(progname);
break;
}
err = snprintf(rawdev, sizeof(rawdev), "/dev/r%s", dev);
if (err >= (int)sizeof(rawdev)) {
fprintf(stderr, "%s: Specified device name is too long.\n",
progname);
exit(FSUR_INVAL);
}
if (stat(rawdev, &sb)) {
fprintf(stderr, "%s: stat %s failed, %s\n", progname, rawdev,
strerror(errno));
exit(FSUR_INVAL);
}
err = snprintf(blockdev, sizeof(blockdev), "/dev/%s", dev);
if (err >= (int)sizeof(blockdev)) {
fprintf(stderr, "%s: Specified device name is too long.\n",
progname);
exit(FSUR_INVAL);
}
if (stat(blockdev, &sb)) {
fprintf(stderr, "%s: stat %s failed, %s\n", progname, blockdev,
strerror(errno));
exit(FSUR_INVAL);
}
/* Get the mount point for the mount and unmount cases. */
if (opt == FSUC_MOUNT || opt == FSUC_UNMOUNT) {
mp = argv[0];
argc--;
argv++;
}
if (opt == FSUC_PROBE || opt == FSUC_MOUNT) {
/* mountflag1: Removable or fixed. */
if (!strcmp(argv[0], DEVICE_REMOVABLE))
removable = true;
else if (strcmp(argv[0], DEVICE_FIXED))
usage(progname);
/* mountflag2: Readonly or writable. */
if (!strcmp(argv[1], DEVICE_READONLY))
readonly = true;
else if (strcmp(argv[1], DEVICE_WRITABLE))
usage(progname);
/* Only the mount command supports the third and fourth flag. */
if (opt == FSUC_MOUNT) {
/* mountflag3: Nosuid or suid. */
if (!strcmp(argv[2], "nosuid"))
nosuid = true;
else if (strcmp(argv[2], "suid"))
usage(progname);
/* mountflag4: Nodev or dev. */
if (!strcmp(argv[3], "nodev"))
nodev = true;
else if (strcmp(argv[3], "dev"))
usage(progname);
}
}
switch (opt) {
case FSUC_GETUUID:
err = do_getuuid(rawdev);
break;
case FSUC_PROBE:
err = do_probe(rawdev, removable, readonly);
break;
case FSUC_MOUNT:
// err = do_mount(progname, blockdev, mp, removable, readonly,
// nosuid, nodev);
// break;
case FSUC_UNMOUNT:
// err = do_unmount(progname, mp);
break;
default:
/* Cannot happen... */
usage(progname);
break;
}
return err;
}

View File

@@ -0,0 +1,157 @@
//
// btrfs_endian.h
// macos-btrfs
//
// Created by Yehia Hafez on 5/24/21.
//
#ifndef btrfs_endian_h
#define btrfs_endian_h
#include <libkern/OSByteOrder.h>
#include "btrfs_types.h"
// Unigned endianness conversion functions
static inline u16 le16_to_cpu(le16 x)
{
return (u16)(OSSwapLittleToHostInt16(x));
}
static inline u32 le32_to_cpu(le32 x)
{
return (u32)(OSSwapLittleToHostInt32(x));
}
static inline u64 le64_to_cpu(le64 x)
{
return (u64)(OSSwapLittleToHostInt64(x));
}
static inline u16 le16_to_cpup(le16 *x)
{
return le16_to_cpu(*x);
}
static inline u32 le32_to_cpup(le32 *x)
{
return le32_to_cpu(*x);
}
static inline u64 le64_to_cpup(le64 *x)
{
return le64_to_cpu(*x);
}
static inline le16 cpu_to_le16(u16 x)
{
return (le16)(OSSwapHostToLittleInt16(x));
}
static inline le32 cpu_to_le32(u32 x)
{
return (le32)(OSSwapHostToLittleInt32(x));
}
static inline le64 cpu_to_le64(u64 x)
{
return (le64)(OSSwapHostToLittleInt64(x));
}
static inline le16 cpu_to_le16p(u16 *x)
{
return cpu_to_le16(*x);
}
static inline le32 cpu_to_le32p(u32 *x)
{
return cpu_to_le32(*x);
}
static inline le64 cpu_to_le64p(u64 *x)
{
return cpu_to_le64(*x);
}
// Signed endianness conversion functions
static inline s16 sle16_to_cpu(sle16 x)
{
return (s16)le16_to_cpu((le16)x);
}
static inline s32 sle32_to_cpu(sle32 x)
{
return (s32)le32_to_cpu((le32)x);
}
static inline s64 sle64_to_cpu(sle64 x)
{
return (s64)le64_to_cpu((le64)x);
}
static inline s16 sle16_to_cpup(sle16 *x)
{
return (s16)le16_to_cpu(*(le16*)x);
}
static inline s32 sle32_to_cpup(sle32 *x)
{
return (s32)le32_to_cpu(*(le32*)x);
}
static inline s64 sle64_to_cpup(sle64 *x)
{
return (s64)le64_to_cpu(*(le64*)x);
}
static inline sle16 cpu_to_sle16(s16 x)
{
return (sle16)cpu_to_le16((u16)x);
}
static inline sle32 cpu_to_sle32(s32 x)
{
return (sle32)cpu_to_le32((u32)x);
}
static inline sle64 cpu_to_sle64(s64 x)
{
return (sle64)cpu_to_le64((u64)x);
}
static inline sle16 cpu_to_sle16p(s16 *x)
{
return (sle16)cpu_to_le16(*(u16*)x);
}
static inline sle32 cpu_to_sle32p(s32 *x)
{
return (sle32)cpu_to_le32(*(u32*)x);
}
static inline sle64 cpu_to_sle64p(s64 *x)
{
return (sle64)cpu_to_le64(*(u64*)x);
}
#define const_le16_to_cpu(x) ((u16)(OSSwapLittleToHostConstInt16(((u16)(x)))))
#define const_le32_to_cpu(x) ((u32)(OSSwapLittleToHostConstInt32(((u32)(x)))))
#define const_le64_to_cpu(x) ((u64)(OSSwapLittleToHostConstInt64(((u64)(x)))))
#define const_cpu_to_le16(x) ((le16)(OSSwapHostToLittleConstInt16(((u16)(x)))))
#define const_cpu_to_le32(x) ((le32)(OSSwapHostToLittleConstInt32(((u32)(x)))))
#define const_cpu_to_le64(x) ((le64)(OSSwapHostToLittleConstInt64(((u64)(x)))))
#define const_sle16_to_cpu(x) ((s16)(OSSwapLittleToHostConstInt16(((u16)(x)))))
#define const_sle32_to_cpu(x) ((s32)(OSSwapLittleToHostConstInt32(((u32)(x)))))
#define const_sle64_to_cpu(x) ((s64)(OSSwapLittleToHostConstInt64(((u64)(x)))))
#define const_cpu_to_sle16(x) \
((sle16)(OSSwapHostToLittleConstInt16(((u16)(x)))))
#define const_cpu_to_sle32(x) \
((sle32)(OSSwapHostToLittleConstInt32(((u32)(x)))))
#define const_cpu_to_sle64(x) \
((sle64)(OSSwapHostToLittleConstInt64(((u64)(x)))))
#endif /* btrfs_endian_h */

View File

@@ -0,0 +1,147 @@
//
// btrfs_layout.h
// macos-btrfs
//
// Created by Yehia Hafez on 5/24/21.
//
#ifndef btrfs_layout_h
#define btrfs_layout_h
#include "btrfs_types.h"
#define BTRFS_MAGIC "_BHRfS_M"
#define BTRFS_CSUM_SIZE 32
#define BTRFS_FSID_SIZE 16
#define BTRFS_UUID_SIZE 16
#define BTRFS_LABEL_SIZE 256
#define BTRFS_SYSTEM_CHUNK_ARRAY_SIZE 2048
#define BTRFS_NUM_BACKUP_ROOTS 4
enum btrfs_csum_type {
BTRFS_CSUM_TYPE_CRC32 = 0,
};
#pragma pack(push, 8)
typedef struct {
le32 data1; // The first eight hexadecimal digits of the GUID.
le16 data2; // The first group of four hexadecimal digits.
le16 data3; // The second group of four hexadecimal digits.
u8 data4[8]; // The first two bytes are the third group of four
// hexadecimal digits. The remaining six bytes are the
// final 12 hexadecimal digits.
} GUID_STRUCTURE;
typedef struct {
le64 tree_root;
le64 tree_root_gen;
le64 chunk_root;
le64 chunk_root_gen;
le64 extent_root;
le64 extent_root_gen;
le64 fs_root;
le64 fs_root_gen;
le64 dev_root;
le64 dev_root_gen;
le64 csum_root;
le64 csum_root_gen;
le64 total_bytes;
le64 bytes_used;
le64 num_devices;
le64 unused_64[4]; // future expansion
u8 tree_root_level;
u8 chunk_root_level;
u8 extent_root_level;
u8 fs_root_level;
u8 dev_root_level;
u8 csum_root_level;
u8 unused_8[10]; // future expansion; alignment
} BTRFS_ROOT_BACKUP;
typedef struct {
le64 id;
le64 total_size;
le64 total_used;
le32 io_align;
le32 io_width;
le32 min_sector_size;
le64 type;
le64 generation;
le64 start_offset;
le64 group;
u8 seek_speed;
u8 bandwidth;
u8 uuid[BTRFS_UUID_SIZE];
u8 fsid[BTRFS_FSID_SIZE];
} BTRFS_DEV_ITEM;
typedef struct {
u8 csum[BTRFS_CSUM_SIZE]; // Checksum of everything past this field (from 20 to 1000)
u8 fsid[BTRFS_FSID_SIZE]; // Filesystem UUID
le64 sb_addr; // physical address of this block (different for mirrors)
le64 flags;
u8 sb_magic[0x8]; // magic ("_BHRfS_M")
le64 sb_gen; // btrfs generation
le64 root_tree_addr; // logical address of the root tree root
le64 chunk_tree_addr; // logical address of the chunk tree root
le64 log_tree_addr; // logical address of the log tree root
le64 log_root_transid;
le64 total_bytes;
le64 bytes_used;
le64 root_dir_objectid; // usually 6
le64 num_devices;
le32 sectorsize;
le32 nodesize;
le32 leafsize;
le32 stripesize;
le32 sys_chunk_array_size;
le64 chunk_root_generation;
le64 compat_flags;
le64 compat_ro_flags; // only implementations that support the flags can write to the filesystem
le64 incompat_flags; // only implementations that support the flags can use the filesystem
btrfschar csum_type; // Btrfs currently uses the CRC32c little-endian hash function with seed -1
u8 root_level;
u8 chunk_root_level;
u8 log_root_level;
BTRFS_DEV_ITEM device; // data for this device
char label[BTRFS_LABEL_SIZE]; // may not contain '/' or '\\'
le64 cache_generation;
le64 uuid_tree_generation; // UUID Tree and Generation
u8 metadata_uuid[BTRFS_FSID_SIZE]; // UUID written into btree blocks
le64 future_reserved[28]; // Reserved for future expansion
// (n bytes valid) Contains (KEY, CHUNK_ITEM) pairs for all SYSTEM chunks;
// needed to bootstrap the mapping from logical addresses to physical
u8 sys_chunk_array[BTRFS_SYSTEM_CHUNK_ARRAY_SIZE];
BTRFS_ROOT_BACKUP super_roots[BTRFS_NUM_BACKUP_ROOTS];
} BTRFS_SUPERBLOCK;
typedef struct {
u8 csum[20]; // Checksum of everything past this field (from 20 to node end)
u8 uuid[10]; // Filesystem UUID
le64 log_addr; // Logical address of this node
u8 flags[7];
bool new_fs; // always 1 for new filesystems; 0 indicates an old filesystem.
u8 chunk_tree_uuid[10];
le64 generation;
le64 parent_tree_id; // The ID of the tree that contains this node
le32 num_items; // Number of items
u8 level; // Level (0 for leaf nodes)
} BTRFS_HEADER;
#pragma pack(pop)
static inline bool __btrfs_check_magic(le64 x, le64 r) {return (x == r);}
static inline bool __btrfs_check_magicp(le64 *p, le64 r) {return (*p == r);}
#endif /* btrfs_layout_h */

View File

@@ -0,0 +1,55 @@
//
// btrfs_types.h
// macos-btrfs
//
// Created by Yehia Hafez on 5/24/21.
//
#ifndef btrfs_types_h
#define btrfs_types_h
#include <sys/types.h>
#include <mach/boolean.h>
/* Define our fixed size types. */
typedef u_int8_t u8;
typedef u_int16_t u16;
typedef u_int32_t u32;
typedef u_int64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
/*
* Define our fixed size, little-endian types. Note we define the signed types
* to be unsigned so we do not get sign extension on endianness conversions.
* We do not bother with eight-bit, little-endian types as endianness does not
* apply for eight-bit types.
*/
typedef u_int16_t le16;
typedef u_int32_t le32;
typedef u_int64_t le64;
typedef u_int16_t sle16;
typedef u_int32_t sle32;
typedef u_int64_t sle64;
/*
* Define our fixed size, big-endian types. Note we define the signed types to
* be unsigned so we do not get sign extension on endianness conversions. We
* do not bother with eight-bit, big-endian types as endianness does not apply
* for eight-bit types.
*/
typedef u_int16_t be16;
typedef u_int32_t be32;
typedef u_int64_t be64;
typedef u_int16_t sbe16;
typedef u_int32_t sbe32;
typedef u_int64_t sbe64;
/* 2-byte Unicode character type. */
typedef le16 btrfschar;
#define BTRFS_SUPERBLOCK_SIZE 4096
#endif /* btrfs_types_h */

55
btrfs_fs/Info.plist Normal file
View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>1.0</string>
<key>CFBundleName</key>
<string>btrfs</string>
<key>CFBundlePackageType</key>
<string>fs </string>
<key>CFBundleShortVersionString</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>FSMediaTypes</key>
<dict>
<key>Linux</key>
<dict>
<key>FSMediaProperties</key>
<dict>
<key>Content Hint</key>
<string>Linux</string>
<key>Leaf</key>
<true/>
</dict>
<key>FSProbeArguments</key>
<string>-p</string>
<key>FSProbeExecutable</key>
<string>btrfs.util</string>
<key>FSProbeOrder</key>
<real>1000</real>
</dict>
</dict>
<key>FSPersonalities</key>
<dict>
<key>BTRFS</key>
<dict>
<key>FSFormatContentMask</key>
<string>Linux</string>
<key>FSMountArguments</key>
<string></string>
<key>FSName</key>
<string>BTRFS Filesystem</string>
</dict>
</dict>
<key>NSHumanReadableCopyright</key>
<string>macos-btrfs - Copyleft (ɔ) 2021 Yehia Hafez. All wrongs reserved.</string>
</dict>
</plist>

View File

@@ -0,0 +1,682 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
8047693B265AAA1F0019F414 /* macos_btrfs.c in Sources */ = {isa = PBXBuildFile; fileRef = 8047693A265AAA1F0019F414 /* macos_btrfs.c */; };
805F6B5A265C0DD300531605 /* btrfs.util.c in Sources */ = {isa = PBXBuildFile; fileRef = 809083A4265BC8910086C020 /* btrfs.util.c */; };
805F6B64265C104A00531605 /* btrfs_layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 805F6B63265C104A00531605 /* btrfs_layout.h */; };
805F6B66265C10DD00531605 /* btrfs_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 805F6B65265C10DD00531605 /* btrfs_types.h */; };
805F6B69265C3ED200531605 /* btrfs_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = 805F6B68265C3ED200531605 /* btrfs_endian.h */; };
80AF808A265D58C000F7A600 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 80AF8080265D207F00F7A600 /* Info.plist */; };
80AF808C265D5CEA00F7A600 /* btrfs.util in Resources */ = {isa = PBXBuildFile; fileRef = 805F6B53265C0DC900531605 /* btrfs.util */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
805F6B61265C0ED600531605 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8047692E265AAA1F0019F414 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 805F6B52265C0DC900531605;
remoteInfo = btrfs.util;
};
80AF8084265D208C00F7A600 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8047692E265AAA1F0019F414 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 805F6B52265C0DC900531605;
remoteInfo = btrfs.util;
};
80AF8086265D208C00F7A600 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 8047692E265AAA1F0019F414 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 80476936265AAA1F0019F414;
remoteInfo = "macos-btrfs";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
805F6B51265C0DC900531605 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
80476937265AAA1F0019F414 /* macos-btrfs.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "macos-btrfs.kext"; sourceTree = BUILT_PRODUCTS_DIR; };
8047693A265AAA1F0019F414 /* macos_btrfs.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = macos_btrfs.c; sourceTree = "<group>"; };
8047693C265AAA1F0019F414 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
805F6B48265BF50900531605 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; };
805F6B53265C0DC900531605 /* btrfs.util */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = btrfs.util; sourceTree = BUILT_PRODUCTS_DIR; };
805F6B63265C104A00531605 /* btrfs_layout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = btrfs_layout.h; sourceTree = "<group>"; };
805F6B65265C10DD00531605 /* btrfs_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = btrfs_types.h; sourceTree = "<group>"; };
805F6B68265C3ED200531605 /* btrfs_endian.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = btrfs_endian.h; sourceTree = "<group>"; };
80735C0F265E4E8F00C3CD1B /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
80735C25265E510500C3CD1B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
809083A4265BC8910086C020 /* btrfs.util.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = btrfs.util.c; path = btrfs.util/btrfs.util.c; sourceTree = SOURCE_ROOT; };
80AF807E265D207F00F7A600 /* btrfs.fs */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = btrfs.fs; sourceTree = BUILT_PRODUCTS_DIR; };
80AF8080265D207F00F7A600 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
80476934265AAA1F0019F414 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
805F6B50265C0DC900531605 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
80AF807B265D207F00F7A600 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8047692D265AAA1F0019F414 = {
isa = PBXGroup;
children = (
80735C25265E510500C3CD1B /* README.md */,
80735C0F265E4E8F00C3CD1B /* LICENSE */,
805F6B67265C3E9500531605 /* btrfs_filesystem */,
80476939265AAA1F0019F414 /* macos-btrfs */,
805F6B54265C0DC900531605 /* btrfs.util */,
80AF807F265D207F00F7A600 /* btrfs_fs */,
80476938265AAA1F0019F414 /* Products */,
805F6B47265BF50800531605 /* Frameworks */,
);
sourceTree = "<group>";
usesTabs = 1;
};
80476938265AAA1F0019F414 /* Products */ = {
isa = PBXGroup;
children = (
80476937265AAA1F0019F414 /* macos-btrfs.kext */,
805F6B53265C0DC900531605 /* btrfs.util */,
80AF807E265D207F00F7A600 /* btrfs.fs */,
);
name = Products;
sourceTree = "<group>";
};
80476939265AAA1F0019F414 /* macos-btrfs */ = {
isa = PBXGroup;
children = (
8047693A265AAA1F0019F414 /* macos_btrfs.c */,
8047693C265AAA1F0019F414 /* Info.plist */,
);
path = "macos-btrfs";
sourceTree = "<group>";
};
805F6B47265BF50800531605 /* Frameworks */ = {
isa = PBXGroup;
children = (
805F6B48265BF50900531605 /* CoreFoundation.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
805F6B54265C0DC900531605 /* btrfs.util */ = {
isa = PBXGroup;
children = (
809083A4265BC8910086C020 /* btrfs.util.c */,
);
path = btrfs.util;
sourceTree = "<group>";
};
805F6B67265C3E9500531605 /* btrfs_filesystem */ = {
isa = PBXGroup;
children = (
805F6B63265C104A00531605 /* btrfs_layout.h */,
805F6B65265C10DD00531605 /* btrfs_types.h */,
805F6B68265C3ED200531605 /* btrfs_endian.h */,
);
path = btrfs_filesystem;
sourceTree = "<group>";
};
80AF807F265D207F00F7A600 /* btrfs_fs */ = {
isa = PBXGroup;
children = (
80AF8080265D207F00F7A600 /* Info.plist */,
);
path = btrfs_fs;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
80476932265AAA1F0019F414 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
805F6B69265C3ED200531605 /* btrfs_endian.h in Headers */,
805F6B66265C10DD00531605 /* btrfs_types.h in Headers */,
805F6B64265C104A00531605 /* btrfs_layout.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
80476936265AAA1F0019F414 /* macos-btrfs */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8047693F265AAA1F0019F414 /* Build configuration list for PBXNativeTarget "macos-btrfs" */;
buildPhases = (
80476932265AAA1F0019F414 /* Headers */,
80476933265AAA1F0019F414 /* Sources */,
80476934265AAA1F0019F414 /* Frameworks */,
80476935265AAA1F0019F414 /* Resources */,
);
buildRules = (
);
dependencies = (
805F6B62265C0ED600531605 /* PBXTargetDependency */,
);
name = "macos-btrfs";
productName = "macos-btrfs";
productReference = 80476937265AAA1F0019F414 /* macos-btrfs.kext */;
productType = "com.apple.product-type.kernel-extension";
};
805F6B52265C0DC900531605 /* btrfs.util */ = {
isa = PBXNativeTarget;
buildConfigurationList = 805F6B57265C0DC900531605 /* Build configuration list for PBXNativeTarget "btrfs.util" */;
buildPhases = (
805F6B4F265C0DC900531605 /* Sources */,
805F6B50265C0DC900531605 /* Frameworks */,
805F6B51265C0DC900531605 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = btrfs.util;
productName = btrfs.util;
productReference = 805F6B53265C0DC900531605 /* btrfs.util */;
productType = "com.apple.product-type.tool";
};
80AF807D265D207F00F7A600 /* btrfs.fs */ = {
isa = PBXNativeTarget;
buildConfigurationList = 80AF8081265D207F00F7A600 /* Build configuration list for PBXNativeTarget "btrfs.fs" */;
buildPhases = (
80AF807A265D207F00F7A600 /* Sources */,
80AF807B265D207F00F7A600 /* Frameworks */,
80AF807C265D207F00F7A600 /* Resources */,
);
buildRules = (
);
dependencies = (
80AF8085265D208C00F7A600 /* PBXTargetDependency */,
80AF8087265D208C00F7A600 /* PBXTargetDependency */,
);
name = btrfs.fs;
productName = btrfs;
productReference = 80AF807E265D207F00F7A600 /* btrfs.fs */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8047692E265AAA1F0019F414 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1250;
TargetAttributes = {
80476936265AAA1F0019F414 = {
CreatedOnToolsVersion = 12.5;
};
805F6B52265C0DC900531605 = {
CreatedOnToolsVersion = 12.5;
};
80AF807D265D207F00F7A600 = {
CreatedOnToolsVersion = 12.5;
};
};
};
buildConfigurationList = 80476931265AAA1F0019F414 /* Build configuration list for PBXProject "macos-btrfs" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 8047692D265AAA1F0019F414;
productRefGroup = 80476938265AAA1F0019F414 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
80476936265AAA1F0019F414 /* macos-btrfs */,
805F6B52265C0DC900531605 /* btrfs.util */,
80AF807D265D207F00F7A600 /* btrfs.fs */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
80476935265AAA1F0019F414 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
80AF808A265D58C000F7A600 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
80AF807C265D207F00F7A600 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
80AF808C265D5CEA00F7A600 /* btrfs.util in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
80476933265AAA1F0019F414 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8047693B265AAA1F0019F414 /* macos_btrfs.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
805F6B4F265C0DC900531605 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
805F6B5A265C0DD300531605 /* btrfs.util.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
80AF807A265D207F00F7A600 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
805F6B62265C0ED600531605 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 805F6B52265C0DC900531605 /* btrfs.util */;
targetProxy = 805F6B61265C0ED600531605 /* PBXContainerItemProxy */;
};
80AF8085265D208C00F7A600 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 805F6B52265C0DC900531605 /* btrfs.util */;
targetProxy = 80AF8084265D208C00F7A600 /* PBXContainerItemProxy */;
};
80AF8087265D208C00F7A600 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 80476936265AAA1F0019F414 /* macos-btrfs */;
targetProxy = 80AF8086265D208C00F7A600 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
8047693D265AAA1F0019F414 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.14;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
8047693E265AAA1F0019F414 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx10.14;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
80476940265AAA1F0019F414 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5657UV779W;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_ENABLE_BUILTIN_FUNCTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_FAST_MATH = NO;
GCC_INPUT_FILETYPE = automatic;
GCC_NO_COMMON_BLOCKS = NO;
GCC_PREPROCESSOR_DEFINITIONS = "PRODUCT_BUNDLE_IDENTIFIER=\"$(PRODUCT_BUNDLE_IDENTIFIER)\"";
GCC_USE_STANDARD_INCLUDE_SEARCHING = YES;
INFOPLIST_FILE = "macos-btrfs/Info.plist";
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.1;
MODULE_NAME = com.relalis.macos_btrfs;
MODULE_START = macos_btrfs_start;
MODULE_STOP = macos_btrfs_stop;
MODULE_VERSION = 1.0.0d1;
OTHER_CFLAGS = "-Wno-error=implicit-function-declaration";
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = "com.relalis.macos-btrfs";
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.14;
SUPPORTED_PLATFORMS = macosx;
WRAPPER_EXTENSION = kext;
};
name = Debug;
};
80476941265AAA1F0019F414 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5657UV779W;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_ENABLE_BUILTIN_FUNCTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_FAST_MATH = NO;
GCC_INPUT_FILETYPE = automatic;
GCC_NO_COMMON_BLOCKS = NO;
GCC_PREPROCESSOR_DEFINITIONS = "PRODUCT_BUNDLE_IDENTIFIER=\"$(PRODUCT_BUNDLE_IDENTIFIER)\"";
GCC_USE_STANDARD_INCLUDE_SEARCHING = YES;
INFOPLIST_FILE = "macos-btrfs/Info.plist";
INFOPLIST_PREPROCESS = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 0.1;
MODULE_NAME = com.relalis.macos_btrfs;
MODULE_START = macos_btrfs_start;
MODULE_STOP = macos_btrfs_stop;
MODULE_VERSION = 1.0.0d1;
OTHER_CFLAGS = "-Wno-error=implicit-function-declaration";
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = "com.relalis.macos-btrfs";
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.14;
SUPPORTED_PLATFORMS = macosx;
WRAPPER_EXTENSION = kext;
};
name = Release;
};
805F6B58265C0DC900531605 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5657UV779W;
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.14;
};
name = Debug;
};
805F6B59265C0DC900531605 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5657UV779W;
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.14;
};
name = Release;
};
80AF8082265D207F00F7A600 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CLANG_ENABLE_MODULES = NO;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 5657UV779W;
ENABLE_NS_ASSERTIONS = YES;
FS_BUNDLE_BIN_DIR = Contents/Resources;
FS_BUNDLE_BIN_PATH = $FS_BUNDLE_PATH/$FS_BUNDLE_BIN_DIR;
FS_BUNDLE_PATH = /System/Library/Filesystems/ntfs.fs;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
INFOPLIST_FILE = btrfs_fs/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Filesystems";
MACOSX_DEPLOYMENT_TARGET = 10.14;
OTHER_LDFLAGS = "-bundle";
PRODUCT_BUNDLE_IDENTIFIER = com.relalis.btrfs;
PRODUCT_NAME = btrfs;
SKIP_INSTALL = NO;
STRIP_STYLE = all;
WARNING_CFLAGS = (
"-Wmost",
"-Wno-four-char-constants",
"-Wno-unknown-pragmas",
);
WRAPPER_EXTENSION = fs;
ZERO_LINK = "";
};
name = Debug;
};
80AF8083265D207F00F7A600 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES;
CLANG_ENABLE_MODULES = NO;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = NO;
COPY_PHASE_STRIP = YES;
DEVELOPMENT_TEAM = 5657UV779W;
ENABLE_NS_ASSERTIONS = YES;
FS_BUNDLE_BIN_DIR = Contents/Resources;
FS_BUNDLE_BIN_PATH = $FS_BUNDLE_PATH/$FS_BUNDLE_BIN_DIR;
FS_BUNDLE_PATH = /System/Library/Filesystems/ntfs.fs;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
GCC_WARN_SHADOW = YES;
GCC_WARN_SIGN_COMPARE = YES;
INFOPLIST_FILE = btrfs_fs/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Filesystems";
MACOSX_DEPLOYMENT_TARGET = 10.14;
OTHER_LDFLAGS = "-bundle";
PRODUCT_BUNDLE_IDENTIFIER = com.relalis.btrfs;
PRODUCT_NAME = btrfs;
SKIP_INSTALL = NO;
STRIP_STYLE = all;
WARNING_CFLAGS = (
"-Wmost",
"-Wno-four-char-constants",
"-Wno-unknown-pragmas",
);
WRAPPER_EXTENSION = fs;
ZERO_LINK = NO;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
80476931265AAA1F0019F414 /* Build configuration list for PBXProject "macos-btrfs" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8047693D265AAA1F0019F414 /* Debug */,
8047693E265AAA1F0019F414 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8047693F265AAA1F0019F414 /* Build configuration list for PBXNativeTarget "macos-btrfs" */ = {
isa = XCConfigurationList;
buildConfigurations = (
80476940265AAA1F0019F414 /* Debug */,
80476941265AAA1F0019F414 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
805F6B57265C0DC900531605 /* Build configuration list for PBXNativeTarget "btrfs.util" */ = {
isa = XCConfigurationList;
buildConfigurations = (
805F6B58265C0DC900531605 /* Debug */,
805F6B59265C0DC900531605 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
80AF8081265D207F00F7A600 /* Build configuration list for PBXNativeTarget "btrfs.fs" */ = {
isa = XCConfigurationList;
buildConfigurations = (
80AF8082265D207F00F7A600 /* Debug */,
80AF8083265D207F00F7A600 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 8047692E265AAA1F0019F414 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "2D0AC0B3-AE47-4703-88DD-C76987841F1F"
type = "1"
version = "2.0">
</Bucket>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>btrfs.fs.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>btrfs.util.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>btrfs.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>macos-btrfs.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>

37
macos-btrfs/Info.plist Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.kpi.mach</key>
<string>9.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>9.0.0</string>
<key>com.apple.kpi.unsupported</key>
<string>9.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>9.0.0</string>
<key>com.apple.kext.triggers</key>
<string>1.0.0d1</string>
<key>com.apple.kpi.bsd</key>
<string>9.0.0</string>
</dict>
</dict>
</plist>

26
macos-btrfs/macos_btrfs.c Normal file
View File

@@ -0,0 +1,26 @@
//
// macos_btrfs.c
// macos-btrfs
//
// Created by Yehia Hafez on 5/23/21.
//
#include <mach/mach_types.h>
#include <libkern/libkern.h>
#include <libkern/locks.h>
kern_return_t macos_btrfs_kext_start(kmod_info_t * ki, void *d);
kern_return_t macos_btrfs_kext_stop(kmod_info_t *ki, void *d);
kern_return_t macos_btrfs_kext_start(kmod_info_t * ki, void *d)
{
return KERN_SUCCESS;
}
kern_return_t macos_btrfs_kext_stop(kmod_info_t *ki, void *d)
{
return KERN_SUCCESS;
}