History log of /openbmc/hiomapd/vpnor/partition.cpp (Results 1 – 8 of 8)
Revision Date Author Comments
# 150be912 16-Jun-2022 Patrick Williams <patrick@stwcx.xyz>

switch experimental::fs to std::fs

std::filesystem was added to C++17 and is well supported now. Remove
the older std::experimental::filesystem usage.

Signed-off-by: Patrick Williams <patrick@stwc

switch experimental::fs to std::fs

std::filesystem was added to C++17 and is well supported now. Remove
the older std::experimental::filesystem usage.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6d1ef0f3ac02954ddbffc332393fa11930dffad7

show more ...


# 5ff50e3c 30-Nov-2020 Adriana Kobylak <anoo@us.ibm.com>

vpnor: Use the partition in rw if it exists

Look for the partition file in the rw directory first as the default.
This allows mboxd to support a single writable directory for the case
where the part

vpnor: Use the partition in rw if it exists

Look for the partition file in the rw directory first as the default.
This allows mboxd to support a single writable directory for the case
where the partition files (including the read-only ones) need to be
modified at runtime by the BMC, for example to support two different
configurations of a system using the same firmware image.

Tested: Enabled debug traces to check where the read and write requests
were being fulfilled from and copied some partition files to
the patch directory:
On witherspoon, verified the reads/writes were done on the patch
directory for the files that existed there, and reads were
fulfilled from the ro dir, and writes from the rw dir.
On rainier where all partitions exist in the rw dir, verified
the reads/writes were done on the patch dir for the files that
existed there, and reads/writes were done to the rw dir. For the
HB_VOLATILE partition that gets erased, the ro dir was then used
to read after it was deleted from the rw dir.

Change-Id: I3fe1875bd6a47aa82e9a1f23bc136a5a4f499c7f
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# 02821c6a 31-Jan-2020 Andrew Jeffery <andrew@aj.id.au>

vpnor: partition: Fix file descriptor leaks

In the face of errors we were leaking the partition file descriptor when
throwing exceptions.

Change-Id: I257a491460062384928d8dda6bbf178da662f3b3
Signed

vpnor: partition: Fix file descriptor leaks

In the face of errors we were leaking the partition file descriptor when
throwing exceptions.

Change-Id: I257a491460062384928d8dda6bbf178da662f3b3
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 5b970448 31-Jan-2020 Andrew Jeffery <andrew@aj.id.au>

vpnor: partition: Only attempt read() for in-bounds accesses

Attempting to read after an lseek() past the end of the file leads to an
error and we bail out. The error propagates up the callstack and

vpnor: partition: Only attempt read() for in-bounds accesses

Attempting to read after an lseek() past the end of the file leads to an
error and we bail out. The error propagates up the callstack and causes
errors on the host side, where really we should just be returning an
erased window.

Change-Id: I06cdda4f7f6aa4d66e133de95cd642e04418bbe0
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# e2744c0e 27-Jan-2020 Andrew Jeffery <andrew@aj.id.au>

vpnor: Avoid mmap() due to lack of support on some filesystems

JFFS2 does not support writable mappings. Switch to read()/write() and
add all the failure handling to ensure we get the required seman

vpnor: Avoid mmap() due to lack of support on some filesystems

JFFS2 does not support writable mappings. Switch to read()/write() and
add all the failure handling to ensure we get the required semantics.

Change-Id: I5ec547bf7a01a389cf8f1403f748026fe6bb21fa
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 0acc6699 09-Oct-2019 Adriana Kobylak <anoo@us.ibm.com>

vpnor: partition: Add write permissions to writable files

The code preserves the file permissions when the partition files are
copied to the writeable area. Currently the file permissions are 664,
b

vpnor: partition: Add write permissions to writable files

The code preserves the file permissions when the partition files are
copied to the writeable area. Currently the file permissions are 664,
but if the squashfs was built with file permissions set to 444 to
make it explicit that the pnor partition files were read-only, the
files in the writable area would also have read only permissions.

Therefore, explicitly add write permissions to the partition files
that are copied to the writable area.

Tested:

- With current permissions (there's no change):

root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/ro/HBD
-rw-rw-r-- 1 253760 401855 1179648 Sep 23 16:30 HBD
root@witherspoon-YL30UF74T02M:~#ls -l /var/lib/phosphor-software-manager/pnor/rw/HBD
-rw-rw-r-- 1 root root 1179648 Oct 9 18:38 HBD

- With read-only permissions:

root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/ro/HBD
-r--r--r-- 1 root root 1179648 Oct 9 15:33 /var/lib/phosphor-software-manager/pnor/ro/HBD
root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/rw/HBD
-rw-r--r-- 1 root root 1179648 Oct 9 18:43 /var/lib/phosphor-software-manager/pnor/rw/HBD

Change-Id: Ibc3f47bd3a4f645d99155d19624c7271df4d0470
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# de08ca2d 17-Mar-2019 Andrew Jeffery <andrew@aj.id.au>

vpnor: Rename pnor_partition_table sources to table

Change-Id: I95c5129aa81a7b4a4d88ce2f7edf6a10a3c94b98
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>


# fb01e14e 17-Mar-2019 Andrew Jeffery <andrew@aj.id.au>

vpnor: Rename pnor_partition sources to partition

Change-Id: I7fb3ba5071c94595449c5469625564233cc8d752
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>