// reference
Synthetic entries (dev / net / sys)
PrismaFS exposes system information via read-only files that, inside the mount, act throgh "everything is a file" model, This is extendable but unified for three top level directories: dev, net, and sys. They are generated upon reading itself, and there is nothing stored for them on disk (base or session layer). In other words, commands acts like files, but their content is generated for on-the-fly output.
dev/cpu is enabled by default. So, for anything else, it needs explicit synthetic <name> directive in your config file:
session /tmp/session base /opt/project-base synthetic hostname synthetic loadavg synthetic interfaces
cat ~/pfs-mnt/dev/cpu cat ~/pfs-mnt/dev/hostname cat ~/pfs-mnt/dev/loadavg cat ~/pfs-mnt/net/interfaces
sys is an example when there are no default entries. Here we can define entries to synthesize command output as files with synthetic <dir>/<name> <command...>:
session /tmp/session base /opt/project-base synthetic sys/uptime uptime synthetic sys/kernel uname -a
cat ~/pfs-mnt/sys/uptime cat ~/pfs-mnt/sys/kernel
Reading those files again runs configured command on-the-fly and returns the output. This will be directory listed for dev, net, and sys. Operation is read-only, so any writes or deletes are rejected.
Note: abive examples read synthetic entries from mountpoint, generally (~/pfs-mnt). On Linux, because of no restriction on private namespaces, prismafs ns can bind mount over real path, so synthetic view temporarily replaces process tree view, effectively shadowing /dev:
SESSION_LAYER_DIR=/tmp/session BASE_LAYER_DIRS=/tmp/base \ prismafs ns /dev -- bash cat /dev/cpu cat /dev/hostname