<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openpower-pnor-code-mgmt/generate-tar, branch master</title>
<subtitle>OpenPOWER PNOR code management utility sources</subtitle>
<id>https://git.raptorcs.com/git/openpower-pnor-code-mgmt/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/'/>
<updated>2020-01-21T02:37:25+00:00</updated>
<entry>
<title>generate-tar: Add machine name</title>
<updated>2020-01-21T02:37:25+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-12-31T06:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=647d6134d448178e6b32892322596a5cc3d78b2d'/>
<id>urn:sha1:647d6134d448178e6b32892322596a5cc3d78b2d</id>
<content type='text'>
The openbmc image manager expects "MachineName" in MANIFEST that matches
the BMC's OPENBMC_TARGET_MACHINE in /etc/os-release.
* If there is no MachineName in MANIFEST, it logs a warning for now;
* If they do not match, an error is reported and the version is deleted.

Add -m, --machine argument for generate-tar to make it support the
"MachineName".

Tested: Verify that when a correct machine name is given, the tarball is
        processed by image manager correctly;
        And if an invalid machine name is given, the tarball uploaded
        will get "Machine name doesn't match" error and is deleted.

Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
Change-Id: I8fbb5060cb1be348c39e0688fe7306426cc4ed77
</content>
</entry>
<entry>
<title>generate-tar: Add --interactive=never for rm</title>
<updated>2020-01-20T03:06:08+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2020-01-14T03:30:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=00d8ade53c7fcea79ec6a71b74d431f2a4a6bf4b'/>
<id>urn:sha1:00d8ade53c7fcea79ec6a71b74d431f2a4a6bf4b</id>
<content type='text'>
On generating Witherspoon PNOR tarball, rm is asking for confirmation on
removing the files in the temp dir, because the partitions are
read-only now.

Add --interactive=never so that it does not ask for interaction.

Tested: Run the script to generate Witherspoon PNOR and verify it does
        not ask for interfaction to remove the files in temp dir.

Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
Change-Id: I89e94e47e02fab53eaca952a70dc672407b75cc7
</content>
</entry>
<entry>
<title>generate-tar: Set permissions of partition files to read only</title>
<updated>2019-10-15T15:10:14+00:00</updated>
<author>
<name>Adriana Kobylak</name>
<email>anoo@us.ibm.com</email>
</author>
<published>2019-10-09T18:56:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=85f25407598494d8f91890df5152501680a067dd'/>
<id>urn:sha1:85f25407598494d8f91890df5152501680a067dd</id>
<content type='text'>
Set file permissions to 440 since the PNOR partition files are
intended to be read-only and managed by the mbox application, so the
permissions should be set accordingly for cases where the BMC root
filesystem is not read-only.

Tested:
Before:
-rw-r--r--    1 root     root       1179648 Oct  9 18:43 HBD

After:
-r--r-----    1 root     root       1179648 Oct  9 15:33 HBD

Change-Id: I9eaf773fc09a12c4c0ed02302a41eb959719013f
Signed-off-by: Adriana Kobylak &lt;anoo@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>generate-tar: Call mksquashfs with -all-root option</title>
<updated>2019-10-09T18:54:50+00:00</updated>
<author>
<name>Adriana Kobylak</name>
<email>anoo@us.ibm.com</email>
</author>
<published>2019-09-11T15:31:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=ddf2b748bfd6eace6e1ab6d06bf6d006027b2c90'/>
<id>urn:sha1:ddf2b748bfd6eace6e1ab6d06bf6d006027b2c90</id>
<content type='text'>
The mksquashfs command preserves the owner of the files it squashes,
which is the login name of the user that runs generate-tar since the
partiton files are extracted into a local directory by pflash.

Bitbake sets the owner for the filesystem files to root as default,
so makes sense that the PNOR partition files are also owned by root
instead of a user name that doesn't exist on the BMC.

Tested:
Before:
root@witherspoon:~# ls -l /media/pnor-ro-652c7b59/
-rw-rw-r--    1 253760   401855       32768 Aug 15 14:39 ATTR_PERM

After:
root@witherspoon:~# ls -l /media/pnor-ro-944751fd/
-rw-rw-r--    1 root     root         32768 Sep 11 15:07 ATTR_PERM
-rw-rw-r--    1 root     root         32768 Sep 11 15:07 ATTR_TMP

