Since a6d31ca, nvram --partitions with large enough argument passed to --nvram-size prints a bogus all-zeros entry at the end:
[root@ltc-zz14-lp1 ~]# ~test/powerpc-utils/src/nvram --partitions
# Sig Chk Len Name
0 50 ef 0024 of-config
1 70 99 009d common
2 a0 b5 0083 ibm,rtas-log
3 a0 4f 00fb lnx,oops-log
4 7f 9b 0181 wwwwwwwwwwww
[root@ltc-zz14-lp1 ~]# ~test/powerpc-utils/src/nvram --partitions --nvram-size $((16 * 1024))
/home/test/powerpc-utils/src/nvram: WARNING: expected 16384 bytes, but only read 15360!
# Sig Chk Len Name
0 50 ef 0024 of-config
1 70 99 009d common
2 a0 b5 0083 ibm,rtas-log
3 a0 4f 00fb lnx,oops-log
4 7f 9b 0181 wwwwwwwwwwww
5 00 00 0000 <<<<<<<<<<
When the user forces there to be excess space in the nvram buffer, nvram_parse_partitions() constructs a bogus entry from the (fortunately zeroed) remainder.
I propose either:
- Ignoring
--nvram-size with a warning, removing all supporting code. I don't know of a use for it, at least not on LPARs. Or:
- Clamping the nvram buffer allocation to the lesser of the user-supplied value and the size reported by the device.
Since a6d31ca,
nvram --partitionswith large enough argument passed to--nvram-sizeprints a bogus all-zeros entry at the end:When the user forces there to be excess space in the nvram buffer,
nvram_parse_partitions()constructs a bogus entry from the (fortunately zeroed) remainder.I propose either:
--nvram-sizewith a warning, removing all supporting code. I don't know of a use for it, at least not on LPARs. Or: