diff options
Diffstat (limited to 'ubi-utils')
-rw-r--r-- | ubi-utils/src/libubigen.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ubi-utils/src/libubigen.c b/ubi-utils/src/libubigen.c index ff7602e..a82d9c2 100644 --- a/ubi-utils/src/libubigen.c +++ b/ubi-utils/src/libubigen.c @@ -303,10 +303,11 @@ int ubigen_write_layout_vol(const struct ubigen_info *ui, vi.bytes = ui->leb_size * UBI_LAYOUT_VOLUME_EBS; vi.id = UBI_LAYOUT_VOLUME_ID; - vi.alignment = 1; - vi.data_pad = 0; - vi.usable_leb_size = ui->leb_size; - vi.type = UBI_VID_DYNAMIC; + vi.alignment = UBI_LAYOUT_VOLUME_ALIGN; + vi.data_pad = ui->leb_size % UBI_LAYOUT_VOLUME_ALIGN; + vi.usable_leb_size = ui->leb_size - vi.data_pad; + vi.data_pad = ui->leb_size - vi.usable_leb_size; + vi.type = UBI_LAYOUT_VOLUME_TYPE; vi.name = UBI_LAYOUT_VOLUME_NAME; vi.name_len = strlen(UBI_LAYOUT_VOLUME_NAME); vi.compat = UBI_LAYOUT_VOLUME_COMPAT; |