feat: Create minimal Zero-OS initramfs with console support
- Fixed build system to clone source repositories instead of downloading binaries - Enhanced scripts/fetch-github.sh with proper git repo cloning and branch handling - Updated scripts/compile-components.sh for RFS compilation with build-binary feature - Added minimal firmware installation for essential network drivers (73 modules) - Created comprehensive zinit configuration set (15 config files including getty) - Added util-linux package for getty/agetty console support - Optimized package selection for minimal 27MB initramfs footprint - Successfully builds bootable vmlinuz.efi with embedded initramfs - Confirmed working: VM boot, console login, network drivers, zinit init system Components: - initramfs.cpio.xz: 27MB compressed minimal Zero-OS image - vmlinuz.efi: 35MB bootable kernel with embedded initramfs - Complete Zero-OS toolchain: zinit, rfs, mycelium compiled from source
This commit is contained in:
46
components/rfs/schema/schema.sql
Normal file
46
components/rfs/schema/schema.sql
Normal file
@@ -0,0 +1,46 @@
|
||||
-- inode table and main entrypoint of the schema
|
||||
CREATE TABLE IF NOT EXISTS inode (
|
||||
ino INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
parent INTEGER,
|
||||
name VARCHAR(255),
|
||||
size INTEGER,
|
||||
uid INTEGER,
|
||||
gid INTEGER,
|
||||
mode INTEGER,
|
||||
rdev INTEGER,
|
||||
ctime INTEGER,
|
||||
mtime INTEGER
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS parents ON inode (parent);
|
||||
CREATE INDEX IF NOT EXISTS names ON inode (name);
|
||||
|
||||
-- extra data for each inode for special types (say link targets)
|
||||
CREATE TABLE IF NOT EXISTS extra (
|
||||
ino INTEGER PRIMARY KEY,
|
||||
data VARCHAR(4096)
|
||||
);
|
||||
|
||||
-- blocks per file, order of insertion is important
|
||||
CREATE TABLE IF NOT EXISTS block (
|
||||
ino INTEGER,
|
||||
id VARCHAR(32),
|
||||
key VARCHAR(32)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS block_ino ON block (ino);
|
||||
|
||||
-- global flist tags, this can include values like `version`, `description`, `block-size`, etc..
|
||||
-- it can also hold extra user-defined tags for extensions
|
||||
CREATE TABLE IF NOT EXISTS tag (
|
||||
key VARCHAR(10) PRIMARY KEY,
|
||||
value VARCHAR(255)
|
||||
);
|
||||
|
||||
-- routing table define ranges where blobs can be found. This allows "sharding" by be able to retrieve
|
||||
-- blobs from different partitions using the prefix range (hashes that are )
|
||||
CREATE TABLE IF NOT EXISTS route (
|
||||
start integer, -- one byte hash prefix
|
||||
end integer, -- one byte hash prefix
|
||||
url VARCHAR(2048)
|
||||
);
|
||||
28
components/rfs/schema/server.sql
Normal file
28
components/rfs/schema/server.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Schema for blocks and files metadata relation tables in SQLite database
|
||||
|
||||
-- Table to store file metadata
|
||||
CREATE TABLE IF NOT EXISTS metadata (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT, -- Auto-incrementing ID for the file
|
||||
file_hash VARCHAR(64) NOT NULL, -- SHA-256 hash of the file content (64 characters for hex representation)
|
||||
block_index INTEGER, -- The index of the block in the file (NULL if not part of a file)
|
||||
block_hash VARCHAR(64), -- SHA-256 hash of the block data (64 characters for hex representation)
|
||||
user_id INTEGER, -- ID of the user who uploaded the block
|
||||
block_size INTEGER, -- Size of the block in bytes
|
||||
downloads_count INTEGER DEFAULT 0, -- Number of times the block has been downloaded
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- When the file was added to the database
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) -- Foreign key constraint to users table
|
||||
);
|
||||
|
||||
-- Index on file_hash for faster lookups
|
||||
CREATE INDEX IF NOT EXISTS idx_files_hash ON metadata (file_hash);
|
||||
|
||||
-- Table to store user information
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT, -- Auto-incrementing ID for the user
|
||||
username VARCHAR(255) NOT NULL UNIQUE, -- Unique username
|
||||
password VARCHAR(255) NOT NULL, -- Hashed password
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -- When the user was added to the database
|
||||
);
|
||||
|
||||
-- Index on username for faster lookups
|
||||
CREATE INDEX IF NOT EXISTS idx_users_username ON users (username);
|
||||
Reference in New Issue
Block a user