xdvdfs
xdvdfs is a collection of tools for interacting with XDVDFS/XISO images.
xdvdfs-cli
xdvdfs-cli is a command line tool for interacting with xiso files.
If cargo is set up correctly in the path, it can be installed with:
cargo install xdvdfs-cli
Otherwise, it can be run from the workspace root as the default project.
A binary distribution of xdvdfs-cli is also available in the github releases.
Usage
Running xdvdfs with no args will bring up the help screen, showing supported subcommands:
$ xdvdfs
Usage: xdvdfs [COMMAND]
Commands:
ls List files in an image
tree List all files in an image, recursively
md5 Show MD5 checksums for files in an image
checksum Compute deterministic checksum of image contents
info Print information about image metadata
copy-out Copy a file or directory out of the provided image file
unpack Unpack an entire image to a directory
pack Pack an image from a given directory or source ISO image
build-image Pack an image from a given specification
image-spec Manage image spec `xdvdfs.toml` files
compress Pack and compress an image from a given directory or source ISO image
help Print this message or the help of the given subcommand(s)
Running a subcommand with the -h flag will show help information for that specific subcommand.
Packing an Image
To pack an image from a directory, run:
xdvdfs pack [optional output path]
This will create an iso that matches 1-to-1 with the input directory.
Repacking an Image
Images can be repacked from an existing ISO image:
xdvdfs pack [optional output path]
This will create an iso that matches 1-to-1 with the input image.
Packing an Image with Path Rewriting
Images can be packed while rewriting host paths to different destinations in the underlying image using the xdvdfs build-image subcommand.
If the path remapping functionality is not needed (i.e. you just want a /**:/{1} rule)
then you should prefer xdvdfs pack instead.
The primary method of accomplishing this is with a xdvdfs.toml file:
[metadata]
# Relative path to output iso, if not specified in command [optional]
output = "dist/image.xiso.iso"
# List of host-to-image path mapping rules. At least one rule is required.
# All paths are relative to the provided source path, the `xdvdfs.toml` file,
# or the working directory, in that priority order
# Host paths are matched by glob pattern
# Image paths have fields given by `{x}` substituted, where `x` is the index
# of the glob match, starting at 1. `{0}` matches the entire host path.
# Globs are evaluated in the provided order
[map_rules]
# Map contents of the "bin" directory to the image root
bin = "/"
# Map anything in the assets directory to `/assets/`
# Equivalent to `assets = "/assets"`
"assets/**" = "/assets/{1}"
# Map any file in the `sound` subdirectory with name `priority`
# and any extension to the same path in the image
# Note that `{0}` matches the entire relative host path
# Also note that due to the linear ordering of glob matches,
# this takes precedence over the below rule
"sound/priority.*" = "/{0}"
# Map any file in the `sound` subdirectory with extension `a`, `b`, or `c`,
# to `/a/filename`, "/b/filename" or `/c/filename`, based on its filename
# and extension.
"sound/*.{a,b,c}" = "/{2}/{1}"
# but, exclude any files in the `sound` subdirectory with filename `excluded`
# The image path is a don't-care value, and has no effect
"!sound/excluded.*" = ""
# Since globs are evaluated in order, this includes any otherwise excluded
# files in the `sound` subdirectory with name `excluded` and extension `c`
"sound/excluded.c" = "/c/excluded"