From 45d5a1735d5ea5d99e68ea398c20ee0ea66ee72d Mon Sep 17 00:00:00 2001 From: amrithvenkat <110397957+amrithvenkat@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:47:00 +0200 Subject: [PATCH] SW-4540 use correct command to check sd card size (#135) * grep the correct disk on the sd card --- src/modules/beamos/filesystem/migration/usr/bin/migration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/beamos/filesystem/migration/usr/bin/migration.sh b/src/modules/beamos/filesystem/migration/usr/bin/migration.sh index dd5c173..d5601bc 100755 --- a/src/modules/beamos/filesystem/migration/usr/bin/migration.sh +++ b/src/modules/beamos/filesystem/migration/usr/bin/migration.sh @@ -47,7 +47,7 @@ do_precondition_checks () { # Check the size of SD-Card echo "$(timestamp) $0: Checking the size of SD-Card." - local SD_CARD_SIZE=$(lsblk -b -o SIZE /dev/mmcblk0 | tail -n 1) + local SD_CARD_SIZE=$(lsblk -b -o SIZE,TYPE /dev/mmcblk0 | grep "disk" | awk '{print $1}') SD_CARD_SIZE_GIGABYTES=$((SD_CARD_SIZE / 1024 / 1024 / 1024)) echo "$(timestamp) $0: SD-Card size - ${SD_CARD_SIZE_GIGABYTES}GB found" if [ "$SD_CARD_SIZE" -gt $((MIN_SD_SIZE_IN_GB * 1024 * 1024 * 1024)) ]; then