]> git.ipfire.org Git - thirdparty/systemd.git/commit
sysupdate: Add --transfer-source=
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 8 Sep 2024 14:09:19 +0000 (16:09 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 9 Sep 2024 14:41:52 +0000 (16:41 +0200)
commitc1852f9d5fad0fd7baf2ea88339c3eaa5a60290d
treee39e9eb519af8c0859876eed7f608b32868d78ed
parent4ec630bfba02543af204f13ad9f5ce4a2329a166
sysupdate: Add --transfer-source=

In mkosi, I want to add a sysupdate verb to wrap systemd-sysupdate.
The definitions will be picked up from mkosi.sysupdate/ and passed
to systemd-sysupdate. I want users to be able to write transfer
definitions that are independent of the output directory used by
mkosi. To make this possible, it should be possible to specify the
directory that transfer sources should be looked up in on the sysupdate
command line. Let's allow this via a new --transfer-source= option.

Additionally, transfer sources that want to take advantage of this
feature should specify PathRelativeTo=directory to indicate the configured
Path= is interpreted relative to the tranfer source directory specified
on the CLI.

This allows for the following transfer definition to be put in
mkosi.sysupdate:

"""
[Transfer]
ProtectVersion=%A

[Source]
Type=regular-file
Path=/
PathRelativeTo=directory
MatchPattern=ParticleOS_@v.usr-%a.@u.raw

[Target]
Type=partition
Path=auto
MatchPattern=ParticleOS_@v
MatchPartitionType=usr
PartitionFlags=0
ReadOnly=1
"""
man/systemd-sysupdate.xml
man/sysupdate.d.xml
src/sysupdate/sysupdate-resource.c
src/sysupdate/sysupdate-resource.h
src/sysupdate/sysupdate-transfer.c
src/sysupdate/sysupdate.c
src/sysupdate/sysupdate.h