diff --git a/sources/meta-yoe/recipes-support/updater/files/updater.installer b/sources/meta-yoe/recipes-support/updater/files/updater.installer index 684b71b1c..9c09b4146 100644 --- a/sources/meta-yoe/recipes-support/updater/files/updater.installer +++ b/sources/meta-yoe/recipes-support/updater/files/updater.installer @@ -97,6 +97,24 @@ initialize() { mkdir -p $DATA_MOUNT_POINT } +resize_sd() { + echo "Resizing data partition started ..." || return 1 + if [ -z "$1" ]; then + DEVICE=$SD_DEVICE + else + DEVICE=$1 + fi + sync + umount ${DEVICE}p3 + PART_SIZE=$(cat "/sys/block/${DEVICE}p3/size") + # only continue if partition size is 1MB + if [ $PART_SIZE -gt 2048 ]; then + return 0 + fi + echo "- +" | sfdisk -N 3 ${DEVICE} + resize2fs ${DEVICE}p3 +} + partition_sd() { echo "Partitioning started ..." || return 1 if [ -z "$1" ]; then @@ -178,6 +196,10 @@ partition_emmc() { partition_sd $EMMC_DEVICE } +resize_emmc() { + resize_sd $EMMC_DEVICE +} + format_emmc_boot() { mkfs.${BOOT_FSTYPE} -I -n "BOOT" $EMMC_BOOT_DEV || return 1 } @@ -484,6 +506,10 @@ boot() { umount_usb umount_sd umount_data + if ! resize_${STORAGE}; then + msg_splash "Resizing ${STORAGE} failed, bad media" + sleep 9999d + fi if [ -e $EMMC_BOOT_DEV ]; then msg_splash "Booting from EMMC ..." diff --git a/sources/meta-yoe/recipes-support/updater/updater_1.0.bb b/sources/meta-yoe/recipes-support/updater/updater_1.0.bb index 8ce91e349..b73df802e 100644 --- a/sources/meta-yoe/recipes-support/updater/updater_1.0.bb +++ b/sources/meta-yoe/recipes-support/updater/updater_1.0.bb @@ -19,3 +19,6 @@ do_install() { } FILES:${PN} += "/init /platform /dev ${datadir}" + +RDEPENDS:${PN} += "e2fsprogs-resize2fs util-linux-sfdisk" +