base-files: fix checks done to execute resize2fs postinst function in kernel 5.4

MMC core block has changed in kernel 5.4 so Replay Protected Memory Block (RPMB)
and boot partitions are not listed under /proc/partitions anymore.

get_emmc_block_device() function in pkg_postinst_ontarget() method was looking
for these entries to identify the MMC partition where to execute resize2fs.

This function has been modified to do the checks inside /dev/mmcblk* where RPMB
and boot entries are still listed.

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

Signed-off-by: Hector Bujanda <hector.bujanda@digi.com>
This commit is contained in:
Hector Bujanda 2020-05-09 16:16:45 +02:00
parent 716d55fadf
commit 2efc2c3e42
1 changed files with 9 additions and 7 deletions

View File

@ -12,13 +12,15 @@ do_install_append() {
pkg_postinst_ontarget_${PN}() {
get_emmc_block_device() {
emmc_number="$(sed -ne 's,.*mmcblk\(.\)boot0.*,\1,g;T;p' /proc/partitions)"
if [ -b "/dev/mmcblk${emmc_number}" ] &&
[ -b "/dev/mmcblk${emmc_number}boot0" ] &&
[ -b "/dev/mmcblk${emmc_number}boot1" ] &&
[ -b "/dev/mmcblk${emmc_number}rpmb" ]; then
echo "/dev/mmcblk${emmc_number}"
fi
for emmc_number in $(seq 0 9); do
if [ -b "/dev/mmcblk${emmc_number}" ] &&
[ -b "/dev/mmcblk${emmc_number}boot0" ] &&
[ -b "/dev/mmcblk${emmc_number}boot1" ] &&
[ -c "/dev/mmcblk${emmc_number}rpmb" ]; then
echo "/dev/mmcblk${emmc_number}"
break
fi
done
}
RESIZE2FS="$(which resize2fs)"