dissect: Allow a few verbs to operate on directories as well as image files
--copy-to, --copy-from, --list and --mtree are useful for image directories as well as image files, so for those verbs, let's check if we were passed a directory and skip all the image file setup if that's the case.
This commit is contained in:
@@ -540,6 +540,16 @@ systemctl stop test-root-ephemeral
|
||||
timeout 10 bash -c 'while ! test -z "$(ls -A /var/lib/systemd/ephemeral-trees)"; do sleep .5; done'
|
||||
test ! -f /tmp/img/abc
|
||||
|
||||
systemd-dissect --mtree /tmp/img
|
||||
systemd-dissect --list /tmp/img
|
||||
|
||||
read -r SHA256SUM1 _ < <(systemd-dissect --copy-from /tmp/img etc/os-release | sha256sum)
|
||||
test "$SHA256SUM1" != ""
|
||||
|
||||
echo abc > abc
|
||||
systemd-dissect --copy-to /tmp/img abc /abc
|
||||
test -f /tmp/img/abc
|
||||
|
||||
echo OK >/testok
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user