[LEDE-DEV] Call defines for minifying scripting languages

Piotr Dymacz pepe2k at gmail.com
Mon Oct 3 05:18:42 PDT 2016


2016-10-03 13:14 GMT+02:00 Karl Palsson <karlp at tweak.net.au>:
> Jan-Tarek Butt <tarek at ring0.de> wrote:
>> 1. Reducing memory size on firmware images.
> But will it? They're in the squashfs image, it's already been
> demonstrated before that compressing things before can actually
> have negative impacts.

That's true, my vote for 'optimization-only' approach and keep fs do
the rest (compression).

>> 2. Strip out all comments (which makes us able to do better
>> code commenting) 3. and so on.

IMHO, we could remove all comments from all scripts (not only Lua) in
target rootfs and work on better documentation outside the code.

As an example of a huge, old comment, left in one of ar71xx base-files
scripts, please see [1].
It's inside every ar71xx image... does it really make sense to have it
there, for devices without related hardware?

>> One negative point will be there:
>> the minified code an not realy human readable but if some one
>> want to read this script or work on it on routers, they can
>> easily copy the unminified script via scp.
> This is a _massive_ downside IMO, and absolutely not something
> that should be enabled by default. There's already far too much
> undocumented/underdocumented internal behaviours of scripts and
> processes in LEDE/OpenWrt, and minifying scripts and stripping
> comments actively works to preserve that situation.

+1 for keeping scripts human readable.
+10 for getting scripts documented, someday, somewhere... Wiki?

[1] https://goo.gl/yQFpDV


More information about the Lede-dev mailing list