* [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
@ 2013-04-25 1:00 seth bollinger
2013-04-25 12:38 ` Paul Barker
0 siblings, 1 reply; 7+ messages in thread
From: seth bollinger @ 2013-04-25 1:00 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]
When the shell tests for rootfs type I was seeing "[[: not found". I
use echo and egrep to test for the xz rootfs type to work around this
error.
Signed-off-by: Seth Bollinger <seth.boll@gmail.com>
---
classes/sdcard_image-rpi.bbclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/classes/sdcard_image-rpi.bbclass
b/classes/sdcard_image-rpi.bbclass
index 421f561..7fe7c35 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -99,7 +99,7 @@ IMAGE_CMD_rpi-sdimg () {
# Burn Partitions
dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1
bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
# If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
- if [[ "$SDIMG_ROOTFS_TYPE" == *.xz ]]
+ if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
then
xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1
bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \*
1024) && sync && sync
else
--
1.7.2.5
[-- Attachment #2: 0001-sdcard_image-rpi.bbclass-Fix-error-in-conditional-te.patch --]
[-- Type: text/plain, Size: 1256 bytes --]
From 26b0b8b79376eea69aeaf91daf43bc6807a09dd0 Mon Sep 17 00:00:00 2001
From: Seth Bollinger <seth.boll@gmail.com>
Date: Mon, 22 Apr 2013 07:23:45 -0500
Subject: [PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
When the shell tests for rootfs type I was seeing "[[: not found". I
use echo and egrep to test for the xz rootfs type to work around this
error.
Signed-off-by: Seth Bollinger <seth.boll@gmail.com>
---
classes/sdcard_image-rpi.bbclass | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 421f561..7fe7c35 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -99,7 +99,7 @@ IMAGE_CMD_rpi-sdimg () {
# Burn Partitions
dd if=${WORKDIR}/boot.img of=${SDIMG} conv=notrunc seek=1 bs=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
# If SDIMG_ROOTFS_TYPE is a .xz file use xzcat
- if [[ "$SDIMG_ROOTFS_TYPE" == *.xz ]]
+ if echo "${SDIMG_ROOTFS_TYPE}" | egrep -q "*\.xz"
then
xzcat ${SDIMG_ROOTFS} | dd of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
else
--
1.7.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
2013-04-25 1:00 [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test seth bollinger
@ 2013-04-25 12:38 ` Paul Barker
2013-04-25 12:42 ` Samuel Stirtzel
[not found] ` <CA+JN8xMvcoaLKufSeCLO21ozH542OG-uZSn8fDS0OVMGXkUNbw@mail.gmail.com>
0 siblings, 2 replies; 7+ messages in thread
From: Paul Barker @ 2013-04-25 12:38 UTC (permalink / raw)
To: seth bollinger; +Cc: Yocto discussion list
On 25 April 2013 02:00, seth bollinger <seth.boll@gmail.com> wrote:
> When the shell tests for rootfs type I was seeing "[[: not found". I
> use echo and egrep to test for the xz rootfs type to work around this
> error.
>
'[[' should be a bash builtin. What host OS are you using for the build?
Also what's the exact error message? I'm wondering if this is somehow
being ran in a shell that isn't bash. With an unknown command 'abcd',
bash gives me "abcd: command not found" and dash gives me "dash: 1:
abcd: not found".
Using egrep for a test like this seems less readable to me.
--
Paul Barker
Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
2013-04-25 12:38 ` Paul Barker
@ 2013-04-25 12:42 ` Samuel Stirtzel
[not found] ` <CA+JN8xMvcoaLKufSeCLO21ozH542OG-uZSn8fDS0OVMGXkUNbw@mail.gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Samuel Stirtzel @ 2013-04-25 12:42 UTC (permalink / raw)
To: Paul Barker; +Cc: Yocto discussion list
2013/4/25 Paul Barker <paul@paulbarker.me.uk>:
> On 25 April 2013 02:00, seth bollinger <seth.boll@gmail.com> wrote:
>> When the shell tests for rootfs type I was seeing "[[: not found". I
>> use echo and egrep to test for the xz rootfs type to work around this
>> error.
>>
>
> '[[' should be a bash builtin. What host OS are you using for the build?
It sounds like Ubuntu / dash to me:
samuel@s-stirtzel-linux:~$ dash
$ [[
dash: 1: [[: not found
Or at least dash will produce this error too.
--
Regards
Samuel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
[not found] ` <CA+JN8xMvcoaLKufSeCLO21ozH542OG-uZSn8fDS0OVMGXkUNbw@mail.gmail.com>
@ 2013-04-25 12:59 ` Paul Barker
2013-05-01 19:10 ` Andrei Gherzan
0 siblings, 1 reply; 7+ messages in thread
From: Paul Barker @ 2013-04-25 12:59 UTC (permalink / raw)
To: Seth Bollinger; +Cc: Yocto discussion list
On 25 April 2013 13:51, Seth Bollinger <seth.boll@gmail.com> wrote:
> On Thu, Apr 25, 2013 at 7:38 AM, Paul Barker <paul@paulbarker.me.uk> wrote:
>>
>> '[[' should be a bash builtin. What host OS are you using for the build?
>
> I'm using debian. I'll check what the default shell is. You're right, it's
> probably dash.
>
Try 'sudo dpkg-reconfigure dash'.
> However, should this fail silently then? In this instance I only saw the
> error with debug enabled. Otherwise it silently tried to dd a compressed
> image to the sd card. Of course this didn't run. :)
>
I assume that 'if' tries to run the command, gets a non-zero return
value as the command doesn't run and just interprets this as the
command running but returning non-zero.
--
Paul Barker
Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
2013-04-25 12:59 ` Paul Barker
@ 2013-05-01 19:10 ` Andrei Gherzan
2013-05-02 11:33 ` Paul Barker
0 siblings, 1 reply; 7+ messages in thread
From: Andrei Gherzan @ 2013-05-01 19:10 UTC (permalink / raw)
To: Paul Barker; +Cc: Yocto discussion list
[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]
On Thu, Apr 25, 2013 at 2:59 PM, Paul Barker <paul@paulbarker.me.uk> wrote:
> On 25 April 2013 13:51, Seth Bollinger <seth.boll@gmail.com> wrote:
> > On Thu, Apr 25, 2013 at 7:38 AM, Paul Barker <paul@paulbarker.me.uk>
> wrote:
> >>
> >> '[[' should be a bash builtin. What host OS are you using for the build?
> >
> > I'm using debian. I'll check what the default shell is. You're right,
> it's
> > probably dash.
> >
>
> Try 'sudo dpkg-reconfigure dash'.
>
> > However, should this fail silently then? In this instance I only saw the
> > error with debug enabled. Otherwise it silently tried to dd a compressed
> > image to the sd card. Of course this didn't run. :)
> >
>
> I assume that 'if' tries to run the command, gets a non-zero return
> value as the command doesn't run and just interprets this as the
> command running but returning non-zero.
>
>
I think I asked Seth a while ago and he confirmed that bash was his shell. I
thought about dash as well. But as a matter of fact we should remove
bashisms and make things as usable as possible. So maybe his patch makes
sense after all.
--
*Andrei Gherzan*
m: +40.744.478.414 | f: +40.31.816.28.12
[-- Attachment #2: Type: text/html, Size: 2307 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
2013-05-01 19:10 ` Andrei Gherzan
@ 2013-05-02 11:33 ` Paul Barker
2013-05-03 9:30 ` Andrei Gherzan
0 siblings, 1 reply; 7+ messages in thread
From: Paul Barker @ 2013-05-02 11:33 UTC (permalink / raw)
To: Andrei Gherzan; +Cc: Yocto discussion list
On 1 May 2013 20:10, Andrei Gherzan <andrei@gherzan.ro> wrote:
> I think I asked Seth a while ago and he confirmed that bash was his shell. I
> thought about dash as well. But as a matter of fact we should remove
> bashisms and make things as usable as possible. So maybe his patch makes
> sense after all.
>
Based on Paul Eggleton's reply elsewhere:
On 2 May 2013 09:07, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> On Wednesday 01 May 2013 19:13:19 seth bollinger wrote:
>> 2. I couldn't find a wildcard string search in dash. Can anyone
>> suggest a more shell agnostic way to do this?
>
> AFAIK grep or awk is the only way.
I think this patch probably does make sense.
--
Paul Barker
Email: paul@paulbarker.me.uk
http://www.paulbarker.me.uk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test
2013-05-02 11:33 ` Paul Barker
@ 2013-05-03 9:30 ` Andrei Gherzan
0 siblings, 0 replies; 7+ messages in thread
From: Andrei Gherzan @ 2013-05-03 9:30 UTC (permalink / raw)
To: Paul Barker; +Cc: Yocto discussion list
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]
Merged to master.
Thanks a lot.
On Thu, May 2, 2013 at 1:33 PM, Paul Barker <paul@paulbarker.me.uk> wrote:
> On 1 May 2013 20:10, Andrei Gherzan <andrei@gherzan.ro> wrote:
> > I think I asked Seth a while ago and he confirmed that bash was his
> shell. I
> > thought about dash as well. But as a matter of fact we should remove
> > bashisms and make things as usable as possible. So maybe his patch makes
> > sense after all.
> >
>
> Based on Paul Eggleton's reply elsewhere:
>
> On 2 May 2013 09:07, Paul Eggleton <paul.eggleton@linux.intel.com> wrote:
> > On Wednesday 01 May 2013 19:13:19 seth bollinger wrote:
> >> 2. I couldn't find a wildcard string search in dash. Can anyone
> >> suggest a more shell agnostic way to do this?
> >
> > AFAIK grep or awk is the only way.
>
> I think this patch probably does make sense.
>
> --
> Paul Barker
>
> Email: paul@paulbarker.me.uk
> http://www.paulbarker.me.uk
>
--
*Andrei Gherzan*
m: +40.744.478.414 | f: +40.31.816.28.12
[-- Attachment #2: Type: text/html, Size: 2121 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-05-03 9:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25 1:00 [meta-raspberrypi][PATCH 1/2] sdcard_image-rpi.bbclass: Fix error in conditional test seth bollinger
2013-04-25 12:38 ` Paul Barker
2013-04-25 12:42 ` Samuel Stirtzel
[not found] ` <CA+JN8xMvcoaLKufSeCLO21ozH542OG-uZSn8fDS0OVMGXkUNbw@mail.gmail.com>
2013-04-25 12:59 ` Paul Barker
2013-05-01 19:10 ` Andrei Gherzan
2013-05-02 11:33 ` Paul Barker
2013-05-03 9:30 ` Andrei Gherzan
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.