#17601: hardware detection layer: board_detect script has bad logic
--------------------------------------+------------------------
 Reporter:  rabryn@…                  |      Owner:  developers
     Type:  defect                    |     Status:  new
 Priority:  normal                    |  Milestone:
Component:  base system               |    Version:  Trunk
 Keywords:  hardware detection layer  |
--------------------------------------+------------------------
 The new /bin/board_detect script "executes" the scripts located in
 /etc/board.d like this:
 {{{
 [ -d "/etc/board.d/" -a ! -f "/etc/board.json" ] || {
         for a in `ls /etc/board.d/*`; do
                 [ -x $a ] || continue;
                 $(. $a)
         done
 }
 }}}

 I could be wrong, but I believe the board.d scripts will only be executed
 if the board.d directory doesn't exist (which would be bad) or the
 /etc/board.json file exists.  The {{{||}}} should be {{{&&}}} which would
 execute the board.d scripts if the board.d directory exists and the
 board.json file doesn't exist.

 Inside the for loop the executable flag is checked on each file.  If it's
 not executable it is skipped, if it is executable, it is sourced.  Is
 sourcing the proper operation here?  Should we actually execute the
 script?

--
Ticket URL: <https://dev.openwrt.org/ticket/17601>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to