Skip to content

A fast, lightweight Go implementation of the EROFS (Enhanced Read-Only File System) designed for efficient, compressed, and immutable file storage.

Notifications You must be signed in to change notification settings

PsychoPunkSage/ErgoFS

Repository files navigation

ErgoFS - Go impl of EroFS

EroFS Filesystem

Filesystem (C lang impl )
.
├── autogen.sh
├── include
│   ├── erofs
│   │   ├── atomic.h
│   │   ├── bitops.h
│   │   ├── blobchunk.h
│   │   ├── block_list.h
│   │   ├── cache.h
│   │   ├── compress.h
│   │   ├── compress_hints.h
│   │   ├── config.h
│   │   ├── decompress.h
│   │   ├── dedupe.h
│   │   ├── defs.h
│   │   ├── dir.h
│   │   ├── diskbuf.h
│   │   ├── err.h
│   │   ├── exclude.h
│   │   ├── flex-array.h
│   │   ├── fragments.h
│   │   ├── hashmap.h
│   │   ├── hashtable.h
│   │   ├── inode.h
│   │   ├── internal.h
│   │   ├── io.h
│   │   ├── list.h
│   │   ├── print.h
│   │   ├── rebuild.h
│   │   ├── tar.h
│   │   ├── trace.h
│   │   ├── workqueue.h
│   │   └── xattr.h
│   └── erofs_fs.h
├── lib
│   ├── bitops.c
│   ├── blobchunk.c
│   ├── block_list.c
│   ├── cache.c
│   ├── compress.c
│   ├── compress_hints.c
│   ├── compressor.c
│   ├── compressor_deflate.c
│   ├── compressor.h
│   ├── compressor_libdeflate.c
│   ├── compressor_liblzma.c
│   ├── compressor_libzstd.c
│   ├── compressor_lz4.c
│   ├── compressor_lz4hc.c
│   ├── config.c
│   ├── data.c
│   ├── decompress.c
│   ├── dedupe.c
│   ├── dir.c
│   ├── diskbuf.c
│   ├── exclude.c
│   ├── fragments.c
│   ├── hashmap.c
│   ├── inode.c
│   ├── io.c
│   ├── kite_deflate.c
│   ├── liberofs_private.h
│   ├── liberofs_uuid.h
│   ├── liberofs_xxhash.h
│   ├── Makefile.am
│   ├── namei.c
│   ├── rebuild.c
│   ├── rolling_hash.h
│   ├── sha256.c
│   ├── sha256.h
│   ├── super.c
│   ├── tar.c
│   ├── uuid.c
│   ├── uuid_unparse.c
│   ├── workqueue.c
│   ├── xattr.c
│   ├── xxhash.c
│   └── zmap.c
├── Makefile.am
├── mkfs
│   ├── main.c
│   └── Makefile.am
├── README
└── VERSION

13 directories, 104 files

My file str

Disclaimer

this str is temporary and will be changed as this project gets more mature

.
├── cmd
│   └── mkfs
│       └── main.go
├── compress_hints.txt
├── go.mod
├── go.sum
├── pkg
│   ├── compression
│   │   ├── algorithms.go
│   │   ├── compress.go
│   │   └── lz4.go
│   ├── dedupe
│   │   └── dedupe.go
│   ├── types
│   │   ├── buffer.go
│   │   ├── compress.go
│   │   ├── compressor
│   │   ├── config.go
│   │   ├── constants.go
│   │   ├── debug.go
│   │   ├── error.go
│   │   ├── helper.go
│   │   ├── inode.go
│   │   ├── internal.go
│   │   ├── list.go
│   │   ├── lz4.go
│   │   ├── macros.go
│   │   ├── superblock.go
│   │   └── uuid.go
│   ├── util
│   │   ├── buffer.go
│   │   └── diskbuf.go
│   └── writer
│       ├── builder.go
│       ├── inode.go
│       ├── utils.go
│       └── xattr.go
├── README.md
├── report
│   ├── c_hexdump.txt
│   ├── c_superblock.bin
│   ├── c_superblock.txt
│   ├── diff.log
│   ├── diff_superblock.log
│   ├── go_hexdump.txt
│   ├── go_superblock.bin
│   └── go_superblock.txt
├── report.sh
├── run.sh
├── script.sh
├── test
└── test_data
    ├── hello.txt
    ├── random.bin
    ├── subdir
    │   └── test.txt
    └── symlink -> hello.txt

