From: Lennart Poettering Date: Wed, 21 Apr 2021 14:46:56 +0000 (+0200) Subject: tree-wide: enable automatic growing of file systems in images in various tools that... X-Git-Tag: v249-rc1~279^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c65f854af628fbe04b087179c4e660fcc0a817a1;p=thirdparty%2Fsystemd.git tree-wide: enable automatic growing of file systems in images in various tools that deal with OS images Let's enable this in all tools that intend to write to the OS images. It's not conditionalized for now, as there already is conditionalization in the existance or absence of the flag in the GPT partition table (and it's opt-in), hence it should be OK to just enable this by default for now if the flag is set. --- diff --git a/src/core/namespace.c b/src/core/namespace.c index 77fb0d4394c..acf8d14b67f 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -1818,7 +1818,8 @@ int setup_namespace( DISSECT_IMAGE_DISCARD_ON_LOOP | DISSECT_IMAGE_RELAX_VAR_CHECK | DISSECT_IMAGE_FSCK | - DISSECT_IMAGE_USR_NO_ROOT; + DISSECT_IMAGE_USR_NO_ROOT | + DISSECT_IMAGE_GROWFS; size_t n_mounts; int r; diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index ba0b360cc1a..ffb92a02c4a 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -1357,7 +1357,8 @@ static int run(int argc, char *argv[]) { DISSECT_IMAGE_REQUIRE_ROOT | DISSECT_IMAGE_VALIDATE_OS | DISSECT_IMAGE_RELAX_VAR_CHECK | - DISSECT_IMAGE_FSCK, + DISSECT_IMAGE_FSCK | + DISSECT_IMAGE_GROWFS, &unlink_dir, &loop_device, &decrypted_image); diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index b4a8bd1bfbb..c8fb726d420 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -2154,7 +2154,7 @@ int main(int argc, char *argv[]) { DISSECT_IMAGE_REQUIRE_ROOT | DISSECT_IMAGE_VALIDATE_OS | DISSECT_IMAGE_RELAX_VAR_CHECK | - (arg_action == ACTION_UPDATE_CATALOG ? DISSECT_IMAGE_FSCK : DISSECT_IMAGE_READ_ONLY), + (arg_action == ACTION_UPDATE_CATALOG ? DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS : DISSECT_IMAGE_READ_ONLY), &unlink_dir, &loop_device, &decrypted_image); diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c index 9539c39c4e7..5af6bfeafe4 100644 --- a/src/machine-id-setup/machine-id-setup-main.c +++ b/src/machine-id-setup/machine-id-setup-main.c @@ -146,7 +146,8 @@ static int run(int argc, char *argv[]) { DISSECT_IMAGE_REQUIRE_ROOT | DISSECT_IMAGE_VALIDATE_OS | DISSECT_IMAGE_RELAX_VAR_CHECK | - DISSECT_IMAGE_FSCK, + DISSECT_IMAGE_FSCK | + DISSECT_IMAGE_GROWFS, &unlink_dir, &loop_device, &decrypted_image); diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index ed9b31e63ba..767e7111504 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -3588,7 +3588,7 @@ static int outer_child( DISSECT_IMAGE_MOUNT_ROOT_ONLY| DISSECT_IMAGE_DISCARD_ON_LOOP| DISSECT_IMAGE_USR_NO_ROOT| - (arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK)| + (arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS)| (arg_start_mode == START_BOOT ? DISSECT_IMAGE_VALIDATE_OS : 0)); if (r < 0) return r; @@ -3681,7 +3681,7 @@ static int outer_child( DISSECT_IMAGE_MOUNT_NON_ROOT_ONLY| DISSECT_IMAGE_DISCARD_ON_LOOP| DISSECT_IMAGE_USR_NO_ROOT| - (arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK)); + (arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS)); if (r == -EUCLEAN) return log_error_errno(r, "File system check for image failed: %m"); if (r < 0) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 8d3086e2091..642cf5be972 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -1997,7 +1997,8 @@ static int run(int argc, char *argv[]) { DISSECT_IMAGE_REQUIRE_ROOT | DISSECT_IMAGE_VALIDATE_OS | DISSECT_IMAGE_RELAX_VAR_CHECK | - DISSECT_IMAGE_FSCK, + DISSECT_IMAGE_FSCK | + DISSECT_IMAGE_GROWFS, &unlink_dir, &loop_device, &decrypted_image); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index b6de1e74b21..98f14bbbe72 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -3446,7 +3446,8 @@ static int run(int argc, char *argv[]) { DISSECT_IMAGE_REQUIRE_ROOT | DISSECT_IMAGE_VALIDATE_OS | DISSECT_IMAGE_RELAX_VAR_CHECK | - DISSECT_IMAGE_FSCK, + DISSECT_IMAGE_FSCK | + DISSECT_IMAGE_GROWFS, &unlink_dir, &loop_device, &decrypted_image);