Felix Fietkau wrote:
On 2009-12-08 1:36 PM, Ugur DOGRU wrote:
Hi,

After getting busybox 1.15.2, "local" macro is not a problem now. So I removed all modifications that removes local. To remind it, these changes are for ubicom32 platform, but for all no-mmu platforms in general.
As ash cannot run on no-mmu system, we are using hush instead.

There are still not compatible features between ash/hush. I've listed them below. Please note that these are only
problems that I've encountered in firewall/iptables scripts.

1/ hush needs "eval" to substitute string.
2/ hush doesn't handle line concatenation : "\"
Are you sure that these two kinds of changes are still necessary? I
tried to reproduce your issues by writing small test cases with hush
here, but every test case I come up with seems to work fine.
I also tested parameter expansion such as ${var:+-p $var}, and I also
cannot get it to fail with hush.
If hush still has issues with some of these expansions, could you please
reduce it down to a small test case, so that I can verify it and maybe
fix it in hush directly instead of the scripts?
Yes. I had some troubles about them. I can not get for now a console prompt on my board
to test it. I think you can get fragments from uci_firewall.sh to test.

For line concatenation. I think below script will show problem by running with/without line concat sign.
I will try if I will be able to get a shell prompt.

#!/bin/sh

src_port=100-200
src_port_first=${src_port%-*}
src_port_last=${src_port#*-}
[ "$src_port_first" -ne "$src_port_last" ] && { \
   src_port="$src_port_first:$src_port_last"; }


3/ hush crashes if two scripts include each other. (uci_firewall.sh and /etc/hotplug.d/iface/20-firewall includes each other)
I replaced that today without duplicating the hotplug script's code.

As to some of your other changes:
-       config_get exists $ZONE_LIST $1
+    eval_ZONE_LIST=$(eval "echo $ZONE_LIST")
+    config_get exists $eval_ZONE_LIST $1
Why is this necessary?
This is about eval problem.
- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to