I would like to propose a new optional feature for frugen: --area-offset <area>=<offset>[,<area>=<offset>...]
Example: frugen --area-offset chassis=8,board=64,product=256 out.fru
Motivation
This feature would help address a layout stability problem similar to the one discussed in ipmitool issue 309
When a field is modified in one FRU area, the encoded size of that area may change. Because FRU areas are normally packed sequentially, this can shift the offsets of later areas even though their contents were not changed.
This has a few practical downsides:
- Unrelated areas move when only one field is updated
- Workflows that rely on fixed area placement may break
- Binary diffs become noisy
- Validation and manufacturing flows become harder to manage/tunning.
Proposed solution
The new --area-offset option would allow users to fix the absolute byte offset of selected FRU areas in the generated FRU image.
For example: frugen --area-offset chassis=8,board=64,product=256 out.fru
would mean:
- chassis area starts at byte 8
- board area starts at byte 64
- product area starts at byte 256
If there is unused space between the end of one area and the next fixed offset, frugen would automatically fill that gap with zero padding.
If a modified area no longer fits before the next fixed area, frugen should fail with a clear error instead of silently shifting later areas.
Suggested constraints
To keep behavior explicit and safe, I think the following rules would make sense:
- Offsets are absolute byte offsets from the start of the FRU file
- Offsets must be 8-byte aligned
- Offsets must not overlap
- If an area cannot fit before the next fixed area, return an explicit error.
Why this is useful
This would allow users to modify one area without affecting the start offsets of other areas, as long as the modified area still fits within the reserved space.
In practice, this provides:
- Stable offsets for unaffected areas
- More predictable FRU image layout
- Cleaner binary comparisons.
- Easier integration into manufacturing/programming workflows
- Better support for use cases where fixed layout is expected
- A clearer and safer alternative to manually tuning padding
Compatibility
This feature would be fully backward compatible because it is opt-in.
If --area-offset is not used, current behavior remains unchanged.
Summary
I think --area-offset would be a useful addition for users who need deterministic FRU layout and stable area positions across updates, while keeping the default behavior unchanged for everyone else.
Please feel free to comment on my proposal. I would be happy to discuss it further, and I will create a pull request once the proposal is approved.
I would like to propose a new optional feature for frugen: `--area-offset <area>=<offset>[,<area>=<offset>...]`
**Example**: `frugen --area-offset chassis=8,board=64,product=256 out.fru`
### Motivation
This feature would help address a layout stability problem similar to the one discussed in [ipmitool issue 309](https://github.com/ipmitool/ipmitool/issues/309)
When a field is modified in one FRU area, the encoded size of that area may change. Because FRU areas are normally packed sequentially, this can shift the offsets of later areas even though their contents were not changed.
This has a few practical downsides:
- Unrelated areas move when only one field is updated
- Workflows that rely on fixed area placement may break
- Binary diffs become noisy
- Validation and manufacturing flows become harder to manage/tunning.
### Proposed solution
The new `--area-offset` option would allow users to fix the absolute byte offset of selected FRU areas in the generated FRU image.
**For example**: `frugen --area-offset chassis=8,board=64,product=256 out.fru`
would mean:
- chassis area starts at byte 8
- board area starts at byte 64
- product area starts at byte 256
If there is unused space between the end of one area and the next fixed offset, frugen would automatically fill that gap with zero padding.
If a modified area no longer fits before the next fixed area, frugen should fail with a clear error instead of silently shifting later areas.
### Suggested constraints
To keep behavior explicit and safe, I think the following rules would make sense:
- Offsets are absolute byte offsets from the start of the FRU file
- Offsets must be 8-byte aligned
- Offsets must not overlap
- If an area cannot fit before the next fixed area, return an explicit error.
### Why this is useful
This would allow users to modify one area without affecting the start offsets of other areas, as long as the modified area still fits within the reserved space.
In practice, this provides:
- Stable offsets for unaffected areas
- More predictable FRU image layout
- Cleaner binary comparisons.
- Easier integration into manufacturing/programming workflows
- Better support for use cases where fixed layout is expected
- A clearer and safer alternative to manually tuning padding
### Compatibility
**This feature would be fully backward compatible because it is opt-in.**
If `--area-offset` is not used, current behavior remains unchanged.
### Summary
I think `--area-offset` would be a useful addition for users who need deterministic FRU layout and stable area positions across updates, while keeping the default behavior unchanged for everyone else.
Please feel free to comment on my proposal. I would be happy to discuss it further, and I will create a pull request once the proposal is approved.