On 05/26/2012 06:03 PM, Lucas Meneghel Rodrigues wrote: > On Fri, 2012-05-25 at 16:31 -0700, Nishanth Aravamudan wrote: >> Sometimes there are firewalls between test machines and the greater >> Internet, so it seems unwise to depend upon external network access in >> the boottool/grubby building code. But some sites won't have those >> restrictions. Add the ability to configure a local mirror for the grubby >> tarball in the CLIENT section, but default to the external location. > The problem with this patch is that makes boottool dependent on autotest > libraries, when the script itself is sometimes used in a stand alone > fashion. Therefore, I can't accept this as is. > > Cleber, I believe we should try to locate and download boottool from the > copy present in the autotest tree, before trying to reach out to github. > What do you say?
On client mode that is definitely the best thing to do. But that would fail on server mode. I suggest that boottool looks for the grubby tarball on those locations: 1) current directory (would solve server mode if we also send the tarball to the client) 2) autotest source tree 3) remote github uri How does that sound? > >> Signed-off-by: Nishanth Aravamudan<n...@us.ibm.com> >> >> diff --git a/client/tools/boottool b/client/tools/boottool >> index c0b095c..d4ad76e 100755 >> --- a/client/tools/boottool >> +++ b/client/tools/boottool >> @@ -6,9 +6,11 @@ A boottool clone, but written in python and relying mostly >> on grubby[1]. >> [1] - http://git.fedorahosted.org/git/?p=grubby.git >> ''' >> >> +from autotest.client.shared import global_config >> import os, re, sys, optparse, logging, subprocess >> import urllib, tarfile, tempfile, shutil, struct, md5 >> >> +GLOBAL_CONFIG = global_config.global_config >> >> __all__ = ['Grubby', 'OptionParser', 'App', 'EfiVar', 'EfiToolSys', >> 'EliloConf', 'find_executable', 'parse_entry'] >> @@ -18,7 +20,10 @@ __all__ = ['Grubby', 'OptionParser', 'App', 'EfiVar', >> 'EfiToolSys', >> # Information on default requirements and installation for grubby >> # >> GRUBBY_REQ_VERSION = (8, 11) >> -GRUBBY_TARBALL_URI = ('http://cloud.github.com/downloads/autotest/' >> +GRUBBY_MIRROR = GLOBAL_CONFIG.get_config_value('CLIENT', >> + 'grubby_mirror', >> + >> default='http://cloud.github.com/downloads/autotest/') >> +GRUBBY_TARBALL_URI = GRUBBY_MIRROR + >> 'grubby/grubby-8.11-autotest.tar.bz2') >> GRUBBY_TARBALL_MD5 = '56695ec865460b25f20427b5329ef641' >> GRUBBY_DEFAULT_SYSTEM_PATH = '/sbin/grubby' >> diff --git a/global_config.ini b/global_config.ini >> index 4f5a976..a753e80 100644 >> --- a/global_config.ini >> +++ b/global_config.ini >> @@ -80,6 +80,8 @@ kernel_mirror: http://www.kernel.org/pub/linux/kernel/ >> kernel_gitweb: >> # gitweb installation(s) for -stable tree (space-separated) >> stable_kernel_gitweb: >> +# local mirror for grubby tarballs >> +# grubby_mirror: >> >> [SERVER] >> # Hostname of the autotest RPC server. You should set a different hostname >> > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest _______________________________________________ Autotest mailing list Autotest@test.kernel.org http://test.kernel.org/cgi-bin/mailman/listinfo/autotest