I've tinkered some more with my latter idea -- to make the
configuration a web-based application -- and have made some
basic progress. 

Clearly one of the biggest hassles with this method would
be having to muck with the local system's web server,
especially if one normally serves pages out from the
machine one is using to build the flash image.  But it
occured to me that, for this application, there was no
particular need or advantage to using the main web server
for the machine. What seemed to make more sense, once
I thought about it, was to use one of the tiny, drop-dead
simple web servers that are available, and bring that up
on a non-standard port; I used port 8083 in my tests.
By running it on a port above 1024 you don't need root
access to your machine to install the web server.

I quickly looked through freshmeat and decided to try
boa, http://www.boa.org/. Boa is GPL'd, and the source
code and documentation amounts to a whopping 107K. On my
333MHz AMD K6, it took maybe a minute or two to configure
and build. There's only one executable really needed,
although they do provide a second one that will generate
html directory listings. Boa supports CGI and I was able to
get it running a python script with no trouble.

Really, it would be very straightforward to include a
customized boa configuration file, start/stop script and
set of html and cgi files in the Linuxbios distribution;
the executable is simple and flexible enough that the
stock, default build of the boa sources should be entirely
sufficient, and since it's GPL'd and tiny the boa sources
could just be included in the distribuiton.

With a few minutes hacking about, I put together a simple
CGI script that provides a list of mainboards for which
source directories are provided in the distribution. This
script is designed to run from [srcroot]/freebios/util/webconfig/cgi-bin/

   import os
   print "Content-type: text/html\n\n\n"
   print "<HTML>"
   print "<BODY>"
   print "<H1><center>Please select a mainboard</center></H1>"
   os.chdir("../../../src/mainboard/")
   mfrlist = os.listdir(".")
   print "<ul>"
   for mfr in mfrlist:
     if mfr == "CVS":
       continue
     print "\t<li>%s</li>" % mfr
     os.chdir("./%s" % mfr);
     mblist = os.listdir(".")
     print "\t\t<ul>"
     for mb in mblist:
       if mb == "CVS":
         continue
       print "\t\t\t<li><a href=\"/cgi-bin/process-mb.cgi?%s,%s\">%s</a></li>" % 
(mfr,mb,mb)
     print "\t\t</ul>"
     os.chdir("..")
   print "</ul>"
   print "</BODY>"
   print "</HTML>"

There's no "process-mb.cgi" script yet.

Clearly this is just a beginning but I thought y'all might
like to have a chance to comment on the direction I'm going
with this.

--Bob

Reply via email to