diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-03-03 18:18:05 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-01-03 18:38:46 +0100 |
commit | 76511c1bd32a262c76d462919083925c47cbd212 (patch) | |
tree | b33e25999938371180789956a73e9505aeb77a5f /src/vpick/vpick-tool.c | |
parent | stat-util: add inode_type_from_string() helper (diff) | |
download | systemd-76511c1bd32a262c76d462919083925c47cbd212.tar.xz systemd-76511c1bd32a262c76d462919083925c47cbd212.zip |
shared: add new "vpick" concept for ".v/" directories that contain versioned resources
This adds a new concept for handling paths. At appropriate places, if a
path such as /foo/bar/baz.v/ is specified, we'll
automatically enumerate all entries in /foo/bar/baz.v/baz* and then
do a version sort and pick the newest file.
A slightly more complex syntax is available, too:
/foo/bar/baz.v/quux___waldo
if that's used, then we'll look for all files matching
/foo/bar/baz.v/quux*waldo, and split out the middle, and version sort
it, and pick the nwest.
The ___ wildcard indicates both a version string, and if needed an
architecture ID, in case per-arch entries shall be supported.
This is a very simple way to maintain versioned resources in a dir, and
make systemd's components automatically pick the newest. Example:
/srv/myimages.v/foobar_1.32.65_x86-64.raw
/srv/myimages.v/foobar_1.33.45_x86-64.raw
/srv/myimages.v/foobar_1.31.5_x86-64.raw
/srv/myimages.v/foobar_1.31.5_arm64.raw
If now nspawn is invoked like this:
systemd-nspawn --image=/srv/myimages.v/foobar___.raw
Then it will automatically pick
/srv/myimages.v/foobar_1.33.45_x86-64.raw as the version to boot on
x86-64, and /srv/myimages.v/foobar_1.31.5_arm64.raw on arm64.
This commit only adds the basic implementation for picking files from a
dir, but no hook-up anywhere.
Diffstat (limited to 'src/vpick/vpick-tool.c')
0 files changed, 0 insertions, 0 deletions