Change-Id: Ic2cbed13e0da687e51a5c15041f54fef93c07be9
Signed-off-by: Adriana Kobylak &lt;anoo@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>Use wc to calculate file sizes</title>
<updated>2019-08-19T17:28:13+00:00</updated>
<author>
<name>Oliver O'Halloran</name>
<email>oohall@gmail.com</email>
</author>
<published>2019-07-30T07:46:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=d23b5b74cfadea0618e5984e8d3565d2696d26b8'/>
<id>urn:sha1:d23b5b74cfadea0618e5984e8d3565d2696d26b8</id>
<content type='text'>
Milton pointed out that for the du command the -b and -k options aren't
really compatible. From the man page:

       -b, --bytes
              equivalent to '--apparent-size --block-size=1'

       -k     like --block-size=1K

As a result 'du -bk' will act as if the following args were
used:
	--apparent-size --block-size=1K

However, it's probably not safe to assume this. Fix this by replacing the
use of du with "wc -c". POSIX requires that wc -c prints size of each
input file in bytes so it should be safe (and portable).

Fixes: adf91f58dac9 ("Fix generate-tar on ppc64 hosts")
Signed-off-by: Oliver O'Halloran &lt;oohall@gmail.com&gt;
Change-Id: I1baf96b4c5304a27ddedf3384cf23d2c346134d8
</content>
</entry>
<entry>
<title>Fix generate-tar on ppc64 hosts</title>
<updated>2019-07-17T05:59:24+00:00</updated>
<author>
<name>Oliver O'Halloran</name>
<email>oohall@gmail.com</email>
</author>
<published>2019-07-16T08:33:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=adf91f58dac9f177a061d9b206d853a9db3db70a'/>
<id>urn:sha1:adf91f58dac9f177a061d9b206d853a9db3db70a</id>
<content type='text'>
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 &lt;oohall@gmail.com&gt;
Change-Id: I03e47d81d837f73159a523bacdd481d6e294b84b
</content>
</entry>
<entry>
<title>generate-tar: Extract PNOR contents to a subdir</title>
<updated>2019-06-11T16:22:55+00:00</updated>
<author>
<name>Adriana Kobylak</name>
<email>anoo@us.ibm.com</email>
</author>
<published>2019-06-05T19:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=851bc064b23c0fcb9c19be30948d1e4f5ec0253a'/>
<id>urn:sha1:851bc064b23c0fcb9c19be30948d1e4f5ec0253a</id>
<content type='text'>
Extract the PNOR contents to a subdir to support creating an ext4 image
that takes a directory as a parameter instead of individual files.

Tested: Generated a squashfs image and verified it contained the PNOR
        partitions.

Change-Id: I4aef816b55833b5e4df8e93c29d9484c2c9b3d3d
Signed-off-by: Adriana Kobylak &lt;anoo@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>generate-tar: Always remove scratch dir</title>
<updated>2019-06-10T17:11:49+00:00</updated>
<author>
<name>Adriana Kobylak</name>
<email>anoo@us.ibm.com</email>
</author>
<published>2019-06-05T19:10:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=8004ff59269e33e19af20a69db08d0f224fb403e'/>
<id>urn:sha1:8004ff59269e33e19af20a69db08d0f224fb403e</id>
<content type='text'>
Add a trap to generate-tar to remove the scratch dir on exit,
otherwise the scratch dir was not being removed if the script
failed before it reached the end where the rm command was.

Tested: Verified the scratch dir was removed on failure.

Change-Id: I177201976d19d5b7a44a909090739f7e74f75320
Signed-off-by: Adriana Kobylak &lt;anoo@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>Static layout: Generate tar.gz for static layout pnor</title>
<updated>2019-03-13T03:01:49+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-02-21T05:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/openpower-pnor-code-mgmt/commit/?id=dcb3fd799cd353925aaa269413b68b672f99315c'/>
<id>urn:sha1:dcb3fd799cd353925aaa269413b68b672f99315c</id>
<content type='text'>
Add --image_type option to specify the image type of generated PNOR in
tarball.
Support "squashfs" and "static" image types.
Rename `generate-squashfs` to `generate-tar` to reflect that this util
is to generate a tarball instead of squashfs.

Example of usage:

    # Generate unsigned tarball for Witherspoon
    ./generate-tar -i squashfs witherspoon.pnor

    # Generate signed tarball with default key for Witherspoon
    ./generate-tar -i squashfs -s -- witherspoon.pnor

    # Generate unsigned tarball for Romulus
    ./generate-tar -i static romulus.pnor

    # Generate signed tarball with default key for Romulus
    ./generate-tar -i static -s -- romulus.pnor

Tested: Verify the generated tarball contains correct files.

Change-Id: Ibb66605663b28888bd643baf92d6e4bdbf60c206
Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
</content>
</entry>
</feed>
