On Sat, Mar 11, 2017 at 03:53:15AM +0100, Pau wrote:
On 11/03/17 00:43, Daniel Golle wrote:
Hi!
Good to see that lime is still alive after all.
I thought about some things which need to be taken care of and would
like to get some feedback and opinions:
* wouldn't it be great to finally use LEDE's SDK + ImageBuilder
instead of lime-build (which is hard to maintain)?
LEDE does rolling-release for packages and promissed regular
maintainace cycle for their releases. 17.01 just came out, 17.01.0
is already in the pipe, 17.01.1 will come in May/June, and so on.
suggestion: drop lime-build in favour of using the lime-packages
feed with the SDK to provide packages to be used with the
ImageBuilder.
If there is any real reason to fork LEDE and/or use custom builds,
please speak up, I'll be your advocate on board of the LEDE team
to resolve those issues.
I don't see a big difference between using the SDK and the standard
buildroot. So far the arguments in favor for using lime-build are the
same in my opinion. You can see lime-build as a configuration template
repository where we store different kind of profiles. So for instance
the ar71xx-mini target can have its own striped kernel configuration
file. And the different flavors of libremesh (like FreiFunk or Guifi)
can have their own set of packets predefined.
Having different flavors and package sets can be achieved with the
released binaries and doesn't need rebuilding the kernel and everything
from scratch.
However, kernel-config modifications are indeed are no-go when we want
to use the vanilla release binaries. Hopefully ar71xx-mini won't be
needed any more once we migrate the target to use device-tree instead
of shipping all the mach-* board initialization on each and every
binary eventhough exactly one is needed ona specific board....
In the other side, IMO until LEDE does not demonstrate that we don't
need to froze a repository for releasing, I won't believe it. The
current (not yet confirmed!) dnsmasq problem for instance is an example,
it breaks everything in LiMe.
The problem for now has been that OpenWrt always used to decided to
make a half-broken release (e.g. 15.05) and then it took us more than
a year to release another build addressing the issues (e.g. 15.05.1).
And then we got stuck and never made a binary build fixing the
remaining issues despite the fact that the fixes have already made it
to our git tree... Hence I do understand that you didn't have another
choice than building your own binaries using up-to-date sources from
scratch.
As release builds in LEDE are generated automatically this will be a
much shorter cycle now.
But sure, I can see how you got to the point you are now, so just
watch it and decide for yourself.
In any case, lime-build is used by many users in LibreMesh and I don't
see the point for dropping it. Using the SDK or the buildroot are
already possibilities that anyone can choose (this procedure is
documented on the README and also the web page). So feel free to use
whatever you feel more comfortable, we are not dogmatic people :)
About Imagebuilder, we are already using it on Chef and the ImageBuilder
binaries are available for downloading on our firmware repository.
It's not about using any ImageBuilder, but about using the binary one
which is released on
downloads.lede-project.org. In that way, e.g.
a stackdump triggered by a kernel bug or segfault traces from userspace
are meaningful to everybody, as we know that we are actually dealing
with the exact same binaries and have collected debugging symbols for
them. The advantage is reproducibility and ability to trace down bugs
in LEDE in a common shared effort instead of each project with their
own build having to deal with their own individual set of bugs and
debugging information being useless for upstream developers.
And sure, there is no reason to be dogmatic, so binaries of the
lime-packages which are built with the released SDK can easily be
provided in addition to the ones created using lime-build. I'll get
back to that approach below in my reply about the additional hardware
platforms.
* lime-config currently re-writes UCI
configuration. ie. if I mess
up /etc/config/network, running lime-config will not necessarily
fix it. There are also situations which make re-running lime-config
impossible as that would break the config completely. To resolve
that mess I suggest to refrain from re-writing UCI configuration and
rather generate it from scratch every time by using the new
/bin/config_generate script.
If anything is missing in that new board-config aka. uci-defaults
approach, then we should add it and discuss with upstream, ie. make
sure that all board-specific details needed to generate the entire
configuration are covered.
That sounds good to me. Let's open a GitHub issue to have this task on
the queue.
Hence I'd like to re-write lime-config
from scratch. And maybe use
Shell instead of Lua. I know, this may sound terrible, but I'm sure
it'd be a great step towards reusability of the code for other
projects (which may not use all the rest of LiMe, maybe not even
use Lua at all) and also make the lime firmware more robust and
cover more use-cases (such as re-configuring images on the go
rather than using CHEF or imagine changing things in the field
using some remote mass-management tools, I'm thinking of OpenWISP)
Here I fully disagree. One of the agreements we made on 2013 when we
joined our efforts was to not use bash anymore. We'd spent so many hours
maintaining a horrible bash based system... We don't want to do it
anymore. LUA is nice and small. The libremesh code is quite clean,
structured, modular and well done. So far I think that is one of the
strongest points of libremesh.
I can understand your resentiments when it comes to bashism, but those
arguments are not necessarily true for all Shell code. Have a look at
that /bin/config_generate for example:
https://git.lede-project.org/?p=source.git;a=blob;f=package/base-files/file…
So it's not necessarily the language which makes scripts horrible, but
the way it is being used. And honestly, Lua can also be used in
horrible ways despite the fact that being a functional language it
prevents you from some of the worst programming styles...
The LiMe code is not bad, but also sometimes bloated or a bit weird.
People who know OpenWrt/LEDE very well still need months or even years
to get into it, and a large fraction of them don't know or even care
about LuCI or Lua at all. I understand that Lua was already part of
the packages included in a default build because of LuCI in the past,
however, today this is something we'd like to get rid of...
Hence, to me a lot of LiMe looks like concepts inspired from LuCI,
which was revolutionary at a time most routers were using CGI scripts
generating HTML3 code using echo commands... Today even LuCI looks
old-fashioned and it's weird to have *any* kind of dynamically
generated code at all, because we don't need that any more. HTML can be
static, JS can be static, RPC handler doesn't need to generate anything
else than JSON or XML, ie. serialized objects and that can be done in
any language including C or even Shell.
Furthermore lime-config is not only a script file named "lime-config" it
is also the set of libraries stored under /usr/lib/lua/lime. Those
libraries can also be used now for developing the new
websockets+rpc+json web interface and Android APP. And they would be
also used if we implement a central controller system or a console CLI
(like mikrotik or cisco).
I'm fully aware of that and there is no reason to have everything in
one long and horrible spaghetti script even when using Shell. Things
can and should be functional and modular, of course.
About the re-usability of the code I think the current LUA code (mainly
the set of libraries) is much more reusable than a bash script monster
able to configure everything. In any case (IMO) the way to involve more
people and communities is to make LibreMesh flexible and modular so they
can base their firmware projects on LibreMesh. That was the idea from
the begging, make a OpenWRT/Lede meta distribution for mesh firmwares,
so anyone can have its own LiMe flavor. To this end a modular and clean
code and API are necessary.
I agree, so let's take LEDE there :)
About the pro-Lua arguments: libremesh has learned some principles of
good programming practise and has become more mature. You can argue
that this is because of the language you have chosen and I agree this
choice has educated programmers as they were forced to write functional
code. However, please differentiate:
I'm not saying you should write your web interface or RPC API in Shell.
Just everything around lime-config, as we already got the libraries and
framework for everything needed to do that in /lib/functions/* as part
of the base-files package in OpenWrt/LEDE. I just don't see the point
in have a lot of redundant code written in two different languages
which basically does the same thing. To me the current lime-config
approach just looks like coming from an approach which was working
around missing features in OpenWrt 5 years ago but are now present and
happen to be provided by Shell libraries.
To finish this point, I don't want to stop you for doing anything. If
you feel like you want to develop this bash script, go ahead and lets
see if we can integrate it somehow with the rest of components. But IMO
it is like starting a project from scratch.
I had a look at all the things dealing with UCI in lime-system, and
yes, I believe it's worth replacing it or at least dropping major parts
of it in favour of using the new board-config approach.
The needed changes should be integrated in LEDE's board-config and
config-generate framework rather than maintaining a seperate
configuration generation framework.
Obviously this will not happen all at once, ideally you will just see
how you less and less need things like lime-hwd-openwrt-wan, just to
name one of the most ugly and confusing corners.
* speaking about CHEF: what's happening on
that scene? I find CHEF
very complicated, but I'm not a web guy :( I saw it finally found
someone willing to maintain it. Is there a roadmap or something?
And how can people contribute documentation, localization and all
that? And will it move to github?
I agree. We need to put more efforts on chef. The problem is that no one
in the core team wanted to touch web stuff... However now it looks like
we have the guy :) So I'm pretty sure there will be improvements soon.
Good to hear that! Though I'm not a big fan of github, I've seen that
people who are coming from a web or l10n/i18n corner are much more
comfortable contributing using github's webui than using mercurial.
Running a gitlab instance would also do the trick, I guess. Just make
sure you have a web-based editor and don't force people to work on a
local copy -- they might be using windows or macos and not familiar
with working on the terminal at all.
Providing a good how-to on working and contributing to CHEF using some
IDE like Eclipse could also do the trick. However, I just found myself
lost and couldn't direct people willing to contribute because of the
fact that mercurial and using the shell was just to much for them
(while they are perfectly able to do web-stuff or l10n/i18n)
* hardware support: I think we should support
more hardware targets,
not just ar71xx, x86 and mt7621 (I do appreciate that mt7621 made
it to the current release!). I'm working a lot on MT7620 lately,
there are a terrible lot of devices out there and though this
chip (or driver...) does not allow combining Ad-Hoc + AP, it
apparently does allow combining 802.11s + AP!
I found this also when playing with a Nodewrt device. However, is
802.11s stable enough on mt7620 for using in a real mesh network? I
would like to know.
It's deffinitely stable on ath9k and by using it there we can start
testing other drivers like ath10k, mwlwifi, brcm*, mt76 and rt2x00
(all of them don't support Ad-Hoc mode nicely but do support 802.11s).
And let's find out how useful it is and fix the bugs :) I don't see
that we ever had a purely theoretical test-bed for anything. That, I
was taught and agree with, is the big difference between ICT and IT:
In IT you got development, testing and production.
In ICT you only got development and production. There are no testing
mobile towers and no testing access concentrator boxes in the streets,
because that would mean having the whole infrastructure twice -- not
really a big deal if it's about a bunch of web or database servers,
but when it comes to telecom stuff that whole idea is just impossible.
You do have one mobile cell or DSL access concentrator for development
somewhere in a lab, but you can't duplicate the whole infratructure for
testing.
suggested additional hardware platforms, in
random order, high-
priotity is marked with an '!': !mvebu, !ramips/rt305x,
ramips/rt3883, !ramips/mt7620, !ramips/mt7628, !ramips/mt7688,
!ipq806x, !lantiq/xrx200, !lantiq/xway, octeon, !x86/generic,
x86/geode, !x86/64, arm64, armvirt, sunxi, mediatek,
brcm2708/bcm2708, brcm2708/bcm2709, brcm2708/bcm2710
(ie. all up-to-date platforms with good support in LEDE)
I don't know enough about the bcm53xx, brcm47xx and brcm63xx
targets to tell if any of those could be useful, but most likely
they can, especially those with brcmsmac or brcmfmac wifi.
For all others, especially those marked to be high-priority in
the list above, I'm more than willing to help and contribute
whatever is needed to get going.
Thanks for the list, very useful. The only reason why we have not
published binaries for this platforms is because we don't have hardware
to test them. But if you have access to all this hardware would be very
helpful if you could keep a repository of libremesh binaries (in
addition or together with
downloads.libremesh.org). We have server space
to create such repository (compile and publish) and can give you SSH
access. Using LEDE SDK for such task would work for me if you feel more
comfortable.
I do have many ramips boards flying around, some lantiq and irq806x.
mvebu became more common since that whole WRT1200AC and WRT1900AC
story, I don't have any of those, though, but we should ask Linksys to
provide them to the community as they claim to be OpenWrt friendly
while selling those boxes are commonly sold around $200 (which isn't
exactly friendly in terms of budget)
About using the vanilla SDK+ImageBuilder: Definitely yes. I'm really
struggling with lime-build. It kinda always fails for me with weird
errors like
line[0]: Using: command not found
So ok, in this case there definitely is some horrible Shell code
involved...
Or it sabotages me by re-downloading things on every run. I usually
don't have a lot of bandwidth while programming, often while on the
train or sitting somewhere in the nature, many times without any
connectivity. So I rely in local git trees and a huge dl/ folder
which I carry around...
In that way, lime-build is just as impossible for me to use as e.g.
Docker turned out to be. It generates hundreds of megabytes of traffic
on every single run...
Hence I suggest this:
I'll write a script which downloads the SDK for an arbitary OpenWrt
target platform and builds all of lime-packages with it. Then downloads
ImageBuilder for that very same platform and generates images for all
boards which include lime-basic and all it's dependencies. I wouldn't
really bother with devices which haven't got enough flash at this point
(though there are tons of Rt305x devices with 4MB flash and 32MB ram,
however, as ramips uses device-tree and is generally a more modern and
hence more modular target than ar71xx I see hope that we'll still fit
everything even on those boxes)
If you can provide me with access to a host which I can use have stuff
built and publish the resulting binaries that'd be amazing!
And it would obviously also resolve the first point above, ie. have
lime-packages for LEDE release builds on ar71xx.
* speaking about 802.11s: should we switch to
use the 802.11s MAC
by default? Ad-Hoc/IBSS has many known problems and nobody among
the people hacking the drivers seems to really care about it as
it's broken by design...
I also agree here. The main problem is that the first release based on
802.11s will break compatibility with the old releases and that would
make users angry. However the latter we do it the worst would be...
We have to discuss it with all the team and get a consensus.
Sure true, and hence it should only be the default for new communities
or those who deliberately want to make the switch (which, indeed, is
a lot of work...)