Skip to content

Commit c65f854

Browse files
committed
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.
1 parent 74a54ba commit c65f854

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

src/core/namespace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,8 @@ int setup_namespace(
18181818
DISSECT_IMAGE_DISCARD_ON_LOOP |
18191819
DISSECT_IMAGE_RELAX_VAR_CHECK |
18201820
DISSECT_IMAGE_FSCK |
1821-
DISSECT_IMAGE_USR_NO_ROOT;
1821+
DISSECT_IMAGE_USR_NO_ROOT |
1822+
DISSECT_IMAGE_GROWFS;
18221823
size_t n_mounts;
18231824
int r;
18241825

src/firstboot/firstboot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,8 @@ static int run(int argc, char *argv[]) {
13571357
DISSECT_IMAGE_REQUIRE_ROOT |
13581358
DISSECT_IMAGE_VALIDATE_OS |
13591359
DISSECT_IMAGE_RELAX_VAR_CHECK |
1360-
DISSECT_IMAGE_FSCK,
1360+
DISSECT_IMAGE_FSCK |
1361+
DISSECT_IMAGE_GROWFS,
13611362
&unlink_dir,
13621363
&loop_device,
13631364
&decrypted_image);

src/journal/journalctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ int main(int argc, char *argv[]) {
21542154
DISSECT_IMAGE_REQUIRE_ROOT |
21552155
DISSECT_IMAGE_VALIDATE_OS |
21562156
DISSECT_IMAGE_RELAX_VAR_CHECK |
2157-
(arg_action == ACTION_UPDATE_CATALOG ? DISSECT_IMAGE_FSCK : DISSECT_IMAGE_READ_ONLY),
2157+
(arg_action == ACTION_UPDATE_CATALOG ? DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS : DISSECT_IMAGE_READ_ONLY),
21582158
&unlink_dir,
21592159
&loop_device,
21602160
&decrypted_image);

src/machine-id-setup/machine-id-setup-main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static int run(int argc, char *argv[]) {
146146
DISSECT_IMAGE_REQUIRE_ROOT |
147147
DISSECT_IMAGE_VALIDATE_OS |
148148
DISSECT_IMAGE_RELAX_VAR_CHECK |
149-
DISSECT_IMAGE_FSCK,
149+
DISSECT_IMAGE_FSCK |
150+
DISSECT_IMAGE_GROWFS,
150151
&unlink_dir,
151152
&loop_device,
152153
&decrypted_image);

src/nspawn/nspawn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,7 +3588,7 @@ static int outer_child(
35883588
DISSECT_IMAGE_MOUNT_ROOT_ONLY|
35893589
DISSECT_IMAGE_DISCARD_ON_LOOP|
35903590
DISSECT_IMAGE_USR_NO_ROOT|
3591-
(arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK)|
3591+
(arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS)|
35923592
(arg_start_mode == START_BOOT ? DISSECT_IMAGE_VALIDATE_OS : 0));
35933593
if (r < 0)
35943594
return r;
@@ -3681,7 +3681,7 @@ static int outer_child(
36813681
DISSECT_IMAGE_MOUNT_NON_ROOT_ONLY|
36823682
DISSECT_IMAGE_DISCARD_ON_LOOP|
36833683
DISSECT_IMAGE_USR_NO_ROOT|
3684-
(arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK));
3684+
(arg_read_only ? DISSECT_IMAGE_READ_ONLY : DISSECT_IMAGE_FSCK|DISSECT_IMAGE_GROWFS));
36853685
if (r == -EUCLEAN)
36863686
return log_error_errno(r, "File system check for image failed: %m");
36873687
if (r < 0)

src/sysusers/sysusers.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,8 @@ static int run(int argc, char *argv[]) {
19971997
DISSECT_IMAGE_REQUIRE_ROOT |
19981998
DISSECT_IMAGE_VALIDATE_OS |
19991999
DISSECT_IMAGE_RELAX_VAR_CHECK |
2000-
DISSECT_IMAGE_FSCK,
2000+
DISSECT_IMAGE_FSCK |
2001+
DISSECT_IMAGE_GROWFS,
20012002
&unlink_dir,
20022003
&loop_device,
20032004
&decrypted_image);

src/tmpfiles/tmpfiles.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3446,7 +3446,8 @@ static int run(int argc, char *argv[]) {
34463446
DISSECT_IMAGE_REQUIRE_ROOT |
34473447
DISSECT_IMAGE_VALIDATE_OS |
34483448
DISSECT_IMAGE_RELAX_VAR_CHECK |
3449-
DISSECT_IMAGE_FSCK,
3449+
DISSECT_IMAGE_FSCK |
3450+
DISSECT_IMAGE_GROWFS,
34503451
&unlink_dir,
34513452
&loop_device,
34523453
&decrypted_image);

0 commit comments

Comments
 (0)