[oe-commits] Koen Kooi : mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.
git at git.openembedded.org
git at git.openembedded.org
Sun Mar 10 04:36:04 UTC 2013
Module: openembedded-core.git
Branch: master
Commit: 2e404930f6fc7d818d2f429793e84bce77163afd
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2e404930f6fc7d818d2f429793e84bce77163afd
Author: Koen Kooi <koen at dominion.thruhere.net>
Date: Fri Mar 8 14:01:45 2013 +0100
mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.
The script greps for 'Disk', which doesn't work when your crazy Dutch distro has parted call it 'Schijf', so force LANG=C.
The second problem is that 'Disk' might be a substring in the Model entry:
[root at Angstrom-F16-vm-rpm contrib] # parted /dev/sdc unit mb print
Model: SanDisk SDDR-113 (scsi)
Disk /dev/sdc: 3905MB
Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
scripts/contrib/mkefidisk.sh | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 38e2217..44ac130 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -18,6 +18,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+LANG=C
+
#
# Defaults
#
@@ -123,7 +125,7 @@ fi
#
# Partition $DEVICE
#
-DEVICE_SIZE=$(parted $DEVICE unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+DEVICE_SIZE=$(parted $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//")
SWAP_SIZE=$((DEVICE_SIZE*SWAP_RATIO/100))
ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE-SWAP_SIZE))
ROOTFS_START=$((BOOT_SIZE))
More information about the Openembedded-commits
mailing list