X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from ncopa-desktop.nor.wtbts.net (3.203.202.84.customer.cdi.no [84.202.203.3]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nc@alpinelinux.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id 8A862DC19A1; Mon, 5 Mar 2012 14:21:06 +0000 (UTC) Date: Mon, 5 Mar 2012 15:21:03 +0100 From: Natanael Copa To: Jim Pryor Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] Understanding alpine-setup Message-ID: <20120305152103.08b6b9d8@ncopa-desktop.nor.wtbts.net> In-Reply-To: <1330941814.16357.140661044929169@webmail.messagingengine.com> References: <1330852060.31716.140661044540177@webmail.messagingengine.com> <20120305094554.23727d3c@ncopa-desktop.nor.wtbts.net> <1330941814.16357.140661044929169@webmail.messagingengine.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 05 Mar 2012 05:03:34 -0500 Jim Pryor wrote: > > I have been thinking of rewriting the setup-* scripts in lua. There > > have been need for unattended installs and better setup-disk script. > > There was some unattended patches that i let in but I'm not 100% > > happy with that implementation (and have personally neer used it). > ... > > Anyways... The reason that I haven't put more effort in cleaning up > > the setup-* scripts is that I think the long time solution is to > > make something in Lua. I just have not had the time to actually > > implement it yet. > > Thanks for your replies Natanael. Can you tell me where to look for > any earlier discussion of your dissatisfaction with the current setup > scripts? It is probably who are mostly dissatisfied so this is something I have been thinking for a while. I searched the email archive and there have various discussions on how to implement unattended installs. I mention Lua here: http://lists.alpinelinux.org/alpine-devel/0957.html I think it has been mentioned in IRC some time that it would have been nice to integrate the setup-* scripts with ACF better. After all they do partially same job. > Lua *is* a terrific and small-footprint language to use if something > stronger than ash is needed. But to my novice eyes the existing > scripts already look like a pretty good system. Ok, thanks for this feedback. Very nice to hear this from someone who have read the code and actually understands it :) Yes, it does the job. We could improve the framework (I cloned some of the functions from the openbsd installer functions and used them in setup-vs-guest script: http://git.alpinelinux.org/cgit/aports/tree/main/util-vserver/setup-vs-guest But while working on all those scripts I have various times thought that the shell things are a bit clumsy, and I miss arrays/hashtables. Specially for things like setup-apkrepos, setup-interfaces and setup-disk. I already have a lua moule in progress for parsing /sys and fishing out disk and partition info in convenient data structures. Bash is way to big be considered (it doesnt help that its slow either). I must admit that using shell if possible is a good thing. I just feel that we are at the limit where something stronger is wanted. > Maybe needing some > tweaks, but also quite flexible. Doesn't the "answerfile" > functionality already do this, for instance: > > > The idea is that you could provide a file with all or parts of the > > info and only get prompted of the missing stuff. It does. But I'm not too happy with the implementation. It was a bolted on as an "afterthought". It could of course be a "not-invented-by-me" syndrome :) What I had in mind was something like a JSON file that holds the answers: { "hostname": "myalpine", "keyboard": "en", "timezone": "UTC", "interfaces": { "eth0": { "method": "static", .... }. "eth1": { "method": "dhcp" } }, ... } This is very convenient with Lua. Also, the idea is also to at some point have a GTK ui for this. Would be nice to use same backend. I guess this is was what ACF was originally supposed to do but ended up as way too web (and html) centric. Actually, ACF grew out from "we need to manage Alpine boxes via web and we need to do it *now*". There was a thought that it should be a general purpose configuration framework but ended up as a more or less web only thing. The setup-* scripts on the other hand grew out from "i want my alpine box up and run as quick as possible" for development. > My main difficulty was the thin documentation, and not having a good > overview of how all the pieces fit together. I've now made a variety > of small wiki commits to help improve this for others. And the dense > new page I already mentioned, > . Very nice! Even if we switch to Lua, we need to be backward compatible with the current script, at least to certain degree. So those docs are definitively a keeper - and they were badly needed. Now, I don't think we need decide what to do with setup-* scripts right now. We have a feature freeze around 1 april and there is no chance that we will reach implement setup-* in Lua before that so we need to polish our current scripts and get the thing out. In other words: same as last N release iterations... Again, thanks! -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---