Skip to content

Commit

Permalink
Merge pull request #234 from entner-electronics/master
Browse files Browse the repository at this point in the history
ubifs: Add configuration for space-fixup
  • Loading branch information
michaelolbrich authored Feb 16, 2024
2 parents 875f1d9 + 483bf6b commit fd7cb9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ Options:

:extraargs: Extra arguments passed to mkubifs
:max-size: Maximum size of the UBIFS image
:space-fixup: Instructs the file-system free space to be freed up on first mount.

vfat
****
Expand Down
5 changes: 4 additions & 1 deletion image-ubifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,19 @@ static int ubifs_generate(struct image *image)
int ret;
char *extraargs = cfg_getstr(image->imagesec, "extraargs");
unsigned long long max_size = cfg_getint_suffix(image->imagesec, "max-size");
cfg_bool_t space_fixup = cfg_getbool(image->imagesec, "space-fixup");

if (max_size)
max_leb_cnt = max_size / image->flash_type->lebsize;
else
max_leb_cnt = image->size / image->flash_type->lebsize;

ret = systemp(image, "%s %s%s%s -e %d -m %d -c %d -o '%s' %s",
ret = systemp(image, "%s %s%s%s %s -e %d -m %d -c %d -o '%s' %s",
get_opt("mkfsubifs"),
image->empty ? "" : "-d '",
image->empty ? "" : mountpath(image),
image->empty ? "" : "'",
space_fixup ? "-F" : "",
image->flash_type->lebsize,
image->flash_type->minimum_io_unit_size,
max_leb_cnt,
Expand Down Expand Up @@ -66,6 +68,7 @@ static int ubifs_setup(struct image *image, cfg_t *cfg)
static cfg_opt_t ubifs_opts[] = {
CFG_STR("extraargs", "", CFGF_NONE),
CFG_STR("max-size", NULL, CFGF_NONE),
CFG_BOOL("space-fixup", 0, CFGF_NONE),
CFG_END()
};

Expand Down

0 comments on commit fd7cb9e

Please sign in to comment.