base-files: add filter to ignore mmc RPMB partitions

The Replay Protected Memory Block (RPMB) is an special storage
partition that cannot be accessed via standard block layer.
When a user space tool like blkid, tries to read it the kernel
suffers buffer I/O errors and timeouts.

This commit modifies the post installation script to filter the RPMB
partitions from the mmc block devices, to avoid multiple kernel
errors during the script execution.

https://jira.digi.com/browse/DEL-6609

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2019-05-16 16:16:39 +02:00
parent 1fe9ca04c2
commit 8c0aaf79b6
1 changed files with 2 additions and 2 deletions

View File

@ -25,9 +25,9 @@ pkg_postinst_ontarget_${PN}() {
DM_BLOCK_DEVICE="/dev/dm-"
EMMC_BLOCK_DEVICE="$(get_emmc_block_device)"
if [ -x "${RESIZE2FS}" -a -n "${EMMC_BLOCK_DEVICE}" ]; then
PARTITIONS="$(blkid | sed -ne "{s,\(^${EMMC_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)"
PARTITIONS="$(blkid ${EMMC_BLOCK_DEVICE}p* | sed -ne "{s,\(^${EMMC_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)"
# Add possible device mapper devices
PARTITIONS="${PARTITIONS} $(blkid | sed -ne "{s,\(^${DM_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)"
PARTITIONS="${PARTITIONS} $(blkid ${DM_BLOCK_DEVICE}* | sed -ne "{s,\(^${DM_BLOCK_DEVICE}[^:]\+\):.*TYPE=\"ext4\".*,\1,g;T;p}" | sort -u)"
for i in ${PARTITIONS}; do
if ! ${RESIZE2FS} ${i} 2>/dev/null; then
echo "ERROR: resize2fs ${i}"