oem: ibm: Use `truncate(1)` to create NVRAM related files

Use of `dd(1)` results in back-to-back `read(2)` and `write(2)` syscalls;
the performance of `dd(1)` is O(n) with respect to the file size. Poor
choice of the `bs=` parameter to `dd(1)` can significantly amplify the
amount of syscalls required to achieve the task.

By contrast, `truncate(1)` generally invokes a single syscall, either
`truncate(2)` or `ftruncate(2)`. As a consequence, `truncate(1)` is O(1)
with respect to file size.

Switch to `truncate(1)` to improve runtime efficiency of the scripts.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I69dd925f36e733fc2a1ee71cb8354ee04ee8871b
diff --git a/oem/ibm/service_files/scripts/create-NVRAM-file b/oem/ibm/service_files/scripts/create-NVRAM-file
index 6e35c46..f55203d 100755
--- a/oem/ibm/service_files/scripts/create-NVRAM-file
+++ b/oem/ibm/service_files/scripts/create-NVRAM-file
@@ -3,5 +3,5 @@
 if [ -f /var/lib/pldm/PHYP-NVRAM ]; then
     mv /var/lib/pldm/PHYP-NVRAM /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM;
 else
-    dd if=/dev/zero of=/var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM bs=1024 count=145408;
+    truncate -s $((1024 * 145408)) /var/lib/phosphor-software-manager/hostfw/nvram/PHYP-NVRAM
 fi