diff options
| author | Oliver O'Halloran <oohall@gmail.com> | 2019-07-16 18:33:15 +1000 |
|---|---|---|
| committer | Oliver O'Halloran <oohall@gmail.com> | 2019-07-17 15:59:24 +1000 |
| commit | adf91f58dac9f177a061d9b206d853a9db3db70a (patch) | |
| tree | 083d4f4efd772a7d8be4070afdec36a9f3f12dca | |
| parent | 10e915abf1bd31d8b1dae8d01c731ac8dd76c7c0 (diff) | |
| download | openpower-pnor-code-mgmt-adf91f58dac9f177a061d9b206d853a9db3db70a.tar.gz openpower-pnor-code-mgmt-adf91f58dac9f177a061d9b206d853a9db3db70a.zip | |
Fix generate-tar on ppc64 hosts
Currently the tarball MANIFEST is garbaled when building the tarball on
a ppc64 host. This is because the check to determine if the secureboot
header needs to be removed is sensitive to the system page size. By
default the scratch directory used when running generate-tar is placed
in /tmp. Typically this is a tmpfs file system which has a minimum block
of one system page, which is 64KB on ppc64.
We use the du utility to calculate the size of the VERSION partition and
when a file is smaller than the file systems minimum allocation block it
gives an unexpected result:
$ du -k /tmp/tmp.BhDKg0pQGF/VERSION
64 /tmp/tmp.BhDKg0pQGF/VERSION
$ du -bk /tmp/tmp.BhDKg0pQGF/VERSION
8 /tmp/tmp.BhDKg0pQGF/VERSION
We can fix this by passing the '-b' parameter to du to make it ignore
the filesystem block size.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Change-Id: I03e47d81d837f73159a523bacdd481d6e294b84b
| -rwxr-xr-x | generate-tar | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generate-tar b/generate-tar index 536b11cad..87046da50 100755 --- a/generate-tar +++ b/generate-tar @@ -152,7 +152,7 @@ mkdir ${pnor_dir} pflash --partition=part --read=${pnor_dir}/part -F ${pnorfile} pflash --partition=VERSION --read=${pnor_dir}/VERSION -F ${pnorfile} -version_size=$(du -k ${pnor_dir}/VERSION | head -1 | cut -f 1) +version_size=$(du -bk ${pnor_dir}/VERSION | head -1 | cut -f 1) magic_number=$(xxd -p -l 4 ${pnor_dir}/VERSION) # Check if VERSION is signed. A signed version partition will have an extra # 4K header starting with the magic number 0x17082011, see: |

