Mastodon Feed: Post

Mastodon Feed

jonny@neuromatch.social ("jonny (nonvenomous)") wrote:

this code is so awesome

# Usage: resolve-rootfs-path.sh <!-- raw HTML omitted --> # Output: resolved rootfs path on stdout -- and NOTHING ELSE, EVER. # # All three callers capture this script with $(...) : pre-start.sh, # launch-daemon.sh and ensure-rootfs.sh. Every byte written to stdout here, # including by anything this script runs without redirecting, is concatenated # into the path they then use. There is no validation downstream to catch it; # the cell would simply be started against a garbage rootfs path. # Diagnostics go to stderr. set -eu # The rendered default is retained for caller compatibility; resolution does # not depend on it (it renders to the image-local path everywhere). _default_rootfs="${1:?usage: resolve-rootfs-path.sh <!-- raw HTML omitted -->}" echo "/var/lib/hatch-runtime/rootfs"