linux-sunxi/sunxi-boards

Invalid line in hyundai_a7.fex

n1tehawk opened this issue · 2 comments

The sunxi-tools FEX compiler chokes on hyundai_a7.fex#L821 with an error message
E: sunxi-boards/sys_config/a10/hyundai_a7.fex:821: invalid character at 1.

That line indeed looks rather wrong, and should probably be removed.

This has resurfaced with xunlong_orange_pi_pc_plus.fex#L357 and xunlong_orange_pi_plus_2e.fex#L357, for which the original .bin files were extracted and decompiled from vendor-provided images.

The .bin files show that these lines actually went into them as <key> = <value> pairs with an unusual / malformed key string, starting with : plus whitespace. Judging from the fact that the keys seem to relate to the section that follows, I get the impression that these originally might have been ; comment = something lines preceding the section, where a typo turned the ; into :.

We probably need to take more care with possibly malformed section entries (e.g. issue a warning) in our sunxi-tools script_bin.c. It might also be desirable to auto-correct this special case into a .fex comment line (by simply reverting to ;), which some sunxi-boards contributors seem to have done manually - compare e.g. xunlong_orange_pi_pc.fex#L359.

This has been addressed with an updated version of sunxi-fexc.

Commit linux-sunxi/sunxi-tools@7a0a701 lets the .fex compiler issue a warning on these lines, but apart from that it will accept (and ignore) them. bin2fex will now also warn when decompiling .bin files that lead to the creation of such entries (so they're easier to spot and fix).