miniximg-cli 1.1.0

Command-line tool for building, inspecting, editing, and interactively exploring Minix v1 filesystem images
miniximg-cli-1.1.0 is not a library.

miniximg-cli

Command-line tool for building, inspecting, editing, and interactively exploring Minix v1 filesystem images.

miniximg-cli ships the miniximg binary. It glues miniximg (the core library) and miniximg-shell (the interactive REPL) into a single tool.

cargo install miniximg-cli

At a glance

Subcommand One-liner
build Create a new image from a TOML manifest or --entry flags.
inspect Print a human-readable summary of an existing image.
check Validate an image and exit non-zero on issues.
ls, tree, cat, stat Read-only browsing.
get, put Transfer one file between the host and an image.
mkdir, mknod, rm, rmdir, mv, ln Direct mutating ops.
shell Drop into an interactive REPL against the image.

Run miniximg <subcommand> --help for the full set of flags on any one command.

Build an image

From a TOML manifest:

miniximg build --manifest rootfs.toml

Or with explicit mappings on the command line:

miniximg build \
  --output build/rootfs.img \
  --size 4MiB \
  --inode-count 128 \
  --entry kind=tree,source=build/root,target=/,overwrite=true \
  --entry kind=file,source=README.md,target=/etc/motd,overwrite=true

Manifest shape

build --manifest expects a TOML file with one [image] table and zero or more [[mapping]] entries.

[image]
output = "build/rootfs.img"
size = "4MiB"
inode_count = 128
default_uid = 0
default_gid = 0
default_file_mode = "0644"
default_dir_mode = "0755"

[[mapping]]
kind = "tree"
source = "build/root"
target = "/"
overwrite = true

[[mapping]]
kind = "file"
source = "README.md"
target = "/etc/motd"
overwrite = true

[[mapping]]
kind = "dir"
target = "/var/log"
mode = "0755"

[[mapping]]
kind = "char-device"
target = "/dev/tty0"
major = 4
minor = 0
mode = "0666"

Supported mapping kinds: file, tree, dir, block-device, char-device.

Inspect and validate

miniximg inspect build/rootfs.img
miniximg check   build/rootfs.img

Read-only browsing

miniximg ls   build/rootfs.img /
miniximg tree build/rootfs.img /
miniximg cat  build/rootfs.img /etc/motd
miniximg stat build/rootfs.img /bin/init
miniximg get  build/rootfs.img /etc/motd --output out/motd

Mutating operations

miniximg mkdir build/rootfs.img /usr/share
miniximg mknod build/rootfs.img /dev/tty0 --kind char --major 4 --minor 0
miniximg put   build/rootfs.img host/message.txt /usr/share/message --overwrite
miniximg mv    build/rootfs.img /usr/share/message /usr/share/motd
miniximg ln    build/rootfs.img /usr/share/motd /etc/motd
miniximg rm    build/rootfs.img /usr/share/motd
miniximg rmdir build/rootfs.img /usr/share

Interactive shell

For ad-hoc exploration and editing, shell is much faster than chaining individual subcommands.

miniximg shell build/rootfs.img            # read-write
miniximg shell --readonly build/rootfs.img # safe browsing
(rootfs.img) /> ls /etc
group  hostname  motd  passwd  profile  rc
(rootfs.img) /> edit /etc/motd           # opens $EDITOR, writes back on save
(rootfs.img) /> put @./local-fix.sh /usr/local/bin/fix
(rootfs.img) /> diff /etc/motd @./old-motd

See miniximg-shell for the full command list, prompt syntax, and the @-prefix convention.

License

MIT. See LICENSE in the workspace root.