15 directories, 48 files

Project Structure (for now)

  • pkg/types/: Core data structures and constants
  • pkg/writer/: Filesystem creation functionality
  • cmd/mkfs/: Command line interface

How to use?

./run.sh
OUTPUT(Go-ErgoFS)
Debug Level: 4, Image Path: output.img, Source Path: test_data/
I'm here
successfully opened output.img
Superblock reserved successfully: &{{0xc000104200 0xc000104200} 0xc000112070 0 0x5e01e0 <nil>}
UUID generated successfully: [51 56 74 108 149 254 78 116 130 208 58 195 69 200 222 149]
Compress Initialization successfully Done
Erofs Bflush successfully executed
Superblock successfully Written
ret: 0
SuperBlock checksum 0x5c390b03 written

$ sudo dmesg | grep -i erofs

NO OUTPUT :)

$ sudo dmesg

[40382.691728] wlo1: associated
[40382.691852] wlo1: Limiting TX power to 30 (30 - 0) dBm as advertised by e8:10:98:6b:3e:32
[40448.887111] audit: type=1400 audit(1742497728.950:517): apparmor="DENIED" operation="open" class="file" profile="snap.brave.brave" name="/proc/pressure/cpu" pid=30524 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[40448.887131] audit: type=1400 audit(1742497728.950:518): apparmor="DENIED" operation="open" class="file" profile="snap.brave.brave" name="/proc/pressure/io" pid=30524 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[40448.887140] audit: type=1400 audit(1742497728.950:519): apparmor="DENIED" operation="open" class="file" profile="snap.brave.brave" name="/proc/pressure/memory" pid=30524 comm="ThreadPoolForeg" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[40619.188322] wlo1: authenticate with e8:10:98:6b:2e:52 (local address=f8:89:d2:8d:e7:05)
[40619.188338] wlo1: send auth to e8:10:98:6b:2e:52 (try 1/3)
[40619.189880] wlo1: authenticated
[40619.191955] wlo1: associate with e8:10:98:6b:2e:52 (try 1/3)
[40619.196179] wlo1: RX AssocResp from e8:10:98:6b:2e:52 (capab=0x1411 status=0 aid=3)
[40619.305425] wlo1: associated
[40619.305672] wlo1: Limiting TX power to 36 (36 - 0) dBm as advertised by e8:10:98:6b:2e:52
  • No recent logs are related to superblock errors. (i.e. earlier I got the malformed superblock error... now everything is working fine)

./script.sh
OUTPUT(C-EroFS)
mkfs.erofs 1.8.5-g6fa861e2-dirty
<I> erofs_io: successfully to open c_reference.img
	c_version:           [1.8.5-g6fa861e2-dirty]
	c_dbg_lvl:           [       4]
	c_dry_run:           [       0]
<I> erofs: file / dumped (mode 40775)
<I> erofs: file /hello.txt dumped (mode 100664)
<I> erofs: file /random.bin dumped (mode 100664)
<I> erofs: file /subdir dumped (mode 40775)
<I> erofs: file /symlink dumped (mode 120777)
<I> erofs: file /subdir/test.txt dumped (mode 100664)
<I> erofs: superblock checksum 0x1be3f68f written
------
Filesystem UUID: 7dd00173-4052-4115-9b79-fcca49d178c1
Filesystem total blocks: 257 (of 4096-byte blocks)
Filesystem total inodes: 6
Filesystem total metadata blocks: 1
Filesystem total deduplicated bytes (of source files): 0

About

A fast, lightweight Go implementation of the EROFS (Enhanced Read-Only File System) designed for efficient, compressed, and immutable file storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published