* [PATCH] mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.
@ 2013-03-08 13:01 Koen Kooi
2013-03-08 17:09 ` Darren Hart
0 siblings, 1 reply; 3+ messages in thread
From: Koen Kooi @ 2013-03-08 13:01 UTC (permalink / raw)
To: openembedded-core; +Cc: Koen Kooi
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@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@dominion.thruhere.net>
---
scripts/contrib/mkefidisk.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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))
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.
2013-03-08 13:01 [PATCH] mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it Koen Kooi
@ 2013-03-08 17:09 ` Darren Hart
2013-03-08 17:28 ` Koen Kooi
0 siblings, 1 reply; 3+ messages in thread
From: Darren Hart @ 2013-03-08 17:09 UTC (permalink / raw)
To: Koen Kooi; +Cc: openembedded-core
On 03/08/2013 05:01 AM, Koen Kooi wrote:
> The script greps for 'Disk', which doesn't work when your crazy Dutch distro has parted call it 'Schijf', so force LANG=C.
Whoopsie :-)
>
> The second problem is that 'Disk' might be a substring in the Model entry:
>
> [root@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@dominion.thruhere.net>
> ---
> scripts/contrib/mkefidisk.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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//")
Looks like something like "^Disk /" might be better still?
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Technical Lead - Linux Kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it.
2013-03-08 17:09 ` Darren Hart
@ 2013-03-08 17:28 ` Koen Kooi
0 siblings, 0 replies; 3+ messages in thread
From: Koen Kooi @ 2013-03-08 17:28 UTC (permalink / raw)
To: Darren Hart; +Cc: openembedded-core@lists.openembedded.org
Op 8 mrt. 2013 om 18:09 heeft Darren Hart <dvhart@linux.intel.com> het volgende geschreven:
>
>
> On 03/08/2013 05:01 AM, Koen Kooi wrote:
>> The script greps for 'Disk', which doesn't work when your crazy Dutch distro has parted call it 'Schijf', so force LANG=C.
>
> Whoopsie :-)
>
>>
>> The second problem is that 'Disk' might be a substring in the Model entry:
>>
>> [root@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@dominion.thruhere.net>
>> ---
>> scripts/contrib/mkefidisk.sh | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> 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//")
>
> Looks like something like "^Disk /" might be better still?
Not sure, it still fragile either way
>
>
>
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Technical Lead - Linux Kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-08 17:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-08 13:01 [PATCH] mkefidisk.sh: Cope with translations and modelnames with 'Disk' in it Koen Kooi
2013-03-08 17:09 ` Darren Hart
2013-03-08 17:28 ` Koen Kooi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.