[FE training-materials-updates] yocto: lab-data: fix sdcard format script

Gregory Clement gregory.clement at free-electrons.com
Fri Sep 2 17:25:57 CEST 2016


Repository : git://git.free-electrons.com/training-materials.git
On branch  : dev_mylene/yocto_update/krogoth
Link       : http://git.free-electrons.com/training-materials/commit/?id=8b9d383662b517efbef2d77d6d4bb5af64eed057

>---------------------------------------------------------------

commit 8b9d383662b517efbef2d77d6d4bb5af64eed057
Author: Antoine Tenart <antoine.tenart at free-electrons.com>
Date:   Thu Jun 16 10:59:21 2016 +0200

    yocto: lab-data: fix sdcard format script
    
    Signed-off-by: Antoine Tenart <antoine.tenart at free-electrons.com>


>---------------------------------------------------------------

8b9d383662b517efbef2d77d6d4bb5af64eed057
 lab-data/yocto/script/format_sdcard.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lab-data/yocto/script/format_sdcard.sh b/lab-data/yocto/script/format_sdcard.sh
index 9f97156..4f0d298 100755
--- a/lab-data/yocto/script/format_sdcard.sh
+++ b/lab-data/yocto/script/format_sdcard.sh
@@ -10,6 +10,8 @@ if [ $# -ne 1 ]; then
   exit
 fi
 
+[[ $1 =~ mmcblk[0-9]+ ]] && delim='p'
+
 exec 1>&-
 exec 2>&-
 
@@ -19,7 +21,7 @@ sfdisk --in-order --L --unit M $1 <<EOF
 ,,,-
 EOF
 
-mkfs.vfat -F 16 ${1}p1 -n boot
-mkfs.ext4 ${1}p2 -L rootfs
+mkfs.vfat -F 16 ${1}${delim}1 -n boot
+mkfs.ext4 ${1}${delim}2 -L rootfs
 
 exit 0




More information about the training-materials-updates mailing list