raise.sh performs the installation by installing the deb or rpm package,
hence it can be easily uninstalled by unraise.sh or manually by the
user.
+It is also possible to specify which components to enable on the command
+line:
+
+COMPONENTS="xen qemu" ./raise build
= Adding new components =
# Config variables for raisin
+# Components
+## All components: xen qemu grub libvirt
+## Core xen functionality: xen
+## Remove a component from the list below, if you want to disable it
+## You can manually overwrite this list using the COMPONENTS
+## environmental variable.
+ENABLED_COMPONENTS="xen qemu grub libvirt"
+
# Build config
## Make command to run
MAKE="make -j2"
GRUB_URL="git://git.savannah.gnu.org/grub.git"
LIBVIRT_URL="git://libvirt.org/libvirt.git"
-# Software versions. Leave blank if you want to avoid the build, like
-# this: GRUB_REVISION=
-# Grub and Libvirt needs Xen to build and run.
+# Software versions.
XEN_REVISION="master"
QEMU_REVISION="master"
GRUB_REVISION="master"
get_distro
get_arch
+ get_components
- for f in `cat "$BASEDIR"/components/series`
+ if [[ $VERBOSE -eq 1 ]]
+ then
+ echo "Distro: $DISTRO"
+ echo "Arch: $ARCH"
+ echo "Components: $COMPONENTS"
+ fi
+
+ for f in $COMPONENTS
do
source "$BASEDIR"/components/"$f"
done
}
+function get_components() {
+ if [[ -z "$COMPONENTS" ]]
+ then
+ COMPONENTS="$ENABLED_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"_REVISION ]]
+ then
+ COMPONENTS="$COMPONENTS $component"
+ if [[ $VERBOSE -eq 1 ]]
+ then
+ echo "Found component $component"
+ fi
+ fi
+ done
+ fi
+ export COMPONENTS
+}
+
function get_distro() {
if [[ -x "`which lsb_release 2>/dev/null`" ]]
then
}
function for_each_component () {
+ local component
+ local enabled
+ local found
+
for component in `cat "$BASEDIR"/components/series`
do
- capital=`echo $component | tr '[:lower:]' '[:upper:]'`
- if [[ $VERBOSE -eq 1 ]]
- then
- echo -n "$capital"_REVISION =" "
- eval echo \$"$capital"_REVISION
- fi
- if eval [[ ! -z \$"$capital"_REVISION ]]
- then
- if [[ $VERBOSE -eq 1 ]]
+ found=0
+ for enabled in $COMPONENTS
+ do
+ if [[ $enabled = $component ]]
then
- echo calling "$component"_"$1"
+ found=1
+ break
fi
- "$component"_"$1"
+ done
+ if [[ $found -eq 0 ]]
+ then
if [[ $VERBOSE -eq 1 ]]
then
- echo "$component"_"$1" done
+ echo "$component" is disabled
fi
+ continue
+ fi
+
+ if [[ $VERBOSE -eq 1 ]]
+ then
+ echo calling "$component"_"$1"
+ fi
+ "$component"_"$1"
+ if [[ $VERBOSE -eq 1 ]]
+ then
+ echo "$component"_"$1" done
fi
done
}