summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-25 11:32:40 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-01-25 11:32:40 +0200
commit294a5065d814d3fecc4cffec2f5c75eb76fbd5fe (patch)
treef95fd42d0dc393a7b98d9948e566b3c93262c15c
parent2805ada1d5861b908b5f8a323ca081e5a6a95306 (diff)
ubi-utils: use macros not hardcoded constants
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--ubi-utils/src/libubigen.c9
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;