]> git.ipfire.org Git - thirdparty/systemd.git/commit
repart: perform an early check for missing mkfs or fs contents
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 27 May 2026 15:10:26 +0000 (17:10 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 3 Jun 2026 14:02:58 +0000 (16:02 +0200)
commit230a38ea52d321a301e84739f627f1408967e7e2
tree563c86b3ac910414761493a0da7e4bc8e4604dc3
parentbf4388ab3147a05b2339faa4928c07357f0dc683
repart: perform an early check for missing mkfs or fs contents

I was running repart in a VM, and if failed because mkfs.vfat was
not available. But if fails quite late in the process, possibly wasting
quite a bit of work. So add a check that catches some obvious cases
where repart would fail.

The condition of whether we have the root directory is complex,
determined in part by partition_target_prepare(). I didn't think it
was worth it to recreate the full logic in the check, so in some cases
it'll not miss cases. But that's still better than having no check ;)
src/repart/repart.c
src/shared/mkfs-util.c
src/shared/mkfs-util.h