This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Locale-dependent sdcard script

The mkmmc-android.sh from http://downloads.ti.com/sitara_android/esd/TI_Android_DevKit/TI_Android_JB_4_2_2_DevKit_4_1_1/exports/TI_Android_JB_4.2.2_DevKit_4.1.1_am335xevm_sk.tar.gz, and mk3PartSDCard.sh from http://processors.wiki.ti.com/index.php/How_to_Make_3_Partition_SD_Card are both locale dependent. More specifically, the line

SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`

relies on an English locale (grep'ing for "Disk" in the output of fdsik) to retrieve the disk size. For the first script, the output looks like

DISK SIZE - bytes
(standard_in) 1: syntax error
CYLINDERS -
expr: erreur de syntaxe

rather than

DISK SIZE - 3904897024 bytes
CYLINDERS - 474

(and the sdcard is not partitioned)

A simple fix would be to start these scripts with

#!/bin/bash

export LANG=C
export LC_ALL=C

to ensure the output of fdisk is in English.

Regards,

Hubert