]> git.ipfire.org Git - thirdparty/systemd.git/commit
repart: Fix deny list logic
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 8 May 2023 16:44:01 +0000 (18:44 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 10 May 2023 16:07:47 +0000 (18:07 +0200)
commite57b7020d2ee89d9c906bcefa091d31b067dedcc
treee16f23cbadb2ad96a69423c4fce51456d2f74439
parent39a39f18f2bd2b1ef7b4fa4823472d129c514030
repart: Fix deny list logic

Until now, we always excluded the top level directories that were
covered by child partition mount points, regardless of the source
directory and the target directory of the copy files operation.
This means that even if we were populating a XBOOTLDR partition, if
there was an EFI partition in the image, we'd exclude /boot
unconditionally, leading to the XBOOTLDR partition to be empty.

Also, because of the same cause, if we were copying a nested source
directory (e.g. /abc/def) to the root directory in the root
partition, if /abc/def/usr existed and was populated with files and
directories, the root partition would have those files under /usr,
even if a /usr partition was defined.

To fix these issues, instead of unconditionally excluding the top
level partition mount points under <source>, let's make sure that
when we're copying files from any source directory to the root
directory of a root partition, that we exclude the partition mount
point directories under the source directory instead of the top
level ones.
src/partition/repart.c
test/units/testsuite-58.sh