fru-device: Add option to allow updating all FRU fields
This patch introduces a new meson option `fru-update-property` to enable
updating FRU properties via D-Bus. This is particularly useful during
lab testing to modify FRU fields as needed.
TESTED=Build for tiagopass with fru-update-property set to true.
Verify the following:
1. Run command:
`busctl introspect xyz.openbmc_project.FruDevice
/xyz/openbmc_project/FruDevice/BMC_Storage_Module`
2. Verify the FRU fields are `writable`
Example:
...
.PRODUCT_ASSET_TAG property s "XXXXXXX"
emits-change writable
.PRODUCT_FRU_VERSION_ID property s "1.0"
emits-change writable
.PRODUCT_INFO_AM1 property s "XXXXXXXXX"
emits-change writable
.PRODUCT_INFO_AM2 property s "Config A"
emits-change writable
...
3. Update FRU field:
busctl set-property xyz.openbmc_project.FruDevice
/xyz/openbmc_project/FruDevice/BMC_Storage_Module
xyz.openbmc_project.FruDevice PRODUCT_INFO_AM2 s "123"
4. Verify by reading the field:
busctl get-property xyz.openbmc_project.FruDevice
/xyz/openbmc_project/FruDevice/BMC_Storage_Module
xyz.openbmc_project.FruDevice PRODUCT_INFO_AM2
s "123"
root@tiogapass:~# hexdump /sys/bus/i2c/drivers/at24/6-0054/eeprom
0000000 0001 0100 000d f100 0c01 3600 d0e6 58c6
0000010 5858 5858 d258 4d42 2043 7453 726f 6761
0000020 2065 6f4d 7564 656c 58cd 5858 5858 5858
0000030 5858 5858 5858 58ce 5858 5858 5858 5858
0000040 5858 5858 c358 2e31 c930 5858 5858 5858
0000050 5858 d258 5858 5858 5858 5858 5858 5858
0000060 5858 5858 5858 39c1 0c01 c600 5858 5858
0000070 5858 54d2 6f69 6167 5020 7361 2073 6953
0000080 676e 656c ce32 5858 5858 5858 5858 5858
0000090 5858 5858 58c4 5858 cd32 5858 5858 5858
00000a0 5858 5858 5858 c758 5858 5858 5858 c358
00000b0 2e31 c930 5858 5858 5858 5858 c858 6f43
00000c0 666e 6769 4120 45c1 0000 0000 0000 0000
00000d0 0000 0000 0000 0000 0000 0000 0000 0000
*
0002000
root@tiogapass:~# busctl set-property xyz.openbmc_project.FruDevice
/xyz/openbmc_project/FruDevice/BMC_Storage_Module
xyz.openbmc_project.FruDevice PRODUCT_INFO_AM1 s "123456"
root@tiogapass:~# hexdump /sys/bus/i2c/drivers/at24/6-0054/eeprom
0000000 0001 0100 000d f100 0c01 3600 d0e6 58c6
0000010 5858 5858 d258 4d42 2043 7453 726f 6761
0000020 2065 6f4d 7564 656c 58cd 5858 5858 5858
0000030 5858 5858 5858 58ce 5858 5858 5858 5858
0000040 5858 5858 c358 2e31 c930 5858 5858 5858
0000050 5858 d258 5858 5858 5858 5858 5858 5858
0000060 5858 5858 5858 39c1 0c01 c600 5858 5858
0000070 5858 54d2 6f69 6167 5020 7361 2073 6953
0000080 676e 656c ce32 5858 5858 5858 5858 5858
0000090 5858 5858 58c4 5858 cd32 5858 5858 5858
00000a0 5858 5858 5858 c758 5858 5858 5858 c358
00000b0 2e31 c630 3231 3433 3635 43c8 6e6f 6966
00000c0 2067 c141 0000 4f00 0000 0000 0000 0000
00000d0 0000 0000 0000 0000 0000 0000 0000 0000
*
0002000
Change-Id: Iff11d64a291e6bdb653b6c524ca90e2e16003ec3
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
diff --git a/meson.options b/meson.options
index bd962e4..d53e7d6 100644
--- a/meson.options
+++ b/meson.options
@@ -5,8 +5,15 @@
description: 'Build fru-device VPD parser.',
)
option(
+ 'fru-device-update-property',
+ type: 'combo',
+ choices: ['asset_only', 'all'],
+ value: 'all',
+ description: 'Enable updating FRU properties via D-BUS. Choose "asset_only" to update only asset properties, or "all" to update all properties.',
+)
+option(
'fru-device-resizefru',
- value: false,
+ value: true,
type: 'boolean',
description: 'Allow FruDevice to resize FRU areas.',
)