[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 7/8] raisin: Rework component specification
On Mon, 20 Apr 2015, George Dunlap wrote: > On 04/17/2015 11:40 AM, Stefano Stabellini wrote: > > On Thu, 16 Apr 2015, George Dunlap wrote: > >> Allow COMPONENTS to be specified in the config (or on the command-line) > >> > >> Now you can keep all components enabled in your config but build only > >> one like so: > >> > >> COMPONENTS="xen" ./raise build > >> > >> Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx> > >> --- > >> CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx> > >> --- > >> defconfig | 5 +++++ > >> lib/common-functions.sh | 49 > >> +++++++++++++++++++++++++++++++++++-------------- > >> 2 files changed, 40 insertions(+), 14 deletions(-) > >> > >> diff --git a/defconfig b/defconfig > >> index 23c76eb..4ec8a0b 100644 > >> --- a/defconfig > >> +++ b/defconfig > >> @@ -1,5 +1,10 @@ > >> # Config variables for raisin > >> > >> +# Components > >> +# All components: xen grub libvirt > >> +# Core xen functionality: xen > >> +DEFAULT_COMPONENTS="xen grub libvirt" > >> + > >> # Build config > >> ## Make command to run > >> MAKE="make -j2" > >> diff --git a/lib/common-functions.sh b/lib/common-functions.sh > >> index e66c6f4..42406e9 100644 > >> --- a/lib/common-functions.sh > >> +++ b/lib/common-functions.sh > >> @@ -31,13 +31,41 @@ function common_init() { > >> > >> get_distro > >> get_arch > >> + get_components > >> > >> - for f in `cat "$BASEDIR"/components/series` > >> + echo "Distro: $DISTRO" > >> + echo "Arch: $ARCH" > >> + echo "Components: $COMPONENTS" > >> + > >> + for f in $COMPONENTS > >> do > >> source "$BASEDIR"/components/"$f" > >> done > >> } > >> > >> +function get_components() { > >> + if [[ -z "$COMPONENTS" ]] > >> + then > >> + COMPONENTS="$DEFAULT_COMPONENTS" > >> + fi > >> + > >> + if [[ -z "$COMPONENTS" ]] > >> + then > >> + local component > >> + for component in `cat "$BASEDIR"/components/series` > >> + do > >> + local capital > >> + capital=`echo $component | tr '[:lower:]' '[:upper:]'` > >> + if eval [[ ! -z \$"$capital"_UPSTREAM_REVISION ]] > >> + then > >> + COMPONENTS="$COMPONENTS $component" > >> + echo "Found component $component" > >> + fi > >> + done > >> + export COMPONENTS > >> + fi > >> +} > >> + > >> function get_distro() { > >> if [[ -x "`which lsb_release 2>/dev/null`" ]] > >> then > >> @@ -222,20 +250,13 @@ function stop_initscripts() { > >> } > >> > >> function for_each_component () { > >> - for component in `cat "$BASEDIR"/components/series` > >> + local component > > > > One important thing here is that the order is important: xen is the > > first item in the series file for a reason. I think we should use the > > COMPONENTS variable to check for what components are enabled, but then > > still use the series file for the ordering. > > Yes, I thought about that. I had the idea it wouldn't be the easiest > thing to do in bash, but I'll take a look. > > FYI I basically spent the "development day" for 4 weeks on those two > series, so it may be a while before I get back to it. :-) (Depends on > how much review there is to do.) OK. I renamed DEFAULT_COMPONENTS to ENABLED_COMPONENTS, reworked this loop, added documentation and committed the result. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |