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

Felix Fietkau nbd at nbd.name
Tue Sep 8 04:42:12 EDT 2020


On 2020-09-08 10:39, David Woodhouse wrote:
> 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.
Sure, using bash is fine. We already require it for many other things.

- Felix



More information about the openwrt-devel mailing list