[PATCH 3/3] mediatek: mt7623: use bash for generating bootable images

David Woodhouse dwmw2 at infradead.org
Tue Sep 8 04:39:19 EDT 2020


On Tue, 2020-09-08 at 10:31 +0200, Felix Fietkau wrote:
> On 2020-09-08 10:26, David Woodhouse wrote:
> > It turns out that 'echo -e' isn't portable; it doesn't work in the dash
> > builtin echo and Ubuntu users are complaining.
> > 
> > I can't even get octal (specified by POSIX) to work consistently because
> > those  variants of 'echo' which *do* support -e don't seem to interpret
> > octalwithout it.
> > 
> > I could switch to /bin/echo but using -e with that isn't actually
> > portable *either* even though it works today.
> > 
> > For now just stick with bash, and use its builtin. We may end up using
> > something else entirely; perhaps perl.
> > 
> > Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
> 
> Have you considered using printf instead of echo?

I played with that for a while a few weeks ago and didn't manage to get
it working in all environments either. Sometimes I need '\\x' and
sometimes just '\x'.

At the time I gave up as it was mostly a theoretical problem and our
own builds worked, and I had more important things to fix.

But now users are hitting this in practice¹ so I need to at least come
up with a stopgap solution, and this was it.

Better solutions welcome — and we do have a handful of other places in
the tree that need fixing too, when we work out what the best approach
is.

¹ http://forum.banana-pi.org/t/banana-pi-r2-openwrt-19-07-image/11323/80
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5174 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20200908/9a46d3d7/attachment.bin>


More information about the openwrt-devel mailing list