{"id":20768508,"url":"https://github.com/papierkorb/tarfs","last_synced_at":"2025-05-11T09:32:03.509Z","repository":{"id":60249129,"uuid":"84612666","full_name":"Papierkorb/tarfs","owner":"Papierkorb","description":"tar file system as loadable kernel module","archived":false,"fork":false,"pushed_at":"2017-03-11T00:58:19.000Z","size":22,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T12:15:15.716Z","etag":null,"topics":["c","linux","loadable-kernel-modules","tar"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Papierkorb.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}},"created_at":"2017-03-11T00:42:11.000Z","updated_at":"2025-04-01T15:56:30.000Z","dependencies_parsed_at":"2022-09-27T07:00:20.983Z","dependency_job_id":null,"html_url":"https://github.com/Papierkorb/tarfs","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/Papierkorb%2Ftarfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papierkorb%2Ftarfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papierkorb%2Ftarfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Papierkorb%2Ftarfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Papierkorb","download_url":"https://codeload.github.com/Papierkorb/tarfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253544987,"owners_count":21925315,"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":["c","linux","loadable-kernel-modules","tar"],"created_at":"2024-11-17T11:39:16.847Z","updated_at":"2025-05-11T09:32:03.243Z","avatar_url":"https://github.com/Papierkorb.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tarfs\n\ntarfs is implemented as Linux kernel module filesystem driver.  It's more of a\nresearch thing.  If you're interested in actually using something like this,\nconsider writing it using libFuse :)\n\n## Features\n\n* Supports GNU tar files\n* Regular files, directories and symlinks\n* UID, GID, access/modification/creation time\n* Read-only access to files and directories\n\n## Compiling\n\nYou'll require the linux development files.  For ArchLinux, you need the\n`linux-headers` packet.\n\nAfter that, just run `make` to build the `tarfs.ko`, which is a loadable\nkernel module.\n\n**Note**: The module was tested with Linux `4.9.11`, on a `x64 ArchLinux`\n          computer.\n\n## Usage\n\n```sh\n# If not already done, build the module\nmake\n\n# Now you can load the module:\nsudo insmod tarfs.ko\n\n# You need a mount directory\nmkdir mnt\n\n# Mount some tar archive.  A sample one is included:\nsudo mount sample.tar -o loop -t tarfs mnt\n\n# Discover the archives content\nls mnt -R\ncat mnt/hello.c\n\n# Unmount\nsudo umount mnt\n\n# And unload the kernel module\nsudo rmmod tarfs.ko\n```\n\n## File overview\n\n* **driver.c** The driver code interfacing with Linux\n* **device.c/h** Code to read from the underlying block device\n* **tar.c/h** Code to read the tar file\n* **gnutar.h** Header definition for tar files, taken from\n  https://www.gnu.org/software/tar/manual/html_node/Standard.html\n\n## Implementation\n\nThis project focuses on the interaction part with Linux.  That's why the\nimplementation of the Tar reading code is kept really simple: On mount, all\nfile entries are read from the tar file, and stored as a linked list.  Some\ndata, like the file path, is stored separatly in the structure to ease access.\n\nWhen Linux wants the module to list a directory, or find a specific file, the\nwhole linked list is iterated, making most file system operations `O(n)`.\n\n## Attention\n\nPlease note that you're actually loading stuff into your kernel.  That means the\nmodule runs with highest permissions possible (Ring 0 on x86 machines).  Also,\nif something goes really wrong, your entire computer could hang/crash/freeze.\n\nIt's recommended to try this in a virtual machine.  You can create one easily\nusing programs like `QEMU` or `VirtualBox`.\n\n## License\n\nThe enclosed source code, and the `sample.tar` file including its contents, are\nsubject to the **General Public License version 3** (**GPLv3**).  Please see the\nincluded `LICENSE` file for the whole license text.  If you're interested in a\nlegally non-binding explanation of this license, have a look at\n[its tl;drLegal page](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)).\n\n## Still reading?\n\nThanks for your interest - Have a nice day, and happy hacking!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapierkorb%2Ftarfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpapierkorb%2Ftarfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapierkorb%2Ftarfs/lists"}