{"id":13830106,"url":"https://github.com/leiless/emptyfs","last_synced_at":"2025-04-15T07:18:15.569Z","repository":{"id":140254991,"uuid":"156951132","full_name":"leiless/emptyfs","owner":"leiless","description":"macOS empty file system driver(VFS layer)","archived":false,"fork":false,"pushed_at":"2019-02-06T03:31:35.000Z","size":72,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T07:18:11.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leiless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-11-10T05:36:25.000Z","updated_at":"2024-09-29T08:13:06.000Z","dependencies_parsed_at":"2024-03-22T13:45:11.902Z","dependency_job_id":null,"html_url":"https://github.com/leiless/emptyfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Femptyfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Femptyfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Femptyfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leiless%2Femptyfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leiless","download_url":"https://codeload.github.com/leiless/emptyfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023745,"owners_count":21199961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T10:00:55.605Z","updated_at":"2025-04-15T07:18:15.553Z","avatar_url":"https://github.com/leiless.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"## `emptyfs` - A trivial macOS VFS plug-in implementation\n\n### Summary\n\n`emptyfs` is a trivial VFS plug-in(kernel extension), its volumes are completely empty(except for the root directory).\n\nThis simple VFS plug-in is a minimal implementation, you can use it to explore VFS behaviours, or as a template as your own VFS plug-in.\n\n### Build\n\nYou must install Apple's [Command Line Tools](https://developer.apple.com/download/more) as a minimal build environment, or Xcode as a full build environment in App Store.\n\n```shell\n$ make            # Debug build\n$ make release    # Release build\n```\n\nTheoretically, this kext can be compile and run in macOS 10.4+, yet currently only from 10.10 up to 10.14 are tested.\n\nIf you compile in macOS \u003e= 10.13 and wants the kext to stay compatible with macOS \u003c= 10.12, you should specify `-DKASAN` or `-D_FORTIFY_SOURCE=0` to `CPPFLAGS`, for more info, please refer to [issues#1](https://github.com/lynnlx/emptyfs/issues/1)\n\n### Debugging\n\n```\n# Under kext/ directory\n$ make load\t\t\t# Load emptyfs kext\n$ make stat\t\t\t# Print status of emptyfs kext\n$ make unload\t\t\t# Unload emptyfs kext\n```\n\n**TODO**: add info about kext logging\n\n### Install\n\n```shell\n# Under kext/ directory\n$ make install\n$ make uninstall\t\t# In case you want to uninstall\n```\n\nYou can specify `PREFIX` variable to make for install location, the default is `/Library/Extensions`\n\n**TODO:** add docs about HOWTO load at boot-up time\n\nAfter installation, the kext will be loaded automatically in each boot.\n\n### Use of `emptyfs`\n\nTo test the VFS plug-in, you must specify what device node to mounted on. Simplest approach is to create a disk image:\n\n```shell\n# Create a disk image (name: test.dmg size: 1MB type: EMPTYFS)\n$ hdiutil create -size 1m -partitionType EMPTYFS test\ncreated: /Users/lynnl/test.dmg\n\n$ file test.dmg\ntest.dmg: Apple Driver Map, blocksize 512, blockcount 2048, devtype 0, devid 0, driver count 0, contains[@0x200]: Apple Partition Map, map block count 2, start block 1, block count 63, name Apple, type Apple_partition_map, valid, allocated, contains[@0x400]: Apple Partition Map, map block count 2, start block 64, block count 1984, name disk image, type EMPTYFS, valid, allocated, readable, writable, mount at startup\n```\n\nThen attach the disk image with `-nomount` flag(.: the system won't automatically mount the volumes on the image):\n\n```shell\n# The first two volumes are image scheme and map partition\n#  We cares about the last one(i.e. EMPTYFS)\n$ hdiutil attach -nomount test.dmg\n/dev/disk2          \tApple_partition_scheme\n/dev/disk2s1        \tApple_partition_map\n/dev/disk2s2        \tEMPTYFS\n```\n\nAfter you load emptyfs kext, you can create a mount point and mount the file system:\n\n```shell\n$ sudo kextload emptyfs.kext\n$ mkdir emptyfs_mp\n$ ./mount_emptyfs /dev/disk2s2 emptyfs_mp\n```\n\nUse [mount(8)](x-man-page://8/mount) to check mount info and explore  the file system:\n\n```shell\n$ mount | grep emptyfs\n/dev/disk2s2 on /Users/lynnl/emptyfs_mp (emptyfs, local, nodev, noexec, nosuid, read-only, noowners, mounted by lynnl)\n\n$ ls -la emptyfs_mp\ntotal 8\ndr-xr-xr-x   2 lynnl  staff  528 Dec 27 22:00 .\ndrwxr-xr-x+ 19 lynnl  staff  608 Dec 27 21:59 ..\n\n$ stat emptyfs_mp\n16777226 2 dr-xr-xr-x 2 lynnl staff 0 528 \"Dec 27 22:00:25 2018\" \"Dec 27 22:00:25 2018\" \"Dec 27 22:00:25 2018\" \"Dec 27 22:00:25 2018\" 4096 8 0 emptyfs_mp\n```\n\nWhen you explore the file system thoroughly, you can first [umount(8)](x-man-page://8/umount) the file system and then unload the kext:\n\n```shell\n$ unmount emptyfs_mp\n$ sudo kextunload emptyfs.kext\n```\n\n---\n\n### Unranked references\n\n[EmptyFS - A very simple VFS plug-in that mounts a volume that is completely empty](https://developer.apple.com/library/archive/samplecode/EmptyFS/Introduction/Intro.html)\n\n[MFSLives - Sample VFS plug-in for the Macintosh File System (MFS) volume format, as used on 400KB floppies](https://developer.apple.com/library/archive/samplecode/MFSLives/Introduction/Intro.html)\n\n[mac9p - 9P for Mac](https://github.com/benavento/mac9p)\n\n[antekone's cross-reference search site](http://xr.anadoxin.org/source/xref)\n\n[FreeBSD and Linux Kernel Cross-Reference](http://fxr.watson.org)\n\n[Darwin kernel miscfs](https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/miscfs)\n\n[Darwin kernel NFS](https://opensource.apple.com/source/xnu/xnu-4570.71.2/bsd/nfs)\n\n[Darwin kernel NTFS](https://opensource.apple.com/source/ntfs)\n\n[Darwin kernel msdosfs](https://opensource.apple.com/source/msdosfs)\n\n[Darwin kernel autofs](https://opensource.apple.com/source/autofs)\n\n[Darwin kernel cddafs](https://opensource.apple.com/source/cddafs/cddafs)\n\n[Darwin kernel hfs](https://opensource.apple.com/source/hfs)\n\n[Darwin kernel webdavfs](https://opensource.apple.com/source/webdavfs/webdavfs)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleiless%2Femptyfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleiless%2Femptyfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleiless%2Femptyfs/lists"}